Lines Matching refs:asd_ha

17 static void asd_write_byte(struct asd_ha_struct *asd_ha,  in asd_write_byte()  argument
20 if (unlikely(asd_ha->iospace)) in asd_write_byte()
22 (unsigned long)asd_ha->io_handle[0].addr + (offs & 0xFF)); in asd_write_byte()
24 writeb(val, asd_ha->io_handle[0].addr + offs); in asd_write_byte()
28 static void asd_write_word(struct asd_ha_struct *asd_ha, in asd_write_word() argument
31 if (unlikely(asd_ha->iospace)) in asd_write_word()
33 (unsigned long)asd_ha->io_handle[0].addr + (offs & 0xFF)); in asd_write_word()
35 writew(val, asd_ha->io_handle[0].addr + offs); in asd_write_word()
39 static void asd_write_dword(struct asd_ha_struct *asd_ha, in asd_write_dword() argument
42 if (unlikely(asd_ha->iospace)) in asd_write_dword()
44 (unsigned long)asd_ha->io_handle[0].addr + (offs & 0xFF)); in asd_write_dword()
46 writel(val, asd_ha->io_handle[0].addr + offs); in asd_write_dword()
52 static u8 asd_read_byte(struct asd_ha_struct *asd_ha, unsigned long offs) in asd_read_byte() argument
55 if (unlikely(asd_ha->iospace)) in asd_read_byte()
56 val = inb((unsigned long) asd_ha->io_handle[0].addr in asd_read_byte()
59 val = readb(asd_ha->io_handle[0].addr + offs); in asd_read_byte()
64 static u16 asd_read_word(struct asd_ha_struct *asd_ha, in asd_read_word() argument
68 if (unlikely(asd_ha->iospace)) in asd_read_word()
69 val = inw((unsigned long)asd_ha->io_handle[0].addr in asd_read_word()
72 val = readw(asd_ha->io_handle[0].addr + offs); in asd_read_word()
77 static u32 asd_read_dword(struct asd_ha_struct *asd_ha, in asd_read_dword() argument
81 if (unlikely(asd_ha->iospace)) in asd_read_dword()
82 val = inl((unsigned long) asd_ha->io_handle[0].addr in asd_read_dword()
85 val = readl(asd_ha->io_handle[0].addr + offs); in asd_read_dword()
109 static type asd_read_##ww##_##ord(struct asd_ha_struct *asd_ha, \
112 struct asd_ha_addrspace *io_handle = &asd_ha->io_handle[0]; \
114 return asd_read_##ord(asd_ha, (unsigned long)map_offs); \
118 static void asd_write_##ww##_##ord(struct asd_ha_struct *asd_ha, \
121 struct asd_ha_addrspace *io_handle = &asd_ha->io_handle[0]; \
123 asd_write_##ord(asd_ha, (unsigned long)map_offs, val); \
170 static void asd_move_swb(struct asd_ha_struct *asd_ha, u32 reg) in asd_move_swb() argument
173 pci_write_config_dword(asd_ha->pcidev, PCI_CONF_MBAR0_SWB, base); in asd_move_swb()
174 asd_ha->io_handle[0].swb_base = base; in asd_move_swb()
177 static void __asd_write_reg_byte(struct asd_ha_struct *asd_ha, u32 reg, u8 val) in __asd_write_reg_byte() argument
179 struct asd_ha_addrspace *io_handle=&asd_ha->io_handle[0]; in __asd_write_reg_byte()
183 asd_write_swa_byte (asd_ha, reg,val); in __asd_write_reg_byte()
186 asd_write_swb_byte (asd_ha, reg, val); in __asd_write_reg_byte()
189 asd_write_swc_byte (asd_ha, reg, val); in __asd_write_reg_byte()
192 asd_move_swb(asd_ha, reg); in __asd_write_reg_byte()
193 asd_write_swb_byte (asd_ha, reg, val); in __asd_write_reg_byte()
198 void asd_write_reg_##ord (struct asd_ha_struct *asd_ha, u32 reg, type val)\
200 struct asd_ha_addrspace *io_handle=&asd_ha->io_handle[0]; \
203 spin_lock_irqsave(&asd_ha->iolock, flags); \
206 asd_write_swa_##ord (asd_ha, reg,val); \
209 asd_write_swb_##ord (asd_ha, reg, val); \
212 asd_write_swc_##ord (asd_ha, reg, val); \
215 asd_move_swb(asd_ha, reg); \
216 asd_write_swb_##ord (asd_ha, reg, val); \
218 spin_unlock_irqrestore(&asd_ha->iolock, flags); \
225 static u8 __asd_read_reg_byte(struct asd_ha_struct *asd_ha, u32 reg) in __asd_read_reg_byte() argument
227 struct asd_ha_addrspace *io_handle=&asd_ha->io_handle[0]; in __asd_read_reg_byte()
232 val = asd_read_swa_byte (asd_ha, reg); in __asd_read_reg_byte()
235 val = asd_read_swb_byte (asd_ha, reg); in __asd_read_reg_byte()
238 val = asd_read_swc_byte (asd_ha, reg); in __asd_read_reg_byte()
241 asd_move_swb(asd_ha, reg); in __asd_read_reg_byte()
242 val = asd_read_swb_byte (asd_ha, reg); in __asd_read_reg_byte()
248 type asd_read_reg_##ord (struct asd_ha_struct *asd_ha, u32 reg) \
250 struct asd_ha_addrspace *io_handle=&asd_ha->io_handle[0]; \
254 spin_lock_irqsave(&asd_ha->iolock, flags); \
257 val = asd_read_swa_##ord (asd_ha, reg); \
260 val = asd_read_swb_##ord (asd_ha, reg); \
263 val = asd_read_swc_##ord (asd_ha, reg); \
266 asd_move_swb(asd_ha, reg); \
267 val = asd_read_swb_##ord (asd_ha, reg); \
269 spin_unlock_irqrestore(&asd_ha->iolock, flags); \
284 void asd_read_reg_string(struct asd_ha_struct *asd_ha, void *dst, in asd_read_reg_string() argument
290 spin_lock_irqsave(&asd_ha->iolock, flags); in asd_read_reg_string()
292 *p = __asd_read_reg_byte(asd_ha, offs); in asd_read_reg_string()
293 spin_unlock_irqrestore(&asd_ha->iolock, flags); in asd_read_reg_string()
303 void asd_write_reg_string(struct asd_ha_struct *asd_ha, void *src, in asd_write_reg_string() argument
309 spin_lock_irqsave(&asd_ha->iolock, flags); in asd_write_reg_string()
311 __asd_write_reg_byte(asd_ha, offs, *p); in asd_write_reg_string()
312 spin_unlock_irqrestore(&asd_ha->iolock, flags); in asd_write_reg_string()