linux/drivers/staging/rar/rar_driver.h
<<
>>
Prefs
   1/* === RAR Physical Addresses === */
   2struct 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 */
  22int get_rar_address(int rar_index,struct RAR_address_struct *addresses);
  23
  24
  25/* The lock_rar function is ued 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 */
  36int 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) \
  52do \
  53{ \
  54  if(DEBUG_LEVEL) \
  55  { \
  56    printk(KERN_WARNING info); \
  57  } \
  58}while(0)
  59
  60/* debug macro with 1 paramater */
  61#define DEBUG_PRINT_1(DEBUG_LEVEL , info , param1) \
  62do \
  63{ \
  64  if(DEBUG_LEVEL) \
  65  { \
  66    printk(KERN_WARNING info , param1); \
  67  } \
  68}while(0)
  69
  70/* debug macro with 2 paramaters */
  71#define DEBUG_PRINT_2(DEBUG_LEVEL , info , param1, param2) \
  72do \
  73{ \
  74  if(DEBUG_LEVEL) \
  75  { \
  76    printk(KERN_WARNING info , param1, param2); \
  77  } \
  78}while(0)
  79
  80/* debug macro with 3 paramaters */
  81#define DEBUG_PRINT_3(DEBUG_LEVEL , info , param1, param2 , param3) \
  82do \
  83{ \
  84  if(DEBUG_LEVEL) \
  85  { \
  86    printk(KERN_WARNING info , param1, param2 , param3); \
  87  } \
  88}while(0)
  89
  90/* debug macro with 4 paramaters */
  91#define DEBUG_PRINT_4(DEBUG_LEVEL , info , param1, param2 , param3 , param4) \
  92do \
  93{ \
  94  if(DEBUG_LEVEL) \
  95  { \
  96    printk(KERN_WARNING info , param1, param2 , param3 , param4); \
  97  } \
  98}while(0)
  99
 100