diff options
Diffstat (limited to 'drivers/scsi/bfa/bfa_iocfc.c')
-rw-r--r-- | drivers/scsi/bfa/bfa_iocfc.c | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/drivers/scsi/bfa/bfa_iocfc.c b/drivers/scsi/bfa/bfa_iocfc.c index d7ab792a9e54..a76de2669bfc 100644 --- a/drivers/scsi/bfa/bfa_iocfc.c +++ b/drivers/scsi/bfa/bfa_iocfc.c | |||
@@ -172,6 +172,7 @@ bfa_iocfc_init_mem(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg, | |||
172 | */ | 172 | */ |
173 | if (bfa_ioc_devid(&bfa->ioc) == BFA_PCI_DEVICE_ID_CT) { | 173 | if (bfa_ioc_devid(&bfa->ioc) == BFA_PCI_DEVICE_ID_CT) { |
174 | iocfc->hwif.hw_reginit = bfa_hwct_reginit; | 174 | iocfc->hwif.hw_reginit = bfa_hwct_reginit; |
175 | iocfc->hwif.hw_reqq_ack = bfa_hwct_reqq_ack; | ||
175 | iocfc->hwif.hw_rspq_ack = bfa_hwct_rspq_ack; | 176 | iocfc->hwif.hw_rspq_ack = bfa_hwct_rspq_ack; |
176 | iocfc->hwif.hw_msix_init = bfa_hwct_msix_init; | 177 | iocfc->hwif.hw_msix_init = bfa_hwct_msix_init; |
177 | iocfc->hwif.hw_msix_install = bfa_hwct_msix_install; | 178 | iocfc->hwif.hw_msix_install = bfa_hwct_msix_install; |
@@ -180,6 +181,7 @@ bfa_iocfc_init_mem(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg, | |||
180 | iocfc->hwif.hw_msix_getvecs = bfa_hwct_msix_getvecs; | 181 | iocfc->hwif.hw_msix_getvecs = bfa_hwct_msix_getvecs; |
181 | } else { | 182 | } else { |
182 | iocfc->hwif.hw_reginit = bfa_hwcb_reginit; | 183 | iocfc->hwif.hw_reginit = bfa_hwcb_reginit; |
184 | iocfc->hwif.hw_reqq_ack = bfa_hwcb_reqq_ack; | ||
183 | iocfc->hwif.hw_rspq_ack = bfa_hwcb_rspq_ack; | 185 | iocfc->hwif.hw_rspq_ack = bfa_hwcb_rspq_ack; |
184 | iocfc->hwif.hw_msix_init = bfa_hwcb_msix_init; | 186 | iocfc->hwif.hw_msix_init = bfa_hwcb_msix_init; |
185 | iocfc->hwif.hw_msix_install = bfa_hwcb_msix_install; | 187 | iocfc->hwif.hw_msix_install = bfa_hwcb_msix_install; |
@@ -336,8 +338,10 @@ bfa_iocfc_init_cb(void *bfa_arg, bfa_boolean_t complete) | |||
336 | bfa_cb_init(bfa->bfad, BFA_STATUS_OK); | 338 | bfa_cb_init(bfa->bfad, BFA_STATUS_OK); |
337 | else | 339 | else |
338 | bfa_cb_init(bfa->bfad, BFA_STATUS_FAILED); | 340 | bfa_cb_init(bfa->bfad, BFA_STATUS_FAILED); |
339 | } else | 341 | } else { |
340 | bfa->iocfc.action = BFA_IOCFC_ACT_NONE; | 342 | if (bfa->iocfc.cfgdone) |
343 | bfa->iocfc.action = BFA_IOCFC_ACT_NONE; | ||
344 | } | ||
341 | } | 345 | } |
342 | 346 | ||
343 | static void | 347 | static void |
@@ -619,8 +623,6 @@ bfa_iocfc_attach(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg, | |||
619 | 623 | ||
620 | bfa_ioc_attach(&bfa->ioc, bfa, &bfa_iocfc_cbfn, &bfa->timer_mod, | 624 | bfa_ioc_attach(&bfa->ioc, bfa, &bfa_iocfc_cbfn, &bfa->timer_mod, |
621 | bfa->trcmod, bfa->aen, bfa->logm); | 625 | bfa->trcmod, bfa->aen, bfa->logm); |
622 | bfa_ioc_pci_init(&bfa->ioc, pcidev, BFI_MC_IOCFC); | ||
623 | bfa_ioc_mbox_register(&bfa->ioc, bfa_mbox_isrs); | ||
624 | 626 | ||
625 | /** | 627 | /** |
626 | * Choose FC (ssid: 0x1C) v/s FCoE (ssid: 0x14) mode. | 628 | * Choose FC (ssid: 0x1C) v/s FCoE (ssid: 0x14) mode. |
@@ -628,6 +630,9 @@ bfa_iocfc_attach(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg, | |||
628 | if (0) | 630 | if (0) |
629 | bfa_ioc_set_fcmode(&bfa->ioc); | 631 | bfa_ioc_set_fcmode(&bfa->ioc); |
630 | 632 | ||
633 | bfa_ioc_pci_init(&bfa->ioc, pcidev, BFI_MC_IOCFC); | ||
634 | bfa_ioc_mbox_register(&bfa->ioc, bfa_mbox_isrs); | ||
635 | |||
631 | bfa_iocfc_init_mem(bfa, bfad, cfg, pcidev); | 636 | bfa_iocfc_init_mem(bfa, bfad, cfg, pcidev); |
632 | bfa_iocfc_mem_claim(bfa, cfg, meminfo); | 637 | bfa_iocfc_mem_claim(bfa, cfg, meminfo); |
633 | bfa_timer_init(&bfa->timer_mod); | 638 | bfa_timer_init(&bfa->timer_mod); |
@@ -654,7 +659,6 @@ bfa_iocfc_init(struct bfa_s *bfa) | |||
654 | { | 659 | { |
655 | bfa->iocfc.action = BFA_IOCFC_ACT_INIT; | 660 | bfa->iocfc.action = BFA_IOCFC_ACT_INIT; |
656 | bfa_ioc_enable(&bfa->ioc); | 661 | bfa_ioc_enable(&bfa->ioc); |
657 | bfa_msix_install(bfa); | ||
658 | } | 662 | } |
659 | 663 | ||
660 | /** | 664 | /** |
@@ -797,6 +801,11 @@ bfa_iocfc_get_stats(struct bfa_s *bfa, struct bfa_iocfc_stats_s *stats, | |||
797 | return BFA_STATUS_DEVBUSY; | 801 | return BFA_STATUS_DEVBUSY; |
798 | } | 802 | } |
799 | 803 | ||
804 | if (!bfa_iocfc_is_operational(bfa)) { | ||
805 | bfa_trc(bfa, 0); | ||
806 | return BFA_STATUS_IOC_NON_OP; | ||
807 | } | ||
808 | |||
800 | iocfc->stats_busy = BFA_TRUE; | 809 | iocfc->stats_busy = BFA_TRUE; |
801 | iocfc->stats_ret = stats; | 810 | iocfc->stats_ret = stats; |
802 | iocfc->stats_cbfn = cbfn; | 811 | iocfc->stats_cbfn = cbfn; |
@@ -817,6 +826,11 @@ bfa_iocfc_clear_stats(struct bfa_s *bfa, bfa_cb_ioc_t cbfn, void *cbarg) | |||
817 | return BFA_STATUS_DEVBUSY; | 826 | return BFA_STATUS_DEVBUSY; |
818 | } | 827 | } |
819 | 828 | ||
829 | if (!bfa_iocfc_is_operational(bfa)) { | ||
830 | bfa_trc(bfa, 0); | ||
831 | return BFA_STATUS_IOC_NON_OP; | ||
832 | } | ||
833 | |||
820 | iocfc->stats_busy = BFA_TRUE; | 834 | iocfc->stats_busy = BFA_TRUE; |
821 | iocfc->stats_cbfn = cbfn; | 835 | iocfc->stats_cbfn = cbfn; |
822 | iocfc->stats_cbarg = cbarg; | 836 | iocfc->stats_cbarg = cbarg; |