Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[SCSI] bfa: clean up one line functions

Cleaned up one line functions.

Signed-off-by: Maggie Zhang <xmzhang@brocade.com>
Signed-off-by: Jing Huang <huangj@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>

authored by

Maggie Zhang and committed by
James Bottomley
f7f73812 df0f1933

+259 -930
-17
drivers/scsi/bfa/bfa.h
··· 296 296 struct bfa_iocfc_cfg_s *cfg, 297 297 struct bfa_meminfo_s *meminfo, 298 298 struct bfa_pcidev_s *pcidev); 299 - void bfa_iocfc_detach(struct bfa_s *bfa); 300 299 void bfa_iocfc_init(struct bfa_s *bfa); 301 300 void bfa_iocfc_start(struct bfa_s *bfa); 302 301 void bfa_iocfc_stop(struct bfa_s *bfa); ··· 384 385 void bfa_attach(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg, 385 386 struct bfa_meminfo_s *meminfo, 386 387 struct bfa_pcidev_s *pcidev); 387 - void bfa_init_trc(struct bfa_s *bfa, struct bfa_trc_mod_s *trcmod); 388 - void bfa_init_plog(struct bfa_s *bfa, struct bfa_plog_s *plog); 389 388 void bfa_detach(struct bfa_s *bfa); 390 - void bfa_init(struct bfa_s *bfa); 391 - void bfa_start(struct bfa_s *bfa); 392 - void bfa_stop(struct bfa_s *bfa); 393 - void bfa_attach_fcs(struct bfa_s *bfa); 394 389 void bfa_cb_init(void *bfad, bfa_status_t status); 395 390 void bfa_cb_updateq(void *bfad, bfa_status_t status); 396 391 ··· 398 405 399 406 typedef void (*bfa_cb_ioc_t) (void *cbarg, enum bfa_status status); 400 407 void bfa_iocfc_get_attr(struct bfa_s *bfa, struct bfa_iocfc_attr_s *attr); 401 - void bfa_get_attr(struct bfa_s *bfa, struct bfa_ioc_attr_s *ioc_attr); 402 408 403 409 404 410 bfa_status_t bfa_iocfc_israttr_set(struct bfa_s *bfa, ··· 405 413 406 414 void bfa_iocfc_enable(struct bfa_s *bfa); 407 415 void bfa_iocfc_disable(struct bfa_s *bfa); 408 - void bfa_timer_tick(struct bfa_s *bfa); 409 416 #define bfa_timer_start(_bfa, _timer, _timercb, _arg, _timeout) \ 410 417 bfa_timer_begin(&(_bfa)->timer_mod, _timer, _timercb, _arg, _timeout) 411 - 412 - /* 413 - * BFA debug API functions 414 - */ 415 - bfa_status_t bfa_debug_fwtrc(struct bfa_s *bfa, void *trcdata, int *trclen); 416 - bfa_status_t bfa_debug_fwsave(struct bfa_s *bfa, void *trcdata, int *trclen); 417 - bfa_status_t bfa_debug_fwcore(struct bfa_s *bfa, void *buf, 418 - u32 *offset, int *buflen); 419 418 420 419 #endif /* __BFA_H__ */
+9 -164
drivers/scsi/bfa/bfa_core.c
··· 67 67 * BFA Interrupt handling functions 68 68 */ 69 69 static void 70 - bfa_msix_errint(struct bfa_s *bfa, u32 intr) 71 - { 72 - bfa_ioc_error_isr(&bfa->ioc); 73 - } 74 - 75 - static void 76 - bfa_msix_lpu(struct bfa_s *bfa) 77 - { 78 - bfa_ioc_mbox_isr(&bfa->ioc); 79 - } 80 - 81 - static void 82 70 bfa_reqq_resume(struct bfa_s *bfa, int qid) 83 71 { 84 72 struct list_head *waitq, *qe, *qen; ··· 255 267 intr = readl(bfa->iocfc.bfa_regs.intr_status); 256 268 257 269 if (intr & (__HFN_INT_MBOX_LPU0 | __HFN_INT_MBOX_LPU1)) 258 - bfa_msix_lpu(bfa); 270 + bfa_ioc_mbox_isr(&bfa->ioc); 259 271 260 272 intr &= (__HFN_INT_ERR_EMC | __HFN_INT_ERR_LPU0 | 261 273 __HFN_INT_ERR_LPU1 | __HFN_INT_ERR_PSS | __HFN_INT_LL_HALT); ··· 286 298 } 287 299 288 300 writel(intr, bfa->iocfc.bfa_regs.intr_status); 289 - bfa_msix_errint(bfa, intr); 301 + bfa_ioc_error_isr(&bfa->ioc); 290 302 } 291 303 } 292 304 ··· 455 467 * First allocate dma memory for IOC. 456 468 */ 457 469 bfa_ioc_mem_claim(&bfa->ioc, dm_kva, dm_pa); 458 - dm_kva += bfa_ioc_meminfo(); 459 - dm_pa += bfa_ioc_meminfo(); 470 + dm_kva += BFA_ROUNDUP(sizeof(struct bfi_ioc_attr_s), BFA_DMA_ALIGN_SZ); 471 + dm_pa += BFA_ROUNDUP(sizeof(struct bfi_ioc_attr_s), BFA_DMA_ALIGN_SZ); 460 472 461 473 /* 462 474 * Claim DMA-able memory for the request/response queues and for shadow ··· 519 531 bfa_meminfo_dma_virt(meminfo) = dm_kva; 520 532 bfa_meminfo_dma_phys(meminfo) = dm_pa; 521 533 522 - dbgsz = bfa_ioc_debug_trcsz(bfa_auto_recover); 534 + dbgsz = (bfa_auto_recover) ? BFA_DBG_FWTRC_LEN : 0; 523 535 if (dbgsz > 0) { 524 536 bfa_ioc_debug_memclaim(&bfa->ioc, bfa_meminfo_kva(meminfo)); 525 537 bfa_meminfo_kva(meminfo) += dbgsz; ··· 711 723 u32 *dm_len) 712 724 { 713 725 /* dma memory for IOC */ 714 - *dm_len += bfa_ioc_meminfo(); 726 + *dm_len += BFA_ROUNDUP(sizeof(struct bfi_ioc_attr_s), BFA_DMA_ALIGN_SZ); 715 727 716 728 bfa_iocfc_fw_cfg_sz(cfg, dm_len); 717 729 bfa_iocfc_cqs_sz(cfg, dm_len); 718 - *km_len += bfa_ioc_debug_trcsz(bfa_auto_recover); 730 + *km_len += (bfa_auto_recover) ? BFA_DBG_FWTRC_LEN : 0; 719 731 } 720 732 721 733 /* ··· 747 759 748 760 bfa_iocfc_init_mem(bfa, bfad, cfg, pcidev); 749 761 bfa_iocfc_mem_claim(bfa, cfg, meminfo); 750 - bfa_timer_init(&bfa->timer_mod); 762 + INIT_LIST_HEAD(&bfa->timer_mod.timer_q); 751 763 752 764 INIT_LIST_HEAD(&bfa->comp_q); 753 765 for (i = 0; i < BFI_IOC_MAX_CQS; i++) 754 766 INIT_LIST_HEAD(&bfa->reqq_waitq[i]); 755 - } 756 - 757 - /* 758 - * Query IOC memory requirement information. 759 - */ 760 - void 761 - bfa_iocfc_detach(struct bfa_s *bfa) 762 - { 763 - bfa_ioc_detach(&bfa->ioc); 764 767 } 765 768 766 769 /* ··· 1069 1090 1070 1091 for (i = 0; hal_mods[i]; i++) 1071 1092 hal_mods[i]->detach(bfa); 1072 - 1073 - bfa_iocfc_detach(bfa); 1074 - } 1075 - 1076 - 1077 - void 1078 - bfa_init_trc(struct bfa_s *bfa, struct bfa_trc_mod_s *trcmod) 1079 - { 1080 - bfa->trcmod = trcmod; 1081 - } 1082 - 1083 - void 1084 - bfa_init_plog(struct bfa_s *bfa, struct bfa_plog_s *plog) 1085 - { 1086 - bfa->plog = plog; 1087 - } 1088 - 1089 - /* 1090 - * Initialize IOC. 1091 - * 1092 - * This function will return immediately, when the IOC initialization is 1093 - * completed, the bfa_cb_init() will be called. 1094 - * 1095 - * @param[in] bfa instance 1096 - * 1097 - * @return void 1098 - * 1099 - * Special Considerations: 1100 - * 1101 - * @note 1102 - * When this function returns, the driver should register the interrupt service 1103 - * routine(s) and enable the device interrupts. If this is not done, 1104 - * bfa_cb_init() will never get called 1105 - */ 1106 - void 1107 - bfa_init(struct bfa_s *bfa) 1108 - { 1109 - bfa_iocfc_init(bfa); 1110 - } 1111 - 1112 - /* 1113 - * Use this function initiate the IOC configuration setup. This function 1114 - * will return immediately. 1115 - * 1116 - * @param[in] bfa instance 1117 - * 1118 - * @return None 1119 - */ 1120 - void 1121 - bfa_start(struct bfa_s *bfa) 1122 - { 1123 - bfa_iocfc_start(bfa); 1124 - } 1125 - 1126 - /* 1127 - * Use this function quiese the IOC. This function will return immediately, 1128 - * when the IOC is actually stopped, the bfad->comp will be set. 1129 - * 1130 - * @param[in]bfa - pointer to bfa_t. 1131 - * 1132 - * @return None 1133 - * 1134 - * Special Considerations: 1135 - * bfad->comp can be set before or after bfa_stop() returns. 1136 - * 1137 - * @note 1138 - * In case of any failure, we could handle it automatically by doing a 1139 - * reset and then succeed the bfa_stop() call. 1140 - */ 1141 - void 1142 - bfa_stop(struct bfa_s *bfa) 1143 - { 1144 - bfa_iocfc_stop(bfa); 1093 + bfa_ioc_detach(&bfa->ioc); 1145 1094 } 1146 1095 1147 1096 void ··· 1105 1198 } 1106 1199 } 1107 1200 1108 - void 1109 - bfa_attach_fcs(struct bfa_s *bfa) 1110 - { 1111 - bfa->fcs = BFA_TRUE; 1112 - } 1113 - 1114 - /* 1115 - * Periodic timer heart beat from driver 1116 - */ 1117 - void 1118 - bfa_timer_tick(struct bfa_s *bfa) 1119 - { 1120 - bfa_timer_beat(&bfa->timer_mod); 1121 - } 1122 1201 1123 1202 /* 1124 1203 * Return the list of PCI vendor/device id lists supported by this ··· 1174 1281 cfg->drvcfg.num_reqq_elems = BFA_REQQ_NELEMS_MIN; 1175 1282 cfg->drvcfg.num_rspq_elems = BFA_RSPQ_NELEMS_MIN; 1176 1283 cfg->drvcfg.min_cfg = BFA_TRUE; 1177 - } 1178 - 1179 - void 1180 - bfa_get_attr(struct bfa_s *bfa, struct bfa_ioc_attr_s *ioc_attr) 1181 - { 1182 - bfa_ioc_get_attr(&bfa->ioc, ioc_attr); 1183 - } 1184 - 1185 - /* 1186 - * Retrieve firmware trace information on IOC failure. 1187 - */ 1188 - bfa_status_t 1189 - bfa_debug_fwsave(struct bfa_s *bfa, void *trcdata, int *trclen) 1190 - { 1191 - return bfa_ioc_debug_fwsave(&bfa->ioc, trcdata, trclen); 1192 - } 1193 - 1194 - /* 1195 - * Fetch firmware trace data. 1196 - * 1197 - * @param[in] bfa BFA instance 1198 - * @param[out] trcdata Firmware trace buffer 1199 - * @param[in,out] trclen Firmware trace buffer len 1200 - * 1201 - * @retval BFA_STATUS_OK Firmware trace is fetched. 1202 - * @retval BFA_STATUS_INPROGRESS Firmware trace fetch is in progress. 1203 - */ 1204 - bfa_status_t 1205 - bfa_debug_fwtrc(struct bfa_s *bfa, void *trcdata, int *trclen) 1206 - { 1207 - return bfa_ioc_debug_fwtrc(&bfa->ioc, trcdata, trclen); 1208 - } 1209 - 1210 - /* 1211 - * Dump firmware memory. 1212 - * 1213 - * @param[in] bfa BFA instance 1214 - * @param[out] buf buffer for dump 1215 - * @param[in,out] offset smem offset to start read 1216 - * @param[in,out] buflen length of buffer 1217 - * 1218 - * @retval BFA_STATUS_OK Firmware memory is dumped. 1219 - * @retval BFA_STATUS_INPROGRESS Firmware memory dump is in progress. 1220 - */ 1221 - bfa_status_t 1222 - bfa_debug_fwcore(struct bfa_s *bfa, void *buf, u32 *offset, int *buflen) 1223 - { 1224 - return bfa_ioc_debug_fwcore(&bfa->ioc, buf, offset, buflen); 1225 1284 }
+1 -1
drivers/scsi/bfa/bfa_fcpim.c
··· 2567 2567 } 2568 2568 bfa_itnim_iodone(ioim->itnim); 2569 2569 } else 2570 - bfa_tskim_iodone(ioim->iosp->tskim); 2570 + bfa_wc_down(&ioim->iosp->tskim->wc); 2571 2571 } 2572 2572 2573 2573 static bfa_boolean_t
+27 -145
drivers/scsi/bfa/bfa_fcs.c
··· 76 76 fcs->bfad = bfad; 77 77 fcs->min_cfg = min_cfg; 78 78 79 - bfa_attach_fcs(bfa); 79 + bfa->fcs = BFA_TRUE; 80 80 fcbuild_init(); 81 81 82 82 for (i = 0; i < sizeof(fcs_modules) / sizeof(fcs_modules[0]); i++) { ··· 110 110 } 111 111 } 112 112 113 - /* 114 - * Start FCS operations. 115 - */ 116 - void 117 - bfa_fcs_start(struct bfa_fcs_s *fcs) 118 - { 119 - bfa_fcs_fabric_modstart(fcs); 120 - } 121 113 122 114 /* 123 115 * brief ··· 130 138 bfa_fcs_fabric_psymb_init(&fcs->fabric); 131 139 } 132 140 133 - /* 134 - * brief 135 - * FCS FDMI Driver Parameter Initialization 136 - * 137 - * param[in] fcs FCS instance 138 - * param[in] fdmi_enable TRUE/FALSE 139 - * 140 - * return None 141 - */ 142 - void 143 - bfa_fcs_set_fdmi_param(struct bfa_fcs_s *fcs, bfa_boolean_t fdmi_enable) 144 - { 145 - 146 - fcs->fdmi_enabled = fdmi_enable; 147 - 148 - } 149 141 /* 150 142 * brief 151 143 * FCS instance cleanup and exit. ··· 159 183 bfa_wc_wait(&fcs->wc); 160 184 } 161 185 162 - 163 - void 164 - bfa_fcs_trc_init(struct bfa_fcs_s *fcs, struct bfa_trc_mod_s *trcmod) 165 - { 166 - fcs->trcmod = trcmod; 167 - } 168 - 169 - void 170 - bfa_fcs_modexit_comp(struct bfa_fcs_s *fcs) 171 - { 172 - bfa_wc_down(&fcs->wc); 173 - } 174 186 175 187 /* 176 188 * Fabric module implementation. ··· 196 232 u32 rsp_len, 197 233 u32 resid_len, 198 234 struct fchs_s *rspfchs); 199 - /* 200 - * fcs_fabric_sm fabric state machine functions 201 - */ 202 - 203 - /* 204 - * Fabric state machine events 205 - */ 206 - enum bfa_fcs_fabric_event { 207 - BFA_FCS_FABRIC_SM_CREATE = 1, /* create from driver */ 208 - BFA_FCS_FABRIC_SM_DELETE = 2, /* delete from driver */ 209 - BFA_FCS_FABRIC_SM_LINK_DOWN = 3, /* link down from port */ 210 - BFA_FCS_FABRIC_SM_LINK_UP = 4, /* link up from port */ 211 - BFA_FCS_FABRIC_SM_CONT_OP = 5, /* flogi/auth continue op */ 212 - BFA_FCS_FABRIC_SM_RETRY_OP = 6, /* flogi/auth retry op */ 213 - BFA_FCS_FABRIC_SM_NO_FABRIC = 7, /* from flogi/auth */ 214 - BFA_FCS_FABRIC_SM_PERF_EVFP = 8, /* from flogi/auth */ 215 - BFA_FCS_FABRIC_SM_ISOLATE = 9, /* from EVFP processing */ 216 - BFA_FCS_FABRIC_SM_NO_TAGGING = 10, /* no VFT tagging from EVFP */ 217 - BFA_FCS_FABRIC_SM_DELAYED = 11, /* timeout delay event */ 218 - BFA_FCS_FABRIC_SM_AUTH_FAILED = 12, /* auth failed */ 219 - BFA_FCS_FABRIC_SM_AUTH_SUCCESS = 13, /* auth successful */ 220 - BFA_FCS_FABRIC_SM_DELCOMP = 14, /* all vports deleted event */ 221 - BFA_FCS_FABRIC_SM_LOOPBACK = 15, /* Received our own FLOGI */ 222 - BFA_FCS_FABRIC_SM_START = 16, /* from driver */ 223 - }; 224 235 225 236 static void bfa_fcs_fabric_sm_uninit(struct bfa_fcs_fabric_s *fabric, 226 237 enum bfa_fcs_fabric_event event); ··· 209 270 enum bfa_fcs_fabric_event event); 210 271 static void bfa_fcs_fabric_sm_auth(struct bfa_fcs_fabric_s *fabric, 211 272 enum bfa_fcs_fabric_event event); 212 - static void bfa_fcs_fabric_sm_auth_failed(struct bfa_fcs_fabric_s *fabric, 213 - enum bfa_fcs_fabric_event event); 214 - static void bfa_fcs_fabric_sm_loopback(struct bfa_fcs_fabric_s *fabric, 215 - enum bfa_fcs_fabric_event event); 216 273 static void bfa_fcs_fabric_sm_nofabric(struct bfa_fcs_fabric_s *fabric, 217 274 enum bfa_fcs_fabric_event event); 218 - static void bfa_fcs_fabric_sm_online(struct bfa_fcs_fabric_s *fabric, 219 - enum bfa_fcs_fabric_event event); 220 275 static void bfa_fcs_fabric_sm_evfp(struct bfa_fcs_fabric_s *fabric, 221 276 enum bfa_fcs_fabric_event event); 222 277 static void bfa_fcs_fabric_sm_evfp_done(struct bfa_fcs_fabric_s *fabric, ··· 270 337 271 338 case BFA_FCS_FABRIC_SM_DELETE: 272 339 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_uninit); 273 - bfa_fcs_modexit_comp(fabric->fcs); 340 + bfa_wc_down(&fabric->fcs->wc); 274 341 break; 275 342 276 343 default: ··· 343 410 344 411 case BFA_FCS_FABRIC_SM_LOOPBACK: 345 412 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_loopback); 346 - bfa_lps_discard(fabric->lps); 413 + bfa_sm_send_event(fabric->lps, BFA_LPS_SM_OFFLINE); 347 414 bfa_fcs_fabric_set_opertype(fabric); 348 415 break; 349 416 ··· 357 424 358 425 case BFA_FCS_FABRIC_SM_LINK_DOWN: 359 426 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_linkdown); 360 - bfa_lps_discard(fabric->lps); 427 + bfa_sm_send_event(fabric->lps, BFA_LPS_SM_OFFLINE); 361 428 break; 362 429 363 430 case BFA_FCS_FABRIC_SM_DELETE: 364 431 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_deleting); 365 - bfa_lps_discard(fabric->lps); 432 + bfa_sm_send_event(fabric->lps, BFA_LPS_SM_OFFLINE); 366 433 bfa_fcs_fabric_delete(fabric); 367 434 break; 368 435 ··· 414 481 switch (event) { 415 482 case BFA_FCS_FABRIC_SM_AUTH_FAILED: 416 483 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_auth_failed); 417 - bfa_lps_discard(fabric->lps); 484 + bfa_sm_send_event(fabric->lps, BFA_LPS_SM_OFFLINE); 418 485 break; 419 486 420 487 case BFA_FCS_FABRIC_SM_AUTH_SUCCESS: ··· 428 495 429 496 case BFA_FCS_FABRIC_SM_LINK_DOWN: 430 497 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_linkdown); 431 - bfa_lps_discard(fabric->lps); 498 + bfa_sm_send_event(fabric->lps, BFA_LPS_SM_OFFLINE); 432 499 break; 433 500 434 501 case BFA_FCS_FABRIC_SM_DELETE: ··· 444 511 /* 445 512 * Authentication failed 446 513 */ 447 - static void 514 + void 448 515 bfa_fcs_fabric_sm_auth_failed(struct bfa_fcs_fabric_s *fabric, 449 516 enum bfa_fcs_fabric_event event) 450 517 { ··· 470 537 /* 471 538 * Port is in loopback mode. 472 539 */ 473 - static void 540 + void 474 541 bfa_fcs_fabric_sm_loopback(struct bfa_fcs_fabric_s *fabric, 475 542 enum bfa_fcs_fabric_event event) 476 543 { ··· 506 573 switch (event) { 507 574 case BFA_FCS_FABRIC_SM_LINK_DOWN: 508 575 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_linkdown); 509 - bfa_lps_discard(fabric->lps); 576 + bfa_sm_send_event(fabric->lps, BFA_LPS_SM_OFFLINE); 510 577 bfa_fcs_fabric_notify_offline(fabric); 511 578 break; 512 579 ··· 529 596 /* 530 597 * Fabric is online - normal operating state. 531 598 */ 532 - static void 599 + void 533 600 bfa_fcs_fabric_sm_online(struct bfa_fcs_fabric_s *fabric, 534 601 enum bfa_fcs_fabric_event event) 535 602 { ··· 539 606 switch (event) { 540 607 case BFA_FCS_FABRIC_SM_LINK_DOWN: 541 608 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_linkdown); 542 - bfa_lps_discard(fabric->lps); 609 + bfa_sm_send_event(fabric->lps, BFA_LPS_SM_OFFLINE); 543 610 bfa_fcs_fabric_notify_offline(fabric); 544 611 break; 545 612 ··· 550 617 551 618 case BFA_FCS_FABRIC_SM_AUTH_FAILED: 552 619 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_auth_failed); 553 - bfa_lps_discard(fabric->lps); 620 + bfa_sm_send_event(fabric->lps, BFA_LPS_SM_OFFLINE); 554 621 break; 555 622 556 623 case BFA_FCS_FABRIC_SM_AUTH_SUCCESS: ··· 630 697 switch (event) { 631 698 case BFA_FCS_FABRIC_SM_DELCOMP: 632 699 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_uninit); 633 - bfa_fcs_modexit_comp(fabric->fcs); 700 + bfa_wc_down(&fabric->fcs->wc); 634 701 break; 635 702 636 703 case BFA_FCS_FABRIC_SM_LINK_UP: ··· 657 724 struct bfa_lport_cfg_s *port_cfg = &fabric->bport.port_cfg; 658 725 659 726 port_cfg->roles = BFA_LPORT_ROLE_FCP_IM; 660 - port_cfg->nwwn = bfa_ioc_get_nwwn(&fabric->fcs->bfa->ioc); 661 - port_cfg->pwwn = bfa_ioc_get_pwwn(&fabric->fcs->bfa->ioc); 727 + port_cfg->nwwn = fabric->fcs->bfa->ioc.attr->nwwn; 728 + port_cfg->pwwn = fabric->fcs->bfa->ioc.attr->pwwn; 662 729 } 663 730 664 731 /* ··· 746 813 return; 747 814 748 815 case BFA_STATUS_EPROTOCOL: 749 - switch (bfa_lps_get_extstatus(fabric->lps)) { 816 + switch (fabric->lps->ext_status) { 750 817 case BFA_EPROTO_BAD_ACCEPT: 751 818 fabric->stats.flogi_acc_err++; 752 819 break; ··· 773 840 return; 774 841 } 775 842 776 - fabric->bb_credit = bfa_lps_get_peer_bbcredit(fabric->lps); 843 + fabric->bb_credit = fabric->lps->pr_bbcred; 777 844 bfa_trc(fabric->fcs, fabric->bb_credit); 778 845 779 - if (!bfa_lps_is_brcd_fabric(fabric->lps)) 780 - fabric->fabric_name = bfa_lps_get_peer_nwwn(fabric->lps); 846 + if (!(fabric->lps->brcd_switch)) 847 + fabric->fabric_name = fabric->lps->pr_nwwn; 781 848 782 849 /* 783 850 * Check port type. It should be 1 = F-port. 784 851 */ 785 - if (bfa_lps_is_fport(fabric->lps)) { 786 - fabric->bport.pid = bfa_lps_get_pid(fabric->lps); 787 - fabric->is_npiv = bfa_lps_is_npiv_en(fabric->lps); 788 - fabric->is_auth = bfa_lps_is_authreq(fabric->lps); 852 + if (fabric->lps->fport) { 853 + fabric->bport.pid = fabric->lps->lp_pid; 854 + fabric->is_npiv = fabric->lps->npiv_en; 855 + fabric->is_auth = fabric->lps->auth_req; 789 856 bfa_sm_send_event(fabric, BFA_FCS_FABRIC_SM_CONT_OP); 790 857 } else { 791 858 /* 792 859 * Nport-2-Nport direct attached 793 860 */ 794 861 fabric->bport.port_topo.pn2n.rem_port_wwn = 795 - bfa_lps_get_peer_pwwn(fabric->lps); 862 + fabric->lps->pr_pwwn; 796 863 bfa_sm_send_event(fabric, BFA_FCS_FABRIC_SM_NO_FABRIC); 797 864 } 798 865 ··· 971 1038 bfa_sm_send_event(fabric, BFA_FCS_FABRIC_SM_START); 972 1039 } 973 1040 974 - bfa_boolean_t 975 - bfa_fcs_fabric_is_loopback(struct bfa_fcs_fabric_s *fabric) 976 - { 977 - return bfa_sm_cmp_state(fabric, bfa_fcs_fabric_sm_loopback); 978 - } 979 - 980 - bfa_boolean_t 981 - bfa_fcs_fabric_is_auth_failed(struct bfa_fcs_fabric_s *fabric) 982 - { 983 - return bfa_sm_cmp_state(fabric, bfa_fcs_fabric_sm_auth_failed); 984 - } 985 - 986 - enum bfa_port_type 987 - bfa_fcs_fabric_port_type(struct bfa_fcs_fabric_s *fabric) 988 - { 989 - return fabric->oper_type; 990 - } 991 1041 992 1042 /* 993 1043 * Link up notification from BFA physical port module. ··· 1031 1115 bfa_wc_down(&fabric->wc); 1032 1116 } 1033 1117 1034 - /* 1035 - * Base port is deleted. 1036 - */ 1037 - void 1038 - bfa_fcs_fabric_port_delete_comp(struct bfa_fcs_fabric_s *fabric) 1039 - { 1040 - bfa_wc_down(&fabric->wc); 1041 - } 1042 - 1043 - 1044 - /* 1045 - * Check if fabric is online. 1046 - * 1047 - * param[in] fabric - Fabric instance. This can be a base fabric or vf. 1048 - * 1049 - * @return TRUE/FALSE 1050 - */ 1051 - int 1052 - bfa_fcs_fabric_is_online(struct bfa_fcs_fabric_s *fabric) 1053 - { 1054 - return bfa_sm_cmp_state(fabric, bfa_fcs_fabric_sm_online); 1055 - } 1056 1118 1057 1119 /* 1058 1120 * Lookup for a vport withing a fabric given its pwwn ··· 1050 1156 return NULL; 1051 1157 } 1052 1158 1053 - /* 1054 - * In a given fabric, return the number of lports. 1055 - * 1056 - * param[in] fabric - Fabric instance. This can be a base fabric or vf. 1057 - * 1058 - * @return : 1 or more. 1059 - */ 1060 - u16 1061 - bfa_fcs_fabric_vport_count(struct bfa_fcs_fabric_s *fabric) 1062 - { 1063 - return fabric->num_vports; 1064 - } 1065 1159 1066 1160 /* 1067 1161 * Get OUI of the attached switch. ··· 1069 1187 u8 *tmp; 1070 1188 u16 oui; 1071 1189 1072 - fab_nwwn = bfa_lps_get_peer_nwwn(fabric->lps); 1190 + fab_nwwn = fabric->lps->pr_nwwn; 1073 1191 1074 1192 tmp = (u8 *)&fab_nwwn; 1075 1193 oui = (tmp[3] << 8) | tmp[4]; ··· 1226 1344 bfa_fcport_get_maxfrsize(bfa), 1227 1345 bfa_fcport_get_rx_bbcredit(bfa)); 1228 1346 1229 - bfa_fcxp_send(fcxp, NULL, fabric->vf_id, bfa_lps_get_tag(fabric->lps), 1347 + bfa_fcxp_send(fcxp, NULL, fabric->vf_id, fabric->lps->lp_tag, 1230 1348 BFA_FALSE, FC_CLASS_3, 1231 1349 reqlen, &fchs, bfa_fcs_fabric_flogiacc_comp, fabric, 1232 1350 FC_MAX_PDUSZ, 0);
+72 -15
drivers/scsi/bfa/bfa_fcs.h
··· 27 27 #define BFA_FCS_OS_STR_LEN 64 28 28 29 29 /* 30 + * lps_pvt BFA LPS private functions 31 + */ 32 + 33 + enum bfa_lps_event { 34 + BFA_LPS_SM_LOGIN = 1, /* login request from user */ 35 + BFA_LPS_SM_LOGOUT = 2, /* logout request from user */ 36 + BFA_LPS_SM_FWRSP = 3, /* f/w response to login/logout */ 37 + BFA_LPS_SM_RESUME = 4, /* space present in reqq queue */ 38 + BFA_LPS_SM_DELETE = 5, /* lps delete from user */ 39 + BFA_LPS_SM_OFFLINE = 6, /* Link is offline */ 40 + BFA_LPS_SM_RX_CVL = 7, /* Rx clear virtual link */ 41 + }; 42 + 43 + 44 + /* 30 45 * !!! Only append to the enums defined here to avoid any versioning 31 46 * !!! needed between trace utility and driver version 32 47 */ ··· 56 41 struct bfa_fcs_s; 57 42 58 43 #define __fcs_min_cfg(__fcs) ((__fcs)->min_cfg) 59 - void bfa_fcs_modexit_comp(struct bfa_fcs_s *fcs); 60 44 61 45 #define BFA_FCS_BRCD_SWITCH_OUI 0x051e 62 46 #define N2N_LOCAL_PID 0x010000 ··· 458 444 459 445 struct bfa_fcs_rport_s *bfa_fcs_rport_create(struct bfa_fcs_lport_s *port, 460 446 u32 pid); 461 - void bfa_fcs_rport_delete(struct bfa_fcs_rport_s *rport); 462 - void bfa_fcs_rport_online(struct bfa_fcs_rport_s *rport); 463 - void bfa_fcs_rport_offline(struct bfa_fcs_rport_s *rport); 464 447 void bfa_fcs_rport_start(struct bfa_fcs_lport_s *port, struct fchs_s *rx_fchs, 465 448 struct fc_logi_s *plogi_rsp); 466 449 void bfa_fcs_rport_plogi_create(struct bfa_fcs_lport_s *port, ··· 465 454 struct fc_logi_s *plogi); 466 455 void bfa_fcs_rport_plogi(struct bfa_fcs_rport_s *rport, struct fchs_s *fchs, 467 456 struct fc_logi_s *plogi); 468 - void bfa_fcs_rport_logo_imp(struct bfa_fcs_rport_s *rport); 469 457 void bfa_fcs_rport_prlo(struct bfa_fcs_rport_s *rport, __be16 ox_id); 470 458 471 - void bfa_fcs_rport_itnim_ack(struct bfa_fcs_rport_s *rport); 472 459 void bfa_fcs_rport_itntm_ack(struct bfa_fcs_rport_s *rport); 473 460 void bfa_fcs_rport_fcptm_offline_done(struct bfa_fcs_rport_s *rport); 474 461 int bfa_fcs_rport_get_state(struct bfa_fcs_rport_s *rport); ··· 657 648 }; 658 649 659 650 /* 651 + * fcs_fabric_sm fabric state machine functions 652 + */ 653 + 654 + /* 655 + * Fabric state machine events 656 + */ 657 + enum bfa_fcs_fabric_event { 658 + BFA_FCS_FABRIC_SM_CREATE = 1, /* create from driver */ 659 + BFA_FCS_FABRIC_SM_DELETE = 2, /* delete from driver */ 660 + BFA_FCS_FABRIC_SM_LINK_DOWN = 3, /* link down from port */ 661 + BFA_FCS_FABRIC_SM_LINK_UP = 4, /* link up from port */ 662 + BFA_FCS_FABRIC_SM_CONT_OP = 5, /* flogi/auth continue op */ 663 + BFA_FCS_FABRIC_SM_RETRY_OP = 6, /* flogi/auth retry op */ 664 + BFA_FCS_FABRIC_SM_NO_FABRIC = 7, /* from flogi/auth */ 665 + BFA_FCS_FABRIC_SM_PERF_EVFP = 8, /* from flogi/auth */ 666 + BFA_FCS_FABRIC_SM_ISOLATE = 9, /* from EVFP processing */ 667 + BFA_FCS_FABRIC_SM_NO_TAGGING = 10, /* no VFT tagging from EVFP */ 668 + BFA_FCS_FABRIC_SM_DELAYED = 11, /* timeout delay event */ 669 + BFA_FCS_FABRIC_SM_AUTH_FAILED = 12, /* auth failed */ 670 + BFA_FCS_FABRIC_SM_AUTH_SUCCESS = 13, /* auth successful */ 671 + BFA_FCS_FABRIC_SM_DELCOMP = 14, /* all vports deleted event */ 672 + BFA_FCS_FABRIC_SM_LOOPBACK = 15, /* Received our own FLOGI */ 673 + BFA_FCS_FABRIC_SM_START = 16, /* from driver */ 674 + }; 675 + 676 + /* 677 + * fcs_rport_sm FCS rport state machine events 678 + */ 679 + 680 + enum rport_event { 681 + RPSM_EVENT_PLOGI_SEND = 1, /* new rport; start with PLOGI */ 682 + RPSM_EVENT_PLOGI_RCVD = 2, /* Inbound PLOGI from remote port */ 683 + RPSM_EVENT_PLOGI_COMP = 3, /* PLOGI completed to rport */ 684 + RPSM_EVENT_LOGO_RCVD = 4, /* LOGO from remote device */ 685 + RPSM_EVENT_LOGO_IMP = 5, /* implicit logo for SLER */ 686 + RPSM_EVENT_FCXP_SENT = 6, /* Frame from has been sent */ 687 + RPSM_EVENT_DELETE = 7, /* RPORT delete request */ 688 + RPSM_EVENT_SCN = 8, /* state change notification */ 689 + RPSM_EVENT_ACCEPTED = 9, /* Good response from remote device */ 690 + RPSM_EVENT_FAILED = 10, /* Request to rport failed. */ 691 + RPSM_EVENT_TIMEOUT = 11, /* Rport SM timeout event */ 692 + RPSM_EVENT_HCB_ONLINE = 12, /* BFA rport online callback */ 693 + RPSM_EVENT_HCB_OFFLINE = 13, /* BFA rport offline callback */ 694 + RPSM_EVENT_FC4_OFFLINE = 14, /* FC-4 offline complete */ 695 + RPSM_EVENT_ADDRESS_CHANGE = 15, /* Rport's PID has changed */ 696 + RPSM_EVENT_ADDRESS_DISC = 16, /* Need to Discover rport's PID */ 697 + RPSM_EVENT_PRLO_RCVD = 17, /* PRLO from remote device */ 698 + RPSM_EVENT_PLOGI_RETRY = 18, /* Retry PLOGI continously */ 699 + }; 700 + 701 + /* 660 702 * bfa fcs API functions 661 703 */ 662 704 void bfa_fcs_attach(struct bfa_fcs_s *fcs, struct bfa_s *bfa, ··· 716 656 void bfa_fcs_init(struct bfa_fcs_s *fcs); 717 657 void bfa_fcs_driver_info_init(struct bfa_fcs_s *fcs, 718 658 struct bfa_fcs_driver_info_s *driver_info); 719 - void bfa_fcs_set_fdmi_param(struct bfa_fcs_s *fcs, bfa_boolean_t fdmi_enable); 720 659 void bfa_fcs_exit(struct bfa_fcs_s *fcs); 721 - void bfa_fcs_trc_init(struct bfa_fcs_s *fcs, struct bfa_trc_mod_s *trcmod); 722 - void bfa_fcs_start(struct bfa_fcs_s *fcs); 723 660 724 661 /* 725 662 * bfa fcs vf public functions 726 663 */ 727 664 bfa_fcs_vf_t *bfa_fcs_vf_lookup(struct bfa_fcs_s *fcs, u16 vf_id); 728 - u16 bfa_fcs_fabric_vport_count(struct bfa_fcs_fabric_s *fabric); 729 665 730 666 /* 731 667 * fabric protected interface functions ··· 735 679 struct bfa_fcs_vport_s *vport); 736 680 void bfa_fcs_fabric_delvport(struct bfa_fcs_fabric_s *fabric, 737 681 struct bfa_fcs_vport_s *vport); 738 - int bfa_fcs_fabric_is_online(struct bfa_fcs_fabric_s *fabric); 739 682 struct bfa_fcs_vport_s *bfa_fcs_fabric_vport_lookup( 740 683 struct bfa_fcs_fabric_s *fabric, wwn_t pwwn); 741 684 void bfa_fcs_fabric_modstart(struct bfa_fcs_s *fcs); 742 685 void bfa_fcs_fabric_uf_recv(struct bfa_fcs_fabric_s *fabric, 743 686 struct fchs_s *fchs, u16 len); 744 - bfa_boolean_t bfa_fcs_fabric_is_loopback(struct bfa_fcs_fabric_s *fabric); 745 - bfa_boolean_t bfa_fcs_fabric_is_auth_failed(struct bfa_fcs_fabric_s *fabric); 746 - enum bfa_port_type bfa_fcs_fabric_port_type(struct bfa_fcs_fabric_s *fabric); 747 687 void bfa_fcs_fabric_psymb_init(struct bfa_fcs_fabric_s *fabric); 748 - void bfa_fcs_fabric_port_delete_comp(struct bfa_fcs_fabric_s *fabric); 749 688 void bfa_fcs_fabric_set_fabric_name(struct bfa_fcs_fabric_s *fabric, 750 689 wwn_t fabric_name); 751 690 u16 bfa_fcs_fabric_get_switch_oui(struct bfa_fcs_fabric_s *fabric); 752 691 void bfa_fcs_uf_attach(struct bfa_fcs_s *fcs); 753 692 void bfa_fcs_port_attach(struct bfa_fcs_s *fcs); 693 + void bfa_fcs_fabric_sm_online(struct bfa_fcs_fabric_s *fabric, 694 + enum bfa_fcs_fabric_event event); 695 + void bfa_fcs_fabric_sm_loopback(struct bfa_fcs_fabric_s *fabric, 696 + enum bfa_fcs_fabric_event event); 697 + void bfa_fcs_fabric_sm_auth_failed(struct bfa_fcs_fabric_s *fabric, 698 + enum bfa_fcs_fabric_event event); 754 699 755 700 /* 756 701 * BFA FCS callback interfaces
+9 -9
drivers/scsi/bfa/bfa_fcs_fcpim.c
··· 103 103 break; 104 104 105 105 case BFA_FCS_ITNIM_SM_OFFLINE: 106 - bfa_fcs_rport_itnim_ack(itnim->rport); 106 + bfa_sm_send_event(itnim->rport, RPSM_EVENT_FC4_OFFLINE); 107 107 break; 108 108 109 109 case BFA_FCS_ITNIM_SM_INITIATOR: ··· 140 140 case BFA_FCS_ITNIM_SM_OFFLINE: 141 141 bfa_sm_set_state(itnim, bfa_fcs_itnim_sm_offline); 142 142 bfa_fcxp_walloc_cancel(itnim->fcs->bfa, &itnim->fcxp_wqe); 143 - bfa_fcs_rport_itnim_ack(itnim->rport); 143 + bfa_sm_send_event(itnim->rport, RPSM_EVENT_FC4_OFFLINE); 144 144 break; 145 145 146 146 case BFA_FCS_ITNIM_SM_DELETE: ··· 181 181 case BFA_FCS_ITNIM_SM_OFFLINE: 182 182 bfa_sm_set_state(itnim, bfa_fcs_itnim_sm_offline); 183 183 bfa_fcxp_discard(itnim->fcxp); 184 - bfa_fcs_rport_itnim_ack(itnim->rport); 184 + bfa_sm_send_event(itnim->rport, RPSM_EVENT_FC4_OFFLINE); 185 185 break; 186 186 187 187 case BFA_FCS_ITNIM_SM_INITIATOR: ··· 217 217 } else { 218 218 /* invoke target offline */ 219 219 bfa_sm_set_state(itnim, bfa_fcs_itnim_sm_offline); 220 - bfa_fcs_rport_logo_imp(itnim->rport); 220 + bfa_sm_send_event(itnim->rport, RPSM_EVENT_LOGO_IMP); 221 221 } 222 222 break; 223 223 ··· 225 225 case BFA_FCS_ITNIM_SM_OFFLINE: 226 226 bfa_sm_set_state(itnim, bfa_fcs_itnim_sm_offline); 227 227 bfa_timer_stop(&itnim->timer); 228 - bfa_fcs_rport_itnim_ack(itnim->rport); 228 + bfa_sm_send_event(itnim->rport, RPSM_EVENT_FC4_OFFLINE); 229 229 break; 230 230 231 231 case BFA_FCS_ITNIM_SM_INITIATOR: ··· 269 269 case BFA_FCS_ITNIM_SM_OFFLINE: 270 270 bfa_sm_set_state(itnim, bfa_fcs_itnim_sm_offline); 271 271 bfa_itnim_offline(itnim->bfa_itnim); 272 - bfa_fcs_rport_itnim_ack(itnim->rport); 272 + bfa_sm_send_event(itnim->rport, RPSM_EVENT_FC4_OFFLINE); 273 273 break; 274 274 275 275 case BFA_FCS_ITNIM_SM_DELETE: ··· 330 330 switch (event) { 331 331 case BFA_FCS_ITNIM_SM_HCB_OFFLINE: 332 332 bfa_sm_set_state(itnim, bfa_fcs_itnim_sm_offline); 333 - bfa_fcs_rport_itnim_ack(itnim->rport); 333 + bfa_sm_send_event(itnim->rport, RPSM_EVENT_FC4_OFFLINE); 334 334 break; 335 335 336 336 case BFA_FCS_ITNIM_SM_DELETE: ··· 358 358 switch (event) { 359 359 case BFA_FCS_ITNIM_SM_OFFLINE: 360 360 bfa_sm_set_state(itnim, bfa_fcs_itnim_sm_offline); 361 - bfa_fcs_rport_itnim_ack(itnim->rport); 361 + bfa_sm_send_event(itnim->rport, RPSM_EVENT_FC4_OFFLINE); 362 362 break; 363 363 364 364 case BFA_FCS_ITNIM_SM_RSP_ERROR: ··· 688 688 689 689 itnim->stats.sler++; 690 690 bfa_trc(itnim->fcs, itnim->rport->pwwn); 691 - bfa_fcs_rport_logo_imp(itnim->rport); 691 + bfa_sm_send_event(itnim->rport, RPSM_EVENT_LOGO_IMP); 692 692 } 693 693 694 694 struct bfa_fcs_itnim_s *
+34 -31
drivers/scsi/bfa/bfa_fcs_lport.c
··· 159 159 bfa_sm_set_state(port, bfa_fcs_lport_sm_deleting); 160 160 list_for_each_safe(qe, qen, &port->rport_q) { 161 161 rport = (struct bfa_fcs_rport_s *) qe; 162 - bfa_fcs_rport_delete(rport); 162 + bfa_sm_send_event(rport, RPSM_EVENT_DELETE); 163 163 } 164 164 } 165 165 break; ··· 197 197 bfa_sm_set_state(port, bfa_fcs_lport_sm_deleting); 198 198 list_for_each_safe(qe, qen, &port->rport_q) { 199 199 rport = (struct bfa_fcs_rport_s *) qe; 200 - bfa_fcs_rport_delete(rport); 200 + bfa_sm_send_event(rport, RPSM_EVENT_DELETE); 201 201 } 202 202 } 203 203 break; ··· 350 350 * disappeared. Send implicit LOGO to old device. 351 351 */ 352 352 bfa_assert(rport->pwwn != plogi->port_name); 353 - bfa_fcs_rport_logo_imp(rport); 353 + bfa_sm_send_event(rport, RPSM_EVENT_LOGO_IMP); 354 354 355 355 /* 356 356 * Inbound PLOGI from a new device (with old PID). ··· 511 511 __port_action[port->fabric->fab_type].offline(port); 512 512 513 513 wwn2str(lpwwn_buf, bfa_fcs_lport_get_pwwn(port)); 514 - if (bfa_fcs_fabric_is_online(port->fabric) == BFA_TRUE) 514 + if (bfa_sm_cmp_state(port->fabric, 515 + bfa_fcs_fabric_sm_online) == BFA_TRUE) 515 516 BFA_LOG(KERN_ERR, bfad, bfa_log_level, 516 517 "Logical port lost fabric connectivity: WWN = %s Role = %s\n", 517 518 lpwwn_buf, "Initiator"); ··· 523 522 524 523 list_for_each_safe(qe, qen, &port->rport_q) { 525 524 rport = (struct bfa_fcs_rport_s *) qe; 526 - bfa_fcs_rport_offline(rport); 525 + bfa_sm_send_event(rport, RPSM_EVENT_LOGO_IMP); 527 526 } 528 527 } 529 528 ··· 585 584 port->vport ? port->vport->vport_drv : NULL); 586 585 bfa_fcs_vport_delete_comp(port->vport); 587 586 } else { 588 - bfa_fcs_fabric_port_delete_comp(port->fabric); 587 + bfa_wc_down(&port->fabric->wc); 589 588 } 590 589 } 591 590 ··· 829 828 lport->fcs = fcs; 830 829 lport->fabric = bfa_fcs_vf_lookup(fcs, vf_id); 831 830 lport->vport = vport; 832 - lport->lp_tag = (vport) ? bfa_lps_get_tag(vport->lps) : 833 - bfa_lps_get_tag(lport->fabric->lps); 831 + lport->lp_tag = (vport) ? vport->lps->lp_tag : 832 + lport->fabric->lps->lp_tag; 834 833 835 834 INIT_LIST_HEAD(&lport->rport_q); 836 835 lport->num_rports = 0; ··· 882 881 port_attr->port_cfg = port->port_cfg; 883 882 884 883 if (port->fabric) { 885 - port_attr->port_type = bfa_fcs_fabric_port_type(port->fabric); 886 - port_attr->loopback = bfa_fcs_fabric_is_loopback(port->fabric); 884 + port_attr->port_type = port->fabric->oper_type; 885 + port_attr->loopback = bfa_sm_cmp_state(port->fabric, bfa_fcs_fabric_sm_loopback); 887 886 port_attr->authfail = 888 - bfa_fcs_fabric_is_auth_failed(port->fabric); 887 + bfa_sm_cmp_state(port->fabric, 888 + bfa_fcs_fabric_sm_auth_failed); 889 889 port_attr->fabric_name = bfa_fcs_lport_get_fabric_name(port); 890 890 memcpy(port_attr->fabric_ip_addr, 891 891 bfa_fcs_lport_get_fabric_ipaddr(port), ··· 895 893 if (port->vport != NULL) { 896 894 port_attr->port_type = BFA_PORT_TYPE_VPORT; 897 895 port_attr->fpma_mac = 898 - bfa_lps_get_lp_mac(port->vport->lps); 896 + port->vport->lps->lp_mac; 899 897 } else { 900 898 port_attr->fpma_mac = 901 - bfa_lps_get_lp_mac(port->fabric->lps); 899 + port->fabric->lps->lp_mac; 902 900 } 903 901 } else { 904 902 port_attr->port_type = BFA_PORT_TYPE_UNKNOWN; ··· 987 985 bfa_trc(port->fcs, rport->pid); 988 986 bfa_trc(port->fcs, rport->pwwn); 989 987 rport->pid = N2N_REMOTE_PID; 990 - bfa_fcs_rport_online(rport); 988 + bfa_sm_send_event(rport, RPSM_EVENT_PLOGI_SEND); 991 989 return; 992 990 } 993 991 ··· 1000 998 bfa_assert(rport != NULL); 1001 999 if (rport) { 1002 1000 bfa_trc(port->fcs, rport->pwwn); 1003 - bfa_fcs_rport_delete(rport); 1001 + bfa_sm_send_event(rport, RPSM_EVENT_DELETE); 1004 1002 } 1005 1003 } 1006 1004 bfa_fcs_rport_create(port, N2N_REMOTE_PID); ··· 2542 2540 2543 2541 len = fc_gmal_req_build(&fchs, bfa_fcxp_get_reqbuf(fcxp), 2544 2542 bfa_fcs_lport_get_fcid(port), 2545 - bfa_lps_get_peer_nwwn(port->fabric->lps)); 2543 + port->fabric->lps->pr_nwwn); 2546 2544 2547 2545 bfa_fcxp_send(fcxp, NULL, port->fabric->vf_id, port->lp_tag, BFA_FALSE, 2548 2546 FC_CLASS_3, len, &fchs, ··· 2742 2740 2743 2741 len = fc_gfn_req_build(&fchs, bfa_fcxp_get_reqbuf(fcxp), 2744 2742 bfa_fcs_lport_get_fcid(port), 2745 - bfa_lps_get_peer_nwwn(port->fabric->lps)); 2743 + port->fabric->lps->pr_nwwn); 2746 2744 2747 2745 bfa_fcxp_send(fcxp, NULL, port->fabric->vf_id, port->lp_tag, BFA_FALSE, 2748 2746 FC_CLASS_3, len, &fchs, ··· 4334 4332 /* Handle VU registrations for Base port only */ 4335 4333 if ((!port->vport) && bfa_ioc_get_fcmode(&port->fcs->bfa->ioc)) { 4336 4334 len = fc_scr_build(&fchs, bfa_fcxp_get_reqbuf(fcxp), 4337 - bfa_lps_is_brcd_fabric(port->fabric->lps), 4338 - port->pid, 0); 4335 + port->fabric->lps->brcd_switch, 4336 + port->pid, 0); 4339 4337 } else { 4340 4338 len = fc_scr_build(&fchs, bfa_fcxp_get_reqbuf(fcxp), 4341 4339 BFA_FALSE, ··· 4835 4833 port_info->max_vports_supp = 4836 4834 bfa_lps_get_max_vport(port->fcs->bfa); 4837 4835 port_info->num_vports_inuse = 4838 - bfa_fcs_fabric_vport_count(port->fabric); 4836 + port->fabric->num_vports; 4839 4837 port_info->max_rports_supp = BFA_FCS_MAX_RPORTS_SUPP; 4840 4838 port_info->num_rports_inuse = port->num_rports; 4841 4839 } else { ··· 4979 4977 4980 4978 switch (event) { 4981 4979 case BFA_FCS_VPORT_SM_START: 4982 - if (bfa_fcs_fabric_is_online(__vport_fabric(vport)) 4980 + if (bfa_sm_cmp_state(__vport_fabric(vport), 4981 + bfa_fcs_fabric_sm_online) 4983 4982 && bfa_fcs_fabric_npiv_capable(__vport_fabric(vport))) { 4984 4983 bfa_sm_set_state(vport, bfa_fcs_vport_sm_fdisc); 4985 4984 bfa_fcs_vport_do_fdisc(vport); ··· 5063 5060 switch (event) { 5064 5061 case BFA_FCS_VPORT_SM_DELETE: 5065 5062 bfa_sm_set_state(vport, bfa_fcs_vport_sm_cleanup); 5066 - bfa_lps_discard(vport->lps); 5063 + bfa_sm_send_event(vport->lps, BFA_LPS_SM_OFFLINE); 5067 5064 bfa_fcs_lport_delete(&vport->lport); 5068 5065 break; 5069 5066 5070 5067 case BFA_FCS_VPORT_SM_OFFLINE: 5071 5068 bfa_sm_set_state(vport, bfa_fcs_vport_sm_offline); 5072 - bfa_lps_discard(vport->lps); 5069 + bfa_sm_send_event(vport->lps, BFA_LPS_SM_OFFLINE); 5073 5070 break; 5074 5071 5075 5072 case BFA_FCS_VPORT_SM_RSP_OK: ··· 5149 5146 5150 5147 case BFA_FCS_VPORT_SM_OFFLINE: 5151 5148 bfa_sm_set_state(vport, bfa_fcs_vport_sm_offline); 5152 - bfa_lps_discard(vport->lps); 5149 + bfa_sm_send_event(vport->lps, BFA_LPS_SM_OFFLINE); 5153 5150 bfa_fcs_lport_offline(&vport->lport); 5154 5151 break; 5155 5152 ··· 5249 5246 5250 5247 switch (event) { 5251 5248 case BFA_FCS_VPORT_SM_OFFLINE: 5252 - bfa_lps_discard(vport->lps); 5249 + bfa_sm_send_event(vport->lps, BFA_LPS_SM_OFFLINE); 5253 5250 /* 5254 5251 * !!! fall through !!! 5255 5252 */ ··· 5288 5285 static void 5289 5286 bfa_fcs_vport_fdisc_rejected(struct bfa_fcs_vport_s *vport) 5290 5287 { 5291 - u8 lsrjt_rsn = bfa_lps_get_lsrjt_rsn(vport->lps); 5292 - u8 lsrjt_expl = bfa_lps_get_lsrjt_expl(vport->lps); 5288 + u8 lsrjt_rsn = vport->lps->lsrjt_rsn; 5289 + u8 lsrjt_expl = vport->lps->lsrjt_expl; 5293 5290 5294 5291 bfa_trc(__vport_fcs(vport), lsrjt_rsn); 5295 5292 bfa_trc(__vport_fcs(vport), lsrjt_expl); 5296 5293 5297 5294 /* For certain reason codes, we don't want to retry. */ 5298 - switch (bfa_lps_get_lsrjt_expl(vport->lps)) { 5295 + switch (vport->lps->lsrjt_expl) { 5299 5296 case FC_LS_RJT_EXP_INV_PORT_NAME: /* by brocade */ 5300 5297 case FC_LS_RJT_EXP_INVALID_NPORT_ID: /* by Cisco */ 5301 5298 if (vport->fdisc_retries < BFA_FCS_VPORT_MAX_RETRIES) ··· 5459 5456 if (bfa_fcs_vport_lookup(fcs, vf_id, vport_cfg->pwwn) != NULL) 5460 5457 return BFA_STATUS_VPORT_EXISTS; 5461 5458 5462 - if (bfa_fcs_fabric_vport_count(&fcs->fabric) == 5459 + if (fcs->fabric.num_vports == 5463 5460 bfa_lps_get_max_vport(fcs->bfa)) 5464 5461 return BFA_STATUS_VPORT_MAX; 5465 5462 ··· 5640 5637 /* 5641 5638 * Initialiaze the V-Port fields 5642 5639 */ 5643 - __vport_fcid(vport) = bfa_lps_get_pid(vport->lps); 5640 + __vport_fcid(vport) = vport->lps->lp_pid; 5644 5641 vport->vport_stats.fdisc_accepts++; 5645 5642 bfa_sm_send_event(vport, BFA_FCS_VPORT_SM_RSP_OK); 5646 5643 break; ··· 5653 5650 break; 5654 5651 5655 5652 case BFA_STATUS_EPROTOCOL: 5656 - switch (bfa_lps_get_extstatus(vport->lps)) { 5653 + switch (vport->lps->ext_status) { 5657 5654 case BFA_EPROTO_BAD_ACCEPT: 5658 5655 vport->vport_stats.fdisc_acc_bad++; 5659 5656 break;
+12 -85
drivers/scsi/bfa/bfa_fcs_rport.c
··· 75 75 static void bfa_fcs_rport_process_adisc(struct bfa_fcs_rport_s *rport, 76 76 struct fchs_s *rx_fchs, u16 len); 77 77 static void bfa_fcs_rport_send_prlo_acc(struct bfa_fcs_rport_s *rport); 78 - /* 79 - * fcs_rport_sm FCS rport state machine events 80 - */ 81 - 82 - enum rport_event { 83 - RPSM_EVENT_PLOGI_SEND = 1, /* new rport; start with PLOGI */ 84 - RPSM_EVENT_PLOGI_RCVD = 2, /* Inbound PLOGI from remote port */ 85 - RPSM_EVENT_PLOGI_COMP = 3, /* PLOGI completed to rport */ 86 - RPSM_EVENT_LOGO_RCVD = 4, /* LOGO from remote device */ 87 - RPSM_EVENT_LOGO_IMP = 5, /* implicit logo for SLER */ 88 - RPSM_EVENT_FCXP_SENT = 6, /* Frame from has been sent */ 89 - RPSM_EVENT_DELETE = 7, /* RPORT delete request */ 90 - RPSM_EVENT_SCN = 8, /* state change notification */ 91 - RPSM_EVENT_ACCEPTED = 9, /* Good response from remote device */ 92 - RPSM_EVENT_FAILED = 10, /* Request to rport failed. */ 93 - RPSM_EVENT_TIMEOUT = 11, /* Rport SM timeout event */ 94 - RPSM_EVENT_HCB_ONLINE = 12, /* BFA rport online callback */ 95 - RPSM_EVENT_HCB_OFFLINE = 13, /* BFA rport offline callback */ 96 - RPSM_EVENT_FC4_OFFLINE = 14, /* FC-4 offline complete */ 97 - RPSM_EVENT_ADDRESS_CHANGE = 15, /* Rport's PID has changed */ 98 - RPSM_EVENT_ADDRESS_DISC = 16, /* Need to Discover rport's PID */ 99 - RPSM_EVENT_PRLO_RCVD = 17, /* PRLO from remote device */ 100 - RPSM_EVENT_PLOGI_RETRY = 18, /* Retry PLOGI continously */ 101 - }; 102 78 103 79 static void bfa_fcs_rport_sm_uninit(struct bfa_fcs_rport_s *rport, 104 80 enum rport_event event); ··· 474 498 475 499 case RPSM_EVENT_LOGO_RCVD: 476 500 bfa_sm_set_state(rport, bfa_fcs_rport_sm_hcb_logorcv); 477 - bfa_rport_offline(rport->bfa_rport); 501 + bfa_sm_send_event(rport->bfa_rport, BFA_RPORT_SM_OFFLINE); 478 502 break; 479 503 480 504 case RPSM_EVENT_LOGO_IMP: 481 505 case RPSM_EVENT_ADDRESS_CHANGE: 482 506 bfa_sm_set_state(rport, bfa_fcs_rport_sm_hcb_offline); 483 - bfa_rport_offline(rport->bfa_rport); 507 + bfa_sm_send_event(rport->bfa_rport, BFA_RPORT_SM_OFFLINE); 484 508 break; 485 509 486 510 case RPSM_EVENT_PLOGI_RCVD: 487 511 bfa_sm_set_state(rport, bfa_fcs_rport_sm_plogiacc_sending); 488 - bfa_rport_offline(rport->bfa_rport); 512 + bfa_sm_send_event(rport->bfa_rport, BFA_RPORT_SM_OFFLINE); 489 513 bfa_fcs_rport_send_plogiacc(rport, NULL); 490 514 break; 491 515 492 516 case RPSM_EVENT_DELETE: 493 517 bfa_sm_set_state(rport, bfa_fcs_rport_sm_hcb_logosend); 494 - bfa_rport_offline(rport->bfa_rport); 518 + bfa_sm_send_event(rport->bfa_rport, BFA_RPORT_SM_OFFLINE); 495 519 break; 496 520 497 521 case RPSM_EVENT_SCN: ··· 800 824 switch (event) { 801 825 case RPSM_EVENT_FC4_OFFLINE: 802 826 bfa_sm_set_state(rport, bfa_fcs_rport_sm_hcb_logorcv); 803 - bfa_rport_offline(rport->bfa_rport); 827 + bfa_sm_send_event(rport->bfa_rport, BFA_RPORT_SM_OFFLINE); 804 828 break; 805 829 806 830 case RPSM_EVENT_DELETE: ··· 832 856 switch (event) { 833 857 case RPSM_EVENT_FC4_OFFLINE: 834 858 bfa_sm_set_state(rport, bfa_fcs_rport_sm_hcb_logosend); 835 - bfa_rport_offline(rport->bfa_rport); 859 + bfa_sm_send_event(rport->bfa_rport, BFA_RPORT_SM_OFFLINE); 836 860 break; 837 861 838 862 default: ··· 854 878 switch (event) { 855 879 case RPSM_EVENT_FC4_OFFLINE: 856 880 bfa_sm_set_state(rport, bfa_fcs_rport_sm_hcb_offline); 857 - bfa_rport_offline(rport->bfa_rport); 881 + bfa_sm_send_event(rport->bfa_rport, BFA_RPORT_SM_OFFLINE); 858 882 break; 859 883 860 884 case RPSM_EVENT_SCN: ··· 1435 1459 twin->stats.plogi_rcvd += rport->stats.plogi_rcvd; 1436 1460 twin->stats.plogi_accs++; 1437 1461 1438 - bfa_fcs_rport_delete(rport); 1462 + bfa_sm_send_event(rport, RPSM_EVENT_DELETE); 1439 1463 1440 1464 bfa_fcs_rport_update(twin, plogi_rsp); 1441 1465 twin->pid = rsp_fchs->s_id; ··· 1974 1998 rport->itnim = bfa_fcs_itnim_create(rport); 1975 1999 if (!rport->itnim) { 1976 2000 bfa_trc(fcs, rpid); 1977 - bfa_rport_delete(rport->bfa_rport); 2001 + bfa_sm_send_event(rport->bfa_rport, BFA_RPORT_SM_DELETE); 1978 2002 kfree(rport_drv); 1979 2003 return NULL; 1980 2004 } ··· 2008 2032 bfa_fcs_rpf_rport_offline(rport); 2009 2033 } 2010 2034 2011 - bfa_rport_delete(rport->bfa_rport); 2035 + bfa_sm_send_event(rport->bfa_rport, BFA_RPORT_SM_DELETE); 2012 2036 bfa_fcs_lport_del_rport(port, rport); 2013 2037 kfree(rport->rp_drv); 2014 2038 } ··· 2283 2307 bfa_sm_send_event(rport, RPSM_EVENT_PLOGI_RCVD); 2284 2308 } 2285 2309 2286 - /* 2287 - * Called by bport/vport to delete a remote port instance. 2288 - * 2289 - * Rport delete is called under the following conditions: 2290 - * - vport is deleted 2291 - * - vf is deleted 2292 - * - explicit request from OS to delete rport 2293 - */ 2294 - void 2295 - bfa_fcs_rport_delete(struct bfa_fcs_rport_s *rport) 2296 - { 2297 - bfa_sm_send_event(rport, RPSM_EVENT_DELETE); 2298 - } 2299 2310 2300 - /* 2301 - * Called by bport/vport to when a target goes offline. 2302 - * 2303 - */ 2304 - void 2305 - bfa_fcs_rport_offline(struct bfa_fcs_rport_s *rport) 2306 - { 2307 - bfa_sm_send_event(rport, RPSM_EVENT_LOGO_IMP); 2308 - } 2309 - 2310 - /* 2311 - * Called by bport in n2n when a target (attached port) becomes online. 2312 - * 2313 - */ 2314 - void 2315 - bfa_fcs_rport_online(struct bfa_fcs_rport_s *rport) 2316 - { 2317 - bfa_sm_send_event(rport, RPSM_EVENT_PLOGI_SEND); 2318 - } 2319 2311 /* 2320 2312 * Called by bport/vport to notify SCN for the remote port 2321 2313 */ ··· 2292 2348 { 2293 2349 rport->stats.rscns++; 2294 2350 bfa_sm_send_event(rport, RPSM_EVENT_SCN); 2295 - } 2296 - 2297 - /* 2298 - * Called by fcpim to notify that the ITN cleanup is done. 2299 - */ 2300 - void 2301 - bfa_fcs_rport_itnim_ack(struct bfa_fcs_rport_s *rport) 2302 - { 2303 - bfa_sm_send_event(rport, RPSM_EVENT_FC4_OFFLINE); 2304 2351 } 2305 2352 2306 2353 ··· 2386 2451 struct bfa_fcs_rport_s *rport = (struct bfa_fcs_rport_s *) cbarg; 2387 2452 2388 2453 bfa_trc(rport->fcs, rport->pwwn); 2389 - } 2390 - 2391 - /* 2392 - * Called to process any unsolicted frames from this remote port 2393 - */ 2394 - void 2395 - bfa_fcs_rport_logo_imp(struct bfa_fcs_rport_s *rport) 2396 - { 2397 - bfa_sm_send_event(rport, RPSM_EVENT_LOGO_IMP); 2398 2454 } 2399 2455 2400 2456 /* ··· 2503 2577 { 2504 2578 return bfa_sm_to_state(rport_sm_table, rport->sm); 2505 2579 } 2580 + 2506 2581 2507 2582 /* 2508 2583 * brief ··· 2630 2703 case RPFSM_EVENT_RPORT_ONLINE: 2631 2704 /* Send RPSC2 to a Brocade fabric only. */ 2632 2705 if ((!BFA_FCS_PID_IS_WKA(rport->pid)) && 2633 - ((bfa_lps_is_brcd_fabric(rport->port->fabric->lps)) || 2706 + ((rport->port->fabric->lps->brcd_switch) || 2634 2707 (bfa_fcs_fabric_get_switch_oui(fabric) == 2635 2708 BFA_FCS_BRCD_SWITCH_OUI))) { 2636 2709 bfa_sm_set_state(rpf, bfa_fcs_rpf_sm_rpsc_sending);
+50 -230
drivers/scsi/bfa/bfa_ioc.c
··· 42 42 bfa_ioc_hb_check, (__ioc), BFA_IOC_HB_TOV) 43 43 #define bfa_hb_timer_stop(__ioc) bfa_timer_stop(&(__ioc)->hb_timer) 44 44 45 - #define BFA_DBG_FWTRC_ENTS (BFI_IOC_TRC_ENTS) 46 - #define BFA_DBG_FWTRC_LEN \ 47 - (BFA_DBG_FWTRC_ENTS * sizeof(struct bfa_trc_s) + \ 48 - (sizeof(struct bfa_trc_mod_s) - \ 49 - BFA_TRC_MAX * sizeof(struct bfa_trc_s))) 50 45 #define BFA_DBG_FWTRC_OFF(_fn) (BFI_IOC_TRC_OFF + BFA_DBG_FWTRC_LEN * (_fn)) 51 46 52 47 /* ··· 76 81 * forward declarations 77 82 */ 78 83 static void bfa_ioc_hw_sem_get(struct bfa_ioc_s *ioc); 79 - static void bfa_ioc_hw_sem_get_cancel(struct bfa_ioc_s *ioc); 80 84 static void bfa_ioc_hwinit(struct bfa_ioc_s *ioc, bfa_boolean_t force); 81 85 static void bfa_ioc_timeout(void *ioc); 82 86 static void bfa_ioc_send_enable(struct bfa_ioc_s *ioc); 83 87 static void bfa_ioc_send_disable(struct bfa_ioc_s *ioc); 84 88 static void bfa_ioc_send_getattr(struct bfa_ioc_s *ioc); 85 89 static void bfa_ioc_hb_monitor(struct bfa_ioc_s *ioc); 86 - static void bfa_ioc_hb_stop(struct bfa_ioc_s *ioc); 87 - static void bfa_ioc_reset(struct bfa_ioc_s *ioc, bfa_boolean_t force); 88 90 static void bfa_ioc_mbox_poll(struct bfa_ioc_s *ioc); 89 91 static void bfa_ioc_mbox_hbfail(struct bfa_ioc_s *ioc); 90 92 static void bfa_ioc_recover(struct bfa_ioc_s *ioc); 91 93 static void bfa_ioc_check_attr_wwns(struct bfa_ioc_s *ioc); 92 94 static void bfa_ioc_disable_comp(struct bfa_ioc_s *ioc); 93 95 static void bfa_ioc_lpu_stop(struct bfa_ioc_s *ioc); 94 - static void bfa_ioc_pf_enabled(struct bfa_ioc_s *ioc); 95 - static void bfa_ioc_pf_disabled(struct bfa_ioc_s *ioc); 96 - static void bfa_ioc_pf_failed(struct bfa_ioc_s *ioc); 97 96 static void bfa_ioc_pf_fwmismatch(struct bfa_ioc_s *ioc); 98 97 99 98 ··· 151 162 /* 152 163 * Forward declareations for iocpf state machine 153 164 */ 154 - static void bfa_iocpf_enable(struct bfa_ioc_s *ioc); 155 - static void bfa_iocpf_disable(struct bfa_ioc_s *ioc); 156 - static void bfa_iocpf_fail(struct bfa_ioc_s *ioc); 157 - static void bfa_iocpf_initfail(struct bfa_ioc_s *ioc); 158 - static void bfa_iocpf_getattrfail(struct bfa_ioc_s *ioc); 159 - static void bfa_iocpf_stop(struct bfa_ioc_s *ioc); 160 165 static void bfa_iocpf_timeout(void *ioc_arg); 161 166 static void bfa_iocpf_sem_timeout(void *ioc_arg); 162 167 ··· 281 298 static void 282 299 bfa_ioc_sm_enabling_entry(struct bfa_ioc_s *ioc) 283 300 { 284 - bfa_iocpf_enable(ioc); 301 + bfa_fsm_send_event(&ioc->iocpf, IOCPF_E_ENABLE); 285 302 } 286 303 287 304 /* ··· 304 321 305 322 case IOC_E_HWERROR: 306 323 bfa_fsm_set_state(ioc, bfa_ioc_sm_initfail); 307 - bfa_iocpf_initfail(ioc); 324 + bfa_fsm_send_event(&ioc->iocpf, IOCPF_E_INITFAIL); 308 325 break; 309 326 310 327 case IOC_E_DISABLE: ··· 313 330 314 331 case IOC_E_DETACH: 315 332 bfa_fsm_set_state(ioc, bfa_ioc_sm_uninit); 316 - bfa_iocpf_stop(ioc); 333 + bfa_fsm_send_event(&ioc->iocpf, IOCPF_E_STOP); 317 334 break; 318 335 319 336 case IOC_E_ENABLE: ··· 358 375 359 376 case IOC_E_TIMEOUT: 360 377 bfa_fsm_set_state(ioc, bfa_ioc_sm_initfail); 361 - bfa_iocpf_getattrfail(ioc); 378 + bfa_fsm_send_event(&ioc->iocpf, IOCPF_E_GETATTRFAIL); 362 379 break; 363 380 364 381 case IOC_E_DISABLE: ··· 395 412 break; 396 413 397 414 case IOC_E_DISABLE: 398 - bfa_ioc_hb_stop(ioc); 415 + bfa_hb_timer_stop(ioc); 399 416 bfa_fsm_set_state(ioc, bfa_ioc_sm_disabling); 400 417 break; 401 418 402 419 case IOC_E_FAILED: 403 - bfa_ioc_hb_stop(ioc); 420 + bfa_hb_timer_stop(ioc); 404 421 bfa_fsm_set_state(ioc, bfa_ioc_sm_fail); 405 422 break; 406 423 407 424 case IOC_E_HWERROR: 408 - bfa_ioc_hb_stop(ioc); 425 + bfa_hb_timer_stop(ioc); 409 426 /* !!! fall through !!! */ 410 427 411 428 case IOC_E_HBFAIL: 412 429 bfa_fsm_set_state(ioc, bfa_ioc_sm_fail); 413 - bfa_iocpf_fail(ioc); 430 + bfa_fsm_send_event(&ioc->iocpf, IOCPF_E_FAIL); 414 431 break; 415 432 416 433 default: ··· 423 440 bfa_ioc_sm_disabling_entry(struct bfa_ioc_s *ioc) 424 441 { 425 442 struct bfad_s *bfad = (struct bfad_s *)ioc->bfa->bfad; 426 - bfa_iocpf_disable(ioc); 443 + bfa_fsm_send_event(&ioc->iocpf, IOCPF_E_DISABLE); 427 444 BFA_LOG(KERN_INFO, bfad, bfa_log_level, "IOC disabled\n"); 428 445 } 429 446 ··· 446 463 * after iocpf sm completes failure processing and 447 464 * moves to disabled state. 448 465 */ 449 - bfa_iocpf_fail(ioc); 466 + bfa_fsm_send_event(&ioc->iocpf, IOCPF_E_FAIL); 450 467 break; 451 468 452 469 default: ··· 479 496 480 497 case IOC_E_DETACH: 481 498 bfa_fsm_set_state(ioc, bfa_ioc_sm_uninit); 482 - bfa_iocpf_stop(ioc); 499 + bfa_fsm_send_event(&ioc->iocpf, IOCPF_E_STOP); 483 500 break; 484 501 485 502 default: ··· 520 537 521 538 case IOC_E_DETACH: 522 539 bfa_fsm_set_state(ioc, bfa_ioc_sm_uninit); 523 - bfa_iocpf_stop(ioc); 540 + bfa_fsm_send_event(&ioc->iocpf, IOCPF_E_STOP); 524 541 break; 525 542 526 543 default: ··· 651 668 iocpf->retry_count = 0; 652 669 bfa_fsm_set_state(iocpf, bfa_iocpf_sm_hwinit); 653 670 } else { 654 - bfa_ioc_hw_sem_release(ioc); 671 + writel(1, ioc->ioc_regs.ioc_sem_reg); 655 672 bfa_fsm_set_state(iocpf, bfa_iocpf_sm_mismatch); 656 673 } 657 674 break; 658 675 659 676 case IOCPF_E_DISABLE: 660 - bfa_ioc_hw_sem_get_cancel(ioc); 677 + bfa_sem_timer_stop(ioc); 661 678 bfa_fsm_set_state(iocpf, bfa_iocpf_sm_reset); 662 - bfa_ioc_pf_disabled(ioc); 679 + bfa_fsm_send_event(ioc, IOC_E_DISABLED); 663 680 break; 664 681 665 682 case IOCPF_E_STOP: 666 - bfa_ioc_hw_sem_get_cancel(ioc); 683 + bfa_sem_timer_stop(ioc); 667 684 bfa_fsm_set_state(iocpf, bfa_iocpf_sm_reset); 668 685 break; 669 686 ··· 706 723 case IOCPF_E_DISABLE: 707 724 bfa_iocpf_timer_stop(ioc); 708 725 bfa_fsm_set_state(iocpf, bfa_iocpf_sm_reset); 709 - bfa_ioc_pf_disabled(ioc); 726 + bfa_fsm_send_event(ioc, IOC_E_DISABLED); 710 727 break; 711 728 712 729 case IOCPF_E_STOP: ··· 745 762 break; 746 763 747 764 case IOCPF_E_DISABLE: 748 - bfa_ioc_hw_sem_get_cancel(ioc); 765 + bfa_sem_timer_stop(ioc); 749 766 bfa_fsm_set_state(iocpf, bfa_iocpf_sm_disabled); 750 767 break; 751 768 ··· 759 776 bfa_iocpf_sm_hwinit_entry(struct bfa_iocpf_s *iocpf) 760 777 { 761 778 bfa_iocpf_timer_start(iocpf->ioc); 762 - bfa_ioc_reset(iocpf->ioc, BFA_FALSE); 779 + bfa_ioc_hwinit(iocpf->ioc, BFA_FALSE); 763 780 } 764 781 765 782 /* ··· 789 806 iocpf->retry_count++; 790 807 if (iocpf->retry_count < BFA_IOC_HWINIT_MAX) { 791 808 bfa_iocpf_timer_start(ioc); 792 - bfa_ioc_reset(ioc, BFA_TRUE); 809 + bfa_ioc_hwinit(ioc, BFA_TRUE); 793 810 break; 794 811 } 795 812 796 - bfa_ioc_hw_sem_release(ioc); 813 + writel(1, ioc->ioc_regs.ioc_sem_reg); 797 814 bfa_fsm_set_state(iocpf, bfa_iocpf_sm_initfail); 798 815 799 816 if (event == IOCPF_E_TIMEOUT) 800 - bfa_ioc_pf_failed(ioc); 817 + bfa_fsm_send_event(ioc, IOC_E_FAILED); 801 818 break; 802 819 803 820 case IOCPF_E_DISABLE: 804 - bfa_ioc_hw_sem_release(ioc); 821 + writel(1, ioc->ioc_regs.ioc_sem_reg); 805 822 bfa_iocpf_timer_stop(ioc); 806 823 bfa_fsm_set_state(iocpf, bfa_iocpf_sm_disabled); 807 824 break; ··· 833 850 switch (event) { 834 851 case IOCPF_E_FWRSP_ENABLE: 835 852 bfa_iocpf_timer_stop(ioc); 836 - bfa_ioc_hw_sem_release(ioc); 853 + writel(1, ioc->ioc_regs.ioc_sem_reg); 837 854 bfa_fsm_set_state(iocpf, bfa_iocpf_sm_ready); 838 855 break; 839 856 ··· 851 868 break; 852 869 } 853 870 854 - bfa_ioc_hw_sem_release(ioc); 871 + writel(1, ioc->ioc_regs.ioc_sem_reg); 855 872 bfa_fsm_set_state(iocpf, bfa_iocpf_sm_initfail); 856 873 857 874 if (event == IOCPF_E_TIMEOUT) 858 - bfa_ioc_pf_failed(ioc); 875 + bfa_fsm_send_event(ioc, IOC_E_FAILED); 859 876 break; 860 877 861 878 case IOCPF_E_DISABLE: 862 879 bfa_iocpf_timer_stop(ioc); 863 - bfa_ioc_hw_sem_release(ioc); 880 + writel(1, ioc->ioc_regs.ioc_sem_reg); 864 881 bfa_fsm_set_state(iocpf, bfa_iocpf_sm_disabling); 865 882 break; 866 883 ··· 878 895 static void 879 896 bfa_iocpf_sm_ready_entry(struct bfa_iocpf_s *iocpf) 880 897 { 881 - bfa_ioc_pf_enabled(iocpf->ioc); 898 + bfa_fsm_send_event(iocpf->ioc, IOC_E_ENABLED); 882 899 } 883 900 884 901 static void ··· 902 919 break; 903 920 904 921 case IOCPF_E_FWREADY: 905 - if (bfa_ioc_is_operational(ioc)) 922 + if (bfa_fsm_cmp_state(ioc, bfa_ioc_sm_op)) 906 923 bfa_fsm_set_state(iocpf, bfa_iocpf_sm_fail); 907 924 else 908 925 bfa_fsm_set_state(iocpf, bfa_iocpf_sm_initfail); 909 926 910 - bfa_ioc_pf_failed(ioc); 927 + bfa_fsm_send_event(ioc, IOC_E_FAILED); 911 928 break; 912 929 913 930 default: ··· 965 982 static void 966 983 bfa_iocpf_sm_disabled_entry(struct bfa_iocpf_s *iocpf) 967 984 { 968 - bfa_ioc_pf_disabled(iocpf->ioc); 985 + bfa_fsm_send_event(iocpf->ioc, IOC_E_DISABLED); 969 986 } 970 987 971 988 static void ··· 1123 1140 return BFA_FALSE; 1124 1141 } 1125 1142 1126 - void 1127 - bfa_ioc_sem_release(void __iomem *sem_reg) 1128 - { 1129 - writel(1, sem_reg); 1130 - } 1131 1143 1132 1144 static void 1133 1145 bfa_ioc_hw_sem_get(struct bfa_ioc_s *ioc) ··· 1140 1162 } 1141 1163 1142 1164 bfa_sem_timer_start(ioc); 1143 - } 1144 - 1145 - void 1146 - bfa_ioc_hw_sem_release(struct bfa_ioc_s *ioc) 1147 - { 1148 - writel(1, ioc->ioc_regs.ioc_sem_reg); 1149 - } 1150 - 1151 - static void 1152 - bfa_ioc_hw_sem_get_cancel(struct bfa_ioc_s *ioc) 1153 - { 1154 - bfa_sem_timer_stop(ioc); 1155 1165 } 1156 1166 1157 1167 /* ··· 1221 1255 int i; 1222 1256 u32 *fwsig = (u32 *) fwhdr; 1223 1257 1224 - pgnum = bfa_ioc_smem_pgnum(ioc, loff); 1225 - pgoff = bfa_ioc_smem_pgoff(ioc, loff); 1258 + pgnum = PSS_SMEM_PGNUM(ioc->ioc_regs.smem_pg0, loff); 1259 + pgoff = PSS_SMEM_PGOFF(loff); 1226 1260 writel(pgnum, ioc->ioc_regs.host_page_num_fn); 1227 1261 1228 1262 for (i = 0; i < (sizeof(struct bfi_ioc_image_hdr_s) / sizeof(u32)); ··· 1485 1519 bfa_hb_timer_start(ioc); 1486 1520 } 1487 1521 1488 - static void 1489 - bfa_ioc_hb_stop(struct bfa_ioc_s *ioc) 1490 - { 1491 - bfa_hb_timer_stop(ioc); 1492 - } 1493 - 1494 - 1495 1522 /* 1496 1523 * Initiate a full firmware download. 1497 1524 */ ··· 1506 1547 bfa_trc(ioc, bfa_cb_image_get_size(BFA_IOC_FWIMG_TYPE(ioc))); 1507 1548 fwimg = bfa_cb_image_get_chunk(BFA_IOC_FWIMG_TYPE(ioc), chunkno); 1508 1549 1509 - pgnum = bfa_ioc_smem_pgnum(ioc, loff); 1510 - pgoff = bfa_ioc_smem_pgoff(ioc, loff); 1550 + pgnum = PSS_SMEM_PGNUM(ioc->ioc_regs.smem_pg0, loff); 1551 + pgoff = PSS_SMEM_PGOFF(loff); 1511 1552 1512 1553 writel(pgnum, ioc->ioc_regs.host_page_num_fn); 1513 1554 ··· 1537 1578 } 1538 1579 } 1539 1580 1540 - writel(bfa_ioc_smem_pgnum(ioc, 0), ioc->ioc_regs.host_page_num_fn); 1581 + writel(PSS_SMEM_PGNUM(ioc->ioc_regs.smem_pg0, 0), 1582 + ioc->ioc_regs.host_page_num_fn); 1541 1583 1542 1584 /* 1543 1585 * Set boot type and boot param at the end. ··· 1549 1589 swab32(boot_env)); 1550 1590 } 1551 1591 1552 - static void 1553 - bfa_ioc_reset(struct bfa_ioc_s *ioc, bfa_boolean_t force) 1554 - { 1555 - bfa_ioc_hwinit(ioc, force); 1556 - } 1557 1592 1558 1593 /* 1559 1594 * Update BFA configuration from firmware configuration. ··· 1640 1685 int i, len; 1641 1686 u32 *buf = tbuf; 1642 1687 1643 - pgnum = bfa_ioc_smem_pgnum(ioc, soff); 1644 - loff = bfa_ioc_smem_pgoff(ioc, soff); 1688 + pgnum = PSS_SMEM_PGNUM(ioc->ioc_regs.smem_pg0, soff); 1689 + loff = PSS_SMEM_PGOFF(soff); 1645 1690 bfa_trc(ioc, pgnum); 1646 1691 bfa_trc(ioc, loff); 1647 1692 bfa_trc(ioc, sz); ··· 1672 1717 writel(pgnum, ioc->ioc_regs.host_page_num_fn); 1673 1718 } 1674 1719 } 1675 - writel(bfa_ioc_smem_pgnum(ioc, 0), ioc->ioc_regs.host_page_num_fn); 1720 + writel(PSS_SMEM_PGNUM(ioc->ioc_regs.smem_pg0, 0), 1721 + ioc->ioc_regs.host_page_num_fn); 1676 1722 /* 1677 1723 * release semaphore. 1678 1724 */ 1679 - bfa_ioc_sem_release(ioc->ioc_regs.ioc_init_sem_reg); 1725 + writel(1, ioc->ioc_regs.ioc_init_sem_reg); 1680 1726 1681 1727 bfa_trc(ioc, pgnum); 1682 1728 return BFA_STATUS_OK; ··· 1696 1740 int i, len; 1697 1741 u32 pgnum, loff; 1698 1742 1699 - pgnum = bfa_ioc_smem_pgnum(ioc, soff); 1700 - loff = bfa_ioc_smem_pgoff(ioc, soff); 1743 + pgnum = PSS_SMEM_PGNUM(ioc->ioc_regs.smem_pg0, soff); 1744 + loff = PSS_SMEM_PGOFF(soff); 1701 1745 bfa_trc(ioc, pgnum); 1702 1746 bfa_trc(ioc, loff); 1703 1747 bfa_trc(ioc, sz); ··· 1727 1771 writel(pgnum, ioc->ioc_regs.host_page_num_fn); 1728 1772 } 1729 1773 } 1730 - writel(bfa_ioc_smem_pgnum(ioc, 0), ioc->ioc_regs.host_page_num_fn); 1774 + writel(PSS_SMEM_PGNUM(ioc->ioc_regs.smem_pg0, 0), 1775 + ioc->ioc_regs.host_page_num_fn); 1731 1776 1732 1777 /* 1733 1778 * release semaphore. 1734 1779 */ 1735 - bfa_ioc_sem_release(ioc->ioc_regs.ioc_init_sem_reg); 1780 + writel(1, ioc->ioc_regs.ioc_init_sem_reg); 1736 1781 bfa_trc(ioc, pgnum); 1737 1782 return BFA_STATUS_OK; 1738 1783 } 1739 1784 1740 - /* 1741 - * hal iocpf to ioc interface 1742 - */ 1743 - static void 1744 - bfa_ioc_pf_enabled(struct bfa_ioc_s *ioc) 1745 - { 1746 - bfa_fsm_send_event(ioc, IOC_E_ENABLED); 1747 - } 1748 - 1749 - static void 1750 - bfa_ioc_pf_disabled(struct bfa_ioc_s *ioc) 1751 - { 1752 - bfa_fsm_send_event(ioc, IOC_E_DISABLED); 1753 - } 1754 - 1755 - static void 1756 - bfa_ioc_pf_failed(struct bfa_ioc_s *ioc) 1757 - { 1758 - bfa_fsm_send_event(ioc, IOC_E_FAILED); 1759 - } 1760 1785 1761 1786 static void 1762 1787 bfa_ioc_pf_fwmismatch(struct bfa_ioc_s *ioc) ··· 1768 1831 /* 1769 1832 * release semaphore. 1770 1833 */ 1771 - bfa_ioc_sem_release(ioc->ioc_regs.ioc_init_sem_reg); 1834 + writel(1, ioc->ioc_regs.ioc_init_sem_reg); 1772 1835 1773 1836 return BFA_STATUS_OK; 1774 1837 } ··· 1973 2036 ioc->attr = (struct bfi_ioc_attr_s *) dm_kva; 1974 2037 } 1975 2038 1976 - /* 1977 - * Return size of dma memory required. 1978 - */ 1979 - u32 1980 - bfa_ioc_meminfo(void) 1981 - { 1982 - return BFA_ROUNDUP(sizeof(struct bfi_ioc_attr_s), BFA_DMA_ALIGN_SZ); 1983 - } 1984 - 1985 2039 void 1986 2040 bfa_ioc_enable(struct bfa_ioc_s *ioc) 1987 2041 { ··· 1989 2061 bfa_fsm_send_event(ioc, IOC_E_DISABLE); 1990 2062 } 1991 2063 1992 - /* 1993 - * Returns memory required for saving firmware trace in case of crash. 1994 - * Driver must call this interface to allocate memory required for 1995 - * automatic saving of firmware trace. Driver should call 1996 - * bfa_ioc_debug_memclaim() right after bfa_ioc_attach() to setup this 1997 - * trace memory. 1998 - */ 1999 - int 2000 - bfa_ioc_debug_trcsz(bfa_boolean_t auto_recover) 2001 - { 2002 - return (auto_recover) ? BFA_DBG_FWTRC_LEN : 0; 2003 - } 2004 2064 2005 2065 /* 2006 2066 * Initialize memory for saving firmware trace. Driver must initialize ··· 1998 2082 bfa_ioc_debug_memclaim(struct bfa_ioc_s *ioc, void *dbg_fwsave) 1999 2083 { 2000 2084 ioc->dbg_fwsave = dbg_fwsave; 2001 - ioc->dbg_fwsave_len = bfa_ioc_debug_trcsz(ioc->iocpf.auto_recover); 2002 - } 2003 - 2004 - u32 2005 - bfa_ioc_smem_pgnum(struct bfa_ioc_s *ioc, u32 fmaddr) 2006 - { 2007 - return PSS_SMEM_PGNUM(ioc->ioc_regs.smem_pg0, fmaddr); 2008 - } 2009 - 2010 - u32 2011 - bfa_ioc_smem_pgoff(struct bfa_ioc_s *ioc, u32 fmaddr) 2012 - { 2013 - return PSS_SMEM_PGOFF(fmaddr); 2085 + ioc->dbg_fwsave_len = (ioc->iocpf.auto_recover) ? BFA_DBG_FWTRC_LEN : 0; 2014 2086 } 2015 2087 2016 2088 /* ··· 2161 2257 return BFA_TRUE; 2162 2258 } 2163 2259 2164 - /* 2165 - * Add to IOC heartbeat failure notification queue. To be used by common 2166 - * modules such as cee, port, diag. 2167 - */ 2168 - void 2169 - bfa_ioc_hbfail_register(struct bfa_ioc_s *ioc, 2170 - struct bfa_ioc_hbfail_notify_s *notify) 2171 - { 2172 - list_add_tail(&notify->qe, &ioc->hb_notify_q); 2173 - } 2174 - 2175 2260 #define BFA_MFG_NAME "Brocade" 2176 2261 void 2177 2262 bfa_ioc_get_adapter_attr(struct bfa_ioc_s *ioc, ··· 2192 2299 else 2193 2300 ad_attr->prototype = 0; 2194 2301 2195 - ad_attr->pwwn = bfa_ioc_get_pwwn(ioc); 2302 + ad_attr->pwwn = ioc->attr->pwwn; 2196 2303 ad_attr->mac = bfa_ioc_get_mac(ioc); 2197 2304 2198 2305 ad_attr->pcie_gen = ioc_attr->pcie_gen; ··· 2341 2448 bfa_ioc_get_pci_chip_rev(ioc, ioc_attr->pci_attr.chip_rev); 2342 2449 } 2343 2450 2344 - wwn_t 2345 - bfa_ioc_get_pwwn(struct bfa_ioc_s *ioc) 2346 - { 2347 - return ioc->attr->pwwn; 2348 - } 2349 - 2350 - wwn_t 2351 - bfa_ioc_get_nwwn(struct bfa_ioc_s *ioc) 2352 - { 2353 - return ioc->attr->nwwn; 2354 - } 2355 - 2356 - u64 2357 - bfa_ioc_get_adid(struct bfa_ioc_s *ioc) 2358 - { 2359 - return ioc->attr->mfg_pwwn; 2360 - } 2361 - 2362 2451 mac_t 2363 2452 bfa_ioc_get_mac(struct bfa_ioc_s *ioc) 2364 2453 { ··· 2351 2476 return ioc->attr->fcoe_mac; 2352 2477 else 2353 2478 return ioc->attr->mac; 2354 - } 2355 - 2356 - wwn_t 2357 - bfa_ioc_get_mfg_pwwn(struct bfa_ioc_s *ioc) 2358 - { 2359 - return ioc->attr->mfg_pwwn; 2360 - } 2361 - 2362 - wwn_t 2363 - bfa_ioc_get_mfg_nwwn(struct bfa_ioc_s *ioc) 2364 - { 2365 - return ioc->attr->mfg_nwwn; 2366 2479 } 2367 2480 2368 2481 mac_t ··· 2581 2718 /* 2582 2719 * BFA IOC PF private functions 2583 2720 */ 2584 - 2585 - static void 2586 - bfa_iocpf_enable(struct bfa_ioc_s *ioc) 2587 - { 2588 - bfa_fsm_send_event(&ioc->iocpf, IOCPF_E_ENABLE); 2589 - } 2590 - 2591 - static void 2592 - bfa_iocpf_disable(struct bfa_ioc_s *ioc) 2593 - { 2594 - bfa_fsm_send_event(&ioc->iocpf, IOCPF_E_DISABLE); 2595 - } 2596 - 2597 - static void 2598 - bfa_iocpf_fail(struct bfa_ioc_s *ioc) 2599 - { 2600 - bfa_fsm_send_event(&ioc->iocpf, IOCPF_E_FAIL); 2601 - } 2602 - 2603 - static void 2604 - bfa_iocpf_initfail(struct bfa_ioc_s *ioc) 2605 - { 2606 - bfa_fsm_send_event(&ioc->iocpf, IOCPF_E_INITFAIL); 2607 - } 2608 - 2609 - static void 2610 - bfa_iocpf_getattrfail(struct bfa_ioc_s *ioc) 2611 - { 2612 - bfa_fsm_send_event(&ioc->iocpf, IOCPF_E_GETATTRFAIL); 2613 - } 2614 - 2615 - static void 2616 - bfa_iocpf_stop(struct bfa_ioc_s *ioc) 2617 - { 2618 - bfa_fsm_send_event(&ioc->iocpf, IOCPF_E_STOP); 2619 - } 2620 - 2621 2721 static void 2622 2722 bfa_iocpf_timeout(void *ioc_arg) 2623 2723 { ··· 2601 2775 /* 2602 2776 * bfa timer function 2603 2777 */ 2604 - void 2605 - bfa_timer_init(struct bfa_timer_mod_s *mod) 2606 - { 2607 - INIT_LIST_HEAD(&mod->timer_q); 2608 - } 2609 - 2610 2778 void 2611 2779 bfa_timer_beat(struct bfa_timer_mod_s *mod) 2612 2780 {
+5 -14
drivers/scsi/bfa/bfa_ioc.h
··· 22 22 #include "bfa_cs.h" 23 23 #include "bfi.h" 24 24 25 + #define BFA_DBG_FWTRC_ENTS (BFI_IOC_TRC_ENTS) 26 + #define BFA_DBG_FWTRC_LEN \ 27 + (BFA_DBG_FWTRC_ENTS * sizeof(struct bfa_trc_s) + \ 28 + (sizeof(struct bfa_trc_mod_s) - \ 29 + BFA_TRC_MAX * sizeof(struct bfa_trc_s))) 25 30 /* 26 31 * BFA timer declarations 27 32 */ ··· 52 47 #define BFA_TIMER_FREQ 200 /* specified in millisecs */ 53 48 54 49 void bfa_timer_beat(struct bfa_timer_mod_s *mod); 55 - void bfa_timer_init(struct bfa_timer_mod_s *mod); 56 50 void bfa_timer_begin(struct bfa_timer_mod_s *mod, struct bfa_timer_s *timer, 57 51 bfa_timer_cbfn_t timercb, void *arg, 58 52 unsigned int timeout); ··· 329 325 void bfa_ioc_detach(struct bfa_ioc_s *ioc); 330 326 void bfa_ioc_pci_init(struct bfa_ioc_s *ioc, struct bfa_pcidev_s *pcidev, 331 327 enum bfi_mclass mc); 332 - u32 bfa_ioc_meminfo(void); 333 328 void bfa_ioc_mem_claim(struct bfa_ioc_s *ioc, u8 *dm_kva, u64 dm_pa); 334 329 void bfa_ioc_enable(struct bfa_ioc_s *ioc); 335 330 void bfa_ioc_disable(struct bfa_ioc_s *ioc); ··· 356 353 void bfa_ioc_get_attr(struct bfa_ioc_s *ioc, struct bfa_ioc_attr_s *ioc_attr); 357 354 void bfa_ioc_get_adapter_attr(struct bfa_ioc_s *ioc, 358 355 struct bfa_adapter_attr_s *ad_attr); 359 - int bfa_ioc_debug_trcsz(bfa_boolean_t auto_recover); 360 356 void bfa_ioc_debug_memclaim(struct bfa_ioc_s *ioc, void *dbg_fwsave); 361 357 bfa_status_t bfa_ioc_debug_fwsave(struct bfa_ioc_s *ioc, void *trcdata, 362 358 int *trclen); ··· 363 361 int *trclen); 364 362 bfa_status_t bfa_ioc_debug_fwcore(struct bfa_ioc_s *ioc, void *buf, 365 363 u32 *offset, int *buflen); 366 - u32 bfa_ioc_smem_pgnum(struct bfa_ioc_s *ioc, u32 fmaddr); 367 - u32 bfa_ioc_smem_pgoff(struct bfa_ioc_s *ioc, u32 fmaddr); 368 364 void bfa_ioc_set_fcmode(struct bfa_ioc_s *ioc); 369 365 bfa_boolean_t bfa_ioc_get_fcmode(struct bfa_ioc_s *ioc); 370 - void bfa_ioc_hbfail_register(struct bfa_ioc_s *ioc, 371 - struct bfa_ioc_hbfail_notify_s *notify); 372 366 bfa_boolean_t bfa_ioc_sem_get(void __iomem *sem_reg); 373 - void bfa_ioc_sem_release(void __iomem *sem_reg); 374 - void bfa_ioc_hw_sem_release(struct bfa_ioc_s *ioc); 375 367 void bfa_ioc_fwver_get(struct bfa_ioc_s *ioc, 376 368 struct bfi_ioc_image_hdr_s *fwhdr); 377 369 bfa_boolean_t bfa_ioc_fwver_cmp(struct bfa_ioc_s *ioc, ··· 376 380 /* 377 381 * bfa mfg wwn API functions 378 382 */ 379 - wwn_t bfa_ioc_get_pwwn(struct bfa_ioc_s *ioc); 380 - wwn_t bfa_ioc_get_nwwn(struct bfa_ioc_s *ioc); 381 383 mac_t bfa_ioc_get_mac(struct bfa_ioc_s *ioc); 382 - wwn_t bfa_ioc_get_mfg_pwwn(struct bfa_ioc_s *ioc); 383 - wwn_t bfa_ioc_get_mfg_nwwn(struct bfa_ioc_s *ioc); 384 384 mac_t bfa_ioc_get_mfg_mac(struct bfa_ioc_s *ioc); 385 - u64 bfa_ioc_get_adid(struct bfa_ioc_s *ioc); 386 385 387 386 /* 388 387 * F/W Image Size & Chunk
+1 -1
drivers/scsi/bfa/bfa_ioc_cb.c
··· 181 181 * will lock it instead of clearing it. 182 182 */ 183 183 readl(ioc->ioc_regs.ioc_sem_reg); 184 - bfa_ioc_hw_sem_release(ioc); 184 + writel(1, ioc->ioc_regs.ioc_sem_reg); 185 185 } 186 186 187 187
+6 -6
drivers/scsi/bfa/bfa_ioc_ct.c
··· 83 83 */ 84 84 if (usecnt == 0) { 85 85 writel(1, ioc->ioc_regs.ioc_usage_reg); 86 - bfa_ioc_sem_release(ioc->ioc_regs.ioc_usage_sem_reg); 86 + writel(1, ioc->ioc_regs.ioc_usage_sem_reg); 87 87 bfa_trc(ioc, usecnt); 88 88 return BFA_TRUE; 89 89 } ··· 101 101 */ 102 102 bfa_ioc_fwver_get(ioc, &fwhdr); 103 103 if (!bfa_ioc_fwver_cmp(ioc, &fwhdr)) { 104 - bfa_ioc_sem_release(ioc->ioc_regs.ioc_usage_sem_reg); 104 + writel(1, ioc->ioc_regs.ioc_usage_sem_reg); 105 105 bfa_trc(ioc, usecnt); 106 106 return BFA_FALSE; 107 107 } ··· 111 111 */ 112 112 usecnt++; 113 113 writel(usecnt, ioc->ioc_regs.ioc_usage_reg); 114 - bfa_ioc_sem_release(ioc->ioc_regs.ioc_usage_sem_reg); 114 + writel(1, ioc->ioc_regs.ioc_usage_sem_reg); 115 115 bfa_trc(ioc, usecnt); 116 116 return BFA_TRUE; 117 117 } ··· 145 145 writel(usecnt, ioc->ioc_regs.ioc_usage_reg); 146 146 bfa_trc(ioc, usecnt); 147 147 148 - bfa_ioc_sem_release(ioc->ioc_regs.ioc_usage_sem_reg); 148 + writel(1, ioc->ioc_regs.ioc_usage_sem_reg); 149 149 } 150 150 151 151 /* ··· 313 313 if (ioc->cna) { 314 314 bfa_ioc_sem_get(ioc->ioc_regs.ioc_usage_sem_reg); 315 315 writel(0, ioc->ioc_regs.ioc_usage_reg); 316 - bfa_ioc_sem_release(ioc->ioc_regs.ioc_usage_sem_reg); 316 + writel(1, ioc->ioc_regs.ioc_usage_sem_reg); 317 317 } 318 318 319 319 /* ··· 322 322 * will lock it instead of clearing it. 323 323 */ 324 324 readl(ioc->ioc_regs.ioc_sem_reg); 325 - bfa_ioc_hw_sem_release(ioc); 325 + writel(1, ioc->ioc_regs.ioc_sem_reg); 326 326 } 327 327 328 328
-1
drivers/scsi/bfa/bfa_plog.h
··· 151 151 void bfa_plog_fchdr_and_pl(struct bfa_plog_s *plog, enum bfa_plog_mid mid, 152 152 enum bfa_plog_eid event, u16 misc, 153 153 struct fchs_s *fchdr, u32 pld_w0); 154 - bfa_boolean_t bfa_plog_get_setting(struct bfa_plog_s *plog); 155 154 156 155 #endif /* __BFA_PORTLOG_H__ */
+1 -1
drivers/scsi/bfa/bfa_port.c
··· 447 447 448 448 bfa_ioc_mbox_regisr(port->ioc, BFI_MC_PORT, bfa_port_isr, port); 449 449 bfa_ioc_hbfail_init(&port->hbfail, bfa_port_hbfail, port); 450 - bfa_ioc_hbfail_register(port->ioc, &port->hbfail); 450 + list_add_tail(&port->hbfail.qe, &port->ioc->hb_notify_q); 451 451 452 452 /* 453 453 * initialize time stamp for stats reset
+6 -179
drivers/scsi/bfa/bfa_svc.c
··· 41 41 #define BFA_LPS_MAX_VPORTS_SUPP_CB 255 42 42 #define BFA_LPS_MAX_VPORTS_SUPP_CT 190 43 43 44 - /* 45 - * lps_pvt BFA LPS private functions 46 - */ 47 - 48 - enum bfa_lps_event { 49 - BFA_LPS_SM_LOGIN = 1, /* login request from user */ 50 - BFA_LPS_SM_LOGOUT = 2, /* logout request from user */ 51 - BFA_LPS_SM_FWRSP = 3, /* f/w response to login/logout */ 52 - BFA_LPS_SM_RESUME = 4, /* space present in reqq queue */ 53 - BFA_LPS_SM_DELETE = 5, /* lps delete from user */ 54 - BFA_LPS_SM_OFFLINE = 6, /* Link is offline */ 55 - BFA_LPS_SM_RX_CVL = 7, /* Rx clear virtual link */ 56 - }; 57 44 58 45 /* 59 46 * FC PORT related definitions ··· 99 112 __bfa_cb_rport_online, (__rp)); \ 100 113 } \ 101 114 } while (0) 102 - 103 - 104 - enum bfa_rport_event { 105 - BFA_RPORT_SM_CREATE = 1, /* rport create event */ 106 - BFA_RPORT_SM_DELETE = 2, /* deleting an existing rport */ 107 - BFA_RPORT_SM_ONLINE = 3, /* rport is online */ 108 - BFA_RPORT_SM_OFFLINE = 4, /* rport is offline */ 109 - BFA_RPORT_SM_FWRSP = 5, /* firmware response */ 110 - BFA_RPORT_SM_HWFAIL = 6, /* IOC h/w failure */ 111 - BFA_RPORT_SM_QOS_SCN = 7, /* QoS SCN from firmware */ 112 - BFA_RPORT_SM_SET_SPEED = 8, /* Set Rport Speed */ 113 - BFA_RPORT_SM_QRESUME = 9, /* space in requeue queue */ 114 - }; 115 115 116 116 /* 117 117 * forward declarations FCXP related functions ··· 411 437 } 412 438 } 413 439 414 - 415 - bfa_boolean_t 416 - bfa_plog_get_setting(struct bfa_plog_s *plog) 417 - { 418 - return (bfa_boolean_t)plog->plog_enabled; 419 - } 420 440 421 441 /* 422 442 * fcxp_pvt BFA FCXP private functions ··· 1814 1846 bfa_sm_send_event(lps, BFA_LPS_SM_LOGOUT); 1815 1847 } 1816 1848 1817 - /* 1818 - * Discard a pending login request -- should be called only for 1819 - * link down handling. 1820 - */ 1821 - void 1822 - bfa_lps_discard(struct bfa_lps_s *lps) 1823 - { 1824 - bfa_sm_send_event(lps, BFA_LPS_SM_OFFLINE); 1825 - } 1826 - 1827 - /* 1828 - * Return lport services tag 1829 - */ 1830 - u8 1831 - bfa_lps_get_tag(struct bfa_lps_s *lps) 1832 - { 1833 - return lps->lp_tag; 1834 - } 1835 1849 1836 1850 /* 1837 1851 * Return lport services tag given the pid ··· 1834 1884 return 0; 1835 1885 } 1836 1886 1837 - /* 1838 - * return if fabric login indicates support for NPIV 1839 - */ 1840 - bfa_boolean_t 1841 - bfa_lps_is_npiv_en(struct bfa_lps_s *lps) 1842 - { 1843 - return lps->npiv_en; 1844 - } 1845 - 1846 - /* 1847 - * Return TRUE if attached to F-Port, else return FALSE 1848 - */ 1849 - bfa_boolean_t 1850 - bfa_lps_is_fport(struct bfa_lps_s *lps) 1851 - { 1852 - return lps->fport; 1853 - } 1854 - 1855 - /* 1856 - * Return TRUE if attached to a Brocade Fabric 1857 - */ 1858 - bfa_boolean_t 1859 - bfa_lps_is_brcd_fabric(struct bfa_lps_s *lps) 1860 - { 1861 - return lps->brcd_switch; 1862 - } 1863 - /* 1864 - * return TRUE if authentication is required 1865 - */ 1866 - bfa_boolean_t 1867 - bfa_lps_is_authreq(struct bfa_lps_s *lps) 1868 - { 1869 - return lps->auth_req; 1870 - } 1871 - 1872 - bfa_eproto_status_t 1873 - bfa_lps_get_extstatus(struct bfa_lps_s *lps) 1874 - { 1875 - return lps->ext_status; 1876 - } 1877 - 1878 - /* 1879 - * return port id assigned to the lport 1880 - */ 1881 - u32 1882 - bfa_lps_get_pid(struct bfa_lps_s *lps) 1883 - { 1884 - return lps->lp_pid; 1885 - } 1886 1887 1887 1888 /* 1888 1889 * return port id assigned to the base lport ··· 1844 1943 struct bfa_lps_mod_s *mod = BFA_LPS_MOD(bfa); 1845 1944 1846 1945 return BFA_LPS_FROM_TAG(mod, 0)->lp_pid; 1847 - } 1848 - 1849 - /* 1850 - * Return bb_credit assigned in FLOGI response 1851 - */ 1852 - u16 1853 - bfa_lps_get_peer_bbcredit(struct bfa_lps_s *lps) 1854 - { 1855 - return lps->pr_bbcred; 1856 - } 1857 - 1858 - /* 1859 - * Return peer port name 1860 - */ 1861 - wwn_t 1862 - bfa_lps_get_peer_pwwn(struct bfa_lps_s *lps) 1863 - { 1864 - return lps->pr_pwwn; 1865 - } 1866 - 1867 - /* 1868 - * Return peer node name 1869 - */ 1870 - wwn_t 1871 - bfa_lps_get_peer_nwwn(struct bfa_lps_s *lps) 1872 - { 1873 - return lps->pr_nwwn; 1874 - } 1875 - 1876 - /* 1877 - * return reason code if login request is rejected 1878 - */ 1879 - u8 1880 - bfa_lps_get_lsrjt_rsn(struct bfa_lps_s *lps) 1881 - { 1882 - return lps->lsrjt_rsn; 1883 - } 1884 - 1885 - /* 1886 - * return explanation code if login request is rejected 1887 - */ 1888 - u8 1889 - bfa_lps_get_lsrjt_expl(struct bfa_lps_s *lps) 1890 - { 1891 - return lps->lsrjt_expl; 1892 - } 1893 - 1894 - /* 1895 - * Return fpma/spma MAC for lport 1896 - */ 1897 - mac_t 1898 - bfa_lps_get_lp_mac(struct bfa_lps_s *lps) 1899 - { 1900 - return lps->lp_mac; 1901 1946 } 1902 1947 1903 1948 /* ··· 2911 3064 static void 2912 3065 bfa_fcport_set_wwns(struct bfa_fcport_s *fcport) 2913 3066 { 2914 - fcport->pwwn = bfa_ioc_get_pwwn(&fcport->bfa->ioc); 2915 - fcport->nwwn = bfa_ioc_get_nwwn(&fcport->bfa->ioc); 3067 + fcport->pwwn = fcport->bfa->ioc.attr->pwwn; 3068 + fcport->nwwn = fcport->bfa->ioc.attr->nwwn; 2916 3069 2917 3070 bfa_trc(fcport->bfa, fcport->pwwn); 2918 3071 bfa_trc(fcport->bfa, fcport->nwwn); ··· 3554 3707 attr->nwwn = fcport->nwwn; 3555 3708 attr->pwwn = fcport->pwwn; 3556 3709 3557 - attr->factorypwwn = bfa_ioc_get_mfg_pwwn(&bfa->ioc); 3558 - attr->factorynwwn = bfa_ioc_get_mfg_nwwn(&bfa->ioc); 3710 + attr->factorypwwn = bfa->ioc.attr->mfg_pwwn; 3711 + attr->factorynwwn = bfa->ioc.attr->mfg_nwwn; 3559 3712 3560 3713 memcpy(&attr->pport_cfg, &fcport->cfg, 3561 3714 sizeof(struct bfa_port_cfg_s)); ··· 3573 3726 /* beacon attributes */ 3574 3727 attr->beacon = fcport->beacon; 3575 3728 attr->link_e2e_beacon = fcport->link_e2e_beacon; 3576 - attr->plog_enabled = bfa_plog_get_setting(fcport->bfa->plog); 3729 + attr->plog_enabled = (bfa_boolean_t)fcport->bfa->plog->plog_enabled; 3577 3730 attr->io_profile = bfa_fcpim_get_io_profile(fcport->bfa); 3578 3731 3579 3732 attr->pport_cfg.path_tov = bfa_fcpim_path_tov_get(bfa); ··· 4431 4584 4432 4585 rp->bfa = bfa; 4433 4586 rp->rport_drv = rport_drv; 4434 - bfa_rport_clear_stats(rp); 4587 + memset(&rp->stats, 0, sizeof(rp->stats)); 4435 4588 4436 4589 bfa_assert(bfa_sm_cmp_state(rp, bfa_rport_sm_uninit)); 4437 4590 bfa_sm_send_event(rp, BFA_RPORT_SM_CREATE); 4438 4591 4439 4592 return rp; 4440 - } 4441 - 4442 - void 4443 - bfa_rport_delete(struct bfa_rport_s *rport) 4444 - { 4445 - bfa_sm_send_event(rport, BFA_RPORT_SM_DELETE); 4446 4593 } 4447 4594 4448 4595 void ··· 4458 4617 } 4459 4618 4460 4619 void 4461 - bfa_rport_offline(struct bfa_rport_s *rport) 4462 - { 4463 - bfa_sm_send_event(rport, BFA_RPORT_SM_OFFLINE); 4464 - } 4465 - 4466 - void 4467 4620 bfa_rport_speed(struct bfa_rport_s *rport, enum bfa_port_speed speed) 4468 4621 { 4469 4622 bfa_assert(speed != 0); ··· 4465 4630 4466 4631 rport->rport_info.speed = speed; 4467 4632 bfa_sm_send_event(rport, BFA_RPORT_SM_SET_SPEED); 4468 - } 4469 - 4470 - void 4471 - bfa_rport_clear_stats(struct bfa_rport_s *rport) 4472 - { 4473 - memset(&rport->stats, 0, sizeof(rport->stats)); 4474 4633 } 4475 4634 4476 4635 ··· 4929 5100 { 4930 5101 bfa_uf_post_all(BFA_UF_MOD(bfa)); 4931 5102 } 4932 - 4933 - 4934 5103 4935 5104 /* 4936 5105 * hal_uf_api
+12 -17
drivers/scsi/bfa/bfa_svc.h
··· 220 220 /* 221 221 * RPORT related defines 222 222 */ 223 + enum bfa_rport_event { 224 + BFA_RPORT_SM_CREATE = 1, /* rport create event */ 225 + BFA_RPORT_SM_DELETE = 2, /* deleting an existing rport */ 226 + BFA_RPORT_SM_ONLINE = 3, /* rport is online */ 227 + BFA_RPORT_SM_OFFLINE = 4, /* rport is offline */ 228 + BFA_RPORT_SM_FWRSP = 5, /* firmware response */ 229 + BFA_RPORT_SM_HWFAIL = 6, /* IOC h/w failure */ 230 + BFA_RPORT_SM_QOS_SCN = 7, /* QoS SCN from firmware */ 231 + BFA_RPORT_SM_SET_SPEED = 8, /* Set Rport Speed */ 232 + BFA_RPORT_SM_QRESUME = 9, /* space in requeue queue */ 233 + }; 234 + 223 235 #define BFA_RPORT_MIN 4 224 236 225 237 struct bfa_rport_mod_s { ··· 528 516 * bfa rport API functions 529 517 */ 530 518 struct bfa_rport_s *bfa_rport_create(struct bfa_s *bfa, void *rport_drv); 531 - void bfa_rport_delete(struct bfa_rport_s *rport); 532 519 void bfa_rport_online(struct bfa_rport_s *rport, 533 520 struct bfa_rport_info_s *rport_info); 534 - void bfa_rport_offline(struct bfa_rport_s *rport); 535 521 void bfa_rport_speed(struct bfa_rport_s *rport, enum bfa_port_speed speed); 536 - void bfa_rport_clear_stats(struct bfa_rport_s *rport); 537 522 void bfa_cb_rport_online(void *rport); 538 523 void bfa_cb_rport_offline(void *rport); 539 524 void bfa_cb_rport_qos_scn_flowid(void *rport, ··· 603 594 u32 bfa_lps_get_max_vport(struct bfa_s *bfa); 604 595 struct bfa_lps_s *bfa_lps_alloc(struct bfa_s *bfa); 605 596 void bfa_lps_delete(struct bfa_lps_s *lps); 606 - void bfa_lps_discard(struct bfa_lps_s *lps); 607 597 void bfa_lps_flogi(struct bfa_lps_s *lps, void *uarg, u8 alpa, 608 598 u16 pdusz, wwn_t pwwn, wwn_t nwwn, 609 599 bfa_boolean_t auth_en); 610 600 void bfa_lps_fdisc(struct bfa_lps_s *lps, void *uarg, u16 pdusz, 611 601 wwn_t pwwn, wwn_t nwwn); 612 602 void bfa_lps_fdisclogo(struct bfa_lps_s *lps); 613 - u8 bfa_lps_get_tag(struct bfa_lps_s *lps); 614 - bfa_boolean_t bfa_lps_is_npiv_en(struct bfa_lps_s *lps); 615 - bfa_boolean_t bfa_lps_is_fport(struct bfa_lps_s *lps); 616 - bfa_boolean_t bfa_lps_is_brcd_fabric(struct bfa_lps_s *lps); 617 - bfa_boolean_t bfa_lps_is_authreq(struct bfa_lps_s *lps); 618 - bfa_eproto_status_t bfa_lps_get_extstatus(struct bfa_lps_s *lps); 619 - u32 bfa_lps_get_pid(struct bfa_lps_s *lps); 620 603 u32 bfa_lps_get_base_pid(struct bfa_s *bfa); 621 604 u8 bfa_lps_get_tag_from_pid(struct bfa_s *bfa, u32 pid); 622 - u16 bfa_lps_get_peer_bbcredit(struct bfa_lps_s *lps); 623 - wwn_t bfa_lps_get_peer_pwwn(struct bfa_lps_s *lps); 624 - wwn_t bfa_lps_get_peer_nwwn(struct bfa_lps_s *lps); 625 - u8 bfa_lps_get_lsrjt_rsn(struct bfa_lps_s *lps); 626 - u8 bfa_lps_get_lsrjt_expl(struct bfa_lps_s *lps); 627 - mac_t bfa_lps_get_lp_mac(struct bfa_lps_s *lps); 628 605 void bfa_cb_lps_flogi_comp(void *bfad, void *uarg, bfa_status_t status); 629 606 void bfa_cb_lps_fdisc_comp(void *bfad, void *uarg, bfa_status_t status); 630 607 void bfa_cb_lps_fdisclogo_comp(void *bfad, void *uarg);
+11 -11
drivers/scsi/bfa/bfad.c
··· 206 206 } 207 207 208 208 spin_lock_irqsave(&bfad->bfad_lock, flags); 209 - bfa_init(&bfad->bfa); 209 + bfa_iocfc_init(&bfad->bfa); 210 210 spin_unlock_irqrestore(&bfad->bfad_lock, flags); 211 211 212 212 /* Set up interrupt handler for each vectors */ ··· 725 725 726 726 spin_lock_irqsave(&bfad->bfad_lock, flags); 727 727 728 - bfa_timer_tick(&bfad->bfa); 728 + bfa_timer_beat(&bfad->bfa.timer_mod); 729 729 730 730 bfa_comp_deq(&bfad->bfa, &doneq); 731 731 spin_unlock_irqrestore(&bfad->bfad_lock, flags); ··· 882 882 goto out_hal_mem_alloc_failure; 883 883 } 884 884 885 - bfa_init_trc(&bfad->bfa, bfad->trcmod); 886 - bfa_init_plog(&bfad->bfa, &bfad->plog_buf); 885 + bfad->bfa.trcmod = bfad->trcmod; 886 + bfad->bfa.plog = &bfad->plog_buf; 887 887 bfa_plog_init(&bfad->plog_buf); 888 888 bfa_plog_str(&bfad->plog_buf, BFA_PL_MID_DRVR, BFA_PL_EID_DRIVER_START, 889 889 0, "Driver Attach"); ··· 893 893 894 894 /* FCS INIT */ 895 895 spin_lock_irqsave(&bfad->bfad_lock, flags); 896 - bfa_fcs_trc_init(&bfad->bfa_fcs, bfad->trcmod); 896 + bfad->bfa_fcs.trcmod = bfad->trcmod; 897 897 bfa_fcs_attach(&bfad->bfa_fcs, &bfad->bfa, bfad, BFA_FALSE); 898 - bfa_fcs_set_fdmi_param(&bfad->bfa_fcs, fdmi_enable); 898 + bfad->bfa_fcs.fdmi_enabled = fdmi_enable; 899 899 spin_unlock_irqrestore(&bfad->bfad_lock, flags); 900 900 901 901 bfad->bfad_flags |= BFAD_DRV_INIT_DONE; ··· 913 913 914 914 spin_lock_irqsave(&bfad->bfad_lock, flags); 915 915 init_completion(&bfad->comp); 916 - bfa_stop(&bfad->bfa); 916 + bfa_iocfc_stop(&bfad->bfa); 917 917 spin_unlock_irqrestore(&bfad->bfad_lock, flags); 918 918 wait_for_completion(&bfad->comp); 919 919 ··· 932 932 unsigned long flags; 933 933 934 934 spin_lock_irqsave(&bfad->bfad_lock, flags); 935 - bfa_start(&bfad->bfa); 936 - bfa_fcs_start(&bfad->bfa_fcs); 935 + bfa_iocfc_start(&bfad->bfa); 936 + bfa_fcs_fabric_modstart(&bfad->bfa_fcs); 937 937 bfad->bfad_flags |= BFAD_HAL_START_DONE; 938 938 spin_unlock_irqrestore(&bfad->bfad_lock, flags); 939 939 ··· 963 963 964 964 spin_lock_irqsave(&bfad->bfad_lock, flags); 965 965 init_completion(&bfad->comp); 966 - bfa_stop(&bfad->bfa); 966 + bfa_iocfc_stop(&bfad->bfa); 967 967 bfad->bfad_flags &= ~BFAD_HAL_START_DONE; 968 968 spin_unlock_irqrestore(&bfad->bfad_lock, flags); 969 969 wait_for_completion(&bfad->comp); ··· 1524 1524 if (strcmp(FCPI_NAME, " fcpim") == 0) 1525 1525 supported_fc4s |= BFA_LPORT_ROLE_FCP_IM; 1526 1526 1527 - bfa_ioc_auto_recover(ioc_auto_recover); 1527 + bfa_auto_recover = ioc_auto_recover; 1528 1528 bfa_fcs_rport_set_del_timeout(rport_del_timeout); 1529 1529 1530 1530 error = pci_register_driver(&bfad_pci_driver);
+2 -2
drivers/scsi/bfa/bfad_debugfs.c
··· 90 90 memset(fw_debug->debug_buffer, 0, fw_debug->buffer_len); 91 91 92 92 spin_lock_irqsave(&bfad->bfad_lock, flags); 93 - rc = bfa_debug_fwtrc(&bfad->bfa, 93 + rc = bfa_ioc_debug_fwtrc(&bfad->bfa.ioc, 94 94 fw_debug->debug_buffer, 95 95 &fw_debug->buffer_len); 96 96 spin_unlock_irqrestore(&bfad->bfad_lock, flags); ··· 134 134 memset(fw_debug->debug_buffer, 0, fw_debug->buffer_len); 135 135 136 136 spin_lock_irqsave(&bfad->bfad_lock, flags); 137 - rc = bfa_debug_fwsave(&bfad->bfa, 137 + rc = bfa_ioc_debug_fwsave(&bfad->bfa.ioc, 138 138 fw_debug->debug_buffer, 139 139 &fw_debug->buffer_len); 140 140 spin_unlock_irqrestore(&bfad->bfad_lock, flags);
+1 -1
drivers/scsi/bfa/bfad_im.c
··· 922 922 if (!ioc_attr) 923 923 return 0; 924 924 925 - bfa_get_attr(bfa, ioc_attr); 925 + bfa_ioc_get_attr(&bfa->ioc, ioc_attr); 926 926 if (ioc_attr->adapter_attr.max_speed == BFA_PORT_SPEED_8GBPS) { 927 927 if (ioc_attr->adapter_attr.is_mezz) { 928 928 supported_speed |= FC_PORTSPEED_8GBIT |