diff options
Diffstat (limited to 'drivers/scsi/bfa/bfa_ioc.h')
-rw-r--r-- | drivers/scsi/bfa/bfa_ioc.h | 57 |
1 files changed, 54 insertions, 3 deletions
diff --git a/drivers/scsi/bfa/bfa_ioc.h b/drivers/scsi/bfa/bfa_ioc.h index 7c30f05ab137..d0804406ea1a 100644 --- a/drivers/scsi/bfa/bfa_ioc.h +++ b/drivers/scsi/bfa/bfa_ioc.h | |||
@@ -74,15 +74,18 @@ struct bfa_ioc_regs_s { | |||
74 | bfa_os_addr_t lpu_mbox_cmd; | 74 | bfa_os_addr_t lpu_mbox_cmd; |
75 | bfa_os_addr_t lpu_mbox; | 75 | bfa_os_addr_t lpu_mbox; |
76 | bfa_os_addr_t pss_ctl_reg; | 76 | bfa_os_addr_t pss_ctl_reg; |
77 | bfa_os_addr_t pss_err_status_reg; | ||
77 | bfa_os_addr_t app_pll_fast_ctl_reg; | 78 | bfa_os_addr_t app_pll_fast_ctl_reg; |
78 | bfa_os_addr_t app_pll_slow_ctl_reg; | 79 | bfa_os_addr_t app_pll_slow_ctl_reg; |
79 | bfa_os_addr_t ioc_sem_reg; | 80 | bfa_os_addr_t ioc_sem_reg; |
80 | bfa_os_addr_t ioc_usage_sem_reg; | 81 | bfa_os_addr_t ioc_usage_sem_reg; |
82 | bfa_os_addr_t ioc_init_sem_reg; | ||
81 | bfa_os_addr_t ioc_usage_reg; | 83 | bfa_os_addr_t ioc_usage_reg; |
82 | bfa_os_addr_t host_page_num_fn; | 84 | bfa_os_addr_t host_page_num_fn; |
83 | bfa_os_addr_t heartbeat; | 85 | bfa_os_addr_t heartbeat; |
84 | bfa_os_addr_t ioc_fwstate; | 86 | bfa_os_addr_t ioc_fwstate; |
85 | bfa_os_addr_t ll_halt; | 87 | bfa_os_addr_t ll_halt; |
88 | bfa_os_addr_t err_set; | ||
86 | bfa_os_addr_t shirq_isr_next; | 89 | bfa_os_addr_t shirq_isr_next; |
87 | bfa_os_addr_t shirq_msk_next; | 90 | bfa_os_addr_t shirq_msk_next; |
88 | bfa_os_addr_t smem_page_start; | 91 | bfa_os_addr_t smem_page_start; |
@@ -154,7 +157,6 @@ struct bfa_ioc_s { | |||
154 | struct bfa_timer_s ioc_timer; | 157 | struct bfa_timer_s ioc_timer; |
155 | struct bfa_timer_s sem_timer; | 158 | struct bfa_timer_s sem_timer; |
156 | u32 hb_count; | 159 | u32 hb_count; |
157 | u32 hb_fail; | ||
158 | u32 retry_count; | 160 | u32 retry_count; |
159 | struct list_head hb_notify_q; | 161 | struct list_head hb_notify_q; |
160 | void *dbg_fwsave; | 162 | void *dbg_fwsave; |
@@ -177,6 +179,22 @@ struct bfa_ioc_s { | |||
177 | struct bfi_ioc_attr_s *attr; | 179 | struct bfi_ioc_attr_s *attr; |
178 | struct bfa_ioc_cbfn_s *cbfn; | 180 | struct bfa_ioc_cbfn_s *cbfn; |
179 | struct bfa_ioc_mbox_mod_s mbox_mod; | 181 | struct bfa_ioc_mbox_mod_s mbox_mod; |
182 | struct bfa_ioc_hwif_s *ioc_hwif; | ||
183 | }; | ||
184 | |||
185 | struct bfa_ioc_hwif_s { | ||
186 | bfa_status_t (*ioc_pll_init) (struct bfa_ioc_s *ioc); | ||
187 | bfa_boolean_t (*ioc_firmware_lock) (struct bfa_ioc_s *ioc); | ||
188 | void (*ioc_firmware_unlock) (struct bfa_ioc_s *ioc); | ||
189 | u32 * (*ioc_fwimg_get_chunk) (struct bfa_ioc_s *ioc, | ||
190 | u32 off); | ||
191 | u32 (*ioc_fwimg_get_size) (struct bfa_ioc_s *ioc); | ||
192 | void (*ioc_reg_init) (struct bfa_ioc_s *ioc); | ||
193 | void (*ioc_map_port) (struct bfa_ioc_s *ioc); | ||
194 | void (*ioc_isr_mode_set) (struct bfa_ioc_s *ioc, | ||
195 | bfa_boolean_t msix); | ||
196 | void (*ioc_notify_hbfail) (struct bfa_ioc_s *ioc); | ||
197 | void (*ioc_ownership_reset) (struct bfa_ioc_s *ioc); | ||
180 | }; | 198 | }; |
181 | 199 | ||
182 | #define bfa_ioc_pcifn(__ioc) ((__ioc)->pcidev.pci_func) | 200 | #define bfa_ioc_pcifn(__ioc) ((__ioc)->pcidev.pci_func) |
@@ -191,6 +209,15 @@ struct bfa_ioc_s { | |||
191 | #define bfa_ioc_rx_bbcredit(__ioc) ((__ioc)->attr->rx_bbcredit) | 209 | #define bfa_ioc_rx_bbcredit(__ioc) ((__ioc)->attr->rx_bbcredit) |
192 | #define bfa_ioc_speed_sup(__ioc) \ | 210 | #define bfa_ioc_speed_sup(__ioc) \ |
193 | BFI_ADAPTER_GETP(SPEED, (__ioc)->attr->adapter_prop) | 211 | BFI_ADAPTER_GETP(SPEED, (__ioc)->attr->adapter_prop) |
212 | #define bfa_ioc_get_nports(__ioc) \ | ||
213 | BFI_ADAPTER_GETP(NPORTS, (__ioc)->attr->adapter_prop) | ||
214 | |||
215 | #define bfa_ioc_stats(_ioc, _stats) ((_ioc)->stats._stats++) | ||
216 | #define BFA_IOC_FWIMG_MINSZ (16 * 1024) | ||
217 | |||
218 | #define BFA_IOC_FLASH_CHUNK_NO(off) (off / BFI_FLASH_CHUNK_SZ_WORDS) | ||
219 | #define BFA_IOC_FLASH_OFFSET_IN_CHUNK(off) (off % BFI_FLASH_CHUNK_SZ_WORDS) | ||
220 | #define BFA_IOC_FLASH_CHUNK_ADDR(chunkno) (chunkno * BFI_FLASH_CHUNK_SZ_WORDS) | ||
194 | 221 | ||
195 | /** | 222 | /** |
196 | * IOC mailbox interface | 223 | * IOC mailbox interface |
@@ -207,6 +234,14 @@ void bfa_ioc_mbox_regisr(struct bfa_ioc_s *ioc, enum bfi_mclass mc, | |||
207 | /** | 234 | /** |
208 | * IOC interfaces | 235 | * IOC interfaces |
209 | */ | 236 | */ |
237 | #define bfa_ioc_pll_init(__ioc) ((__ioc)->ioc_hwif->ioc_pll_init(__ioc)) | ||
238 | #define bfa_ioc_isr_mode_set(__ioc, __msix) \ | ||
239 | ((__ioc)->ioc_hwif->ioc_isr_mode_set(__ioc, __msix)) | ||
240 | #define bfa_ioc_ownership_reset(__ioc) \ | ||
241 | ((__ioc)->ioc_hwif->ioc_ownership_reset(__ioc)) | ||
242 | |||
243 | void bfa_ioc_set_ct_hwif(struct bfa_ioc_s *ioc); | ||
244 | void bfa_ioc_set_cb_hwif(struct bfa_ioc_s *ioc); | ||
210 | void bfa_ioc_attach(struct bfa_ioc_s *ioc, void *bfa, | 245 | 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, | 246 | struct bfa_ioc_cbfn_s *cbfn, struct bfa_timer_mod_s *timer_mod, |
212 | struct bfa_trc_mod_s *trcmod, | 247 | struct bfa_trc_mod_s *trcmod, |
@@ -223,13 +258,21 @@ 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); | 258 | 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); | 259 | 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); | 260 | 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); | 261 | 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); | 262 | 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); | 263 | bfa_boolean_t bfa_ioc_fw_mismatch(struct bfa_ioc_s *ioc); |
231 | bfa_boolean_t bfa_ioc_adapter_is_disabled(struct bfa_ioc_s *ioc); | 264 | bfa_boolean_t bfa_ioc_adapter_is_disabled(struct bfa_ioc_s *ioc); |
232 | void bfa_ioc_cfg_complete(struct bfa_ioc_s *ioc); | 265 | void bfa_ioc_cfg_complete(struct bfa_ioc_s *ioc); |
266 | enum bfa_ioc_type_e bfa_ioc_get_type(struct bfa_ioc_s *ioc); | ||
267 | void bfa_ioc_get_adapter_serial_num(struct bfa_ioc_s *ioc, char *serial_num); | ||
268 | void bfa_ioc_get_adapter_fw_ver(struct bfa_ioc_s *ioc, char *fw_ver); | ||
269 | void bfa_ioc_get_adapter_optrom_ver(struct bfa_ioc_s *ioc, char *optrom_ver); | ||
270 | void bfa_ioc_get_adapter_model(struct bfa_ioc_s *ioc, char *model); | ||
271 | void bfa_ioc_get_adapter_manufacturer(struct bfa_ioc_s *ioc, | ||
272 | char *manufacturer); | ||
273 | void bfa_ioc_get_pci_chip_rev(struct bfa_ioc_s *ioc, char *chip_rev); | ||
274 | enum bfa_ioc_state bfa_ioc_get_state(struct bfa_ioc_s *ioc); | ||
275 | |||
233 | void bfa_ioc_get_attr(struct bfa_ioc_s *ioc, struct bfa_ioc_attr_s *ioc_attr); | 276 | void bfa_ioc_get_attr(struct bfa_ioc_s *ioc, struct bfa_ioc_attr_s *ioc_attr); |
234 | void bfa_ioc_get_adapter_attr(struct bfa_ioc_s *ioc, | 277 | void bfa_ioc_get_adapter_attr(struct bfa_ioc_s *ioc, |
235 | struct bfa_adapter_attr_s *ad_attr); | 278 | struct bfa_adapter_attr_s *ad_attr); |
@@ -237,6 +280,7 @@ int bfa_ioc_debug_trcsz(bfa_boolean_t auto_recover); | |||
237 | void bfa_ioc_debug_memclaim(struct bfa_ioc_s *ioc, void *dbg_fwsave); | 280 | void bfa_ioc_debug_memclaim(struct bfa_ioc_s *ioc, void *dbg_fwsave); |
238 | bfa_status_t bfa_ioc_debug_fwsave(struct bfa_ioc_s *ioc, void *trcdata, | 281 | bfa_status_t bfa_ioc_debug_fwsave(struct bfa_ioc_s *ioc, void *trcdata, |
239 | int *trclen); | 282 | int *trclen); |
283 | void bfa_ioc_debug_fwsave_clear(struct bfa_ioc_s *ioc); | ||
240 | bfa_status_t bfa_ioc_debug_fwtrc(struct bfa_ioc_s *ioc, void *trcdata, | 284 | bfa_status_t bfa_ioc_debug_fwtrc(struct bfa_ioc_s *ioc, void *trcdata, |
241 | int *trclen); | 285 | int *trclen); |
242 | u32 bfa_ioc_smem_pgnum(struct bfa_ioc_s *ioc, u32 fmaddr); | 286 | u32 bfa_ioc_smem_pgnum(struct bfa_ioc_s *ioc, u32 fmaddr); |
@@ -245,6 +289,13 @@ void bfa_ioc_set_fcmode(struct bfa_ioc_s *ioc); | |||
245 | bfa_boolean_t bfa_ioc_get_fcmode(struct bfa_ioc_s *ioc); | 289 | bfa_boolean_t bfa_ioc_get_fcmode(struct bfa_ioc_s *ioc); |
246 | void bfa_ioc_hbfail_register(struct bfa_ioc_s *ioc, | 290 | void bfa_ioc_hbfail_register(struct bfa_ioc_s *ioc, |
247 | struct bfa_ioc_hbfail_notify_s *notify); | 291 | struct bfa_ioc_hbfail_notify_s *notify); |
292 | bfa_boolean_t bfa_ioc_sem_get(bfa_os_addr_t sem_reg); | ||
293 | void bfa_ioc_sem_release(bfa_os_addr_t sem_reg); | ||
294 | void bfa_ioc_hw_sem_release(struct bfa_ioc_s *ioc); | ||
295 | void bfa_ioc_fwver_get(struct bfa_ioc_s *ioc, | ||
296 | struct bfi_ioc_image_hdr_s *fwhdr); | ||
297 | bfa_boolean_t bfa_ioc_fwver_cmp(struct bfa_ioc_s *ioc, | ||
298 | struct bfi_ioc_image_hdr_s *fwhdr); | ||
248 | 299 | ||
249 | /* | 300 | /* |
250 | * bfa mfg wwn API functions | 301 | * bfa mfg wwn API functions |