Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
aic94xx_reg.c File Reference
#include <linux/pci.h>
#include "aic94xx_reg.h"
#include "aic94xx.h"

Go to the source code of this file.

Macros

#define ASD_READ_SW(ww, type, ord)
 
#define ASD_WRITE_SW(ww, type, ord)
 
#define ASD_WRITE_REG(type, ord)
 
#define ASD_READ_REG(type, ord)
 

Functions

 ASD_READ_SW (swa, u8, byte)
 
 ASD_READ_SW (swa, u16, word)
 
 ASD_READ_SW (swa, u32, dword)
 
 ASD_READ_SW (swb, u8, byte)
 
 ASD_READ_SW (swb, u16, word)
 
 ASD_READ_SW (swb, u32, dword)
 
 ASD_READ_SW (swc, u8, byte)
 
 ASD_READ_SW (swc, u16, word)
 
 ASD_READ_SW (swc, u32, dword)
 
 ASD_WRITE_SW (swa, u8, byte)
 
 ASD_WRITE_SW (swa, u16, word)
 
 ASD_WRITE_SW (swa, u32, dword)
 
 ASD_WRITE_SW (swb, u8, byte)
 
 ASD_WRITE_SW (swb, u16, word)
 
 ASD_WRITE_SW (swb, u32, dword)
 
 ASD_WRITE_SW (swc, u8, byte)
 
 ASD_WRITE_SW (swc, u16, word)
 
 ASD_WRITE_SW (swc, u32, dword)
 
 ASD_WRITE_REG (u8, byte)
 
 ASD_WRITE_REG (u16, word)
 
 ASD_WRITE_REG (u32, dword)
 
 ASD_READ_REG (u8, byte)
 
 ASD_READ_REG (u16, word)
 
 ASD_READ_REG (u32, dword)
 
void asd_read_reg_string (struct asd_ha_struct *asd_ha, void *dst, u32 offs, int count)
 
void asd_write_reg_string (struct asd_ha_struct *asd_ha, void *src, u32 offs, int count)
 

Macro Definition Documentation

#define ASD_READ_REG (   type,
  ord 
)
Value:
type asd_read_reg_##ord (struct asd_ha_struct *asd_ha, u32 reg) \
{ \
struct asd_ha_addrspace *io_handle=&asd_ha->io_handle[0]; \
unsigned long flags; \
BUG_ON(reg >= 0xC0000000 || reg < ALL_BASE_ADDR); \
spin_lock_irqsave(&asd_ha->iolock, flags); \
if (io_handle->swa_base <= reg \
val = asd_read_swa_##ord (asd_ha, reg); \
else if (io_handle->swb_base <= reg \
val = asd_read_swb_##ord (asd_ha, reg); \
else if (io_handle->swc_base <= reg \
val = asd_read_swc_##ord (asd_ha, reg); \
else { \
/* Ok, we have to move SWB */ \
asd_move_swb(asd_ha, reg); \
val = asd_read_swb_##ord (asd_ha, reg); \
} \
spin_unlock_irqrestore(&asd_ha->iolock, flags); \
return val; \
}

Definition at line 265 of file aic94xx_reg.c.

#define ASD_READ_SW (   ww,
  type,
  ord 
)
Value:
static type asd_read_##ww##_##ord(struct asd_ha_struct *asd_ha, \
u32 reg) \
{ \
struct asd_ha_addrspace *io_handle = &asd_ha->io_handle[0]; \
u32 map_offs = (reg - io_handle->ww##_base) + asd_mem_offs_##ww();\
return asd_read_##ord(asd_ha, (unsigned long)map_offs); \
}

Definition at line 126 of file aic94xx_reg.c.

#define ASD_WRITE_REG (   type,
  ord 
)
Value:
void asd_write_reg_##ord (struct asd_ha_struct *asd_ha, u32 reg, type val)\
{ \
struct asd_ha_addrspace *io_handle=&asd_ha->io_handle[0]; \
unsigned long flags; \
BUG_ON(reg >= 0xC0000000 || reg < ALL_BASE_ADDR); \
spin_lock_irqsave(&asd_ha->iolock, flags); \
if (io_handle->swa_base <= reg \
asd_write_swa_##ord (asd_ha, reg,val); \
else if (io_handle->swb_base <= reg \
asd_write_swb_##ord (asd_ha, reg, val); \
else if (io_handle->swc_base <= reg \
asd_write_swc_##ord (asd_ha, reg, val); \
else { \
/* Ok, we have to move SWB */ \
asd_move_swb(asd_ha, reg); \
asd_write_swb_##ord (asd_ha, reg, val); \
} \
spin_unlock_irqrestore(&asd_ha->iolock, flags); \
}

Definition at line 215 of file aic94xx_reg.c.

#define ASD_WRITE_SW (   ww,
  type,
  ord 
)
Value:
static void asd_write_##ww##_##ord(struct asd_ha_struct *asd_ha, \
{ \
struct asd_ha_addrspace *io_handle = &asd_ha->io_handle[0]; \
u32 map_offs = (reg - io_handle->ww##_base) + asd_mem_offs_##ww();\
asd_write_##ord(asd_ha, (unsigned long)map_offs, val); \
}

Definition at line 135 of file aic94xx_reg.c.

Function Documentation

ASD_READ_REG ( u8  ,
byte   
)
ASD_READ_REG ( u16  ,
word   
)
ASD_READ_REG ( u32  ,
dword   
)
void asd_read_reg_string ( struct asd_ha_struct asd_ha,
void dst,
u32  offs,
int  count 
)

asd_read_reg_string – read a string of bytes from io space memory : pointer to host adapter structure : pointer to a destination buffer where data will be written to : start offset (register) to read from : number of bytes to read

Definition at line 302 of file aic94xx_reg.c.

ASD_READ_SW ( swa  ,
u8  ,
byte   
)
ASD_READ_SW ( swa  ,
u16  ,
word   
)
ASD_READ_SW ( swa  ,
u32  ,
dword   
)
ASD_READ_SW ( swb  ,
u8  ,
byte   
)
ASD_READ_SW ( swb  ,
u16  ,
word   
)
ASD_READ_SW ( swb  ,
u32  ,
dword   
)
ASD_READ_SW ( swc  ,
u8  ,
byte   
)
ASD_READ_SW ( swc  ,
u16  ,
word   
)
ASD_READ_SW ( swc  ,
u32  ,
dword   
)
ASD_WRITE_REG ( u8  ,
byte   
)
ASD_WRITE_REG ( u16  ,
word   
)
ASD_WRITE_REG ( u32  ,
dword   
)
void asd_write_reg_string ( struct asd_ha_struct asd_ha,
void src,
u32  offs,
int  count 
)

asd_write_reg_string – write a string of bytes to io space memory : pointer to host adapter structure : pointer to source buffer where data will be read from : start offset (register) to write to : number of bytes to write

Definition at line 321 of file aic94xx_reg.c.

ASD_WRITE_SW ( swa  ,
u8  ,
byte   
)
ASD_WRITE_SW ( swa  ,
u16  ,
word   
)
ASD_WRITE_SW ( swa  ,
u32  ,
dword   
)
ASD_WRITE_SW ( swb  ,
u8  ,
byte   
)
ASD_WRITE_SW ( swb  ,
u16  ,
word   
)
ASD_WRITE_SW ( swb  ,
u32  ,
dword   
)
ASD_WRITE_SW ( swc  ,
u8  ,
byte   
)
ASD_WRITE_SW ( swc  ,
u16  ,
word   
)
ASD_WRITE_SW ( swc  ,
u32  ,
dword   
)