diff options
Diffstat (limited to 'drivers/scsi/bfa/bfa_ioc.h')
-rw-r--r-- | drivers/scsi/bfa/bfa_ioc.h | 45 |
1 files changed, 42 insertions, 3 deletions
diff --git a/drivers/scsi/bfa/bfa_ioc.h b/drivers/scsi/bfa/bfa_ioc.h index 7c30f05ab137..1633a50187f7 100644 --- a/drivers/scsi/bfa/bfa_ioc.h +++ b/drivers/scsi/bfa/bfa_ioc.h | |||
@@ -78,11 +78,13 @@ struct bfa_ioc_regs_s { | |||
78 | bfa_os_addr_t app_pll_slow_ctl_reg; | 78 | bfa_os_addr_t app_pll_slow_ctl_reg; |
79 | bfa_os_addr_t ioc_sem_reg; | 79 | bfa_os_addr_t ioc_sem_reg; |
80 | bfa_os_addr_t ioc_usage_sem_reg; | 80 | bfa_os_addr_t ioc_usage_sem_reg; |
81 | bfa_os_addr_t ioc_init_sem_reg; | ||
81 | bfa_os_addr_t ioc_usage_reg; | 82 | bfa_os_addr_t ioc_usage_reg; |
82 | bfa_os_addr_t host_page_num_fn; | 83 | bfa_os_addr_t host_page_num_fn; |
83 | bfa_os_addr_t heartbeat; | 84 | bfa_os_addr_t heartbeat; |
84 | bfa_os_addr_t ioc_fwstate; | 85 | bfa_os_addr_t ioc_fwstate; |
85 | bfa_os_addr_t ll_halt; | 86 | bfa_os_addr_t ll_halt; |
87 | bfa_os_addr_t err_set; | ||
86 | bfa_os_addr_t shirq_isr_next; | 88 | bfa_os_addr_t shirq_isr_next; |
87 | bfa_os_addr_t shirq_msk_next; | 89 | bfa_os_addr_t shirq_msk_next; |
88 | bfa_os_addr_t smem_page_start; | 90 | bfa_os_addr_t smem_page_start; |
@@ -154,7 +156,6 @@ struct bfa_ioc_s { | |||
154 | struct bfa_timer_s ioc_timer; | 156 | struct bfa_timer_s ioc_timer; |
155 | struct bfa_timer_s sem_timer; | 157 | struct bfa_timer_s sem_timer; |
156 | u32 hb_count; | 158 | u32 hb_count; |
157 | u32 hb_fail; | ||
158 | u32 retry_count; | 159 | u32 retry_count; |
159 | struct list_head hb_notify_q; | 160 | struct list_head hb_notify_q; |
160 | void *dbg_fwsave; | 161 | void *dbg_fwsave; |
@@ -177,6 +178,22 @@ struct bfa_ioc_s { | |||
177 | struct bfi_ioc_attr_s *attr; | 178 | struct bfi_ioc_attr_s *attr; |
178 | struct bfa_ioc_cbfn_s *cbfn; | 179 | struct bfa_ioc_cbfn_s *cbfn; |
179 | struct bfa_ioc_mbox_mod_s mbox_mod; | 180 | struct bfa_ioc_mbox_mod_s mbox_mod; |
181 | struct bfa_ioc_hwif_s *ioc_hwif; | ||
182 | }; | ||
183 | |||
184 | struct bfa_ioc_hwif_s { | ||
185 | bfa_status_t (*ioc_pll_init) (struct bfa_ioc_s *ioc); | ||
186 | bfa_boolean_t (*ioc_firmware_lock) (struct bfa_ioc_s *ioc); | ||
187 | void (*ioc_firmware_unlock) (struct bfa_ioc_s *ioc); | ||
188 | u32 * (*ioc_fwimg_get_chunk) (struct bfa_ioc_s *ioc, | ||
189 | u32 off); | ||
190 | u32 (*ioc_fwimg_get_size) (struct bfa_ioc_s *ioc); | ||
191 | void (*ioc_reg_init) (struct bfa_ioc_s *ioc); | ||
192 | void (*ioc_map_port) (struct bfa_ioc_s *ioc); | ||
193 | void (*ioc_isr_mode_set) (struct bfa_ioc_s *ioc, | ||
194 | bfa_boolean_t msix); | ||
195 | void (*ioc_notify_hbfail) (struct bfa_ioc_s *ioc); | ||
196 | void (*ioc_ownership_reset) (struct bfa_ioc_s *ioc); | ||
180 | }; | 197 | }; |
181 | 198 | ||
182 | #define bfa_ioc_pcifn(__ioc) ((__ioc)->pcidev.pci_func) | 199 | #define bfa_ioc_pcifn(__ioc) ((__ioc)->pcidev.pci_func) |
@@ -191,6 +208,15 @@ struct bfa_ioc_s { | |||
191 | #define bfa_ioc_rx_bbcredit(__ioc) ((__ioc)->attr->rx_bbcredit) | 208 | #define bfa_ioc_rx_bbcredit(__ioc) ((__ioc)->attr->rx_bbcredit) |
192 | #define bfa_ioc_speed_sup(__ioc) \ | 209 | #define bfa_ioc_speed_sup(__ioc) \ |
193 | BFI_ADAPTER_GETP(SPEED, (__ioc)->attr->adapter_prop) | 210 | BFI_ADAPTER_GETP(SPEED, (__ioc)->attr->adapter_prop) |
211 | #define bfa_ioc_get_nports(__ioc) \ | ||
212 | BFI_ADAPTER_GETP(NPORTS, (__ioc)->attr->adapter_prop) | ||
213 | |||
214 | #define bfa_ioc_stats(_ioc, _stats) ((_ioc)->stats._stats++) | ||
215 | #define BFA_IOC_FWIMG_MINSZ (16 * 1024) | ||
216 | |||
217 | #define BFA_IOC_FLASH_CHUNK_NO(off) (off / BFI_FLASH_CHUNK_SZ_WORDS) | ||
218 | #define BFA_IOC_FLASH_OFFSET_IN_CHUNK(off) (off % BFI_FLASH_CHUNK_SZ_WORDS) | ||
219 | #define BFA_IOC_FLASH_CHUNK_ADDR(chunkno) (chunkno * BFI_FLASH_CHUNK_SZ_WORDS) | ||
194 | 220 | ||
195 | /** | 221 | /** |
196 | * IOC mailbox interface | 222 | * IOC mailbox interface |
@@ -207,6 +233,14 @@ void bfa_ioc_mbox_regisr(struct bfa_ioc_s *ioc, enum bfi_mclass mc, | |||
207 | /** | 233 | /** |
208 | * IOC interfaces | 234 | * IOC interfaces |
209 | */ | 235 | */ |
236 | #define bfa_ioc_pll_init(__ioc) ((__ioc)->ioc_hwif->ioc_pll_init(__ioc)) | ||
237 | #define bfa_ioc_isr_mode_set(__ioc, __msix) \ | ||
238 | ((__ioc)->ioc_hwif->ioc_isr_mode_set(__ioc, __msix)) | ||
239 | #define bfa_ioc_ownership_reset(__ioc) \ | ||
240 | ((__ioc)->ioc_hwif->ioc_ownership_reset(__ioc)) | ||
241 | |||
242 | void bfa_ioc_set_ct_hwif(struct bfa_ioc_s *ioc); | ||
243 | void bfa_ioc_set_cb_hwif(struct bfa_ioc_s *ioc); | ||
210 | void bfa_ioc_attach(struct bfa_ioc_s *ioc, void *bfa, | 244 | void bfa_ioc_attach(struct bfa_ioc_s *ioc, void *bfa, |
211 | struct bfa_ioc_cbfn_s *cbfn, struct bfa_timer_mod_s *timer_mod, | 245 | struct bfa_ioc_cbfn_s *cbfn, struct bfa_timer_mod_s *timer_mod, |
212 | struct bfa_trc_mod_s *trcmod, | 246 | struct bfa_trc_mod_s *trcmod, |
@@ -223,8 +257,6 @@ bfa_boolean_t bfa_ioc_intx_claim(struct bfa_ioc_s *ioc); | |||
223 | void bfa_ioc_boot(struct bfa_ioc_s *ioc, u32 boot_type, u32 boot_param); | 257 | void bfa_ioc_boot(struct bfa_ioc_s *ioc, u32 boot_type, u32 boot_param); |
224 | void bfa_ioc_isr(struct bfa_ioc_s *ioc, struct bfi_mbmsg_s *msg); | 258 | void bfa_ioc_isr(struct bfa_ioc_s *ioc, struct bfi_mbmsg_s *msg); |
225 | void bfa_ioc_error_isr(struct bfa_ioc_s *ioc); | 259 | void bfa_ioc_error_isr(struct bfa_ioc_s *ioc); |
226 | void bfa_ioc_isr_mode_set(struct bfa_ioc_s *ioc, bfa_boolean_t intx); | ||
227 | bfa_status_t bfa_ioc_pll_init(struct bfa_ioc_s *ioc); | ||
228 | bfa_boolean_t bfa_ioc_is_operational(struct bfa_ioc_s *ioc); | 260 | bfa_boolean_t bfa_ioc_is_operational(struct bfa_ioc_s *ioc); |
229 | bfa_boolean_t bfa_ioc_is_disabled(struct bfa_ioc_s *ioc); | 261 | bfa_boolean_t bfa_ioc_is_disabled(struct bfa_ioc_s *ioc); |
230 | bfa_boolean_t bfa_ioc_fw_mismatch(struct bfa_ioc_s *ioc); | 262 | bfa_boolean_t bfa_ioc_fw_mismatch(struct bfa_ioc_s *ioc); |
@@ -245,6 +277,13 @@ void bfa_ioc_set_fcmode(struct bfa_ioc_s *ioc); | |||
245 | bfa_boolean_t bfa_ioc_get_fcmode(struct bfa_ioc_s *ioc); | 277 | bfa_boolean_t bfa_ioc_get_fcmode(struct bfa_ioc_s *ioc); |
246 | void bfa_ioc_hbfail_register(struct bfa_ioc_s *ioc, | 278 | void bfa_ioc_hbfail_register(struct bfa_ioc_s *ioc, |
247 | struct bfa_ioc_hbfail_notify_s *notify); | 279 | struct bfa_ioc_hbfail_notify_s *notify); |
280 | bfa_boolean_t bfa_ioc_sem_get(bfa_os_addr_t sem_reg); | ||
281 | void bfa_ioc_sem_release(bfa_os_addr_t sem_reg); | ||
282 | void bfa_ioc_hw_sem_release(struct bfa_ioc_s *ioc); | ||
283 | void bfa_ioc_fwver_get(struct bfa_ioc_s *ioc, | ||
284 | struct bfi_ioc_image_hdr_s *fwhdr); | ||
285 | bfa_boolean_t bfa_ioc_fwver_cmp(struct bfa_ioc_s *ioc, | ||
286 | struct bfi_ioc_image_hdr_s *fwhdr); | ||
248 | 287 | ||
249 | /* | 288 | /* |
250 | * bfa mfg wwn API functions | 289 | * bfa mfg wwn API functions |