4172fbf36327cbcb7b2f3b5aa53a34640ec6c3ee
[safe/jmp/linux-2.6] / drivers / staging / rar / rar_driver.h
1 /* === RAR Physical Addresses === */
2 struct RAR_address_struct {
3         u32 low;
4         u32 high;
5 };
6
7 /* The get_rar_address function is used by other device drivers
8  * to obtain RAR address information on a RAR. It takes two
9  * parameter:
10  *
11  * int rar_index
12  * The rar_index is an index to the rar for which you wish to retrieve
13  * the address information.
14  * Values can be 0,1, or 2.
15  *
16  * struct RAR_address_struct is a pointer to a place to which the function
17  * can return the address structure for the RAR.
18  *
19  * The function returns a 0 upon success or a -1 if there is no RAR
20  * facility on this system.
21  */
22 int get_rar_address(int rar_index, struct RAR_address_struct *addresses);
23
24
25 /* The lock_rar function is used by other device drivers to lock an RAR.
26  * once an RAR is locked, it stays locked until the next system reboot.
27  * The function takes one parameter:
28  *
29  * int rar_index
30  * The rar_index is an index to the rar that you want to lock.
31  * Values can be 0,1, or 2.
32  *
33  * The function returns a 0 upon success or a -1 if there is no RAR
34  * facility on this system.
35  */
36 int lock_rar(int rar_index);
37
38
39 /* DEBUG LEVEL MASKS */
40 #define RAR_DEBUG_LEVEL_BASIC       0x1
41
42 #define RAR_DEBUG_LEVEL_REGISTERS   0x2
43
44 #define RAR_DEBUG_LEVEL_EXTENDED    0x4
45
46 #define DEBUG_LEVEL     0x7
47
48 /* FUNCTIONAL MACROS */
49
50 /* debug macro without paramaters */
51 #define DEBUG_PRINT_0(DEBUG_LEVEL , info) \
52 do { \
53         if (DEBUG_LEVEL) { \
54                 printk(KERN_WARNING info); \
55         } \
56 } while (0)
57
58 /* debug macro with 1 paramater */
59 #define DEBUG_PRINT_1(DEBUG_LEVEL , info , param1) \
60 do { \
61         if (DEBUG_LEVEL) { \
62                 printk(KERN_WARNING info , param1); \
63         } \
64 } while (0)
65
66 /* debug macro with 2 paramaters */
67 #define DEBUG_PRINT_2(DEBUG_LEVEL , info , param1, param2) \
68 do { \
69         if (DEBUG_LEVEL) { \
70                 printk(KERN_WARNING info , param1, param2); \
71         } \
72 } while (0)
73
74 /* debug macro with 3 paramaters */
75 #define DEBUG_PRINT_3(DEBUG_LEVEL , info , param1, param2 , param3) \
76 do { \
77         if (DEBUG_LEVEL) { \
78                 printk(KERN_WARNING info , param1, param2 , param3); \
79         } \
80 } while (0)
81
82 /* debug macro with 4 paramaters */
83 #define DEBUG_PRINT_4(DEBUG_LEVEL , info , param1, param2 , param3 , param4) \
84 do { \
85         if (DEBUG_LEVEL) { \
86                 printk(KERN_WARNING info , param1, param2 , param3 , param4); \
87         } \
88 } while (0)
89