diff options
author | Krishna Gudipati <kgudipat@brocade.com> | 2011-06-13 18:52:40 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2011-06-29 16:50:50 -0400 |
commit | 8b070b4a022f86dd5098308e36426ce29b6b8960 (patch) | |
tree | 6e6e2077aa3de449d4e3917392eb0179a635f1ad /drivers/scsi/bfa/bfa_ioc.c | |
parent | 775c7742adfd7726f05914198bf33eaa3b9f64bb (diff) |
[SCSI] bfa: Brocade-1860 Fabric Adapter 16Gbs support and flash controller fixes.
- Added support for 16Gbps.
- Added logic to flush pending mailbox command queue when IOC is disabled.
- Fix to Halt the flash controller during fw initialization - since
when asic blck is programmed flash controller's continuous access
blocks f/w access to flash.
- Added new asic based card types and modified IOC get card model routine.
- Added PLL init fix to do LPU reset every time we do a memory
initialization, since not doing so will cause LPU to be
uninitialized during driver load.
- Added fix to Halt flash controller before PLL initialization.
Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/bfa/bfa_ioc.c')
-rw-r--r-- | drivers/scsi/bfa/bfa_ioc.c | 68 |
1 files changed, 51 insertions, 17 deletions
diff --git a/drivers/scsi/bfa/bfa_ioc.c b/drivers/scsi/bfa/bfa_ioc.c index 9c6e493cb9c7..b9413c2e67ff 100644 --- a/drivers/scsi/bfa/bfa_ioc.c +++ b/drivers/scsi/bfa/bfa_ioc.c | |||
@@ -85,7 +85,7 @@ static void bfa_ioc_send_disable(struct bfa_ioc_s *ioc); | |||
85 | static void bfa_ioc_send_getattr(struct bfa_ioc_s *ioc); | 85 | static void bfa_ioc_send_getattr(struct bfa_ioc_s *ioc); |
86 | static void bfa_ioc_hb_monitor(struct bfa_ioc_s *ioc); | 86 | static void bfa_ioc_hb_monitor(struct bfa_ioc_s *ioc); |
87 | static void bfa_ioc_mbox_poll(struct bfa_ioc_s *ioc); | 87 | static void bfa_ioc_mbox_poll(struct bfa_ioc_s *ioc); |
88 | static void bfa_ioc_mbox_hbfail(struct bfa_ioc_s *ioc); | 88 | static void bfa_ioc_mbox_flush(struct bfa_ioc_s *ioc); |
89 | static void bfa_ioc_recover(struct bfa_ioc_s *ioc); | 89 | static void bfa_ioc_recover(struct bfa_ioc_s *ioc); |
90 | static void bfa_ioc_check_attr_wwns(struct bfa_ioc_s *ioc); | 90 | static void bfa_ioc_check_attr_wwns(struct bfa_ioc_s *ioc); |
91 | static void bfa_ioc_event_notify(struct bfa_ioc_s *ioc , | 91 | static void bfa_ioc_event_notify(struct bfa_ioc_s *ioc , |
@@ -971,6 +971,7 @@ bfa_iocpf_sm_disabling_sync(struct bfa_iocpf_s *iocpf, enum iocpf_event event) | |||
971 | static void | 971 | static void |
972 | bfa_iocpf_sm_disabled_entry(struct bfa_iocpf_s *iocpf) | 972 | bfa_iocpf_sm_disabled_entry(struct bfa_iocpf_s *iocpf) |
973 | { | 973 | { |
974 | bfa_ioc_mbox_flush(iocpf->ioc); | ||
974 | bfa_fsm_send_event(iocpf->ioc, IOC_E_DISABLED); | 975 | bfa_fsm_send_event(iocpf->ioc, IOC_E_DISABLED); |
975 | } | 976 | } |
976 | 977 | ||
@@ -1081,7 +1082,7 @@ bfa_iocpf_sm_fail_sync_entry(struct bfa_iocpf_s *iocpf) | |||
1081 | /* | 1082 | /* |
1082 | * Flush any queued up mailbox requests. | 1083 | * Flush any queued up mailbox requests. |
1083 | */ | 1084 | */ |
1084 | bfa_ioc_mbox_hbfail(iocpf->ioc); | 1085 | bfa_ioc_mbox_flush(iocpf->ioc); |
1085 | 1086 | ||
1086 | bfa_ioc_hw_sem_get(iocpf->ioc); | 1087 | bfa_ioc_hw_sem_get(iocpf->ioc); |
1087 | } | 1088 | } |
@@ -1399,6 +1400,7 @@ bfa_ioc_hwinit(struct bfa_ioc_s *ioc, bfa_boolean_t force) | |||
1399 | 1400 | ||
1400 | if (!fwvalid) { | 1401 | if (!fwvalid) { |
1401 | bfa_ioc_boot(ioc, boot_type, boot_env); | 1402 | bfa_ioc_boot(ioc, boot_type, boot_env); |
1403 | bfa_ioc_poll_fwinit(ioc); | ||
1402 | return; | 1404 | return; |
1403 | } | 1405 | } |
1404 | 1406 | ||
@@ -1434,6 +1436,7 @@ bfa_ioc_hwinit(struct bfa_ioc_s *ioc, bfa_boolean_t force) | |||
1434 | * Initialize the h/w for any other states. | 1436 | * Initialize the h/w for any other states. |
1435 | */ | 1437 | */ |
1436 | bfa_ioc_boot(ioc, boot_type, boot_env); | 1438 | bfa_ioc_boot(ioc, boot_type, boot_env); |
1439 | bfa_ioc_poll_fwinit(ioc); | ||
1437 | } | 1440 | } |
1438 | 1441 | ||
1439 | static void | 1442 | static void |
@@ -1668,7 +1671,7 @@ bfa_ioc_mbox_poll(struct bfa_ioc_s *ioc) | |||
1668 | * Cleanup any pending requests. | 1671 | * Cleanup any pending requests. |
1669 | */ | 1672 | */ |
1670 | static void | 1673 | static void |
1671 | bfa_ioc_mbox_hbfail(struct bfa_ioc_s *ioc) | 1674 | bfa_ioc_mbox_flush(struct bfa_ioc_s *ioc) |
1672 | { | 1675 | { |
1673 | struct bfa_ioc_mbox_mod_s *mod = &ioc->mbox_mod; | 1676 | struct bfa_ioc_mbox_mod_s *mod = &ioc->mbox_mod; |
1674 | struct bfa_mbox_cmd_s *cmd; | 1677 | struct bfa_mbox_cmd_s *cmd; |
@@ -2178,22 +2181,28 @@ bfa_ioc_mbox_isr(struct bfa_ioc_s *ioc) | |||
2178 | struct bfi_mbmsg_s m; | 2181 | struct bfi_mbmsg_s m; |
2179 | int mc; | 2182 | int mc; |
2180 | 2183 | ||
2181 | if (!bfa_ioc_msgget(ioc, &m)) | 2184 | if (bfa_ioc_msgget(ioc, &m)) { |
2182 | return; | 2185 | /* |
2186 | * Treat IOC message class as special. | ||
2187 | */ | ||
2188 | mc = m.mh.msg_class; | ||
2189 | if (mc == BFI_MC_IOC) { | ||
2190 | bfa_ioc_isr(ioc, &m); | ||
2191 | return; | ||
2192 | } | ||
2183 | 2193 | ||
2184 | /* | 2194 | if ((mc > BFI_MC_MAX) || (mod->mbhdlr[mc].cbfn == NULL)) |
2185 | * Treat IOC message class as special. | 2195 | return; |
2186 | */ | 2196 | |
2187 | mc = m.mh.msg_class; | 2197 | mod->mbhdlr[mc].cbfn(mod->mbhdlr[mc].cbarg, &m); |
2188 | if (mc == BFI_MC_IOC) { | ||
2189 | bfa_ioc_isr(ioc, &m); | ||
2190 | return; | ||
2191 | } | 2198 | } |
2192 | 2199 | ||
2193 | if ((mc > BFI_MC_MAX) || (mod->mbhdlr[mc].cbfn == NULL)) | 2200 | bfa_ioc_lpu_read_stat(ioc); |
2194 | return; | ||
2195 | 2201 | ||
2196 | mod->mbhdlr[mc].cbfn(mod->mbhdlr[mc].cbarg, &m); | 2202 | /* |
2203 | * Try to send pending mailbox commands | ||
2204 | */ | ||
2205 | bfa_ioc_mbox_poll(ioc); | ||
2197 | } | 2206 | } |
2198 | 2207 | ||
2199 | void | 2208 | void |
@@ -2392,8 +2401,33 @@ bfa_ioc_get_adapter_model(struct bfa_ioc_s *ioc, char *model) | |||
2392 | /* | 2401 | /* |
2393 | * model name | 2402 | * model name |
2394 | */ | 2403 | */ |
2395 | snprintf(model, BFA_ADAPTER_MODEL_NAME_LEN, "%s-%u", | 2404 | if (ioc->asic_gen == BFI_ASIC_GEN_CT2) { |
2396 | BFA_MFG_NAME, ioc_attr->card_type); | 2405 | int np = bfa_ioc_get_nports(ioc); |
2406 | char c; | ||
2407 | switch (ioc_attr->card_type) { | ||
2408 | case BFA_MFG_TYPE_PROWLER_F: | ||
2409 | case BFA_MFG_TYPE_PROWLER_N: | ||
2410 | case BFA_MFG_TYPE_PROWLER_C: | ||
2411 | snprintf(model, BFA_ADAPTER_MODEL_NAME_LEN, | ||
2412 | "%s-%u-%u", | ||
2413 | BFA_MFG_NAME, ioc_attr->card_type, np); | ||
2414 | break; | ||
2415 | case BFA_MFG_TYPE_PROWLER_D: | ||
2416 | if (ioc_attr->ic == BFA_MFG_IC_FC) | ||
2417 | c = 'F'; | ||
2418 | else | ||
2419 | c = 'P'; | ||
2420 | |||
2421 | snprintf(model, BFA_ADAPTER_MODEL_NAME_LEN, | ||
2422 | "%s-%u-%u%c", | ||
2423 | BFA_MFG_NAME, ioc_attr->card_type, np, c); | ||
2424 | break; | ||
2425 | default: | ||
2426 | break; | ||
2427 | } | ||
2428 | } else | ||
2429 | snprintf(model, BFA_ADAPTER_MODEL_NAME_LEN, "%s-%u", | ||
2430 | BFA_MFG_NAME, ioc_attr->card_type); | ||
2397 | } | 2431 | } |
2398 | 2432 | ||
2399 | enum bfa_ioc_state | 2433 | enum bfa_ioc_state |