diff options
author | Jing Huang <huangj@brocade.com> | 2010-10-18 20:12:29 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-10-25 17:18:20 -0400 |
commit | 5344026065f79b102fcc44bc6332f856a111962a (patch) | |
tree | c28f91eb4593e3e89b030a65a4fd71b8b43cc1f1 /drivers/scsi/bfa/bfa_ioc.h | |
parent | ba816ea8e2eacbf3d198ad1859f413c2d6213434 (diff) |
[SCSI] bfa: remove os wrapper functions and macros
This patch replaces register access functions and macros with the the ones
provided by linux.
Signed-off-by: Jing Huang <huangj@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/bfa/bfa_ioc.h')
-rw-r--r-- | drivers/scsi/bfa/bfa_ioc.h | 66 |
1 files changed, 32 insertions, 34 deletions
diff --git a/drivers/scsi/bfa/bfa_ioc.h b/drivers/scsi/bfa/bfa_ioc.h index 71c0b5ac4af5..d60e4721f240 100644 --- a/drivers/scsi/bfa/bfa_ioc.h +++ b/drivers/scsi/bfa/bfa_ioc.h | |||
@@ -62,9 +62,9 @@ struct bfa_sge_s { | |||
62 | }; | 62 | }; |
63 | 63 | ||
64 | #define bfa_sge_word_swap(__sge) do { \ | 64 | #define bfa_sge_word_swap(__sge) do { \ |
65 | ((u32 *)(__sge))[0] = bfa_os_swap32(((u32 *)(__sge))[0]); \ | 65 | ((u32 *)(__sge))[0] = swab32(((u32 *)(__sge))[0]); \ |
66 | ((u32 *)(__sge))[1] = bfa_os_swap32(((u32 *)(__sge))[1]); \ | 66 | ((u32 *)(__sge))[1] = swab32(((u32 *)(__sge))[1]); \ |
67 | ((u32 *)(__sge))[2] = bfa_os_swap32(((u32 *)(__sge))[2]); \ | 67 | ((u32 *)(__sge))[2] = swab32(((u32 *)(__sge))[2]); \ |
68 | } while (0) | 68 | } while (0) |
69 | 69 | ||
70 | #define bfa_swap_words(_x) ( \ | 70 | #define bfa_swap_words(_x) ( \ |
@@ -87,7 +87,7 @@ struct bfa_pcidev_s { | |||
87 | int pci_slot; | 87 | int pci_slot; |
88 | u8 pci_func; | 88 | u8 pci_func; |
89 | u16 device_id; | 89 | u16 device_id; |
90 | bfa_os_addr_t pci_bar_kva; | 90 | void __iomem *pci_bar_kva; |
91 | }; | 91 | }; |
92 | 92 | ||
93 | /** | 93 | /** |
@@ -130,34 +130,32 @@ __bfa_dma_be_addr_set(union bfi_addr_u *dma_addr, u64 pa) | |||
130 | } | 130 | } |
131 | 131 | ||
132 | struct bfa_ioc_regs_s { | 132 | struct bfa_ioc_regs_s { |
133 | bfa_os_addr_t hfn_mbox_cmd; | 133 | void __iomem *hfn_mbox_cmd; |
134 | bfa_os_addr_t hfn_mbox; | 134 | void __iomem *hfn_mbox; |
135 | bfa_os_addr_t lpu_mbox_cmd; | 135 | void __iomem *lpu_mbox_cmd; |
136 | bfa_os_addr_t lpu_mbox; | 136 | void __iomem *lpu_mbox; |
137 | bfa_os_addr_t pss_ctl_reg; | 137 | void __iomem *pss_ctl_reg; |
138 | bfa_os_addr_t pss_err_status_reg; | 138 | void __iomem *pss_err_status_reg; |
139 | bfa_os_addr_t app_pll_fast_ctl_reg; | 139 | void __iomem *app_pll_fast_ctl_reg; |
140 | bfa_os_addr_t app_pll_slow_ctl_reg; | 140 | void __iomem *app_pll_slow_ctl_reg; |
141 | bfa_os_addr_t ioc_sem_reg; | 141 | void __iomem *ioc_sem_reg; |
142 | bfa_os_addr_t ioc_usage_sem_reg; | 142 | void __iomem *ioc_usage_sem_reg; |
143 | bfa_os_addr_t ioc_init_sem_reg; | 143 | void __iomem *ioc_init_sem_reg; |
144 | bfa_os_addr_t ioc_usage_reg; | 144 | void __iomem *ioc_usage_reg; |
145 | bfa_os_addr_t host_page_num_fn; | 145 | void __iomem *host_page_num_fn; |
146 | bfa_os_addr_t heartbeat; | 146 | void __iomem *heartbeat; |
147 | bfa_os_addr_t ioc_fwstate; | 147 | void __iomem *ioc_fwstate; |
148 | bfa_os_addr_t ll_halt; | 148 | void __iomem *ll_halt; |
149 | bfa_os_addr_t err_set; | 149 | void __iomem *err_set; |
150 | bfa_os_addr_t shirq_isr_next; | 150 | void __iomem *shirq_isr_next; |
151 | bfa_os_addr_t shirq_msk_next; | 151 | void __iomem *shirq_msk_next; |
152 | bfa_os_addr_t smem_page_start; | 152 | void __iomem *smem_page_start; |
153 | u32 smem_pg0; | 153 | u32 smem_pg0; |
154 | }; | 154 | }; |
155 | 155 | ||
156 | #define bfa_reg_read(_raddr) bfa_os_reg_read(_raddr) | 156 | #define bfa_mem_read(_raddr, _off) swab32(readl(((_raddr) + (_off)))) |
157 | #define bfa_reg_write(_raddr, _val) bfa_os_reg_write(_raddr, _val) | ||
158 | #define bfa_mem_read(_raddr, _off) bfa_os_mem_read(_raddr, _off) | ||
159 | #define bfa_mem_write(_raddr, _off, _val) \ | 157 | #define bfa_mem_write(_raddr, _off, _val) \ |
160 | bfa_os_mem_write(_raddr, _off, _val) | 158 | writel(swab32((_val)), ((_raddr) + (_off))) |
161 | /** | 159 | /** |
162 | * IOC Mailbox structures | 160 | * IOC Mailbox structures |
163 | */ | 161 | */ |
@@ -249,7 +247,7 @@ struct bfa_ioc_s { | |||
249 | }; | 247 | }; |
250 | 248 | ||
251 | struct bfa_ioc_hwif_s { | 249 | struct bfa_ioc_hwif_s { |
252 | bfa_status_t (*ioc_pll_init) (bfa_os_addr_t rb, bfa_boolean_t fcmode); | 250 | bfa_status_t (*ioc_pll_init) (void __iomem *rb, bfa_boolean_t fcmode); |
253 | bfa_boolean_t (*ioc_firmware_lock) (struct bfa_ioc_s *ioc); | 251 | bfa_boolean_t (*ioc_firmware_lock) (struct bfa_ioc_s *ioc); |
254 | void (*ioc_firmware_unlock) (struct bfa_ioc_s *ioc); | 252 | void (*ioc_firmware_unlock) (struct bfa_ioc_s *ioc); |
255 | void (*ioc_reg_init) (struct bfa_ioc_s *ioc); | 253 | void (*ioc_reg_init) (struct bfa_ioc_s *ioc); |
@@ -308,9 +306,9 @@ void bfa_ioc_mbox_regisr(struct bfa_ioc_s *ioc, enum bfi_mclass mc, | |||
308 | (__ioc)->fcmode)) | 306 | (__ioc)->fcmode)) |
309 | 307 | ||
310 | bfa_status_t bfa_ioc_pll_init(struct bfa_ioc_s *ioc); | 308 | bfa_status_t bfa_ioc_pll_init(struct bfa_ioc_s *ioc); |
311 | bfa_status_t bfa_ioc_cb_pll_init(bfa_os_addr_t rb, bfa_boolean_t fcmode); | 309 | bfa_status_t bfa_ioc_cb_pll_init(void __iomem *rb, bfa_boolean_t fcmode); |
312 | bfa_boolean_t bfa_ioc_ct_pll_init_complete(bfa_os_addr_t rb); | 310 | bfa_boolean_t bfa_ioc_ct_pll_init_complete(void __iomem *rb); |
313 | bfa_status_t bfa_ioc_ct_pll_init(bfa_os_addr_t rb, bfa_boolean_t fcmode); | 311 | bfa_status_t bfa_ioc_ct_pll_init(void __iomem *rb, bfa_boolean_t fcmode); |
314 | 312 | ||
315 | #define bfa_ioc_isr_mode_set(__ioc, __msix) \ | 313 | #define bfa_ioc_isr_mode_set(__ioc, __msix) \ |
316 | ((__ioc)->ioc_hwif->ioc_isr_mode_set(__ioc, __msix)) | 314 | ((__ioc)->ioc_hwif->ioc_isr_mode_set(__ioc, __msix)) |
@@ -370,8 +368,8 @@ void bfa_ioc_set_fcmode(struct bfa_ioc_s *ioc); | |||
370 | bfa_boolean_t bfa_ioc_get_fcmode(struct bfa_ioc_s *ioc); | 368 | bfa_boolean_t bfa_ioc_get_fcmode(struct bfa_ioc_s *ioc); |
371 | void bfa_ioc_hbfail_register(struct bfa_ioc_s *ioc, | 369 | void bfa_ioc_hbfail_register(struct bfa_ioc_s *ioc, |
372 | struct bfa_ioc_hbfail_notify_s *notify); | 370 | struct bfa_ioc_hbfail_notify_s *notify); |
373 | bfa_boolean_t bfa_ioc_sem_get(bfa_os_addr_t sem_reg); | 371 | bfa_boolean_t bfa_ioc_sem_get(void __iomem *sem_reg); |
374 | void bfa_ioc_sem_release(bfa_os_addr_t sem_reg); | 372 | void bfa_ioc_sem_release(void __iomem *sem_reg); |
375 | void bfa_ioc_hw_sem_release(struct bfa_ioc_s *ioc); | 373 | void bfa_ioc_hw_sem_release(struct bfa_ioc_s *ioc); |
376 | void bfa_ioc_fwver_get(struct bfa_ioc_s *ioc, | 374 | void bfa_ioc_fwver_get(struct bfa_ioc_s *ioc, |
377 | struct bfi_ioc_image_hdr_s *fwhdr); | 375 | struct bfi_ioc_image_hdr_s *fwhdr); |