diff options
author | Maggie Zhang <xmzhang@brocade.com> | 2010-12-09 22:08:43 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-12-21 13:32:43 -0500 |
commit | f7f73812e95077c19a2801bbf4f483fcdab5232f (patch) | |
tree | 1683aef984bf23a83dc5764503a0972f64ddf5a5 | |
parent | df0f1933eb5454a5c481311837076056557467ad (diff) |
[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>
-rw-r--r-- | drivers/scsi/bfa/bfa.h | 17 | ||||
-rw-r--r-- | drivers/scsi/bfa/bfa_core.c | 173 | ||||
-rw-r--r-- | drivers/scsi/bfa/bfa_fcpim.c | 2 | ||||
-rw-r--r-- | drivers/scsi/bfa/bfa_fcs.c | 172 | ||||
-rw-r--r-- | drivers/scsi/bfa/bfa_fcs.h | 87 | ||||
-rw-r--r-- | drivers/scsi/bfa/bfa_fcs_fcpim.c | 18 | ||||
-rw-r--r-- | drivers/scsi/bfa/bfa_fcs_lport.c | 65 | ||||
-rw-r--r-- | drivers/scsi/bfa/bfa_fcs_rport.c | 97 | ||||
-rw-r--r-- | drivers/scsi/bfa/bfa_ioc.c | 280 | ||||
-rw-r--r-- | drivers/scsi/bfa/bfa_ioc.h | 19 | ||||
-rw-r--r-- | drivers/scsi/bfa/bfa_ioc_cb.c | 2 | ||||
-rw-r--r-- | drivers/scsi/bfa/bfa_ioc_ct.c | 12 | ||||
-rw-r--r-- | drivers/scsi/bfa/bfa_plog.h | 1 | ||||
-rw-r--r-- | drivers/scsi/bfa/bfa_port.c | 2 | ||||
-rw-r--r-- | drivers/scsi/bfa/bfa_svc.c | 185 | ||||
-rw-r--r-- | drivers/scsi/bfa/bfa_svc.h | 29 | ||||
-rw-r--r-- | drivers/scsi/bfa/bfad.c | 22 | ||||
-rw-r--r-- | drivers/scsi/bfa/bfad_debugfs.c | 4 | ||||
-rw-r--r-- | drivers/scsi/bfa/bfad_im.c | 2 |
19 files changed, 259 insertions, 930 deletions
diff --git a/drivers/scsi/bfa/bfa.h b/drivers/scsi/bfa/bfa.h index 7ed13ce6d6aa..6231e5aa55b3 100644 --- a/drivers/scsi/bfa/bfa.h +++ b/drivers/scsi/bfa/bfa.h | |||
@@ -296,7 +296,6 @@ void bfa_iocfc_attach(struct bfa_s *bfa, void *bfad, | |||
296 | struct bfa_iocfc_cfg_s *cfg, | 296 | struct bfa_iocfc_cfg_s *cfg, |
297 | struct bfa_meminfo_s *meminfo, | 297 | struct bfa_meminfo_s *meminfo, |
298 | struct bfa_pcidev_s *pcidev); | 298 | struct bfa_pcidev_s *pcidev); |
299 | void bfa_iocfc_detach(struct bfa_s *bfa); | ||
300 | void bfa_iocfc_init(struct bfa_s *bfa); | 299 | void bfa_iocfc_init(struct bfa_s *bfa); |
301 | void bfa_iocfc_start(struct bfa_s *bfa); | 300 | void bfa_iocfc_start(struct bfa_s *bfa); |
302 | void bfa_iocfc_stop(struct bfa_s *bfa); | 301 | void bfa_iocfc_stop(struct bfa_s *bfa); |
@@ -385,13 +384,7 @@ void bfa_cfg_get_meminfo(struct bfa_iocfc_cfg_s *cfg, | |||
385 | void bfa_attach(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg, | 384 | void bfa_attach(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg, |
386 | struct bfa_meminfo_s *meminfo, | 385 | struct bfa_meminfo_s *meminfo, |
387 | struct bfa_pcidev_s *pcidev); | 386 | struct bfa_pcidev_s *pcidev); |
388 | void bfa_init_trc(struct bfa_s *bfa, struct bfa_trc_mod_s *trcmod); | ||
389 | void bfa_init_plog(struct bfa_s *bfa, struct bfa_plog_s *plog); | ||
390 | void bfa_detach(struct bfa_s *bfa); | 387 | void bfa_detach(struct bfa_s *bfa); |
391 | void bfa_init(struct bfa_s *bfa); | ||
392 | void bfa_start(struct bfa_s *bfa); | ||
393 | void bfa_stop(struct bfa_s *bfa); | ||
394 | void bfa_attach_fcs(struct bfa_s *bfa); | ||
395 | void bfa_cb_init(void *bfad, bfa_status_t status); | 388 | void bfa_cb_init(void *bfad, bfa_status_t status); |
396 | void bfa_cb_updateq(void *bfad, bfa_status_t status); | 389 | void bfa_cb_updateq(void *bfad, bfa_status_t status); |
397 | 390 | ||
@@ -405,7 +398,6 @@ void bfa_comp_free(struct bfa_s *bfa, struct list_head *comp_q); | |||
405 | 398 | ||
406 | typedef void (*bfa_cb_ioc_t) (void *cbarg, enum bfa_status status); | 399 | typedef void (*bfa_cb_ioc_t) (void *cbarg, enum bfa_status status); |
407 | void bfa_iocfc_get_attr(struct bfa_s *bfa, struct bfa_iocfc_attr_s *attr); | 400 | void bfa_iocfc_get_attr(struct bfa_s *bfa, struct bfa_iocfc_attr_s *attr); |
408 | void bfa_get_attr(struct bfa_s *bfa, struct bfa_ioc_attr_s *ioc_attr); | ||
409 | 401 | ||
410 | 402 | ||
411 | bfa_status_t bfa_iocfc_israttr_set(struct bfa_s *bfa, | 403 | bfa_status_t bfa_iocfc_israttr_set(struct bfa_s *bfa, |
@@ -413,16 +405,7 @@ bfa_status_t bfa_iocfc_israttr_set(struct bfa_s *bfa, | |||
413 | 405 | ||
414 | void bfa_iocfc_enable(struct bfa_s *bfa); | 406 | void bfa_iocfc_enable(struct bfa_s *bfa); |
415 | void bfa_iocfc_disable(struct bfa_s *bfa); | 407 | void bfa_iocfc_disable(struct bfa_s *bfa); |
416 | void bfa_timer_tick(struct bfa_s *bfa); | ||
417 | #define bfa_timer_start(_bfa, _timer, _timercb, _arg, _timeout) \ | 408 | #define bfa_timer_start(_bfa, _timer, _timercb, _arg, _timeout) \ |
418 | bfa_timer_begin(&(_bfa)->timer_mod, _timer, _timercb, _arg, _timeout) | 409 | bfa_timer_begin(&(_bfa)->timer_mod, _timer, _timercb, _arg, _timeout) |
419 | 410 | ||
420 | /* | ||
421 | * BFA debug API functions | ||
422 | */ | ||
423 | bfa_status_t bfa_debug_fwtrc(struct bfa_s *bfa, void *trcdata, int *trclen); | ||
424 | bfa_status_t bfa_debug_fwsave(struct bfa_s *bfa, void *trcdata, int *trclen); | ||
425 | bfa_status_t bfa_debug_fwcore(struct bfa_s *bfa, void *buf, | ||
426 | u32 *offset, int *buflen); | ||
427 | |||
428 | #endif /* __BFA_H__ */ | 411 | #endif /* __BFA_H__ */ |
diff --git a/drivers/scsi/bfa/bfa_core.c b/drivers/scsi/bfa/bfa_core.c index 90e0f81ae425..002907c694af 100644 --- a/drivers/scsi/bfa/bfa_core.c +++ b/drivers/scsi/bfa/bfa_core.c | |||
@@ -67,18 +67,6 @@ static struct bfa_ioc_cbfn_s bfa_iocfc_cbfn; | |||
67 | * BFA Interrupt handling functions | 67 | * BFA Interrupt handling functions |
68 | */ | 68 | */ |
69 | static void | 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 | bfa_reqq_resume(struct bfa_s *bfa, int qid) | 70 | bfa_reqq_resume(struct bfa_s *bfa, int qid) |
83 | { | 71 | { |
84 | struct list_head *waitq, *qe, *qen; | 72 | struct list_head *waitq, *qe, *qen; |
@@ -267,7 +255,7 @@ bfa_msix_lpu_err(struct bfa_s *bfa, int vec) | |||
267 | intr = readl(bfa->iocfc.bfa_regs.intr_status); | 255 | intr = readl(bfa->iocfc.bfa_regs.intr_status); |
268 | 256 | ||
269 | if (intr & (__HFN_INT_MBOX_LPU0 | __HFN_INT_MBOX_LPU1)) | 257 | if (intr & (__HFN_INT_MBOX_LPU0 | __HFN_INT_MBOX_LPU1)) |
270 | bfa_msix_lpu(bfa); | 258 | bfa_ioc_mbox_isr(&bfa->ioc); |
271 | 259 | ||
272 | intr &= (__HFN_INT_ERR_EMC | __HFN_INT_ERR_LPU0 | | 260 | intr &= (__HFN_INT_ERR_EMC | __HFN_INT_ERR_LPU0 | |
273 | __HFN_INT_ERR_LPU1 | __HFN_INT_ERR_PSS | __HFN_INT_LL_HALT); | 261 | __HFN_INT_ERR_LPU1 | __HFN_INT_ERR_PSS | __HFN_INT_LL_HALT); |
@@ -298,7 +286,7 @@ bfa_msix_lpu_err(struct bfa_s *bfa, int vec) | |||
298 | } | 286 | } |
299 | 287 | ||
300 | writel(intr, bfa->iocfc.bfa_regs.intr_status); | 288 | writel(intr, bfa->iocfc.bfa_regs.intr_status); |
301 | bfa_msix_errint(bfa, intr); | 289 | bfa_ioc_error_isr(&bfa->ioc); |
302 | } | 290 | } |
303 | } | 291 | } |
304 | 292 | ||
@@ -467,8 +455,8 @@ bfa_iocfc_mem_claim(struct bfa_s *bfa, struct bfa_iocfc_cfg_s *cfg, | |||
467 | * First allocate dma memory for IOC. | 455 | * First allocate dma memory for IOC. |
468 | */ | 456 | */ |
469 | bfa_ioc_mem_claim(&bfa->ioc, dm_kva, dm_pa); | 457 | bfa_ioc_mem_claim(&bfa->ioc, dm_kva, dm_pa); |
470 | dm_kva += bfa_ioc_meminfo(); | 458 | dm_kva += BFA_ROUNDUP(sizeof(struct bfi_ioc_attr_s), BFA_DMA_ALIGN_SZ); |
471 | dm_pa += bfa_ioc_meminfo(); | 459 | dm_pa += BFA_ROUNDUP(sizeof(struct bfi_ioc_attr_s), BFA_DMA_ALIGN_SZ); |
472 | 460 | ||
473 | /* | 461 | /* |
474 | * Claim DMA-able memory for the request/response queues and for shadow | 462 | * Claim DMA-able memory for the request/response queues and for shadow |
@@ -531,7 +519,7 @@ bfa_iocfc_mem_claim(struct bfa_s *bfa, struct bfa_iocfc_cfg_s *cfg, | |||
531 | bfa_meminfo_dma_virt(meminfo) = dm_kva; | 519 | bfa_meminfo_dma_virt(meminfo) = dm_kva; |
532 | bfa_meminfo_dma_phys(meminfo) = dm_pa; | 520 | bfa_meminfo_dma_phys(meminfo) = dm_pa; |
533 | 521 | ||
534 | dbgsz = bfa_ioc_debug_trcsz(bfa_auto_recover); | 522 | dbgsz = (bfa_auto_recover) ? BFA_DBG_FWTRC_LEN : 0; |
535 | if (dbgsz > 0) { | 523 | if (dbgsz > 0) { |
536 | bfa_ioc_debug_memclaim(&bfa->ioc, bfa_meminfo_kva(meminfo)); | 524 | bfa_ioc_debug_memclaim(&bfa->ioc, bfa_meminfo_kva(meminfo)); |
537 | bfa_meminfo_kva(meminfo) += dbgsz; | 525 | bfa_meminfo_kva(meminfo) += dbgsz; |
@@ -723,11 +711,11 @@ bfa_iocfc_meminfo(struct bfa_iocfc_cfg_s *cfg, u32 *km_len, | |||
723 | u32 *dm_len) | 711 | u32 *dm_len) |
724 | { | 712 | { |
725 | /* dma memory for IOC */ | 713 | /* dma memory for IOC */ |
726 | *dm_len += bfa_ioc_meminfo(); | 714 | *dm_len += BFA_ROUNDUP(sizeof(struct bfi_ioc_attr_s), BFA_DMA_ALIGN_SZ); |
727 | 715 | ||
728 | bfa_iocfc_fw_cfg_sz(cfg, dm_len); | 716 | bfa_iocfc_fw_cfg_sz(cfg, dm_len); |
729 | bfa_iocfc_cqs_sz(cfg, dm_len); | 717 | bfa_iocfc_cqs_sz(cfg, dm_len); |
730 | *km_len += bfa_ioc_debug_trcsz(bfa_auto_recover); | 718 | *km_len += (bfa_auto_recover) ? BFA_DBG_FWTRC_LEN : 0; |
731 | } | 719 | } |
732 | 720 | ||
733 | /* | 721 | /* |
@@ -759,7 +747,7 @@ bfa_iocfc_attach(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg, | |||
759 | 747 | ||
760 | bfa_iocfc_init_mem(bfa, bfad, cfg, pcidev); | 748 | bfa_iocfc_init_mem(bfa, bfad, cfg, pcidev); |
761 | bfa_iocfc_mem_claim(bfa, cfg, meminfo); | 749 | bfa_iocfc_mem_claim(bfa, cfg, meminfo); |
762 | bfa_timer_init(&bfa->timer_mod); | 750 | INIT_LIST_HEAD(&bfa->timer_mod.timer_q); |
763 | 751 | ||
764 | INIT_LIST_HEAD(&bfa->comp_q); | 752 | INIT_LIST_HEAD(&bfa->comp_q); |
765 | for (i = 0; i < BFI_IOC_MAX_CQS; i++) | 753 | for (i = 0; i < BFI_IOC_MAX_CQS; i++) |
@@ -770,15 +758,6 @@ bfa_iocfc_attach(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg, | |||
770 | * Query IOC memory requirement information. | 758 | * Query IOC memory requirement information. |
771 | */ | 759 | */ |
772 | void | 760 | void |
773 | bfa_iocfc_detach(struct bfa_s *bfa) | ||
774 | { | ||
775 | bfa_ioc_detach(&bfa->ioc); | ||
776 | } | ||
777 | |||
778 | /* | ||
779 | * Query IOC memory requirement information. | ||
780 | */ | ||
781 | void | ||
782 | bfa_iocfc_init(struct bfa_s *bfa) | 761 | bfa_iocfc_init(struct bfa_s *bfa) |
783 | { | 762 | { |
784 | bfa->iocfc.action = BFA_IOCFC_ACT_INIT; | 763 | bfa->iocfc.action = BFA_IOCFC_ACT_INIT; |
@@ -1090,79 +1069,7 @@ bfa_detach(struct bfa_s *bfa) | |||
1090 | 1069 | ||
1091 | for (i = 0; hal_mods[i]; i++) | 1070 | for (i = 0; hal_mods[i]; i++) |
1092 | hal_mods[i]->detach(bfa); | 1071 | hal_mods[i]->detach(bfa); |
1093 | 1072 | bfa_ioc_detach(&bfa->ioc); | |
1094 | bfa_iocfc_detach(bfa); | ||
1095 | } | ||
1096 | |||
1097 | |||
1098 | void | ||
1099 | bfa_init_trc(struct bfa_s *bfa, struct bfa_trc_mod_s *trcmod) | ||
1100 | { | ||
1101 | bfa->trcmod = trcmod; | ||
1102 | } | ||
1103 | |||
1104 | void | ||
1105 | bfa_init_plog(struct bfa_s *bfa, struct bfa_plog_s *plog) | ||
1106 | { | ||
1107 | bfa->plog = plog; | ||
1108 | } | ||
1109 | |||
1110 | /* | ||
1111 | * Initialize IOC. | ||
1112 | * | ||
1113 | * This function will return immediately, when the IOC initialization is | ||
1114 | * completed, the bfa_cb_init() will be called. | ||
1115 | * | ||
1116 | * @param[in] bfa instance | ||
1117 | * | ||
1118 | * @return void | ||
1119 | * | ||
1120 | * Special Considerations: | ||
1121 | * | ||
1122 | * @note | ||
1123 | * When this function returns, the driver should register the interrupt service | ||
1124 | * routine(s) and enable the device interrupts. If this is not done, | ||
1125 | * bfa_cb_init() will never get called | ||
1126 | */ | ||
1127 | void | ||
1128 | bfa_init(struct bfa_s *bfa) | ||
1129 | { | ||
1130 | bfa_iocfc_init(bfa); | ||
1131 | } | ||
1132 | |||
1133 | /* | ||
1134 | * Use this function initiate the IOC configuration setup. This function | ||
1135 | * will return immediately. | ||
1136 | * | ||
1137 | * @param[in] bfa instance | ||
1138 | * | ||
1139 | * @return None | ||
1140 | */ | ||
1141 | void | ||
1142 | bfa_start(struct bfa_s *bfa) | ||
1143 | { | ||
1144 | bfa_iocfc_start(bfa); | ||
1145 | } | ||
1146 | |||
1147 | /* | ||
1148 | * Use this function quiese the IOC. This function will return immediately, | ||
1149 | * when the IOC is actually stopped, the bfad->comp will be set. | ||
1150 | * | ||
1151 | * @param[in]bfa - pointer to bfa_t. | ||
1152 | * | ||
1153 | * @return None | ||
1154 | * | ||
1155 | * Special Considerations: | ||
1156 | * bfad->comp can be set before or after bfa_stop() returns. | ||
1157 | * | ||
1158 | * @note | ||
1159 | * In case of any failure, we could handle it automatically by doing a | ||
1160 | * reset and then succeed the bfa_stop() call. | ||
1161 | */ | ||
1162 | void | ||
1163 | bfa_stop(struct bfa_s *bfa) | ||
1164 | { | ||
1165 | bfa_iocfc_stop(bfa); | ||
1166 | } | 1073 | } |
1167 | 1074 | ||
1168 | void | 1075 | void |
@@ -1198,20 +1105,6 @@ bfa_comp_free(struct bfa_s *bfa, struct list_head *comp_q) | |||
1198 | } | 1105 | } |
1199 | } | 1106 | } |
1200 | 1107 | ||
1201 | void | ||
1202 | bfa_attach_fcs(struct bfa_s *bfa) | ||
1203 | { | ||
1204 | bfa->fcs = BFA_TRUE; | ||
1205 | } | ||
1206 | |||
1207 | /* | ||
1208 | * Periodic timer heart beat from driver | ||
1209 | */ | ||
1210 | void | ||
1211 | bfa_timer_tick(struct bfa_s *bfa) | ||
1212 | { | ||
1213 | bfa_timer_beat(&bfa->timer_mod); | ||
1214 | } | ||
1215 | 1108 | ||
1216 | /* | 1109 | /* |
1217 | * Return the list of PCI vendor/device id lists supported by this | 1110 | * Return the list of PCI vendor/device id lists supported by this |
@@ -1282,51 +1175,3 @@ bfa_cfg_get_min(struct bfa_iocfc_cfg_s *cfg) | |||
1282 | cfg->drvcfg.num_rspq_elems = BFA_RSPQ_NELEMS_MIN; | 1175 | cfg->drvcfg.num_rspq_elems = BFA_RSPQ_NELEMS_MIN; |
1283 | cfg->drvcfg.min_cfg = BFA_TRUE; | 1176 | cfg->drvcfg.min_cfg = BFA_TRUE; |
1284 | } | 1177 | } |
1285 | |||
1286 | void | ||
1287 | bfa_get_attr(struct bfa_s *bfa, struct bfa_ioc_attr_s *ioc_attr) | ||
1288 | { | ||
1289 | bfa_ioc_get_attr(&bfa->ioc, ioc_attr); | ||
1290 | } | ||
1291 | |||
1292 | /* | ||
1293 | * Retrieve firmware trace information on IOC failure. | ||
1294 | */ | ||
1295 | bfa_status_t | ||
1296 | bfa_debug_fwsave(struct bfa_s *bfa, void *trcdata, int *trclen) | ||
1297 | { | ||
1298 | return bfa_ioc_debug_fwsave(&bfa->ioc, trcdata, trclen); | ||
1299 | } | ||
1300 | |||
1301 | /* | ||
1302 | * Fetch firmware trace data. | ||
1303 | * | ||
1304 | * @param[in] bfa BFA instance | ||
1305 | * @param[out] trcdata Firmware trace buffer | ||
1306 | * @param[in,out] trclen Firmware trace buffer len | ||
1307 | * | ||
1308 | * @retval BFA_STATUS_OK Firmware trace is fetched. | ||
1309 | * @retval BFA_STATUS_INPROGRESS Firmware trace fetch is in progress. | ||
1310 | */ | ||
1311 | bfa_status_t | ||
1312 | bfa_debug_fwtrc(struct bfa_s *bfa, void *trcdata, int *trclen) | ||
1313 | { | ||
1314 | return bfa_ioc_debug_fwtrc(&bfa->ioc, trcdata, trclen); | ||
1315 | } | ||
1316 | |||
1317 | /* | ||
1318 | * Dump firmware memory. | ||
1319 | * | ||
1320 | * @param[in] bfa BFA instance | ||
1321 | * @param[out] buf buffer for dump | ||
1322 | * @param[in,out] offset smem offset to start read | ||
1323 | * @param[in,out] buflen length of buffer | ||
1324 | * | ||
1325 | * @retval BFA_STATUS_OK Firmware memory is dumped. | ||
1326 | * @retval BFA_STATUS_INPROGRESS Firmware memory dump is in progress. | ||
1327 | */ | ||
1328 | bfa_status_t | ||
1329 | bfa_debug_fwcore(struct bfa_s *bfa, void *buf, u32 *offset, int *buflen) | ||
1330 | { | ||
1331 | return bfa_ioc_debug_fwcore(&bfa->ioc, buf, offset, buflen); | ||
1332 | } | ||
diff --git a/drivers/scsi/bfa/bfa_fcpim.c b/drivers/scsi/bfa/bfa_fcpim.c index 0e7f3807dba2..d6aea5d4425f 100644 --- a/drivers/scsi/bfa/bfa_fcpim.c +++ b/drivers/scsi/bfa/bfa_fcpim.c | |||
@@ -2567,7 +2567,7 @@ bfa_ioim_notify_cleanup(struct bfa_ioim_s *ioim) | |||
2567 | } | 2567 | } |
2568 | bfa_itnim_iodone(ioim->itnim); | 2568 | bfa_itnim_iodone(ioim->itnim); |
2569 | } else | 2569 | } else |
2570 | bfa_tskim_iodone(ioim->iosp->tskim); | 2570 | bfa_wc_down(&ioim->iosp->tskim->wc); |
2571 | } | 2571 | } |
2572 | 2572 | ||
2573 | static bfa_boolean_t | 2573 | static bfa_boolean_t |
diff --git a/drivers/scsi/bfa/bfa_fcs.c b/drivers/scsi/bfa/bfa_fcs.c index 5b561bde2264..141215c51635 100644 --- a/drivers/scsi/bfa/bfa_fcs.c +++ b/drivers/scsi/bfa/bfa_fcs.c | |||
@@ -76,7 +76,7 @@ bfa_fcs_attach(struct bfa_fcs_s *fcs, struct bfa_s *bfa, struct bfad_s *bfad, | |||
76 | fcs->bfad = bfad; | 76 | fcs->bfad = bfad; |
77 | fcs->min_cfg = min_cfg; | 77 | fcs->min_cfg = min_cfg; |
78 | 78 | ||
79 | bfa_attach_fcs(bfa); | 79 | bfa->fcs = BFA_TRUE; |
80 | fcbuild_init(); | 80 | fcbuild_init(); |
81 | 81 | ||
82 | for (i = 0; i < sizeof(fcs_modules) / sizeof(fcs_modules[0]); i++) { | 82 | for (i = 0; i < sizeof(fcs_modules) / sizeof(fcs_modules[0]); i++) { |
@@ -110,14 +110,6 @@ bfa_fcs_init(struct bfa_fcs_s *fcs) | |||
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 | * brief | 115 | * brief |
@@ -140,22 +132,6 @@ bfa_fcs_driver_info_init(struct bfa_fcs_s *fcs, | |||
140 | 132 | ||
141 | /* | 133 | /* |
142 | * brief | 134 | * brief |
143 | * FCS FDMI Driver Parameter Initialization | ||
144 | * | ||
145 | * param[in] fcs FCS instance | ||
146 | * param[in] fdmi_enable TRUE/FALSE | ||
147 | * | ||
148 | * return None | ||
149 | */ | ||
150 | void | ||
151 | bfa_fcs_set_fdmi_param(struct bfa_fcs_s *fcs, bfa_boolean_t fdmi_enable) | ||
152 | { | ||
153 | |||
154 | fcs->fdmi_enabled = fdmi_enable; | ||
155 | |||
156 | } | ||
157 | /* | ||
158 | * brief | ||
159 | * FCS instance cleanup and exit. | 135 | * FCS instance cleanup and exit. |
160 | * | 136 | * |
161 | * param[in] fcs FCS instance | 137 | * param[in] fcs FCS instance |
@@ -184,18 +160,6 @@ bfa_fcs_exit(struct bfa_fcs_s *fcs) | |||
184 | } | 160 | } |
185 | 161 | ||
186 | 162 | ||
187 | void | ||
188 | bfa_fcs_trc_init(struct bfa_fcs_s *fcs, struct bfa_trc_mod_s *trcmod) | ||
189 | { | ||
190 | fcs->trcmod = trcmod; | ||
191 | } | ||
192 | |||
193 | void | ||
194 | bfa_fcs_modexit_comp(struct bfa_fcs_s *fcs) | ||
195 | { | ||
196 | bfa_wc_down(&fcs->wc); | ||
197 | } | ||
198 | |||
199 | /* | 163 | /* |
200 | * Fabric module implementation. | 164 | * Fabric module implementation. |
201 | */ | 165 | */ |
@@ -232,31 +196,6 @@ static void bfa_fcs_fabric_flogiacc_comp(void *fcsarg, | |||
232 | u32 rsp_len, | 196 | u32 rsp_len, |
233 | u32 resid_len, | 197 | u32 resid_len, |
234 | struct fchs_s *rspfchs); | 198 | struct fchs_s *rspfchs); |
235 | /* | ||
236 | * fcs_fabric_sm fabric state machine functions | ||
237 | */ | ||
238 | |||
239 | /* | ||
240 | * Fabric state machine events | ||
241 | */ | ||
242 | enum bfa_fcs_fabric_event { | ||
243 | BFA_FCS_FABRIC_SM_CREATE = 1, /* create from driver */ | ||
244 | BFA_FCS_FABRIC_SM_DELETE = 2, /* delete from driver */ | ||
245 | BFA_FCS_FABRIC_SM_LINK_DOWN = 3, /* link down from port */ | ||
246 | BFA_FCS_FABRIC_SM_LINK_UP = 4, /* link up from port */ | ||
247 | BFA_FCS_FABRIC_SM_CONT_OP = 5, /* flogi/auth continue op */ | ||
248 | BFA_FCS_FABRIC_SM_RETRY_OP = 6, /* flogi/auth retry op */ | ||
249 | BFA_FCS_FABRIC_SM_NO_FABRIC = 7, /* from flogi/auth */ | ||
250 | BFA_FCS_FABRIC_SM_PERF_EVFP = 8, /* from flogi/auth */ | ||
251 | BFA_FCS_FABRIC_SM_ISOLATE = 9, /* from EVFP processing */ | ||
252 | BFA_FCS_FABRIC_SM_NO_TAGGING = 10, /* no VFT tagging from EVFP */ | ||
253 | BFA_FCS_FABRIC_SM_DELAYED = 11, /* timeout delay event */ | ||
254 | BFA_FCS_FABRIC_SM_AUTH_FAILED = 12, /* auth failed */ | ||
255 | BFA_FCS_FABRIC_SM_AUTH_SUCCESS = 13, /* auth successful */ | ||
256 | BFA_FCS_FABRIC_SM_DELCOMP = 14, /* all vports deleted event */ | ||
257 | BFA_FCS_FABRIC_SM_LOOPBACK = 15, /* Received our own FLOGI */ | ||
258 | BFA_FCS_FABRIC_SM_START = 16, /* from driver */ | ||
259 | }; | ||
260 | 199 | ||
261 | static void bfa_fcs_fabric_sm_uninit(struct bfa_fcs_fabric_s *fabric, | 200 | static void bfa_fcs_fabric_sm_uninit(struct bfa_fcs_fabric_s *fabric, |
262 | enum bfa_fcs_fabric_event event); | 201 | enum bfa_fcs_fabric_event event); |
@@ -270,14 +209,8 @@ static void bfa_fcs_fabric_sm_flogi_retry(struct bfa_fcs_fabric_s *fabric, | |||
270 | enum bfa_fcs_fabric_event event); | 209 | enum bfa_fcs_fabric_event event); |
271 | static void bfa_fcs_fabric_sm_auth(struct bfa_fcs_fabric_s *fabric, | 210 | static void bfa_fcs_fabric_sm_auth(struct bfa_fcs_fabric_s *fabric, |
272 | enum bfa_fcs_fabric_event event); | 211 | enum bfa_fcs_fabric_event event); |
273 | static void bfa_fcs_fabric_sm_auth_failed(struct bfa_fcs_fabric_s *fabric, | ||
274 | enum bfa_fcs_fabric_event event); | ||
275 | static void bfa_fcs_fabric_sm_loopback(struct bfa_fcs_fabric_s *fabric, | ||
276 | enum bfa_fcs_fabric_event event); | ||
277 | static void bfa_fcs_fabric_sm_nofabric(struct bfa_fcs_fabric_s *fabric, | 212 | static void bfa_fcs_fabric_sm_nofabric(struct bfa_fcs_fabric_s *fabric, |
278 | enum bfa_fcs_fabric_event event); | 213 | enum bfa_fcs_fabric_event event); |
279 | static void bfa_fcs_fabric_sm_online(struct bfa_fcs_fabric_s *fabric, | ||
280 | enum bfa_fcs_fabric_event event); | ||
281 | static void bfa_fcs_fabric_sm_evfp(struct bfa_fcs_fabric_s *fabric, | 214 | static void bfa_fcs_fabric_sm_evfp(struct bfa_fcs_fabric_s *fabric, |
282 | enum bfa_fcs_fabric_event event); | 215 | enum bfa_fcs_fabric_event event); |
283 | static void bfa_fcs_fabric_sm_evfp_done(struct bfa_fcs_fabric_s *fabric, | 216 | static void bfa_fcs_fabric_sm_evfp_done(struct bfa_fcs_fabric_s *fabric, |
@@ -337,7 +270,7 @@ bfa_fcs_fabric_sm_created(struct bfa_fcs_fabric_s *fabric, | |||
337 | 270 | ||
338 | case BFA_FCS_FABRIC_SM_DELETE: | 271 | case BFA_FCS_FABRIC_SM_DELETE: |
339 | bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_uninit); | 272 | bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_uninit); |
340 | bfa_fcs_modexit_comp(fabric->fcs); | 273 | bfa_wc_down(&fabric->fcs->wc); |
341 | break; | 274 | break; |
342 | 275 | ||
343 | default: | 276 | default: |
@@ -410,7 +343,7 @@ bfa_fcs_fabric_sm_flogi(struct bfa_fcs_fabric_s *fabric, | |||
410 | 343 | ||
411 | case BFA_FCS_FABRIC_SM_LOOPBACK: | 344 | case BFA_FCS_FABRIC_SM_LOOPBACK: |
412 | bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_loopback); | 345 | bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_loopback); |
413 | bfa_lps_discard(fabric->lps); | 346 | bfa_sm_send_event(fabric->lps, BFA_LPS_SM_OFFLINE); |
414 | bfa_fcs_fabric_set_opertype(fabric); | 347 | bfa_fcs_fabric_set_opertype(fabric); |
415 | break; | 348 | break; |
416 | 349 | ||
@@ -424,12 +357,12 @@ bfa_fcs_fabric_sm_flogi(struct bfa_fcs_fabric_s *fabric, | |||
424 | 357 | ||
425 | case BFA_FCS_FABRIC_SM_LINK_DOWN: | 358 | case BFA_FCS_FABRIC_SM_LINK_DOWN: |
426 | bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_linkdown); | 359 | bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_linkdown); |
427 | bfa_lps_discard(fabric->lps); | 360 | bfa_sm_send_event(fabric->lps, BFA_LPS_SM_OFFLINE); |
428 | break; | 361 | break; |
429 | 362 | ||
430 | case BFA_FCS_FABRIC_SM_DELETE: | 363 | case BFA_FCS_FABRIC_SM_DELETE: |
431 | bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_deleting); | 364 | bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_deleting); |
432 | bfa_lps_discard(fabric->lps); | 365 | bfa_sm_send_event(fabric->lps, BFA_LPS_SM_OFFLINE); |
433 | bfa_fcs_fabric_delete(fabric); | 366 | bfa_fcs_fabric_delete(fabric); |
434 | break; | 367 | break; |
435 | 368 | ||
@@ -481,7 +414,7 @@ bfa_fcs_fabric_sm_auth(struct bfa_fcs_fabric_s *fabric, | |||
481 | switch (event) { | 414 | switch (event) { |
482 | case BFA_FCS_FABRIC_SM_AUTH_FAILED: | 415 | case BFA_FCS_FABRIC_SM_AUTH_FAILED: |
483 | bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_auth_failed); | 416 | bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_auth_failed); |
484 | bfa_lps_discard(fabric->lps); | 417 | bfa_sm_send_event(fabric->lps, BFA_LPS_SM_OFFLINE); |
485 | break; | 418 | break; |
486 | 419 | ||
487 | case BFA_FCS_FABRIC_SM_AUTH_SUCCESS: | 420 | case BFA_FCS_FABRIC_SM_AUTH_SUCCESS: |
@@ -495,7 +428,7 @@ bfa_fcs_fabric_sm_auth(struct bfa_fcs_fabric_s *fabric, | |||
495 | 428 | ||
496 | case BFA_FCS_FABRIC_SM_LINK_DOWN: | 429 | case BFA_FCS_FABRIC_SM_LINK_DOWN: |
497 | bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_linkdown); | 430 | bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_linkdown); |
498 | bfa_lps_discard(fabric->lps); | 431 | bfa_sm_send_event(fabric->lps, BFA_LPS_SM_OFFLINE); |
499 | break; | 432 | break; |
500 | 433 | ||
501 | case BFA_FCS_FABRIC_SM_DELETE: | 434 | case BFA_FCS_FABRIC_SM_DELETE: |
@@ -511,7 +444,7 @@ bfa_fcs_fabric_sm_auth(struct bfa_fcs_fabric_s *fabric, | |||
511 | /* | 444 | /* |
512 | * Authentication failed | 445 | * Authentication failed |
513 | */ | 446 | */ |
514 | static void | 447 | void |
515 | bfa_fcs_fabric_sm_auth_failed(struct bfa_fcs_fabric_s *fabric, | 448 | bfa_fcs_fabric_sm_auth_failed(struct bfa_fcs_fabric_s *fabric, |
516 | enum bfa_fcs_fabric_event event) | 449 | enum bfa_fcs_fabric_event event) |
517 | { | 450 | { |
@@ -537,7 +470,7 @@ bfa_fcs_fabric_sm_auth_failed(struct bfa_fcs_fabric_s *fabric, | |||
537 | /* | 470 | /* |
538 | * Port is in loopback mode. | 471 | * Port is in loopback mode. |
539 | */ | 472 | */ |
540 | static void | 473 | void |
541 | bfa_fcs_fabric_sm_loopback(struct bfa_fcs_fabric_s *fabric, | 474 | bfa_fcs_fabric_sm_loopback(struct bfa_fcs_fabric_s *fabric, |
542 | enum bfa_fcs_fabric_event event) | 475 | enum bfa_fcs_fabric_event event) |
543 | { | 476 | { |
@@ -573,7 +506,7 @@ bfa_fcs_fabric_sm_nofabric(struct bfa_fcs_fabric_s *fabric, | |||
573 | switch (event) { | 506 | switch (event) { |
574 | case BFA_FCS_FABRIC_SM_LINK_DOWN: | 507 | case BFA_FCS_FABRIC_SM_LINK_DOWN: |
575 | bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_linkdown); | 508 | bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_linkdown); |
576 | bfa_lps_discard(fabric->lps); | 509 | bfa_sm_send_event(fabric->lps, BFA_LPS_SM_OFFLINE); |
577 | bfa_fcs_fabric_notify_offline(fabric); | 510 | bfa_fcs_fabric_notify_offline(fabric); |
578 | break; | 511 | break; |
579 | 512 | ||
@@ -596,7 +529,7 @@ bfa_fcs_fabric_sm_nofabric(struct bfa_fcs_fabric_s *fabric, | |||
596 | /* | 529 | /* |
597 | * Fabric is online - normal operating state. | 530 | * Fabric is online - normal operating state. |
598 | */ | 531 | */ |
599 | static void | 532 | void |
600 | bfa_fcs_fabric_sm_online(struct bfa_fcs_fabric_s *fabric, | 533 | bfa_fcs_fabric_sm_online(struct bfa_fcs_fabric_s *fabric, |
601 | enum bfa_fcs_fabric_event event) | 534 | enum bfa_fcs_fabric_event event) |
602 | { | 535 | { |
@@ -606,7 +539,7 @@ bfa_fcs_fabric_sm_online(struct bfa_fcs_fabric_s *fabric, | |||
606 | switch (event) { | 539 | switch (event) { |
607 | case BFA_FCS_FABRIC_SM_LINK_DOWN: | 540 | case BFA_FCS_FABRIC_SM_LINK_DOWN: |
608 | bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_linkdown); | 541 | bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_linkdown); |
609 | bfa_lps_discard(fabric->lps); | 542 | bfa_sm_send_event(fabric->lps, BFA_LPS_SM_OFFLINE); |
610 | bfa_fcs_fabric_notify_offline(fabric); | 543 | bfa_fcs_fabric_notify_offline(fabric); |
611 | break; | 544 | break; |
612 | 545 | ||
@@ -617,7 +550,7 @@ bfa_fcs_fabric_sm_online(struct bfa_fcs_fabric_s *fabric, | |||
617 | 550 | ||
618 | case BFA_FCS_FABRIC_SM_AUTH_FAILED: | 551 | case BFA_FCS_FABRIC_SM_AUTH_FAILED: |
619 | bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_auth_failed); | 552 | bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_auth_failed); |
620 | bfa_lps_discard(fabric->lps); | 553 | bfa_sm_send_event(fabric->lps, BFA_LPS_SM_OFFLINE); |
621 | break; | 554 | break; |
622 | 555 | ||
623 | case BFA_FCS_FABRIC_SM_AUTH_SUCCESS: | 556 | case BFA_FCS_FABRIC_SM_AUTH_SUCCESS: |
@@ -697,7 +630,7 @@ bfa_fcs_fabric_sm_deleting(struct bfa_fcs_fabric_s *fabric, | |||
697 | switch (event) { | 630 | switch (event) { |
698 | case BFA_FCS_FABRIC_SM_DELCOMP: | 631 | case BFA_FCS_FABRIC_SM_DELCOMP: |
699 | bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_uninit); | 632 | bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_uninit); |
700 | bfa_fcs_modexit_comp(fabric->fcs); | 633 | bfa_wc_down(&fabric->fcs->wc); |
701 | break; | 634 | break; |
702 | 635 | ||
703 | case BFA_FCS_FABRIC_SM_LINK_UP: | 636 | case BFA_FCS_FABRIC_SM_LINK_UP: |
@@ -724,8 +657,8 @@ bfa_fcs_fabric_init(struct bfa_fcs_fabric_s *fabric) | |||
724 | struct bfa_lport_cfg_s *port_cfg = &fabric->bport.port_cfg; | 657 | struct bfa_lport_cfg_s *port_cfg = &fabric->bport.port_cfg; |
725 | 658 | ||
726 | port_cfg->roles = BFA_LPORT_ROLE_FCP_IM; | 659 | port_cfg->roles = BFA_LPORT_ROLE_FCP_IM; |
727 | port_cfg->nwwn = bfa_ioc_get_nwwn(&fabric->fcs->bfa->ioc); | 660 | port_cfg->nwwn = fabric->fcs->bfa->ioc.attr->nwwn; |
728 | port_cfg->pwwn = bfa_ioc_get_pwwn(&fabric->fcs->bfa->ioc); | 661 | port_cfg->pwwn = fabric->fcs->bfa->ioc.attr->pwwn; |
729 | } | 662 | } |
730 | 663 | ||
731 | /* | 664 | /* |
@@ -813,7 +746,7 @@ bfa_cb_lps_flogi_comp(void *bfad, void *uarg, bfa_status_t status) | |||
813 | return; | 746 | return; |
814 | 747 | ||
815 | case BFA_STATUS_EPROTOCOL: | 748 | case BFA_STATUS_EPROTOCOL: |
816 | switch (bfa_lps_get_extstatus(fabric->lps)) { | 749 | switch (fabric->lps->ext_status) { |
817 | case BFA_EPROTO_BAD_ACCEPT: | 750 | case BFA_EPROTO_BAD_ACCEPT: |
818 | fabric->stats.flogi_acc_err++; | 751 | fabric->stats.flogi_acc_err++; |
819 | break; | 752 | break; |
@@ -840,26 +773,26 @@ bfa_cb_lps_flogi_comp(void *bfad, void *uarg, bfa_status_t status) | |||
840 | return; | 773 | return; |
841 | } | 774 | } |
842 | 775 | ||
843 | fabric->bb_credit = bfa_lps_get_peer_bbcredit(fabric->lps); | 776 | fabric->bb_credit = fabric->lps->pr_bbcred; |
844 | bfa_trc(fabric->fcs, fabric->bb_credit); | 777 | bfa_trc(fabric->fcs, fabric->bb_credit); |
845 | 778 | ||
846 | if (!bfa_lps_is_brcd_fabric(fabric->lps)) | 779 | if (!(fabric->lps->brcd_switch)) |
847 | fabric->fabric_name = bfa_lps_get_peer_nwwn(fabric->lps); | 780 | fabric->fabric_name = fabric->lps->pr_nwwn; |
848 | 781 | ||
849 | /* | 782 | /* |
850 | * Check port type. It should be 1 = F-port. | 783 | * Check port type. It should be 1 = F-port. |
851 | */ | 784 | */ |
852 | if (bfa_lps_is_fport(fabric->lps)) { | 785 | if (fabric->lps->fport) { |
853 | fabric->bport.pid = bfa_lps_get_pid(fabric->lps); | 786 | fabric->bport.pid = fabric->lps->lp_pid; |
854 | fabric->is_npiv = bfa_lps_is_npiv_en(fabric->lps); | 787 | fabric->is_npiv = fabric->lps->npiv_en; |
855 | fabric->is_auth = bfa_lps_is_authreq(fabric->lps); | 788 | fabric->is_auth = fabric->lps->auth_req; |
856 | bfa_sm_send_event(fabric, BFA_FCS_FABRIC_SM_CONT_OP); | 789 | bfa_sm_send_event(fabric, BFA_FCS_FABRIC_SM_CONT_OP); |
857 | } else { | 790 | } else { |
858 | /* | 791 | /* |
859 | * Nport-2-Nport direct attached | 792 | * Nport-2-Nport direct attached |
860 | */ | 793 | */ |
861 | fabric->bport.port_topo.pn2n.rem_port_wwn = | 794 | fabric->bport.port_topo.pn2n.rem_port_wwn = |
862 | bfa_lps_get_peer_pwwn(fabric->lps); | 795 | fabric->lps->pr_pwwn; |
863 | bfa_sm_send_event(fabric, BFA_FCS_FABRIC_SM_NO_FABRIC); | 796 | bfa_sm_send_event(fabric, BFA_FCS_FABRIC_SM_NO_FABRIC); |
864 | } | 797 | } |
865 | 798 | ||
@@ -1038,23 +971,6 @@ bfa_fcs_fabric_modstart(struct bfa_fcs_s *fcs) | |||
1038 | bfa_sm_send_event(fabric, BFA_FCS_FABRIC_SM_START); | 971 | bfa_sm_send_event(fabric, BFA_FCS_FABRIC_SM_START); |
1039 | } | 972 | } |
1040 | 973 | ||
1041 | bfa_boolean_t | ||
1042 | bfa_fcs_fabric_is_loopback(struct bfa_fcs_fabric_s *fabric) | ||
1043 | { | ||
1044 | return bfa_sm_cmp_state(fabric, bfa_fcs_fabric_sm_loopback); | ||
1045 | } | ||
1046 | |||
1047 | bfa_boolean_t | ||
1048 | bfa_fcs_fabric_is_auth_failed(struct bfa_fcs_fabric_s *fabric) | ||
1049 | { | ||
1050 | return bfa_sm_cmp_state(fabric, bfa_fcs_fabric_sm_auth_failed); | ||
1051 | } | ||
1052 | |||
1053 | enum bfa_port_type | ||
1054 | bfa_fcs_fabric_port_type(struct bfa_fcs_fabric_s *fabric) | ||
1055 | { | ||
1056 | return fabric->oper_type; | ||
1057 | } | ||
1058 | 974 | ||
1059 | /* | 975 | /* |
1060 | * Link up notification from BFA physical port module. | 976 | * Link up notification from BFA physical port module. |
@@ -1115,28 +1031,6 @@ bfa_fcs_fabric_delvport(struct bfa_fcs_fabric_s *fabric, | |||
1115 | bfa_wc_down(&fabric->wc); | 1031 | bfa_wc_down(&fabric->wc); |
1116 | } | 1032 | } |
1117 | 1033 | ||
1118 | /* | ||
1119 | * Base port is deleted. | ||
1120 | */ | ||
1121 | void | ||
1122 | bfa_fcs_fabric_port_delete_comp(struct bfa_fcs_fabric_s *fabric) | ||
1123 | { | ||
1124 | bfa_wc_down(&fabric->wc); | ||
1125 | } | ||
1126 | |||
1127 | |||
1128 | /* | ||
1129 | * Check if fabric is online. | ||
1130 | * | ||
1131 | * param[in] fabric - Fabric instance. This can be a base fabric or vf. | ||
1132 | * | ||
1133 | * @return TRUE/FALSE | ||
1134 | */ | ||
1135 | int | ||
1136 | bfa_fcs_fabric_is_online(struct bfa_fcs_fabric_s *fabric) | ||
1137 | { | ||
1138 | return bfa_sm_cmp_state(fabric, bfa_fcs_fabric_sm_online); | ||
1139 | } | ||
1140 | 1034 | ||
1141 | /* | 1035 | /* |
1142 | * Lookup for a vport withing a fabric given its pwwn | 1036 | * Lookup for a vport withing a fabric given its pwwn |
@@ -1156,18 +1050,6 @@ bfa_fcs_fabric_vport_lookup(struct bfa_fcs_fabric_s *fabric, wwn_t pwwn) | |||
1156 | return NULL; | 1050 | return NULL; |
1157 | } | 1051 | } |
1158 | 1052 | ||
1159 | /* | ||
1160 | * In a given fabric, return the number of lports. | ||
1161 | * | ||
1162 | * param[in] fabric - Fabric instance. This can be a base fabric or vf. | ||
1163 | * | ||
1164 | * @return : 1 or more. | ||
1165 | */ | ||
1166 | u16 | ||
1167 | bfa_fcs_fabric_vport_count(struct bfa_fcs_fabric_s *fabric) | ||
1168 | { | ||
1169 | return fabric->num_vports; | ||
1170 | } | ||
1171 | 1053 | ||
1172 | /* | 1054 | /* |
1173 | * Get OUI of the attached switch. | 1055 | * Get OUI of the attached switch. |
@@ -1187,7 +1069,7 @@ bfa_fcs_fabric_get_switch_oui(struct bfa_fcs_fabric_s *fabric) | |||
1187 | u8 *tmp; | 1069 | u8 *tmp; |
1188 | u16 oui; | 1070 | u16 oui; |
1189 | 1071 | ||
1190 | fab_nwwn = bfa_lps_get_peer_nwwn(fabric->lps); | 1072 | fab_nwwn = fabric->lps->pr_nwwn; |
1191 | 1073 | ||
1192 | tmp = (u8 *)&fab_nwwn; | 1074 | tmp = (u8 *)&fab_nwwn; |
1193 | oui = (tmp[3] << 8) | tmp[4]; | 1075 | oui = (tmp[3] << 8) | tmp[4]; |
@@ -1344,7 +1226,7 @@ bfa_fcs_fabric_send_flogi_acc(struct bfa_fcs_fabric_s *fabric) | |||
1344 | bfa_fcport_get_maxfrsize(bfa), | 1226 | bfa_fcport_get_maxfrsize(bfa), |
1345 | bfa_fcport_get_rx_bbcredit(bfa)); | 1227 | bfa_fcport_get_rx_bbcredit(bfa)); |
1346 | 1228 | ||
1347 | bfa_fcxp_send(fcxp, NULL, fabric->vf_id, bfa_lps_get_tag(fabric->lps), | 1229 | bfa_fcxp_send(fcxp, NULL, fabric->vf_id, fabric->lps->lp_tag, |
1348 | BFA_FALSE, FC_CLASS_3, | 1230 | BFA_FALSE, FC_CLASS_3, |
1349 | reqlen, &fchs, bfa_fcs_fabric_flogiacc_comp, fabric, | 1231 | reqlen, &fchs, bfa_fcs_fabric_flogiacc_comp, fabric, |
1350 | FC_MAX_PDUSZ, 0); | 1232 | FC_MAX_PDUSZ, 0); |
diff --git a/drivers/scsi/bfa/bfa_fcs.h b/drivers/scsi/bfa/bfa_fcs.h index fcb54e5ef331..e7977ee32992 100644 --- a/drivers/scsi/bfa/bfa_fcs.h +++ b/drivers/scsi/bfa/bfa_fcs.h | |||
@@ -27,6 +27,21 @@ | |||
27 | #define BFA_FCS_OS_STR_LEN 64 | 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 | * !!! Only append to the enums defined here to avoid any versioning | 45 | * !!! Only append to the enums defined here to avoid any versioning |
31 | * !!! needed between trace utility and driver version | 46 | * !!! needed between trace utility and driver version |
32 | */ | 47 | */ |
@@ -41,7 +56,6 @@ enum { | |||
41 | struct bfa_fcs_s; | 56 | struct bfa_fcs_s; |
42 | 57 | ||
43 | #define __fcs_min_cfg(__fcs) ((__fcs)->min_cfg) | 58 | #define __fcs_min_cfg(__fcs) ((__fcs)->min_cfg) |
44 | void bfa_fcs_modexit_comp(struct bfa_fcs_s *fcs); | ||
45 | 59 | ||
46 | #define BFA_FCS_BRCD_SWITCH_OUI 0x051e | 60 | #define BFA_FCS_BRCD_SWITCH_OUI 0x051e |
47 | #define N2N_LOCAL_PID 0x010000 | 61 | #define N2N_LOCAL_PID 0x010000 |
@@ -444,9 +458,6 @@ void bfa_fcs_rport_scn(struct bfa_fcs_rport_s *rport); | |||
444 | 458 | ||
445 | struct bfa_fcs_rport_s *bfa_fcs_rport_create(struct bfa_fcs_lport_s *port, | 459 | struct bfa_fcs_rport_s *bfa_fcs_rport_create(struct bfa_fcs_lport_s *port, |
446 | u32 pid); | 460 | u32 pid); |
447 | void bfa_fcs_rport_delete(struct bfa_fcs_rport_s *rport); | ||
448 | void bfa_fcs_rport_online(struct bfa_fcs_rport_s *rport); | ||
449 | void bfa_fcs_rport_offline(struct bfa_fcs_rport_s *rport); | ||
450 | void bfa_fcs_rport_start(struct bfa_fcs_lport_s *port, struct fchs_s *rx_fchs, | 461 | void bfa_fcs_rport_start(struct bfa_fcs_lport_s *port, struct fchs_s *rx_fchs, |
451 | struct fc_logi_s *plogi_rsp); | 462 | struct fc_logi_s *plogi_rsp); |
452 | void bfa_fcs_rport_plogi_create(struct bfa_fcs_lport_s *port, | 463 | void bfa_fcs_rport_plogi_create(struct bfa_fcs_lport_s *port, |
@@ -454,10 +465,8 @@ void bfa_fcs_rport_plogi_create(struct bfa_fcs_lport_s *port, | |||
454 | struct fc_logi_s *plogi); | 465 | struct fc_logi_s *plogi); |
455 | void bfa_fcs_rport_plogi(struct bfa_fcs_rport_s *rport, struct fchs_s *fchs, | 466 | void bfa_fcs_rport_plogi(struct bfa_fcs_rport_s *rport, struct fchs_s *fchs, |
456 | struct fc_logi_s *plogi); | 467 | struct fc_logi_s *plogi); |
457 | void bfa_fcs_rport_logo_imp(struct bfa_fcs_rport_s *rport); | ||
458 | void bfa_fcs_rport_prlo(struct bfa_fcs_rport_s *rport, __be16 ox_id); | 468 | void bfa_fcs_rport_prlo(struct bfa_fcs_rport_s *rport, __be16 ox_id); |
459 | 469 | ||
460 | void bfa_fcs_rport_itnim_ack(struct bfa_fcs_rport_s *rport); | ||
461 | void bfa_fcs_rport_itntm_ack(struct bfa_fcs_rport_s *rport); | 470 | void bfa_fcs_rport_itntm_ack(struct bfa_fcs_rport_s *rport); |
462 | void bfa_fcs_rport_fcptm_offline_done(struct bfa_fcs_rport_s *rport); | 471 | void bfa_fcs_rport_fcptm_offline_done(struct bfa_fcs_rport_s *rport); |
463 | int bfa_fcs_rport_get_state(struct bfa_fcs_rport_s *rport); | 472 | int bfa_fcs_rport_get_state(struct bfa_fcs_rport_s *rport); |
@@ -648,6 +657,57 @@ struct bfa_fcs_s { | |||
648 | }; | 657 | }; |
649 | 658 | ||
650 | /* | 659 | /* |
660 | * fcs_fabric_sm fabric state machine functions | ||
661 | */ | ||
662 | |||
663 | /* | ||
664 | * Fabric state machine events | ||
665 | */ | ||
666 | enum bfa_fcs_fabric_event { | ||
667 | BFA_FCS_FABRIC_SM_CREATE = 1, /* create from driver */ | ||
668 | BFA_FCS_FABRIC_SM_DELETE = 2, /* delete from driver */ | ||
669 | BFA_FCS_FABRIC_SM_LINK_DOWN = 3, /* link down from port */ | ||
670 | BFA_FCS_FABRIC_SM_LINK_UP = 4, /* link up from port */ | ||
671 | BFA_FCS_FABRIC_SM_CONT_OP = 5, /* flogi/auth continue op */ | ||
672 | BFA_FCS_FABRIC_SM_RETRY_OP = 6, /* flogi/auth retry op */ | ||
673 | BFA_FCS_FABRIC_SM_NO_FABRIC = 7, /* from flogi/auth */ | ||
674 | BFA_FCS_FABRIC_SM_PERF_EVFP = 8, /* from flogi/auth */ | ||
675 | BFA_FCS_FABRIC_SM_ISOLATE = 9, /* from EVFP processing */ | ||
676 | BFA_FCS_FABRIC_SM_NO_TAGGING = 10, /* no VFT tagging from EVFP */ | ||
677 | BFA_FCS_FABRIC_SM_DELAYED = 11, /* timeout delay event */ | ||
678 | BFA_FCS_FABRIC_SM_AUTH_FAILED = 12, /* auth failed */ | ||
679 | BFA_FCS_FABRIC_SM_AUTH_SUCCESS = 13, /* auth successful */ | ||
680 | BFA_FCS_FABRIC_SM_DELCOMP = 14, /* all vports deleted event */ | ||
681 | BFA_FCS_FABRIC_SM_LOOPBACK = 15, /* Received our own FLOGI */ | ||
682 | BFA_FCS_FABRIC_SM_START = 16, /* from driver */ | ||
683 | }; | ||
684 | |||
685 | /* | ||
686 | * fcs_rport_sm FCS rport state machine events | ||
687 | */ | ||
688 | |||
689 | enum rport_event { | ||
690 | RPSM_EVENT_PLOGI_SEND = 1, /* new rport; start with PLOGI */ | ||
691 | RPSM_EVENT_PLOGI_RCVD = 2, /* Inbound PLOGI from remote port */ | ||
692 | RPSM_EVENT_PLOGI_COMP = 3, /* PLOGI completed to rport */ | ||
693 | RPSM_EVENT_LOGO_RCVD = 4, /* LOGO from remote device */ | ||
694 | RPSM_EVENT_LOGO_IMP = 5, /* implicit logo for SLER */ | ||
695 | RPSM_EVENT_FCXP_SENT = 6, /* Frame from has been sent */ | ||
696 | RPSM_EVENT_DELETE = 7, /* RPORT delete request */ | ||
697 | RPSM_EVENT_SCN = 8, /* state change notification */ | ||
698 | RPSM_EVENT_ACCEPTED = 9, /* Good response from remote device */ | ||
699 | RPSM_EVENT_FAILED = 10, /* Request to rport failed. */ | ||
700 | RPSM_EVENT_TIMEOUT = 11, /* Rport SM timeout event */ | ||
701 | RPSM_EVENT_HCB_ONLINE = 12, /* BFA rport online callback */ | ||
702 | RPSM_EVENT_HCB_OFFLINE = 13, /* BFA rport offline callback */ | ||
703 | RPSM_EVENT_FC4_OFFLINE = 14, /* FC-4 offline complete */ | ||
704 | RPSM_EVENT_ADDRESS_CHANGE = 15, /* Rport's PID has changed */ | ||
705 | RPSM_EVENT_ADDRESS_DISC = 16, /* Need to Discover rport's PID */ | ||
706 | RPSM_EVENT_PRLO_RCVD = 17, /* PRLO from remote device */ | ||
707 | RPSM_EVENT_PLOGI_RETRY = 18, /* Retry PLOGI continously */ | ||
708 | }; | ||
709 | |||
710 | /* | ||
651 | * bfa fcs API functions | 711 | * bfa fcs API functions |
652 | */ | 712 | */ |
653 | void bfa_fcs_attach(struct bfa_fcs_s *fcs, struct bfa_s *bfa, | 713 | void bfa_fcs_attach(struct bfa_fcs_s *fcs, struct bfa_s *bfa, |
@@ -656,16 +716,12 @@ void bfa_fcs_attach(struct bfa_fcs_s *fcs, struct bfa_s *bfa, | |||
656 | void bfa_fcs_init(struct bfa_fcs_s *fcs); | 716 | void bfa_fcs_init(struct bfa_fcs_s *fcs); |
657 | void bfa_fcs_driver_info_init(struct bfa_fcs_s *fcs, | 717 | void bfa_fcs_driver_info_init(struct bfa_fcs_s *fcs, |
658 | struct bfa_fcs_driver_info_s *driver_info); | 718 | struct bfa_fcs_driver_info_s *driver_info); |
659 | void bfa_fcs_set_fdmi_param(struct bfa_fcs_s *fcs, bfa_boolean_t fdmi_enable); | ||
660 | void bfa_fcs_exit(struct bfa_fcs_s *fcs); | 719 | void bfa_fcs_exit(struct bfa_fcs_s *fcs); |
661 | void bfa_fcs_trc_init(struct bfa_fcs_s *fcs, struct bfa_trc_mod_s *trcmod); | ||
662 | void bfa_fcs_start(struct bfa_fcs_s *fcs); | ||
663 | 720 | ||
664 | /* | 721 | /* |
665 | * bfa fcs vf public functions | 722 | * bfa fcs vf public functions |
666 | */ | 723 | */ |
667 | bfa_fcs_vf_t *bfa_fcs_vf_lookup(struct bfa_fcs_s *fcs, u16 vf_id); | 724 | bfa_fcs_vf_t *bfa_fcs_vf_lookup(struct bfa_fcs_s *fcs, u16 vf_id); |
668 | u16 bfa_fcs_fabric_vport_count(struct bfa_fcs_fabric_s *fabric); | ||
669 | 725 | ||
670 | /* | 726 | /* |
671 | * fabric protected interface functions | 727 | * fabric protected interface functions |
@@ -679,22 +735,23 @@ void bfa_fcs_fabric_addvport(struct bfa_fcs_fabric_s *fabric, | |||
679 | struct bfa_fcs_vport_s *vport); | 735 | struct bfa_fcs_vport_s *vport); |
680 | void bfa_fcs_fabric_delvport(struct bfa_fcs_fabric_s *fabric, | 736 | void bfa_fcs_fabric_delvport(struct bfa_fcs_fabric_s *fabric, |
681 | struct bfa_fcs_vport_s *vport); | 737 | struct bfa_fcs_vport_s *vport); |
682 | int bfa_fcs_fabric_is_online(struct bfa_fcs_fabric_s *fabric); | ||
683 | struct bfa_fcs_vport_s *bfa_fcs_fabric_vport_lookup( | 738 | struct bfa_fcs_vport_s *bfa_fcs_fabric_vport_lookup( |
684 | struct bfa_fcs_fabric_s *fabric, wwn_t pwwn); | 739 | struct bfa_fcs_fabric_s *fabric, wwn_t pwwn); |
685 | void bfa_fcs_fabric_modstart(struct bfa_fcs_s *fcs); | 740 | void bfa_fcs_fabric_modstart(struct bfa_fcs_s *fcs); |
686 | void bfa_fcs_fabric_uf_recv(struct bfa_fcs_fabric_s *fabric, | 741 | void bfa_fcs_fabric_uf_recv(struct bfa_fcs_fabric_s *fabric, |
687 | struct fchs_s *fchs, u16 len); | 742 | struct fchs_s *fchs, u16 len); |
688 | bfa_boolean_t bfa_fcs_fabric_is_loopback(struct bfa_fcs_fabric_s *fabric); | ||
689 | bfa_boolean_t bfa_fcs_fabric_is_auth_failed(struct bfa_fcs_fabric_s *fabric); | ||
690 | enum bfa_port_type bfa_fcs_fabric_port_type(struct bfa_fcs_fabric_s *fabric); | ||
691 | void bfa_fcs_fabric_psymb_init(struct bfa_fcs_fabric_s *fabric); | 743 | void bfa_fcs_fabric_psymb_init(struct bfa_fcs_fabric_s *fabric); |
692 | void bfa_fcs_fabric_port_delete_comp(struct bfa_fcs_fabric_s *fabric); | ||
693 | void bfa_fcs_fabric_set_fabric_name(struct bfa_fcs_fabric_s *fabric, | 744 | void bfa_fcs_fabric_set_fabric_name(struct bfa_fcs_fabric_s *fabric, |
694 | wwn_t fabric_name); | 745 | wwn_t fabric_name); |
695 | u16 bfa_fcs_fabric_get_switch_oui(struct bfa_fcs_fabric_s *fabric); | 746 | u16 bfa_fcs_fabric_get_switch_oui(struct bfa_fcs_fabric_s *fabric); |
696 | void bfa_fcs_uf_attach(struct bfa_fcs_s *fcs); | 747 | void bfa_fcs_uf_attach(struct bfa_fcs_s *fcs); |
697 | void bfa_fcs_port_attach(struct bfa_fcs_s *fcs); | 748 | void bfa_fcs_port_attach(struct bfa_fcs_s *fcs); |
749 | void bfa_fcs_fabric_sm_online(struct bfa_fcs_fabric_s *fabric, | ||
750 | enum bfa_fcs_fabric_event event); | ||
751 | void bfa_fcs_fabric_sm_loopback(struct bfa_fcs_fabric_s *fabric, | ||
752 | enum bfa_fcs_fabric_event event); | ||
753 | void bfa_fcs_fabric_sm_auth_failed(struct bfa_fcs_fabric_s *fabric, | ||
754 | enum bfa_fcs_fabric_event event); | ||
698 | 755 | ||
699 | /* | 756 | /* |
700 | * BFA FCS callback interfaces | 757 | * BFA FCS callback interfaces |
diff --git a/drivers/scsi/bfa/bfa_fcs_fcpim.c b/drivers/scsi/bfa/bfa_fcs_fcpim.c index 413b58eef93a..82ac2798c545 100644 --- a/drivers/scsi/bfa/bfa_fcs_fcpim.c +++ b/drivers/scsi/bfa/bfa_fcs_fcpim.c | |||
@@ -103,7 +103,7 @@ bfa_fcs_itnim_sm_offline(struct bfa_fcs_itnim_s *itnim, | |||
103 | break; | 103 | break; |
104 | 104 | ||
105 | case BFA_FCS_ITNIM_SM_OFFLINE: | 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 | break; | 107 | break; |
108 | 108 | ||
109 | case BFA_FCS_ITNIM_SM_INITIATOR: | 109 | case BFA_FCS_ITNIM_SM_INITIATOR: |
@@ -140,7 +140,7 @@ bfa_fcs_itnim_sm_prli_send(struct bfa_fcs_itnim_s *itnim, | |||
140 | case BFA_FCS_ITNIM_SM_OFFLINE: | 140 | case BFA_FCS_ITNIM_SM_OFFLINE: |
141 | bfa_sm_set_state(itnim, bfa_fcs_itnim_sm_offline); | 141 | bfa_sm_set_state(itnim, bfa_fcs_itnim_sm_offline); |
142 | bfa_fcxp_walloc_cancel(itnim->fcs->bfa, &itnim->fcxp_wqe); | 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 | break; | 144 | break; |
145 | 145 | ||
146 | case BFA_FCS_ITNIM_SM_DELETE: | 146 | case BFA_FCS_ITNIM_SM_DELETE: |
@@ -181,7 +181,7 @@ bfa_fcs_itnim_sm_prli(struct bfa_fcs_itnim_s *itnim, | |||
181 | case BFA_FCS_ITNIM_SM_OFFLINE: | 181 | case BFA_FCS_ITNIM_SM_OFFLINE: |
182 | bfa_sm_set_state(itnim, bfa_fcs_itnim_sm_offline); | 182 | bfa_sm_set_state(itnim, bfa_fcs_itnim_sm_offline); |
183 | bfa_fcxp_discard(itnim->fcxp); | 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 | break; | 185 | break; |
186 | 186 | ||
187 | case BFA_FCS_ITNIM_SM_INITIATOR: | 187 | case BFA_FCS_ITNIM_SM_INITIATOR: |
@@ -217,7 +217,7 @@ bfa_fcs_itnim_sm_prli_retry(struct bfa_fcs_itnim_s *itnim, | |||
217 | } else { | 217 | } else { |
218 | /* invoke target offline */ | 218 | /* invoke target offline */ |
219 | bfa_sm_set_state(itnim, bfa_fcs_itnim_sm_offline); | 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 | break; | 222 | break; |
223 | 223 | ||
@@ -225,7 +225,7 @@ bfa_fcs_itnim_sm_prli_retry(struct bfa_fcs_itnim_s *itnim, | |||
225 | case BFA_FCS_ITNIM_SM_OFFLINE: | 225 | case BFA_FCS_ITNIM_SM_OFFLINE: |
226 | bfa_sm_set_state(itnim, bfa_fcs_itnim_sm_offline); | 226 | bfa_sm_set_state(itnim, bfa_fcs_itnim_sm_offline); |
227 | bfa_timer_stop(&itnim->timer); | 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 | break; | 229 | break; |
230 | 230 | ||
231 | case BFA_FCS_ITNIM_SM_INITIATOR: | 231 | case BFA_FCS_ITNIM_SM_INITIATOR: |
@@ -269,7 +269,7 @@ bfa_fcs_itnim_sm_hcb_online(struct bfa_fcs_itnim_s *itnim, | |||
269 | case BFA_FCS_ITNIM_SM_OFFLINE: | 269 | case BFA_FCS_ITNIM_SM_OFFLINE: |
270 | bfa_sm_set_state(itnim, bfa_fcs_itnim_sm_offline); | 270 | bfa_sm_set_state(itnim, bfa_fcs_itnim_sm_offline); |
271 | bfa_itnim_offline(itnim->bfa_itnim); | 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 | break; | 273 | break; |
274 | 274 | ||
275 | case BFA_FCS_ITNIM_SM_DELETE: | 275 | case BFA_FCS_ITNIM_SM_DELETE: |
@@ -330,7 +330,7 @@ bfa_fcs_itnim_sm_hcb_offline(struct bfa_fcs_itnim_s *itnim, | |||
330 | switch (event) { | 330 | switch (event) { |
331 | case BFA_FCS_ITNIM_SM_HCB_OFFLINE: | 331 | case BFA_FCS_ITNIM_SM_HCB_OFFLINE: |
332 | bfa_sm_set_state(itnim, bfa_fcs_itnim_sm_offline); | 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 | break; | 334 | break; |
335 | 335 | ||
336 | case BFA_FCS_ITNIM_SM_DELETE: | 336 | case BFA_FCS_ITNIM_SM_DELETE: |
@@ -358,7 +358,7 @@ bfa_fcs_itnim_sm_initiator(struct bfa_fcs_itnim_s *itnim, | |||
358 | switch (event) { | 358 | switch (event) { |
359 | case BFA_FCS_ITNIM_SM_OFFLINE: | 359 | case BFA_FCS_ITNIM_SM_OFFLINE: |
360 | bfa_sm_set_state(itnim, bfa_fcs_itnim_sm_offline); | 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 | break; | 362 | break; |
363 | 363 | ||
364 | case BFA_FCS_ITNIM_SM_RSP_ERROR: | 364 | case BFA_FCS_ITNIM_SM_RSP_ERROR: |
@@ -688,7 +688,7 @@ bfa_cb_itnim_sler(void *cb_arg) | |||
688 | 688 | ||
689 | itnim->stats.sler++; | 689 | itnim->stats.sler++; |
690 | bfa_trc(itnim->fcs, itnim->rport->pwwn); | 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 | struct bfa_fcs_itnim_s * | 694 | struct bfa_fcs_itnim_s * |
diff --git a/drivers/scsi/bfa/bfa_fcs_lport.c b/drivers/scsi/bfa/bfa_fcs_lport.c index bd0c093fca66..6e9151fecb74 100644 --- a/drivers/scsi/bfa/bfa_fcs_lport.c +++ b/drivers/scsi/bfa/bfa_fcs_lport.c | |||
@@ -159,7 +159,7 @@ bfa_fcs_lport_sm_online( | |||
159 | bfa_sm_set_state(port, bfa_fcs_lport_sm_deleting); | 159 | bfa_sm_set_state(port, bfa_fcs_lport_sm_deleting); |
160 | list_for_each_safe(qe, qen, &port->rport_q) { | 160 | list_for_each_safe(qe, qen, &port->rport_q) { |
161 | rport = (struct bfa_fcs_rport_s *) qe; | 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 | break; | 165 | break; |
@@ -197,7 +197,7 @@ bfa_fcs_lport_sm_offline( | |||
197 | bfa_sm_set_state(port, bfa_fcs_lport_sm_deleting); | 197 | bfa_sm_set_state(port, bfa_fcs_lport_sm_deleting); |
198 | list_for_each_safe(qe, qen, &port->rport_q) { | 198 | list_for_each_safe(qe, qen, &port->rport_q) { |
199 | rport = (struct bfa_fcs_rport_s *) qe; | 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 | break; | 203 | break; |
@@ -350,7 +350,7 @@ bfa_fcs_lport_plogi(struct bfa_fcs_lport_s *port, | |||
350 | * disappeared. Send implicit LOGO to old device. | 350 | * disappeared. Send implicit LOGO to old device. |
351 | */ | 351 | */ |
352 | bfa_assert(rport->pwwn != plogi->port_name); | 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 | * Inbound PLOGI from a new device (with old PID). | 356 | * Inbound PLOGI from a new device (with old PID). |
@@ -511,7 +511,8 @@ bfa_fcs_lport_offline_actions(struct bfa_fcs_lport_s *port) | |||
511 | __port_action[port->fabric->fab_type].offline(port); | 511 | __port_action[port->fabric->fab_type].offline(port); |
512 | 512 | ||
513 | wwn2str(lpwwn_buf, bfa_fcs_lport_get_pwwn(port)); | 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 | BFA_LOG(KERN_ERR, bfad, bfa_log_level, | 516 | BFA_LOG(KERN_ERR, bfad, bfa_log_level, |
516 | "Logical port lost fabric connectivity: WWN = %s Role = %s\n", | 517 | "Logical port lost fabric connectivity: WWN = %s Role = %s\n", |
517 | lpwwn_buf, "Initiator"); | 518 | lpwwn_buf, "Initiator"); |
@@ -522,7 +523,7 @@ bfa_fcs_lport_offline_actions(struct bfa_fcs_lport_s *port) | |||
522 | 523 | ||
523 | list_for_each_safe(qe, qen, &port->rport_q) { | 524 | list_for_each_safe(qe, qen, &port->rport_q) { |
524 | rport = (struct bfa_fcs_rport_s *) qe; | 525 | rport = (struct bfa_fcs_rport_s *) qe; |
525 | bfa_fcs_rport_offline(rport); | 526 | bfa_sm_send_event(rport, RPSM_EVENT_LOGO_IMP); |
526 | } | 527 | } |
527 | } | 528 | } |
528 | 529 | ||
@@ -584,7 +585,7 @@ bfa_fcs_lport_deleted(struct bfa_fcs_lport_s *port) | |||
584 | port->vport ? port->vport->vport_drv : NULL); | 585 | port->vport ? port->vport->vport_drv : NULL); |
585 | bfa_fcs_vport_delete_comp(port->vport); | 586 | bfa_fcs_vport_delete_comp(port->vport); |
586 | } else { | 587 | } else { |
587 | bfa_fcs_fabric_port_delete_comp(port->fabric); | 588 | bfa_wc_down(&port->fabric->wc); |
588 | } | 589 | } |
589 | } | 590 | } |
590 | 591 | ||
@@ -828,8 +829,8 @@ bfa_fcs_lport_attach(struct bfa_fcs_lport_s *lport, struct bfa_fcs_s *fcs, | |||
828 | lport->fcs = fcs; | 829 | lport->fcs = fcs; |
829 | lport->fabric = bfa_fcs_vf_lookup(fcs, vf_id); | 830 | lport->fabric = bfa_fcs_vf_lookup(fcs, vf_id); |
830 | lport->vport = vport; | 831 | lport->vport = vport; |
831 | lport->lp_tag = (vport) ? bfa_lps_get_tag(vport->lps) : | 832 | lport->lp_tag = (vport) ? vport->lps->lp_tag : |
832 | bfa_lps_get_tag(lport->fabric->lps); | 833 | lport->fabric->lps->lp_tag; |
833 | 834 | ||
834 | INIT_LIST_HEAD(&lport->rport_q); | 835 | INIT_LIST_HEAD(&lport->rport_q); |
835 | lport->num_rports = 0; | 836 | lport->num_rports = 0; |
@@ -881,10 +882,11 @@ bfa_fcs_lport_get_attr( | |||
881 | port_attr->port_cfg = port->port_cfg; | 882 | port_attr->port_cfg = port->port_cfg; |
882 | 883 | ||
883 | if (port->fabric) { | 884 | if (port->fabric) { |
884 | port_attr->port_type = bfa_fcs_fabric_port_type(port->fabric); | 885 | port_attr->port_type = port->fabric->oper_type; |
885 | port_attr->loopback = bfa_fcs_fabric_is_loopback(port->fabric); | 886 | port_attr->loopback = bfa_sm_cmp_state(port->fabric, bfa_fcs_fabric_sm_loopback); |
886 | port_attr->authfail = | 887 | port_attr->authfail = |
887 | bfa_fcs_fabric_is_auth_failed(port->fabric); | 888 | bfa_sm_cmp_state(port->fabric, |
889 | bfa_fcs_fabric_sm_auth_failed); | ||
888 | port_attr->fabric_name = bfa_fcs_lport_get_fabric_name(port); | 890 | port_attr->fabric_name = bfa_fcs_lport_get_fabric_name(port); |
889 | memcpy(port_attr->fabric_ip_addr, | 891 | memcpy(port_attr->fabric_ip_addr, |
890 | bfa_fcs_lport_get_fabric_ipaddr(port), | 892 | bfa_fcs_lport_get_fabric_ipaddr(port), |
@@ -893,10 +895,10 @@ bfa_fcs_lport_get_attr( | |||
893 | if (port->vport != NULL) { | 895 | if (port->vport != NULL) { |
894 | port_attr->port_type = BFA_PORT_TYPE_VPORT; | 896 | port_attr->port_type = BFA_PORT_TYPE_VPORT; |
895 | port_attr->fpma_mac = | 897 | port_attr->fpma_mac = |
896 | bfa_lps_get_lp_mac(port->vport->lps); | 898 | port->vport->lps->lp_mac; |
897 | } else { | 899 | } else { |
898 | port_attr->fpma_mac = | 900 | port_attr->fpma_mac = |
899 | bfa_lps_get_lp_mac(port->fabric->lps); | 901 | port->fabric->lps->lp_mac; |
900 | } | 902 | } |
901 | } else { | 903 | } else { |
902 | port_attr->port_type = BFA_PORT_TYPE_UNKNOWN; | 904 | port_attr->port_type = BFA_PORT_TYPE_UNKNOWN; |
@@ -985,7 +987,7 @@ bfa_fcs_lport_n2n_online(struct bfa_fcs_lport_s *port) | |||
985 | bfa_trc(port->fcs, rport->pid); | 987 | bfa_trc(port->fcs, rport->pid); |
986 | bfa_trc(port->fcs, rport->pwwn); | 988 | bfa_trc(port->fcs, rport->pwwn); |
987 | rport->pid = N2N_REMOTE_PID; | 989 | rport->pid = N2N_REMOTE_PID; |
988 | bfa_fcs_rport_online(rport); | 990 | bfa_sm_send_event(rport, RPSM_EVENT_PLOGI_SEND); |
989 | return; | 991 | return; |
990 | } | 992 | } |
991 | 993 | ||
@@ -998,7 +1000,7 @@ bfa_fcs_lport_n2n_online(struct bfa_fcs_lport_s *port) | |||
998 | bfa_assert(rport != NULL); | 1000 | bfa_assert(rport != NULL); |
999 | if (rport) { | 1001 | if (rport) { |
1000 | bfa_trc(port->fcs, rport->pwwn); | 1002 | bfa_trc(port->fcs, rport->pwwn); |
1001 | bfa_fcs_rport_delete(rport); | 1003 | bfa_sm_send_event(rport, RPSM_EVENT_DELETE); |
1002 | } | 1004 | } |
1003 | } | 1005 | } |
1004 | bfa_fcs_rport_create(port, N2N_REMOTE_PID); | 1006 | bfa_fcs_rport_create(port, N2N_REMOTE_PID); |
@@ -2540,7 +2542,7 @@ bfa_fcs_lport_ms_send_gmal(void *ms_cbarg, struct bfa_fcxp_s *fcxp_alloced) | |||
2540 | 2542 | ||
2541 | len = fc_gmal_req_build(&fchs, bfa_fcxp_get_reqbuf(fcxp), | 2543 | len = fc_gmal_req_build(&fchs, bfa_fcxp_get_reqbuf(fcxp), |
2542 | bfa_fcs_lport_get_fcid(port), | 2544 | bfa_fcs_lport_get_fcid(port), |
2543 | bfa_lps_get_peer_nwwn(port->fabric->lps)); | 2545 | port->fabric->lps->pr_nwwn); |
2544 | 2546 | ||
2545 | bfa_fcxp_send(fcxp, NULL, port->fabric->vf_id, port->lp_tag, BFA_FALSE, | 2547 | bfa_fcxp_send(fcxp, NULL, port->fabric->vf_id, port->lp_tag, BFA_FALSE, |
2546 | FC_CLASS_3, len, &fchs, | 2548 | FC_CLASS_3, len, &fchs, |
@@ -2740,7 +2742,7 @@ bfa_fcs_lport_ms_send_gfn(void *ms_cbarg, struct bfa_fcxp_s *fcxp_alloced) | |||
2740 | 2742 | ||
2741 | len = fc_gfn_req_build(&fchs, bfa_fcxp_get_reqbuf(fcxp), | 2743 | len = fc_gfn_req_build(&fchs, bfa_fcxp_get_reqbuf(fcxp), |
2742 | bfa_fcs_lport_get_fcid(port), | 2744 | bfa_fcs_lport_get_fcid(port), |
2743 | bfa_lps_get_peer_nwwn(port->fabric->lps)); | 2745 | port->fabric->lps->pr_nwwn); |
2744 | 2746 | ||
2745 | bfa_fcxp_send(fcxp, NULL, port->fabric->vf_id, port->lp_tag, BFA_FALSE, | 2747 | bfa_fcxp_send(fcxp, NULL, port->fabric->vf_id, port->lp_tag, BFA_FALSE, |
2746 | FC_CLASS_3, len, &fchs, | 2748 | FC_CLASS_3, len, &fchs, |
@@ -4332,8 +4334,8 @@ bfa_fcs_lport_scn_send_scr(void *scn_cbarg, struct bfa_fcxp_s *fcxp_alloced) | |||
4332 | /* Handle VU registrations for Base port only */ | 4334 | /* Handle VU registrations for Base port only */ |
4333 | if ((!port->vport) && bfa_ioc_get_fcmode(&port->fcs->bfa->ioc)) { | 4335 | if ((!port->vport) && bfa_ioc_get_fcmode(&port->fcs->bfa->ioc)) { |
4334 | len = fc_scr_build(&fchs, bfa_fcxp_get_reqbuf(fcxp), | 4336 | len = fc_scr_build(&fchs, bfa_fcxp_get_reqbuf(fcxp), |
4335 | bfa_lps_is_brcd_fabric(port->fabric->lps), | 4337 | port->fabric->lps->brcd_switch, |
4336 | port->pid, 0); | 4338 | port->pid, 0); |
4337 | } else { | 4339 | } else { |
4338 | len = fc_scr_build(&fchs, bfa_fcxp_get_reqbuf(fcxp), | 4340 | len = fc_scr_build(&fchs, bfa_fcxp_get_reqbuf(fcxp), |
4339 | BFA_FALSE, | 4341 | BFA_FALSE, |
@@ -4833,7 +4835,7 @@ bfa_fcs_lport_get_info(struct bfa_fcs_lport_s *port, | |||
4833 | port_info->max_vports_supp = | 4835 | port_info->max_vports_supp = |
4834 | bfa_lps_get_max_vport(port->fcs->bfa); | 4836 | bfa_lps_get_max_vport(port->fcs->bfa); |
4835 | port_info->num_vports_inuse = | 4837 | port_info->num_vports_inuse = |
4836 | bfa_fcs_fabric_vport_count(port->fabric); | 4838 | port->fabric->num_vports; |
4837 | port_info->max_rports_supp = BFA_FCS_MAX_RPORTS_SUPP; | 4839 | port_info->max_rports_supp = BFA_FCS_MAX_RPORTS_SUPP; |
4838 | port_info->num_rports_inuse = port->num_rports; | 4840 | port_info->num_rports_inuse = port->num_rports; |
4839 | } else { | 4841 | } else { |
@@ -4977,7 +4979,8 @@ bfa_fcs_vport_sm_created(struct bfa_fcs_vport_s *vport, | |||
4977 | 4979 | ||
4978 | switch (event) { | 4980 | switch (event) { |
4979 | case BFA_FCS_VPORT_SM_START: | 4981 | case BFA_FCS_VPORT_SM_START: |
4980 | if (bfa_fcs_fabric_is_online(__vport_fabric(vport)) | 4982 | if (bfa_sm_cmp_state(__vport_fabric(vport), |
4983 | bfa_fcs_fabric_sm_online) | ||
4981 | && bfa_fcs_fabric_npiv_capable(__vport_fabric(vport))) { | 4984 | && bfa_fcs_fabric_npiv_capable(__vport_fabric(vport))) { |
4982 | bfa_sm_set_state(vport, bfa_fcs_vport_sm_fdisc); | 4985 | bfa_sm_set_state(vport, bfa_fcs_vport_sm_fdisc); |
4983 | bfa_fcs_vport_do_fdisc(vport); | 4986 | bfa_fcs_vport_do_fdisc(vport); |
@@ -5060,13 +5063,13 @@ bfa_fcs_vport_sm_fdisc(struct bfa_fcs_vport_s *vport, | |||
5060 | switch (event) { | 5063 | switch (event) { |
5061 | case BFA_FCS_VPORT_SM_DELETE: | 5064 | case BFA_FCS_VPORT_SM_DELETE: |
5062 | bfa_sm_set_state(vport, bfa_fcs_vport_sm_cleanup); | 5065 | bfa_sm_set_state(vport, bfa_fcs_vport_sm_cleanup); |
5063 | bfa_lps_discard(vport->lps); | 5066 | bfa_sm_send_event(vport->lps, BFA_LPS_SM_OFFLINE); |
5064 | bfa_fcs_lport_delete(&vport->lport); | 5067 | bfa_fcs_lport_delete(&vport->lport); |
5065 | break; | 5068 | break; |
5066 | 5069 | ||
5067 | case BFA_FCS_VPORT_SM_OFFLINE: | 5070 | case BFA_FCS_VPORT_SM_OFFLINE: |
5068 | bfa_sm_set_state(vport, bfa_fcs_vport_sm_offline); | 5071 | bfa_sm_set_state(vport, bfa_fcs_vport_sm_offline); |
5069 | bfa_lps_discard(vport->lps); | 5072 | bfa_sm_send_event(vport->lps, BFA_LPS_SM_OFFLINE); |
5070 | break; | 5073 | break; |
5071 | 5074 | ||
5072 | case BFA_FCS_VPORT_SM_RSP_OK: | 5075 | case BFA_FCS_VPORT_SM_RSP_OK: |
@@ -5146,7 +5149,7 @@ bfa_fcs_vport_sm_online(struct bfa_fcs_vport_s *vport, | |||
5146 | 5149 | ||
5147 | case BFA_FCS_VPORT_SM_OFFLINE: | 5150 | case BFA_FCS_VPORT_SM_OFFLINE: |
5148 | bfa_sm_set_state(vport, bfa_fcs_vport_sm_offline); | 5151 | bfa_sm_set_state(vport, bfa_fcs_vport_sm_offline); |
5149 | bfa_lps_discard(vport->lps); | 5152 | bfa_sm_send_event(vport->lps, BFA_LPS_SM_OFFLINE); |
5150 | bfa_fcs_lport_offline(&vport->lport); | 5153 | bfa_fcs_lport_offline(&vport->lport); |
5151 | break; | 5154 | break; |
5152 | 5155 | ||
@@ -5246,7 +5249,7 @@ bfa_fcs_vport_sm_logo(struct bfa_fcs_vport_s *vport, | |||
5246 | 5249 | ||
5247 | switch (event) { | 5250 | switch (event) { |
5248 | case BFA_FCS_VPORT_SM_OFFLINE: | 5251 | case BFA_FCS_VPORT_SM_OFFLINE: |
5249 | bfa_lps_discard(vport->lps); | 5252 | bfa_sm_send_event(vport->lps, BFA_LPS_SM_OFFLINE); |
5250 | /* | 5253 | /* |
5251 | * !!! fall through !!! | 5254 | * !!! fall through !!! |
5252 | */ | 5255 | */ |
@@ -5285,14 +5288,14 @@ bfa_fcs_vport_do_fdisc(struct bfa_fcs_vport_s *vport) | |||
5285 | static void | 5288 | static void |
5286 | bfa_fcs_vport_fdisc_rejected(struct bfa_fcs_vport_s *vport) | 5289 | bfa_fcs_vport_fdisc_rejected(struct bfa_fcs_vport_s *vport) |
5287 | { | 5290 | { |
5288 | u8 lsrjt_rsn = bfa_lps_get_lsrjt_rsn(vport->lps); | 5291 | u8 lsrjt_rsn = vport->lps->lsrjt_rsn; |
5289 | u8 lsrjt_expl = bfa_lps_get_lsrjt_expl(vport->lps); | 5292 | u8 lsrjt_expl = vport->lps->lsrjt_expl; |
5290 | 5293 | ||
5291 | bfa_trc(__vport_fcs(vport), lsrjt_rsn); | 5294 | bfa_trc(__vport_fcs(vport), lsrjt_rsn); |
5292 | bfa_trc(__vport_fcs(vport), lsrjt_expl); | 5295 | bfa_trc(__vport_fcs(vport), lsrjt_expl); |
5293 | 5296 | ||
5294 | /* For certain reason codes, we don't want to retry. */ | 5297 | /* For certain reason codes, we don't want to retry. */ |
5295 | switch (bfa_lps_get_lsrjt_expl(vport->lps)) { | 5298 | switch (vport->lps->lsrjt_expl) { |
5296 | case FC_LS_RJT_EXP_INV_PORT_NAME: /* by brocade */ | 5299 | case FC_LS_RJT_EXP_INV_PORT_NAME: /* by brocade */ |
5297 | case FC_LS_RJT_EXP_INVALID_NPORT_ID: /* by Cisco */ | 5300 | case FC_LS_RJT_EXP_INVALID_NPORT_ID: /* by Cisco */ |
5298 | if (vport->fdisc_retries < BFA_FCS_VPORT_MAX_RETRIES) | 5301 | if (vport->fdisc_retries < BFA_FCS_VPORT_MAX_RETRIES) |
@@ -5456,7 +5459,7 @@ bfa_fcs_vport_create(struct bfa_fcs_vport_s *vport, struct bfa_fcs_s *fcs, | |||
5456 | if (bfa_fcs_vport_lookup(fcs, vf_id, vport_cfg->pwwn) != NULL) | 5459 | if (bfa_fcs_vport_lookup(fcs, vf_id, vport_cfg->pwwn) != NULL) |
5457 | return BFA_STATUS_VPORT_EXISTS; | 5460 | return BFA_STATUS_VPORT_EXISTS; |
5458 | 5461 | ||
5459 | if (bfa_fcs_fabric_vport_count(&fcs->fabric) == | 5462 | if (fcs->fabric.num_vports == |
5460 | bfa_lps_get_max_vport(fcs->bfa)) | 5463 | bfa_lps_get_max_vport(fcs->bfa)) |
5461 | return BFA_STATUS_VPORT_MAX; | 5464 | return BFA_STATUS_VPORT_MAX; |
5462 | 5465 | ||
@@ -5637,7 +5640,7 @@ bfa_cb_lps_fdisc_comp(void *bfad, void *uarg, bfa_status_t status) | |||
5637 | /* | 5640 | /* |
5638 | * Initialiaze the V-Port fields | 5641 | * Initialiaze the V-Port fields |
5639 | */ | 5642 | */ |
5640 | __vport_fcid(vport) = bfa_lps_get_pid(vport->lps); | 5643 | __vport_fcid(vport) = vport->lps->lp_pid; |
5641 | vport->vport_stats.fdisc_accepts++; | 5644 | vport->vport_stats.fdisc_accepts++; |
5642 | bfa_sm_send_event(vport, BFA_FCS_VPORT_SM_RSP_OK); | 5645 | bfa_sm_send_event(vport, BFA_FCS_VPORT_SM_RSP_OK); |
5643 | break; | 5646 | break; |
@@ -5650,7 +5653,7 @@ bfa_cb_lps_fdisc_comp(void *bfad, void *uarg, bfa_status_t status) | |||
5650 | break; | 5653 | break; |
5651 | 5654 | ||
5652 | case BFA_STATUS_EPROTOCOL: | 5655 | case BFA_STATUS_EPROTOCOL: |
5653 | switch (bfa_lps_get_extstatus(vport->lps)) { | 5656 | switch (vport->lps->ext_status) { |
5654 | case BFA_EPROTO_BAD_ACCEPT: | 5657 | case BFA_EPROTO_BAD_ACCEPT: |
5655 | vport->vport_stats.fdisc_acc_bad++; | 5658 | vport->vport_stats.fdisc_acc_bad++; |
5656 | break; | 5659 | break; |
diff --git a/drivers/scsi/bfa/bfa_fcs_rport.c b/drivers/scsi/bfa/bfa_fcs_rport.c index 7928bc8c1ed7..2089d686fa5d 100644 --- a/drivers/scsi/bfa/bfa_fcs_rport.c +++ b/drivers/scsi/bfa/bfa_fcs_rport.c | |||
@@ -75,30 +75,6 @@ static void bfa_fcs_rport_send_ls_rjt(struct bfa_fcs_rport_s *rport, | |||
75 | static void bfa_fcs_rport_process_adisc(struct bfa_fcs_rport_s *rport, | 75 | static void bfa_fcs_rport_process_adisc(struct bfa_fcs_rport_s *rport, |
76 | struct fchs_s *rx_fchs, u16 len); | 76 | struct fchs_s *rx_fchs, u16 len); |
77 | static void bfa_fcs_rport_send_prlo_acc(struct bfa_fcs_rport_s *rport); | 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 | static void bfa_fcs_rport_sm_uninit(struct bfa_fcs_rport_s *rport, | 79 | static void bfa_fcs_rport_sm_uninit(struct bfa_fcs_rport_s *rport, |
104 | enum rport_event event); | 80 | enum rport_event event); |
@@ -498,24 +474,24 @@ bfa_fcs_rport_sm_hal_online(struct bfa_fcs_rport_s *rport, | |||
498 | 474 | ||
499 | case RPSM_EVENT_LOGO_RCVD: | 475 | case RPSM_EVENT_LOGO_RCVD: |
500 | bfa_sm_set_state(rport, bfa_fcs_rport_sm_hcb_logorcv); | 476 | bfa_sm_set_state(rport, bfa_fcs_rport_sm_hcb_logorcv); |
501 | bfa_rport_offline(rport->bfa_rport); | 477 | bfa_sm_send_event(rport->bfa_rport, BFA_RPORT_SM_OFFLINE); |
502 | break; | 478 | break; |
503 | 479 | ||
504 | case RPSM_EVENT_LOGO_IMP: | 480 | case RPSM_EVENT_LOGO_IMP: |
505 | case RPSM_EVENT_ADDRESS_CHANGE: | 481 | case RPSM_EVENT_ADDRESS_CHANGE: |
506 | bfa_sm_set_state(rport, bfa_fcs_rport_sm_hcb_offline); | 482 | bfa_sm_set_state(rport, bfa_fcs_rport_sm_hcb_offline); |
507 | bfa_rport_offline(rport->bfa_rport); | 483 | bfa_sm_send_event(rport->bfa_rport, BFA_RPORT_SM_OFFLINE); |
508 | break; | 484 | break; |
509 | 485 | ||
510 | case RPSM_EVENT_PLOGI_RCVD: | 486 | case RPSM_EVENT_PLOGI_RCVD: |
511 | bfa_sm_set_state(rport, bfa_fcs_rport_sm_plogiacc_sending); | 487 | bfa_sm_set_state(rport, bfa_fcs_rport_sm_plogiacc_sending); |
512 | bfa_rport_offline(rport->bfa_rport); | 488 | bfa_sm_send_event(rport->bfa_rport, BFA_RPORT_SM_OFFLINE); |
513 | bfa_fcs_rport_send_plogiacc(rport, NULL); | 489 | bfa_fcs_rport_send_plogiacc(rport, NULL); |
514 | break; | 490 | break; |
515 | 491 | ||
516 | case RPSM_EVENT_DELETE: | 492 | case RPSM_EVENT_DELETE: |
517 | bfa_sm_set_state(rport, bfa_fcs_rport_sm_hcb_logosend); | 493 | bfa_sm_set_state(rport, bfa_fcs_rport_sm_hcb_logosend); |
518 | bfa_rport_offline(rport->bfa_rport); | 494 | bfa_sm_send_event(rport->bfa_rport, BFA_RPORT_SM_OFFLINE); |
519 | break; | 495 | break; |
520 | 496 | ||
521 | case RPSM_EVENT_SCN: | 497 | case RPSM_EVENT_SCN: |
@@ -824,7 +800,7 @@ bfa_fcs_rport_sm_fc4_logorcv(struct bfa_fcs_rport_s *rport, | |||
824 | switch (event) { | 800 | switch (event) { |
825 | case RPSM_EVENT_FC4_OFFLINE: | 801 | case RPSM_EVENT_FC4_OFFLINE: |
826 | bfa_sm_set_state(rport, bfa_fcs_rport_sm_hcb_logorcv); | 802 | bfa_sm_set_state(rport, bfa_fcs_rport_sm_hcb_logorcv); |
827 | bfa_rport_offline(rport->bfa_rport); | 803 | bfa_sm_send_event(rport->bfa_rport, BFA_RPORT_SM_OFFLINE); |
828 | break; | 804 | break; |
829 | 805 | ||
830 | case RPSM_EVENT_DELETE: | 806 | case RPSM_EVENT_DELETE: |
@@ -856,7 +832,7 @@ bfa_fcs_rport_sm_fc4_logosend(struct bfa_fcs_rport_s *rport, | |||
856 | switch (event) { | 832 | switch (event) { |
857 | case RPSM_EVENT_FC4_OFFLINE: | 833 | case RPSM_EVENT_FC4_OFFLINE: |
858 | bfa_sm_set_state(rport, bfa_fcs_rport_sm_hcb_logosend); | 834 | bfa_sm_set_state(rport, bfa_fcs_rport_sm_hcb_logosend); |
859 | bfa_rport_offline(rport->bfa_rport); | 835 | bfa_sm_send_event(rport->bfa_rport, BFA_RPORT_SM_OFFLINE); |
860 | break; | 836 | break; |
861 | 837 | ||
862 | default: | 838 | default: |
@@ -878,7 +854,7 @@ bfa_fcs_rport_sm_fc4_offline(struct bfa_fcs_rport_s *rport, | |||
878 | switch (event) { | 854 | switch (event) { |
879 | case RPSM_EVENT_FC4_OFFLINE: | 855 | case RPSM_EVENT_FC4_OFFLINE: |
880 | bfa_sm_set_state(rport, bfa_fcs_rport_sm_hcb_offline); | 856 | bfa_sm_set_state(rport, bfa_fcs_rport_sm_hcb_offline); |
881 | bfa_rport_offline(rport->bfa_rport); | 857 | bfa_sm_send_event(rport->bfa_rport, BFA_RPORT_SM_OFFLINE); |
882 | break; | 858 | break; |
883 | 859 | ||
884 | case RPSM_EVENT_SCN: | 860 | case RPSM_EVENT_SCN: |
@@ -1459,7 +1435,7 @@ bfa_fcs_rport_plogi_response(void *fcsarg, struct bfa_fcxp_s *fcxp, void *cbarg, | |||
1459 | twin->stats.plogi_rcvd += rport->stats.plogi_rcvd; | 1435 | twin->stats.plogi_rcvd += rport->stats.plogi_rcvd; |
1460 | twin->stats.plogi_accs++; | 1436 | twin->stats.plogi_accs++; |
1461 | 1437 | ||
1462 | bfa_fcs_rport_delete(rport); | 1438 | bfa_sm_send_event(rport, RPSM_EVENT_DELETE); |
1463 | 1439 | ||
1464 | bfa_fcs_rport_update(twin, plogi_rsp); | 1440 | bfa_fcs_rport_update(twin, plogi_rsp); |
1465 | twin->pid = rsp_fchs->s_id; | 1441 | twin->pid = rsp_fchs->s_id; |
@@ -1998,7 +1974,7 @@ bfa_fcs_rport_alloc(struct bfa_fcs_lport_s *port, wwn_t pwwn, u32 rpid) | |||
1998 | rport->itnim = bfa_fcs_itnim_create(rport); | 1974 | rport->itnim = bfa_fcs_itnim_create(rport); |
1999 | if (!rport->itnim) { | 1975 | if (!rport->itnim) { |
2000 | bfa_trc(fcs, rpid); | 1976 | bfa_trc(fcs, rpid); |
2001 | bfa_rport_delete(rport->bfa_rport); | 1977 | bfa_sm_send_event(rport->bfa_rport, BFA_RPORT_SM_DELETE); |
2002 | kfree(rport_drv); | 1978 | kfree(rport_drv); |
2003 | return NULL; | 1979 | return NULL; |
2004 | } | 1980 | } |
@@ -2032,7 +2008,7 @@ bfa_fcs_rport_free(struct bfa_fcs_rport_s *rport) | |||
2032 | bfa_fcs_rpf_rport_offline(rport); | 2008 | bfa_fcs_rpf_rport_offline(rport); |
2033 | } | 2009 | } |
2034 | 2010 | ||
2035 | bfa_rport_delete(rport->bfa_rport); | 2011 | bfa_sm_send_event(rport->bfa_rport, BFA_RPORT_SM_DELETE); |
2036 | bfa_fcs_lport_del_rport(port, rport); | 2012 | bfa_fcs_lport_del_rport(port, rport); |
2037 | kfree(rport->rp_drv); | 2013 | kfree(rport->rp_drv); |
2038 | } | 2014 | } |
@@ -2307,40 +2283,8 @@ bfa_fcs_rport_plogi(struct bfa_fcs_rport_s *rport, struct fchs_s *rx_fchs, | |||
2307 | bfa_sm_send_event(rport, RPSM_EVENT_PLOGI_RCVD); | 2283 | bfa_sm_send_event(rport, RPSM_EVENT_PLOGI_RCVD); |
2308 | } | 2284 | } |
2309 | 2285 | ||
2310 | /* | ||
2311 | * Called by bport/vport to delete a remote port instance. | ||
2312 | * | ||
2313 | * Rport delete is called under the following conditions: | ||
2314 | * - vport is deleted | ||
2315 | * - vf is deleted | ||
2316 | * - explicit request from OS to delete rport | ||
2317 | */ | ||
2318 | void | ||
2319 | bfa_fcs_rport_delete(struct bfa_fcs_rport_s *rport) | ||
2320 | { | ||
2321 | bfa_sm_send_event(rport, RPSM_EVENT_DELETE); | ||
2322 | } | ||
2323 | 2286 | ||
2324 | /* | 2287 | /* |
2325 | * Called by bport/vport to when a target goes offline. | ||
2326 | * | ||
2327 | */ | ||
2328 | void | ||
2329 | bfa_fcs_rport_offline(struct bfa_fcs_rport_s *rport) | ||
2330 | { | ||
2331 | bfa_sm_send_event(rport, RPSM_EVENT_LOGO_IMP); | ||
2332 | } | ||
2333 | |||
2334 | /* | ||
2335 | * Called by bport in n2n when a target (attached port) becomes online. | ||
2336 | * | ||
2337 | */ | ||
2338 | void | ||
2339 | bfa_fcs_rport_online(struct bfa_fcs_rport_s *rport) | ||
2340 | { | ||
2341 | bfa_sm_send_event(rport, RPSM_EVENT_PLOGI_SEND); | ||
2342 | } | ||
2343 | /* | ||
2344 | * Called by bport/vport to notify SCN for the remote port | 2288 | * Called by bport/vport to notify SCN for the remote port |
2345 | */ | 2289 | */ |
2346 | void | 2290 | void |
@@ -2350,15 +2294,6 @@ bfa_fcs_rport_scn(struct bfa_fcs_rport_s *rport) | |||
2350 | bfa_sm_send_event(rport, RPSM_EVENT_SCN); | 2294 | bfa_sm_send_event(rport, RPSM_EVENT_SCN); |
2351 | } | 2295 | } |
2352 | 2296 | ||
2353 | /* | ||
2354 | * Called by fcpim to notify that the ITN cleanup is done. | ||
2355 | */ | ||
2356 | void | ||
2357 | bfa_fcs_rport_itnim_ack(struct bfa_fcs_rport_s *rport) | ||
2358 | { | ||
2359 | bfa_sm_send_event(rport, RPSM_EVENT_FC4_OFFLINE); | ||
2360 | } | ||
2361 | |||
2362 | 2297 | ||
2363 | /* | 2298 | /* |
2364 | * brief | 2299 | * brief |
@@ -2457,15 +2392,6 @@ bfa_cb_rport_qos_scn_prio(void *cbarg, | |||
2457 | * Called to process any unsolicted frames from this remote port | 2392 | * Called to process any unsolicted frames from this remote port |
2458 | */ | 2393 | */ |
2459 | void | 2394 | void |
2460 | bfa_fcs_rport_logo_imp(struct bfa_fcs_rport_s *rport) | ||
2461 | { | ||
2462 | bfa_sm_send_event(rport, RPSM_EVENT_LOGO_IMP); | ||
2463 | } | ||
2464 | |||
2465 | /* | ||
2466 | * Called to process any unsolicted frames from this remote port | ||
2467 | */ | ||
2468 | void | ||
2469 | bfa_fcs_rport_uf_recv(struct bfa_fcs_rport_s *rport, | 2395 | bfa_fcs_rport_uf_recv(struct bfa_fcs_rport_s *rport, |
2470 | struct fchs_s *fchs, u16 len) | 2396 | struct fchs_s *fchs, u16 len) |
2471 | { | 2397 | { |
@@ -2578,6 +2504,7 @@ bfa_fcs_rport_get_state(struct bfa_fcs_rport_s *rport) | |||
2578 | return bfa_sm_to_state(rport_sm_table, rport->sm); | 2504 | return bfa_sm_to_state(rport_sm_table, rport->sm); |
2579 | } | 2505 | } |
2580 | 2506 | ||
2507 | |||
2581 | /* | 2508 | /* |
2582 | * brief | 2509 | * brief |
2583 | * Called by the Driver to set rport delete/ageout timeout | 2510 | * Called by the Driver to set rport delete/ageout timeout |
@@ -2703,7 +2630,7 @@ bfa_fcs_rpf_sm_uninit(struct bfa_fcs_rpf_s *rpf, enum rpf_event event) | |||
2703 | case RPFSM_EVENT_RPORT_ONLINE: | 2630 | case RPFSM_EVENT_RPORT_ONLINE: |
2704 | /* Send RPSC2 to a Brocade fabric only. */ | 2631 | /* Send RPSC2 to a Brocade fabric only. */ |
2705 | if ((!BFA_FCS_PID_IS_WKA(rport->pid)) && | 2632 | if ((!BFA_FCS_PID_IS_WKA(rport->pid)) && |
2706 | ((bfa_lps_is_brcd_fabric(rport->port->fabric->lps)) || | 2633 | ((rport->port->fabric->lps->brcd_switch) || |
2707 | (bfa_fcs_fabric_get_switch_oui(fabric) == | 2634 | (bfa_fcs_fabric_get_switch_oui(fabric) == |
2708 | BFA_FCS_BRCD_SWITCH_OUI))) { | 2635 | BFA_FCS_BRCD_SWITCH_OUI))) { |
2709 | bfa_sm_set_state(rpf, bfa_fcs_rpf_sm_rpsc_sending); | 2636 | bfa_sm_set_state(rpf, bfa_fcs_rpf_sm_rpsc_sending); |
diff --git a/drivers/scsi/bfa/bfa_ioc.c b/drivers/scsi/bfa/bfa_ioc.c index 3f41d290142d..a8f745420f32 100644 --- a/drivers/scsi/bfa/bfa_ioc.c +++ b/drivers/scsi/bfa/bfa_ioc.c | |||
@@ -42,11 +42,6 @@ BFA_TRC_FILE(CNA, IOC); | |||
42 | bfa_ioc_hb_check, (__ioc), BFA_IOC_HB_TOV) | 42 | bfa_ioc_hb_check, (__ioc), BFA_IOC_HB_TOV) |
43 | #define bfa_hb_timer_stop(__ioc) bfa_timer_stop(&(__ioc)->hb_timer) | 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 | #define BFA_DBG_FWTRC_OFF(_fn) (BFI_IOC_TRC_OFF + BFA_DBG_FWTRC_LEN * (_fn)) | 45 | #define BFA_DBG_FWTRC_OFF(_fn) (BFI_IOC_TRC_OFF + BFA_DBG_FWTRC_LEN * (_fn)) |
51 | 46 | ||
52 | /* | 47 | /* |
@@ -81,24 +76,18 @@ bfa_boolean_t bfa_auto_recover = BFA_TRUE; | |||
81 | * forward declarations | 76 | * forward declarations |
82 | */ | 77 | */ |
83 | static void bfa_ioc_hw_sem_get(struct bfa_ioc_s *ioc); | 78 | static void bfa_ioc_hw_sem_get(struct bfa_ioc_s *ioc); |
84 | static void bfa_ioc_hw_sem_get_cancel(struct bfa_ioc_s *ioc); | ||
85 | static void bfa_ioc_hwinit(struct bfa_ioc_s *ioc, bfa_boolean_t force); | 79 | static void bfa_ioc_hwinit(struct bfa_ioc_s *ioc, bfa_boolean_t force); |
86 | static void bfa_ioc_timeout(void *ioc); | 80 | static void bfa_ioc_timeout(void *ioc); |
87 | static void bfa_ioc_send_enable(struct bfa_ioc_s *ioc); | 81 | static void bfa_ioc_send_enable(struct bfa_ioc_s *ioc); |
88 | static void bfa_ioc_send_disable(struct bfa_ioc_s *ioc); | 82 | static void bfa_ioc_send_disable(struct bfa_ioc_s *ioc); |
89 | static void bfa_ioc_send_getattr(struct bfa_ioc_s *ioc); | 83 | static void bfa_ioc_send_getattr(struct bfa_ioc_s *ioc); |
90 | static void bfa_ioc_hb_monitor(struct bfa_ioc_s *ioc); | 84 | static void bfa_ioc_hb_monitor(struct bfa_ioc_s *ioc); |
91 | static void bfa_ioc_hb_stop(struct bfa_ioc_s *ioc); | ||
92 | static void bfa_ioc_reset(struct bfa_ioc_s *ioc, bfa_boolean_t force); | ||
93 | static void bfa_ioc_mbox_poll(struct bfa_ioc_s *ioc); | 85 | static void bfa_ioc_mbox_poll(struct bfa_ioc_s *ioc); |
94 | static void bfa_ioc_mbox_hbfail(struct bfa_ioc_s *ioc); | 86 | static void bfa_ioc_mbox_hbfail(struct bfa_ioc_s *ioc); |
95 | static void bfa_ioc_recover(struct bfa_ioc_s *ioc); | 87 | static void bfa_ioc_recover(struct bfa_ioc_s *ioc); |
96 | static void bfa_ioc_check_attr_wwns(struct bfa_ioc_s *ioc); | 88 | static void bfa_ioc_check_attr_wwns(struct bfa_ioc_s *ioc); |
97 | static void bfa_ioc_disable_comp(struct bfa_ioc_s *ioc); | 89 | static void bfa_ioc_disable_comp(struct bfa_ioc_s *ioc); |
98 | static void bfa_ioc_lpu_stop(struct bfa_ioc_s *ioc); | 90 | static void bfa_ioc_lpu_stop(struct bfa_ioc_s *ioc); |
99 | static void bfa_ioc_pf_enabled(struct bfa_ioc_s *ioc); | ||
100 | static void bfa_ioc_pf_disabled(struct bfa_ioc_s *ioc); | ||
101 | static void bfa_ioc_pf_failed(struct bfa_ioc_s *ioc); | ||
102 | static void bfa_ioc_pf_fwmismatch(struct bfa_ioc_s *ioc); | 91 | static void bfa_ioc_pf_fwmismatch(struct bfa_ioc_s *ioc); |
103 | 92 | ||
104 | 93 | ||
@@ -162,12 +151,6 @@ static struct bfa_sm_table_s ioc_sm_table[] = { | |||
162 | /* | 151 | /* |
163 | * Forward declareations for iocpf state machine | 152 | * Forward declareations for iocpf state machine |
164 | */ | 153 | */ |
165 | static void bfa_iocpf_enable(struct bfa_ioc_s *ioc); | ||
166 | static void bfa_iocpf_disable(struct bfa_ioc_s *ioc); | ||
167 | static void bfa_iocpf_fail(struct bfa_ioc_s *ioc); | ||
168 | static void bfa_iocpf_initfail(struct bfa_ioc_s *ioc); | ||
169 | static void bfa_iocpf_getattrfail(struct bfa_ioc_s *ioc); | ||
170 | static void bfa_iocpf_stop(struct bfa_ioc_s *ioc); | ||
171 | static void bfa_iocpf_timeout(void *ioc_arg); | 154 | static void bfa_iocpf_timeout(void *ioc_arg); |
172 | static void bfa_iocpf_sem_timeout(void *ioc_arg); | 155 | static void bfa_iocpf_sem_timeout(void *ioc_arg); |
173 | 156 | ||
@@ -298,7 +281,7 @@ bfa_ioc_sm_reset(struct bfa_ioc_s *ioc, enum ioc_event event) | |||
298 | static void | 281 | static void |
299 | bfa_ioc_sm_enabling_entry(struct bfa_ioc_s *ioc) | 282 | bfa_ioc_sm_enabling_entry(struct bfa_ioc_s *ioc) |
300 | { | 283 | { |
301 | bfa_iocpf_enable(ioc); | 284 | bfa_fsm_send_event(&ioc->iocpf, IOCPF_E_ENABLE); |
302 | } | 285 | } |
303 | 286 | ||
304 | /* | 287 | /* |
@@ -321,7 +304,7 @@ bfa_ioc_sm_enabling(struct bfa_ioc_s *ioc, enum ioc_event event) | |||
321 | 304 | ||
322 | case IOC_E_HWERROR: | 305 | case IOC_E_HWERROR: |
323 | bfa_fsm_set_state(ioc, bfa_ioc_sm_initfail); | 306 | bfa_fsm_set_state(ioc, bfa_ioc_sm_initfail); |
324 | bfa_iocpf_initfail(ioc); | 307 | bfa_fsm_send_event(&ioc->iocpf, IOCPF_E_INITFAIL); |
325 | break; | 308 | break; |
326 | 309 | ||
327 | case IOC_E_DISABLE: | 310 | case IOC_E_DISABLE: |
@@ -330,7 +313,7 @@ bfa_ioc_sm_enabling(struct bfa_ioc_s *ioc, enum ioc_event event) | |||
330 | 313 | ||
331 | case IOC_E_DETACH: | 314 | case IOC_E_DETACH: |
332 | bfa_fsm_set_state(ioc, bfa_ioc_sm_uninit); | 315 | bfa_fsm_set_state(ioc, bfa_ioc_sm_uninit); |
333 | bfa_iocpf_stop(ioc); | 316 | bfa_fsm_send_event(&ioc->iocpf, IOCPF_E_STOP); |
334 | break; | 317 | break; |
335 | 318 | ||
336 | case IOC_E_ENABLE: | 319 | case IOC_E_ENABLE: |
@@ -375,7 +358,7 @@ bfa_ioc_sm_getattr(struct bfa_ioc_s *ioc, enum ioc_event event) | |||
375 | 358 | ||
376 | case IOC_E_TIMEOUT: | 359 | case IOC_E_TIMEOUT: |
377 | bfa_fsm_set_state(ioc, bfa_ioc_sm_initfail); | 360 | bfa_fsm_set_state(ioc, bfa_ioc_sm_initfail); |
378 | bfa_iocpf_getattrfail(ioc); | 361 | bfa_fsm_send_event(&ioc->iocpf, IOCPF_E_GETATTRFAIL); |
379 | break; | 362 | break; |
380 | 363 | ||
381 | case IOC_E_DISABLE: | 364 | case IOC_E_DISABLE: |
@@ -412,22 +395,22 @@ bfa_ioc_sm_op(struct bfa_ioc_s *ioc, enum ioc_event event) | |||
412 | break; | 395 | break; |
413 | 396 | ||
414 | case IOC_E_DISABLE: | 397 | case IOC_E_DISABLE: |
415 | bfa_ioc_hb_stop(ioc); | 398 | bfa_hb_timer_stop(ioc); |
416 | bfa_fsm_set_state(ioc, bfa_ioc_sm_disabling); | 399 | bfa_fsm_set_state(ioc, bfa_ioc_sm_disabling); |
417 | break; | 400 | break; |
418 | 401 | ||
419 | case IOC_E_FAILED: | 402 | case IOC_E_FAILED: |
420 | bfa_ioc_hb_stop(ioc); | 403 | bfa_hb_timer_stop(ioc); |
421 | bfa_fsm_set_state(ioc, bfa_ioc_sm_fail); | 404 | bfa_fsm_set_state(ioc, bfa_ioc_sm_fail); |
422 | break; | 405 | break; |
423 | 406 | ||
424 | case IOC_E_HWERROR: | 407 | case IOC_E_HWERROR: |
425 | bfa_ioc_hb_stop(ioc); | 408 | bfa_hb_timer_stop(ioc); |
426 | /* !!! fall through !!! */ | 409 | /* !!! fall through !!! */ |
427 | 410 | ||
428 | case IOC_E_HBFAIL: | 411 | case IOC_E_HBFAIL: |
429 | bfa_fsm_set_state(ioc, bfa_ioc_sm_fail); | 412 | bfa_fsm_set_state(ioc, bfa_ioc_sm_fail); |
430 | bfa_iocpf_fail(ioc); | 413 | bfa_fsm_send_event(&ioc->iocpf, IOCPF_E_FAIL); |
431 | break; | 414 | break; |
432 | 415 | ||
433 | default: | 416 | default: |
@@ -440,7 +423,7 @@ static void | |||
440 | bfa_ioc_sm_disabling_entry(struct bfa_ioc_s *ioc) | 423 | bfa_ioc_sm_disabling_entry(struct bfa_ioc_s *ioc) |
441 | { | 424 | { |
442 | struct bfad_s *bfad = (struct bfad_s *)ioc->bfa->bfad; | 425 | struct bfad_s *bfad = (struct bfad_s *)ioc->bfa->bfad; |
443 | bfa_iocpf_disable(ioc); | 426 | bfa_fsm_send_event(&ioc->iocpf, IOCPF_E_DISABLE); |
444 | BFA_LOG(KERN_INFO, bfad, bfa_log_level, "IOC disabled\n"); | 427 | BFA_LOG(KERN_INFO, bfad, bfa_log_level, "IOC disabled\n"); |
445 | } | 428 | } |
446 | 429 | ||
@@ -463,7 +446,7 @@ bfa_ioc_sm_disabling(struct bfa_ioc_s *ioc, enum ioc_event event) | |||
463 | * after iocpf sm completes failure processing and | 446 | * after iocpf sm completes failure processing and |
464 | * moves to disabled state. | 447 | * moves to disabled state. |
465 | */ | 448 | */ |
466 | bfa_iocpf_fail(ioc); | 449 | bfa_fsm_send_event(&ioc->iocpf, IOCPF_E_FAIL); |
467 | break; | 450 | break; |
468 | 451 | ||
469 | default: | 452 | default: |
@@ -496,7 +479,7 @@ bfa_ioc_sm_disabled(struct bfa_ioc_s *ioc, enum ioc_event event) | |||
496 | 479 | ||
497 | case IOC_E_DETACH: | 480 | case IOC_E_DETACH: |
498 | bfa_fsm_set_state(ioc, bfa_ioc_sm_uninit); | 481 | bfa_fsm_set_state(ioc, bfa_ioc_sm_uninit); |
499 | bfa_iocpf_stop(ioc); | 482 | bfa_fsm_send_event(&ioc->iocpf, IOCPF_E_STOP); |
500 | break; | 483 | break; |
501 | 484 | ||
502 | default: | 485 | default: |
@@ -537,7 +520,7 @@ bfa_ioc_sm_initfail(struct bfa_ioc_s *ioc, enum ioc_event event) | |||
537 | 520 | ||
538 | case IOC_E_DETACH: | 521 | case IOC_E_DETACH: |
539 | bfa_fsm_set_state(ioc, bfa_ioc_sm_uninit); | 522 | bfa_fsm_set_state(ioc, bfa_ioc_sm_uninit); |
540 | bfa_iocpf_stop(ioc); | 523 | bfa_fsm_send_event(&ioc->iocpf, IOCPF_E_STOP); |
541 | break; | 524 | break; |
542 | 525 | ||
543 | default: | 526 | default: |
@@ -668,19 +651,19 @@ bfa_iocpf_sm_fwcheck(struct bfa_iocpf_s *iocpf, enum iocpf_event event) | |||
668 | iocpf->retry_count = 0; | 651 | iocpf->retry_count = 0; |
669 | bfa_fsm_set_state(iocpf, bfa_iocpf_sm_hwinit); | 652 | bfa_fsm_set_state(iocpf, bfa_iocpf_sm_hwinit); |
670 | } else { | 653 | } else { |
671 | bfa_ioc_hw_sem_release(ioc); | 654 | writel(1, ioc->ioc_regs.ioc_sem_reg); |
672 | bfa_fsm_set_state(iocpf, bfa_iocpf_sm_mismatch); | 655 | bfa_fsm_set_state(iocpf, bfa_iocpf_sm_mismatch); |
673 | } | 656 | } |
674 | break; | 657 | break; |
675 | 658 | ||
676 | case IOCPF_E_DISABLE: | 659 | case IOCPF_E_DISABLE: |
677 | bfa_ioc_hw_sem_get_cancel(ioc); | 660 | bfa_sem_timer_stop(ioc); |
678 | bfa_fsm_set_state(iocpf, bfa_iocpf_sm_reset); | 661 | bfa_fsm_set_state(iocpf, bfa_iocpf_sm_reset); |
679 | bfa_ioc_pf_disabled(ioc); | 662 | bfa_fsm_send_event(ioc, IOC_E_DISABLED); |
680 | break; | 663 | break; |
681 | 664 | ||
682 | case IOCPF_E_STOP: | 665 | case IOCPF_E_STOP: |
683 | bfa_ioc_hw_sem_get_cancel(ioc); | 666 | bfa_sem_timer_stop(ioc); |
684 | bfa_fsm_set_state(iocpf, bfa_iocpf_sm_reset); | 667 | bfa_fsm_set_state(iocpf, bfa_iocpf_sm_reset); |
685 | break; | 668 | break; |
686 | 669 | ||
@@ -723,7 +706,7 @@ bfa_iocpf_sm_mismatch(struct bfa_iocpf_s *iocpf, enum iocpf_event event) | |||
723 | case IOCPF_E_DISABLE: | 706 | case IOCPF_E_DISABLE: |
724 | bfa_iocpf_timer_stop(ioc); | 707 | bfa_iocpf_timer_stop(ioc); |
725 | bfa_fsm_set_state(iocpf, bfa_iocpf_sm_reset); | 708 | bfa_fsm_set_state(iocpf, bfa_iocpf_sm_reset); |
726 | bfa_ioc_pf_disabled(ioc); | 709 | bfa_fsm_send_event(ioc, IOC_E_DISABLED); |
727 | break; | 710 | break; |
728 | 711 | ||
729 | case IOCPF_E_STOP: | 712 | case IOCPF_E_STOP: |
@@ -762,7 +745,7 @@ bfa_iocpf_sm_semwait(struct bfa_iocpf_s *iocpf, enum iocpf_event event) | |||
762 | break; | 745 | break; |
763 | 746 | ||
764 | case IOCPF_E_DISABLE: | 747 | case IOCPF_E_DISABLE: |
765 | bfa_ioc_hw_sem_get_cancel(ioc); | 748 | bfa_sem_timer_stop(ioc); |
766 | bfa_fsm_set_state(iocpf, bfa_iocpf_sm_disabled); | 749 | bfa_fsm_set_state(iocpf, bfa_iocpf_sm_disabled); |
767 | break; | 750 | break; |
768 | 751 | ||
@@ -776,7 +759,7 @@ static void | |||
776 | bfa_iocpf_sm_hwinit_entry(struct bfa_iocpf_s *iocpf) | 759 | bfa_iocpf_sm_hwinit_entry(struct bfa_iocpf_s *iocpf) |
777 | { | 760 | { |
778 | bfa_iocpf_timer_start(iocpf->ioc); | 761 | bfa_iocpf_timer_start(iocpf->ioc); |
779 | bfa_ioc_reset(iocpf->ioc, BFA_FALSE); | 762 | bfa_ioc_hwinit(iocpf->ioc, BFA_FALSE); |
780 | } | 763 | } |
781 | 764 | ||
782 | /* | 765 | /* |
@@ -806,19 +789,19 @@ bfa_iocpf_sm_hwinit(struct bfa_iocpf_s *iocpf, enum iocpf_event event) | |||
806 | iocpf->retry_count++; | 789 | iocpf->retry_count++; |
807 | if (iocpf->retry_count < BFA_IOC_HWINIT_MAX) { | 790 | if (iocpf->retry_count < BFA_IOC_HWINIT_MAX) { |
808 | bfa_iocpf_timer_start(ioc); | 791 | bfa_iocpf_timer_start(ioc); |
809 | bfa_ioc_reset(ioc, BFA_TRUE); | 792 | bfa_ioc_hwinit(ioc, BFA_TRUE); |
810 | break; | 793 | break; |
811 | } | 794 | } |
812 | 795 | ||
813 | bfa_ioc_hw_sem_release(ioc); | 796 | writel(1, ioc->ioc_regs.ioc_sem_reg); |
814 | bfa_fsm_set_state(iocpf, bfa_iocpf_sm_initfail); | 797 | bfa_fsm_set_state(iocpf, bfa_iocpf_sm_initfail); |
815 | 798 | ||
816 | if (event == IOCPF_E_TIMEOUT) | 799 | if (event == IOCPF_E_TIMEOUT) |
817 | bfa_ioc_pf_failed(ioc); | 800 | bfa_fsm_send_event(ioc, IOC_E_FAILED); |
818 | break; | 801 | break; |
819 | 802 | ||
820 | case IOCPF_E_DISABLE: | 803 | case IOCPF_E_DISABLE: |
821 | bfa_ioc_hw_sem_release(ioc); | 804 | writel(1, ioc->ioc_regs.ioc_sem_reg); |
822 | bfa_iocpf_timer_stop(ioc); | 805 | bfa_iocpf_timer_stop(ioc); |
823 | bfa_fsm_set_state(iocpf, bfa_iocpf_sm_disabled); | 806 | bfa_fsm_set_state(iocpf, bfa_iocpf_sm_disabled); |
824 | break; | 807 | break; |
@@ -850,7 +833,7 @@ bfa_iocpf_sm_enabling(struct bfa_iocpf_s *iocpf, enum iocpf_event event) | |||
850 | switch (event) { | 833 | switch (event) { |
851 | case IOCPF_E_FWRSP_ENABLE: | 834 | case IOCPF_E_FWRSP_ENABLE: |
852 | bfa_iocpf_timer_stop(ioc); | 835 | bfa_iocpf_timer_stop(ioc); |
853 | bfa_ioc_hw_sem_release(ioc); | 836 | writel(1, ioc->ioc_regs.ioc_sem_reg); |
854 | bfa_fsm_set_state(iocpf, bfa_iocpf_sm_ready); | 837 | bfa_fsm_set_state(iocpf, bfa_iocpf_sm_ready); |
855 | break; | 838 | break; |
856 | 839 | ||
@@ -868,16 +851,16 @@ bfa_iocpf_sm_enabling(struct bfa_iocpf_s *iocpf, enum iocpf_event event) | |||
868 | break; | 851 | break; |
869 | } | 852 | } |
870 | 853 | ||
871 | bfa_ioc_hw_sem_release(ioc); | 854 | writel(1, ioc->ioc_regs.ioc_sem_reg); |
872 | bfa_fsm_set_state(iocpf, bfa_iocpf_sm_initfail); | 855 | bfa_fsm_set_state(iocpf, bfa_iocpf_sm_initfail); |
873 | 856 | ||
874 | if (event == IOCPF_E_TIMEOUT) | 857 | if (event == IOCPF_E_TIMEOUT) |
875 | bfa_ioc_pf_failed(ioc); | 858 | bfa_fsm_send_event(ioc, IOC_E_FAILED); |
876 | break; | 859 | break; |
877 | 860 | ||
878 | case IOCPF_E_DISABLE: | 861 | case IOCPF_E_DISABLE: |
879 | bfa_iocpf_timer_stop(ioc); | 862 | bfa_iocpf_timer_stop(ioc); |
880 | bfa_ioc_hw_sem_release(ioc); | 863 | writel(1, ioc->ioc_regs.ioc_sem_reg); |
881 | bfa_fsm_set_state(iocpf, bfa_iocpf_sm_disabling); | 864 | bfa_fsm_set_state(iocpf, bfa_iocpf_sm_disabling); |
882 | break; | 865 | break; |
883 | 866 | ||
@@ -895,7 +878,7 @@ bfa_iocpf_sm_enabling(struct bfa_iocpf_s *iocpf, enum iocpf_event event) | |||
895 | static void | 878 | static void |
896 | bfa_iocpf_sm_ready_entry(struct bfa_iocpf_s *iocpf) | 879 | bfa_iocpf_sm_ready_entry(struct bfa_iocpf_s *iocpf) |
897 | { | 880 | { |
898 | bfa_ioc_pf_enabled(iocpf->ioc); | 881 | bfa_fsm_send_event(iocpf->ioc, IOC_E_ENABLED); |
899 | } | 882 | } |
900 | 883 | ||
901 | static void | 884 | static void |
@@ -919,12 +902,12 @@ bfa_iocpf_sm_ready(struct bfa_iocpf_s *iocpf, enum iocpf_event event) | |||
919 | break; | 902 | break; |
920 | 903 | ||
921 | case IOCPF_E_FWREADY: | 904 | case IOCPF_E_FWREADY: |
922 | if (bfa_ioc_is_operational(ioc)) | 905 | if (bfa_fsm_cmp_state(ioc, bfa_ioc_sm_op)) |
923 | bfa_fsm_set_state(iocpf, bfa_iocpf_sm_fail); | 906 | bfa_fsm_set_state(iocpf, bfa_iocpf_sm_fail); |
924 | else | 907 | else |
925 | bfa_fsm_set_state(iocpf, bfa_iocpf_sm_initfail); | 908 | bfa_fsm_set_state(iocpf, bfa_iocpf_sm_initfail); |
926 | 909 | ||
927 | bfa_ioc_pf_failed(ioc); | 910 | bfa_fsm_send_event(ioc, IOC_E_FAILED); |
928 | break; | 911 | break; |
929 | 912 | ||
930 | default: | 913 | default: |
@@ -982,7 +965,7 @@ bfa_iocpf_sm_disabling(struct bfa_iocpf_s *iocpf, enum iocpf_event event) | |||
982 | static void | 965 | static void |
983 | bfa_iocpf_sm_disabled_entry(struct bfa_iocpf_s *iocpf) | 966 | bfa_iocpf_sm_disabled_entry(struct bfa_iocpf_s *iocpf) |
984 | { | 967 | { |
985 | bfa_ioc_pf_disabled(iocpf->ioc); | 968 | bfa_fsm_send_event(iocpf->ioc, IOC_E_DISABLED); |
986 | } | 969 | } |
987 | 970 | ||
988 | static void | 971 | static void |
@@ -1140,11 +1123,6 @@ bfa_ioc_sem_get(void __iomem *sem_reg) | |||
1140 | return BFA_FALSE; | 1123 | return BFA_FALSE; |
1141 | } | 1124 | } |
1142 | 1125 | ||
1143 | void | ||
1144 | bfa_ioc_sem_release(void __iomem *sem_reg) | ||
1145 | { | ||
1146 | writel(1, sem_reg); | ||
1147 | } | ||
1148 | 1126 | ||
1149 | static void | 1127 | static void |
1150 | bfa_ioc_hw_sem_get(struct bfa_ioc_s *ioc) | 1128 | bfa_ioc_hw_sem_get(struct bfa_ioc_s *ioc) |
@@ -1164,18 +1142,6 @@ bfa_ioc_hw_sem_get(struct bfa_ioc_s *ioc) | |||
1164 | bfa_sem_timer_start(ioc); | 1142 | bfa_sem_timer_start(ioc); |
1165 | } | 1143 | } |
1166 | 1144 | ||
1167 | void | ||
1168 | bfa_ioc_hw_sem_release(struct bfa_ioc_s *ioc) | ||
1169 | { | ||
1170 | writel(1, ioc->ioc_regs.ioc_sem_reg); | ||
1171 | } | ||
1172 | |||
1173 | static void | ||
1174 | bfa_ioc_hw_sem_get_cancel(struct bfa_ioc_s *ioc) | ||
1175 | { | ||
1176 | bfa_sem_timer_stop(ioc); | ||
1177 | } | ||
1178 | |||
1179 | /* | 1145 | /* |
1180 | * Initialize LPU local memory (aka secondary memory / SRAM) | 1146 | * Initialize LPU local memory (aka secondary memory / SRAM) |
1181 | */ | 1147 | */ |
@@ -1255,8 +1221,8 @@ bfa_ioc_fwver_get(struct bfa_ioc_s *ioc, struct bfi_ioc_image_hdr_s *fwhdr) | |||
1255 | int i; | 1221 | int i; |
1256 | u32 *fwsig = (u32 *) fwhdr; | 1222 | u32 *fwsig = (u32 *) fwhdr; |
1257 | 1223 | ||
1258 | pgnum = bfa_ioc_smem_pgnum(ioc, loff); | 1224 | pgnum = PSS_SMEM_PGNUM(ioc->ioc_regs.smem_pg0, loff); |
1259 | pgoff = bfa_ioc_smem_pgoff(ioc, loff); | 1225 | pgoff = PSS_SMEM_PGOFF(loff); |
1260 | writel(pgnum, ioc->ioc_regs.host_page_num_fn); | 1226 | writel(pgnum, ioc->ioc_regs.host_page_num_fn); |
1261 | 1227 | ||
1262 | for (i = 0; i < (sizeof(struct bfi_ioc_image_hdr_s) / sizeof(u32)); | 1228 | for (i = 0; i < (sizeof(struct bfi_ioc_image_hdr_s) / sizeof(u32)); |
@@ -1519,13 +1485,6 @@ bfa_ioc_hb_monitor(struct bfa_ioc_s *ioc) | |||
1519 | bfa_hb_timer_start(ioc); | 1485 | bfa_hb_timer_start(ioc); |
1520 | } | 1486 | } |
1521 | 1487 | ||
1522 | static void | ||
1523 | bfa_ioc_hb_stop(struct bfa_ioc_s *ioc) | ||
1524 | { | ||
1525 | bfa_hb_timer_stop(ioc); | ||
1526 | } | ||
1527 | |||
1528 | |||
1529 | /* | 1488 | /* |
1530 | * Initiate a full firmware download. | 1489 | * Initiate a full firmware download. |
1531 | */ | 1490 | */ |
@@ -1547,8 +1506,8 @@ bfa_ioc_download_fw(struct bfa_ioc_s *ioc, u32 boot_type, | |||
1547 | bfa_trc(ioc, bfa_cb_image_get_size(BFA_IOC_FWIMG_TYPE(ioc))); | 1506 | bfa_trc(ioc, bfa_cb_image_get_size(BFA_IOC_FWIMG_TYPE(ioc))); |
1548 | fwimg = bfa_cb_image_get_chunk(BFA_IOC_FWIMG_TYPE(ioc), chunkno); | 1507 | fwimg = bfa_cb_image_get_chunk(BFA_IOC_FWIMG_TYPE(ioc), chunkno); |
1549 | 1508 | ||
1550 | pgnum = bfa_ioc_smem_pgnum(ioc, loff); | 1509 | pgnum = PSS_SMEM_PGNUM(ioc->ioc_regs.smem_pg0, loff); |
1551 | pgoff = bfa_ioc_smem_pgoff(ioc, loff); | 1510 | pgoff = PSS_SMEM_PGOFF(loff); |
1552 | 1511 | ||
1553 | writel(pgnum, ioc->ioc_regs.host_page_num_fn); | 1512 | writel(pgnum, ioc->ioc_regs.host_page_num_fn); |
1554 | 1513 | ||
@@ -1578,7 +1537,8 @@ bfa_ioc_download_fw(struct bfa_ioc_s *ioc, u32 boot_type, | |||
1578 | } | 1537 | } |
1579 | } | 1538 | } |
1580 | 1539 | ||
1581 | writel(bfa_ioc_smem_pgnum(ioc, 0), ioc->ioc_regs.host_page_num_fn); | 1540 | writel(PSS_SMEM_PGNUM(ioc->ioc_regs.smem_pg0, 0), |
1541 | ioc->ioc_regs.host_page_num_fn); | ||
1582 | 1542 | ||
1583 | /* | 1543 | /* |
1584 | * Set boot type and boot param at the end. | 1544 | * Set boot type and boot param at the end. |
@@ -1589,11 +1549,6 @@ bfa_ioc_download_fw(struct bfa_ioc_s *ioc, u32 boot_type, | |||
1589 | swab32(boot_env)); | 1549 | swab32(boot_env)); |
1590 | } | 1550 | } |
1591 | 1551 | ||
1592 | static void | ||
1593 | bfa_ioc_reset(struct bfa_ioc_s *ioc, bfa_boolean_t force) | ||
1594 | { | ||
1595 | bfa_ioc_hwinit(ioc, force); | ||
1596 | } | ||
1597 | 1552 | ||
1598 | /* | 1553 | /* |
1599 | * Update BFA configuration from firmware configuration. | 1554 | * Update BFA configuration from firmware configuration. |
@@ -1685,8 +1640,8 @@ bfa_ioc_smem_read(struct bfa_ioc_s *ioc, void *tbuf, u32 soff, u32 sz) | |||
1685 | int i, len; | 1640 | int i, len; |
1686 | u32 *buf = tbuf; | 1641 | u32 *buf = tbuf; |
1687 | 1642 | ||
1688 | pgnum = bfa_ioc_smem_pgnum(ioc, soff); | 1643 | pgnum = PSS_SMEM_PGNUM(ioc->ioc_regs.smem_pg0, soff); |
1689 | loff = bfa_ioc_smem_pgoff(ioc, soff); | 1644 | loff = PSS_SMEM_PGOFF(soff); |
1690 | bfa_trc(ioc, pgnum); | 1645 | bfa_trc(ioc, pgnum); |
1691 | bfa_trc(ioc, loff); | 1646 | bfa_trc(ioc, loff); |
1692 | bfa_trc(ioc, sz); | 1647 | bfa_trc(ioc, sz); |
@@ -1717,11 +1672,12 @@ bfa_ioc_smem_read(struct bfa_ioc_s *ioc, void *tbuf, u32 soff, u32 sz) | |||
1717 | writel(pgnum, ioc->ioc_regs.host_page_num_fn); | 1672 | writel(pgnum, ioc->ioc_regs.host_page_num_fn); |
1718 | } | 1673 | } |
1719 | } | 1674 | } |
1720 | writel(bfa_ioc_smem_pgnum(ioc, 0), ioc->ioc_regs.host_page_num_fn); | 1675 | writel(PSS_SMEM_PGNUM(ioc->ioc_regs.smem_pg0, 0), |
1676 | ioc->ioc_regs.host_page_num_fn); | ||
1721 | /* | 1677 | /* |
1722 | * release semaphore. | 1678 | * release semaphore. |
1723 | */ | 1679 | */ |
1724 | bfa_ioc_sem_release(ioc->ioc_regs.ioc_init_sem_reg); | 1680 | writel(1, ioc->ioc_regs.ioc_init_sem_reg); |
1725 | 1681 | ||
1726 | bfa_trc(ioc, pgnum); | 1682 | bfa_trc(ioc, pgnum); |
1727 | return BFA_STATUS_OK; | 1683 | return BFA_STATUS_OK; |
@@ -1740,8 +1696,8 @@ bfa_ioc_smem_clr(struct bfa_ioc_s *ioc, u32 soff, u32 sz) | |||
1740 | int i, len; | 1696 | int i, len; |
1741 | u32 pgnum, loff; | 1697 | u32 pgnum, loff; |
1742 | 1698 | ||
1743 | pgnum = bfa_ioc_smem_pgnum(ioc, soff); | 1699 | pgnum = PSS_SMEM_PGNUM(ioc->ioc_regs.smem_pg0, soff); |
1744 | loff = bfa_ioc_smem_pgoff(ioc, soff); | 1700 | loff = PSS_SMEM_PGOFF(soff); |
1745 | bfa_trc(ioc, pgnum); | 1701 | bfa_trc(ioc, pgnum); |
1746 | bfa_trc(ioc, loff); | 1702 | bfa_trc(ioc, loff); |
1747 | bfa_trc(ioc, sz); | 1703 | bfa_trc(ioc, sz); |
@@ -1771,36 +1727,17 @@ bfa_ioc_smem_clr(struct bfa_ioc_s *ioc, u32 soff, u32 sz) | |||
1771 | writel(pgnum, ioc->ioc_regs.host_page_num_fn); | 1727 | writel(pgnum, ioc->ioc_regs.host_page_num_fn); |
1772 | } | 1728 | } |
1773 | } | 1729 | } |
1774 | writel(bfa_ioc_smem_pgnum(ioc, 0), ioc->ioc_regs.host_page_num_fn); | 1730 | writel(PSS_SMEM_PGNUM(ioc->ioc_regs.smem_pg0, 0), |
1731 | ioc->ioc_regs.host_page_num_fn); | ||
1775 | 1732 | ||
1776 | /* | 1733 | /* |
1777 | * release semaphore. | 1734 | * release semaphore. |
1778 | */ | 1735 | */ |
1779 | bfa_ioc_sem_release(ioc->ioc_regs.ioc_init_sem_reg); | 1736 | writel(1, ioc->ioc_regs.ioc_init_sem_reg); |
1780 | bfa_trc(ioc, pgnum); | 1737 | bfa_trc(ioc, pgnum); |
1781 | return BFA_STATUS_OK; | 1738 | return BFA_STATUS_OK; |
1782 | } | 1739 | } |
1783 | 1740 | ||
1784 | /* | ||
1785 | * hal iocpf to ioc interface | ||
1786 | */ | ||
1787 | static void | ||
1788 | bfa_ioc_pf_enabled(struct bfa_ioc_s *ioc) | ||
1789 | { | ||
1790 | bfa_fsm_send_event(ioc, IOC_E_ENABLED); | ||
1791 | } | ||
1792 | |||
1793 | static void | ||
1794 | bfa_ioc_pf_disabled(struct bfa_ioc_s *ioc) | ||
1795 | { | ||
1796 | bfa_fsm_send_event(ioc, IOC_E_DISABLED); | ||
1797 | } | ||
1798 | |||
1799 | static void | ||
1800 | bfa_ioc_pf_failed(struct bfa_ioc_s *ioc) | ||
1801 | { | ||
1802 | bfa_fsm_send_event(ioc, IOC_E_FAILED); | ||
1803 | } | ||
1804 | 1741 | ||
1805 | static void | 1742 | static void |
1806 | bfa_ioc_pf_fwmismatch(struct bfa_ioc_s *ioc) | 1743 | bfa_ioc_pf_fwmismatch(struct bfa_ioc_s *ioc) |
@@ -1831,7 +1768,7 @@ bfa_ioc_pll_init(struct bfa_ioc_s *ioc) | |||
1831 | /* | 1768 | /* |
1832 | * release semaphore. | 1769 | * release semaphore. |
1833 | */ | 1770 | */ |
1834 | bfa_ioc_sem_release(ioc->ioc_regs.ioc_init_sem_reg); | 1771 | writel(1, ioc->ioc_regs.ioc_init_sem_reg); |
1835 | 1772 | ||
1836 | return BFA_STATUS_OK; | 1773 | return BFA_STATUS_OK; |
1837 | } | 1774 | } |
@@ -2036,15 +1973,6 @@ bfa_ioc_mem_claim(struct bfa_ioc_s *ioc, u8 *dm_kva, u64 dm_pa) | |||
2036 | ioc->attr = (struct bfi_ioc_attr_s *) dm_kva; | 1973 | ioc->attr = (struct bfi_ioc_attr_s *) dm_kva; |
2037 | } | 1974 | } |
2038 | 1975 | ||
2039 | /* | ||
2040 | * Return size of dma memory required. | ||
2041 | */ | ||
2042 | u32 | ||
2043 | bfa_ioc_meminfo(void) | ||
2044 | { | ||
2045 | return BFA_ROUNDUP(sizeof(struct bfi_ioc_attr_s), BFA_DMA_ALIGN_SZ); | ||
2046 | } | ||
2047 | |||
2048 | void | 1976 | void |
2049 | bfa_ioc_enable(struct bfa_ioc_s *ioc) | 1977 | bfa_ioc_enable(struct bfa_ioc_s *ioc) |
2050 | { | 1978 | { |
@@ -2061,18 +1989,6 @@ bfa_ioc_disable(struct bfa_ioc_s *ioc) | |||
2061 | bfa_fsm_send_event(ioc, IOC_E_DISABLE); | 1989 | bfa_fsm_send_event(ioc, IOC_E_DISABLE); |
2062 | } | 1990 | } |
2063 | 1991 | ||
2064 | /* | ||
2065 | * Returns memory required for saving firmware trace in case of crash. | ||
2066 | * Driver must call this interface to allocate memory required for | ||
2067 | * automatic saving of firmware trace. Driver should call | ||
2068 | * bfa_ioc_debug_memclaim() right after bfa_ioc_attach() to setup this | ||
2069 | * trace memory. | ||
2070 | */ | ||
2071 | int | ||
2072 | bfa_ioc_debug_trcsz(bfa_boolean_t auto_recover) | ||
2073 | { | ||
2074 | return (auto_recover) ? BFA_DBG_FWTRC_LEN : 0; | ||
2075 | } | ||
2076 | 1992 | ||
2077 | /* | 1993 | /* |
2078 | * Initialize memory for saving firmware trace. Driver must initialize | 1994 | * Initialize memory for saving firmware trace. Driver must initialize |
@@ -2082,19 +1998,7 @@ void | |||
2082 | bfa_ioc_debug_memclaim(struct bfa_ioc_s *ioc, void *dbg_fwsave) | 1998 | bfa_ioc_debug_memclaim(struct bfa_ioc_s *ioc, void *dbg_fwsave) |
2083 | { | 1999 | { |
2084 | ioc->dbg_fwsave = dbg_fwsave; | 2000 | ioc->dbg_fwsave = dbg_fwsave; |
2085 | ioc->dbg_fwsave_len = bfa_ioc_debug_trcsz(ioc->iocpf.auto_recover); | 2001 | ioc->dbg_fwsave_len = (ioc->iocpf.auto_recover) ? BFA_DBG_FWTRC_LEN : 0; |
2086 | } | ||
2087 | |||
2088 | u32 | ||
2089 | bfa_ioc_smem_pgnum(struct bfa_ioc_s *ioc, u32 fmaddr) | ||
2090 | { | ||
2091 | return PSS_SMEM_PGNUM(ioc->ioc_regs.smem_pg0, fmaddr); | ||
2092 | } | ||
2093 | |||
2094 | u32 | ||
2095 | bfa_ioc_smem_pgoff(struct bfa_ioc_s *ioc, u32 fmaddr) | ||
2096 | { | ||
2097 | return PSS_SMEM_PGOFF(fmaddr); | ||
2098 | } | 2002 | } |
2099 | 2003 | ||
2100 | /* | 2004 | /* |
@@ -2257,17 +2161,6 @@ bfa_ioc_adapter_is_disabled(struct bfa_ioc_s *ioc) | |||
2257 | return BFA_TRUE; | 2161 | return BFA_TRUE; |
2258 | } | 2162 | } |
2259 | 2163 | ||
2260 | /* | ||
2261 | * Add to IOC heartbeat failure notification queue. To be used by common | ||
2262 | * modules such as cee, port, diag. | ||
2263 | */ | ||
2264 | void | ||
2265 | bfa_ioc_hbfail_register(struct bfa_ioc_s *ioc, | ||
2266 | struct bfa_ioc_hbfail_notify_s *notify) | ||
2267 | { | ||
2268 | list_add_tail(¬ify->qe, &ioc->hb_notify_q); | ||
2269 | } | ||
2270 | |||
2271 | #define BFA_MFG_NAME "Brocade" | 2164 | #define BFA_MFG_NAME "Brocade" |
2272 | void | 2165 | void |
2273 | bfa_ioc_get_adapter_attr(struct bfa_ioc_s *ioc, | 2166 | bfa_ioc_get_adapter_attr(struct bfa_ioc_s *ioc, |
@@ -2299,7 +2192,7 @@ bfa_ioc_get_adapter_attr(struct bfa_ioc_s *ioc, | |||
2299 | else | 2192 | else |
2300 | ad_attr->prototype = 0; | 2193 | ad_attr->prototype = 0; |
2301 | 2194 | ||
2302 | ad_attr->pwwn = bfa_ioc_get_pwwn(ioc); | 2195 | ad_attr->pwwn = ioc->attr->pwwn; |
2303 | ad_attr->mac = bfa_ioc_get_mac(ioc); | 2196 | ad_attr->mac = bfa_ioc_get_mac(ioc); |
2304 | 2197 | ||
2305 | ad_attr->pcie_gen = ioc_attr->pcie_gen; | 2198 | ad_attr->pcie_gen = ioc_attr->pcie_gen; |
@@ -2448,24 +2341,6 @@ bfa_ioc_get_attr(struct bfa_ioc_s *ioc, struct bfa_ioc_attr_s *ioc_attr) | |||
2448 | bfa_ioc_get_pci_chip_rev(ioc, ioc_attr->pci_attr.chip_rev); | 2341 | bfa_ioc_get_pci_chip_rev(ioc, ioc_attr->pci_attr.chip_rev); |
2449 | } | 2342 | } |
2450 | 2343 | ||
2451 | wwn_t | ||
2452 | bfa_ioc_get_pwwn(struct bfa_ioc_s *ioc) | ||
2453 | { | ||
2454 | return ioc->attr->pwwn; | ||
2455 | } | ||
2456 | |||
2457 | wwn_t | ||
2458 | bfa_ioc_get_nwwn(struct bfa_ioc_s *ioc) | ||
2459 | { | ||
2460 | return ioc->attr->nwwn; | ||
2461 | } | ||
2462 | |||
2463 | u64 | ||
2464 | bfa_ioc_get_adid(struct bfa_ioc_s *ioc) | ||
2465 | { | ||
2466 | return ioc->attr->mfg_pwwn; | ||
2467 | } | ||
2468 | |||
2469 | mac_t | 2344 | mac_t |
2470 | bfa_ioc_get_mac(struct bfa_ioc_s *ioc) | 2345 | bfa_ioc_get_mac(struct bfa_ioc_s *ioc) |
2471 | { | 2346 | { |
@@ -2478,18 +2353,6 @@ bfa_ioc_get_mac(struct bfa_ioc_s *ioc) | |||
2478 | return ioc->attr->mac; | 2353 | return ioc->attr->mac; |
2479 | } | 2354 | } |
2480 | 2355 | ||
2481 | wwn_t | ||
2482 | bfa_ioc_get_mfg_pwwn(struct bfa_ioc_s *ioc) | ||
2483 | { | ||
2484 | return ioc->attr->mfg_pwwn; | ||
2485 | } | ||
2486 | |||
2487 | wwn_t | ||
2488 | bfa_ioc_get_mfg_nwwn(struct bfa_ioc_s *ioc) | ||
2489 | { | ||
2490 | return ioc->attr->mfg_nwwn; | ||
2491 | } | ||
2492 | |||
2493 | mac_t | 2356 | mac_t |
2494 | bfa_ioc_get_mfg_mac(struct bfa_ioc_s *ioc) | 2357 | bfa_ioc_get_mfg_mac(struct bfa_ioc_s *ioc) |
2495 | { | 2358 | { |
@@ -2718,43 +2581,6 @@ bfa_ioc_check_attr_wwns(struct bfa_ioc_s *ioc) | |||
2718 | /* | 2581 | /* |
2719 | * BFA IOC PF private functions | 2582 | * BFA IOC PF private functions |
2720 | */ | 2583 | */ |
2721 | |||
2722 | static void | ||
2723 | bfa_iocpf_enable(struct bfa_ioc_s *ioc) | ||
2724 | { | ||
2725 | bfa_fsm_send_event(&ioc->iocpf, IOCPF_E_ENABLE); | ||
2726 | } | ||
2727 | |||
2728 | static void | ||
2729 | bfa_iocpf_disable(struct bfa_ioc_s *ioc) | ||
2730 | { | ||
2731 | bfa_fsm_send_event(&ioc->iocpf, IOCPF_E_DISABLE); | ||
2732 | } | ||
2733 | |||
2734 | static void | ||
2735 | bfa_iocpf_fail(struct bfa_ioc_s *ioc) | ||
2736 | { | ||
2737 | bfa_fsm_send_event(&ioc->iocpf, IOCPF_E_FAIL); | ||
2738 | } | ||
2739 | |||
2740 | static void | ||
2741 | bfa_iocpf_initfail(struct bfa_ioc_s *ioc) | ||
2742 | { | ||
2743 | bfa_fsm_send_event(&ioc->iocpf, IOCPF_E_INITFAIL); | ||
2744 | } | ||
2745 | |||
2746 | static void | ||
2747 | bfa_iocpf_getattrfail(struct bfa_ioc_s *ioc) | ||
2748 | { | ||
2749 | bfa_fsm_send_event(&ioc->iocpf, IOCPF_E_GETATTRFAIL); | ||
2750 | } | ||
2751 | |||
2752 | static void | ||
2753 | bfa_iocpf_stop(struct bfa_ioc_s *ioc) | ||
2754 | { | ||
2755 | bfa_fsm_send_event(&ioc->iocpf, IOCPF_E_STOP); | ||
2756 | } | ||
2757 | |||
2758 | static void | 2584 | static void |
2759 | bfa_iocpf_timeout(void *ioc_arg) | 2585 | bfa_iocpf_timeout(void *ioc_arg) |
2760 | { | 2586 | { |
@@ -2776,12 +2602,6 @@ bfa_iocpf_sem_timeout(void *ioc_arg) | |||
2776 | * bfa timer function | 2602 | * bfa timer function |
2777 | */ | 2603 | */ |
2778 | void | 2604 | void |
2779 | bfa_timer_init(struct bfa_timer_mod_s *mod) | ||
2780 | { | ||
2781 | INIT_LIST_HEAD(&mod->timer_q); | ||
2782 | } | ||
2783 | |||
2784 | void | ||
2785 | bfa_timer_beat(struct bfa_timer_mod_s *mod) | 2605 | bfa_timer_beat(struct bfa_timer_mod_s *mod) |
2786 | { | 2606 | { |
2787 | struct list_head *qh = &mod->timer_q; | 2607 | struct list_head *qh = &mod->timer_q; |
diff --git a/drivers/scsi/bfa/bfa_ioc.h b/drivers/scsi/bfa/bfa_ioc.h index ff012f7f0757..3c5bdd1c0c7f 100644 --- a/drivers/scsi/bfa/bfa_ioc.h +++ b/drivers/scsi/bfa/bfa_ioc.h | |||
@@ -22,6 +22,11 @@ | |||
22 | #include "bfa_cs.h" | 22 | #include "bfa_cs.h" |
23 | #include "bfi.h" | 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 | * BFA timer declarations | 31 | * BFA timer declarations |
27 | */ | 32 | */ |
@@ -47,7 +52,6 @@ struct bfa_timer_mod_s { | |||
47 | #define BFA_TIMER_FREQ 200 /* specified in millisecs */ | 52 | #define BFA_TIMER_FREQ 200 /* specified in millisecs */ |
48 | 53 | ||
49 | void bfa_timer_beat(struct bfa_timer_mod_s *mod); | 54 | void bfa_timer_beat(struct bfa_timer_mod_s *mod); |
50 | void bfa_timer_init(struct bfa_timer_mod_s *mod); | ||
51 | void bfa_timer_begin(struct bfa_timer_mod_s *mod, struct bfa_timer_s *timer, | 55 | void bfa_timer_begin(struct bfa_timer_mod_s *mod, struct bfa_timer_s *timer, |
52 | bfa_timer_cbfn_t timercb, void *arg, | 56 | bfa_timer_cbfn_t timercb, void *arg, |
53 | unsigned int timeout); | 57 | unsigned int timeout); |
@@ -325,7 +329,6 @@ void bfa_ioc_auto_recover(bfa_boolean_t auto_recover); | |||
325 | void bfa_ioc_detach(struct bfa_ioc_s *ioc); | 329 | void bfa_ioc_detach(struct bfa_ioc_s *ioc); |
326 | void bfa_ioc_pci_init(struct bfa_ioc_s *ioc, struct bfa_pcidev_s *pcidev, | 330 | void bfa_ioc_pci_init(struct bfa_ioc_s *ioc, struct bfa_pcidev_s *pcidev, |
327 | enum bfi_mclass mc); | 331 | enum bfi_mclass mc); |
328 | u32 bfa_ioc_meminfo(void); | ||
329 | void bfa_ioc_mem_claim(struct bfa_ioc_s *ioc, u8 *dm_kva, u64 dm_pa); | 332 | void bfa_ioc_mem_claim(struct bfa_ioc_s *ioc, u8 *dm_kva, u64 dm_pa); |
330 | void bfa_ioc_enable(struct bfa_ioc_s *ioc); | 333 | void bfa_ioc_enable(struct bfa_ioc_s *ioc); |
331 | void bfa_ioc_disable(struct bfa_ioc_s *ioc); | 334 | void bfa_ioc_disable(struct bfa_ioc_s *ioc); |
@@ -353,7 +356,6 @@ enum bfa_ioc_state bfa_ioc_get_state(struct bfa_ioc_s *ioc); | |||
353 | void bfa_ioc_get_attr(struct bfa_ioc_s *ioc, struct bfa_ioc_attr_s *ioc_attr); | 356 | void bfa_ioc_get_attr(struct bfa_ioc_s *ioc, struct bfa_ioc_attr_s *ioc_attr); |
354 | void bfa_ioc_get_adapter_attr(struct bfa_ioc_s *ioc, | 357 | void bfa_ioc_get_adapter_attr(struct bfa_ioc_s *ioc, |
355 | struct bfa_adapter_attr_s *ad_attr); | 358 | struct bfa_adapter_attr_s *ad_attr); |
356 | int bfa_ioc_debug_trcsz(bfa_boolean_t auto_recover); | ||
357 | void bfa_ioc_debug_memclaim(struct bfa_ioc_s *ioc, void *dbg_fwsave); | 359 | void bfa_ioc_debug_memclaim(struct bfa_ioc_s *ioc, void *dbg_fwsave); |
358 | bfa_status_t bfa_ioc_debug_fwsave(struct bfa_ioc_s *ioc, void *trcdata, | 360 | bfa_status_t bfa_ioc_debug_fwsave(struct bfa_ioc_s *ioc, void *trcdata, |
359 | int *trclen); | 361 | int *trclen); |
@@ -361,15 +363,9 @@ bfa_status_t bfa_ioc_debug_fwtrc(struct bfa_ioc_s *ioc, void *trcdata, | |||
361 | int *trclen); | 363 | int *trclen); |
362 | bfa_status_t bfa_ioc_debug_fwcore(struct bfa_ioc_s *ioc, void *buf, | 364 | bfa_status_t bfa_ioc_debug_fwcore(struct bfa_ioc_s *ioc, void *buf, |
363 | u32 *offset, int *buflen); | 365 | u32 *offset, int *buflen); |
364 | u32 bfa_ioc_smem_pgnum(struct bfa_ioc_s *ioc, u32 fmaddr); | ||
365 | u32 bfa_ioc_smem_pgoff(struct bfa_ioc_s *ioc, u32 fmaddr); | ||
366 | void bfa_ioc_set_fcmode(struct bfa_ioc_s *ioc); | 366 | void bfa_ioc_set_fcmode(struct bfa_ioc_s *ioc); |
367 | bfa_boolean_t bfa_ioc_get_fcmode(struct bfa_ioc_s *ioc); | 367 | bfa_boolean_t bfa_ioc_get_fcmode(struct bfa_ioc_s *ioc); |
368 | void bfa_ioc_hbfail_register(struct bfa_ioc_s *ioc, | ||
369 | struct bfa_ioc_hbfail_notify_s *notify); | ||
370 | bfa_boolean_t bfa_ioc_sem_get(void __iomem *sem_reg); | 368 | bfa_boolean_t bfa_ioc_sem_get(void __iomem *sem_reg); |
371 | void bfa_ioc_sem_release(void __iomem *sem_reg); | ||
372 | void bfa_ioc_hw_sem_release(struct bfa_ioc_s *ioc); | ||
373 | void bfa_ioc_fwver_get(struct bfa_ioc_s *ioc, | 369 | void bfa_ioc_fwver_get(struct bfa_ioc_s *ioc, |
374 | struct bfi_ioc_image_hdr_s *fwhdr); | 370 | struct bfi_ioc_image_hdr_s *fwhdr); |
375 | bfa_boolean_t bfa_ioc_fwver_cmp(struct bfa_ioc_s *ioc, | 371 | bfa_boolean_t bfa_ioc_fwver_cmp(struct bfa_ioc_s *ioc, |
@@ -380,13 +376,8 @@ bfa_status_t bfa_ioc_fw_stats_clear(struct bfa_ioc_s *ioc); | |||
380 | /* | 376 | /* |
381 | * bfa mfg wwn API functions | 377 | * bfa mfg wwn API functions |
382 | */ | 378 | */ |
383 | wwn_t bfa_ioc_get_pwwn(struct bfa_ioc_s *ioc); | ||
384 | wwn_t bfa_ioc_get_nwwn(struct bfa_ioc_s *ioc); | ||
385 | mac_t bfa_ioc_get_mac(struct bfa_ioc_s *ioc); | 379 | mac_t bfa_ioc_get_mac(struct bfa_ioc_s *ioc); |
386 | wwn_t bfa_ioc_get_mfg_pwwn(struct bfa_ioc_s *ioc); | ||
387 | wwn_t bfa_ioc_get_mfg_nwwn(struct bfa_ioc_s *ioc); | ||
388 | mac_t bfa_ioc_get_mfg_mac(struct bfa_ioc_s *ioc); | 380 | mac_t bfa_ioc_get_mfg_mac(struct bfa_ioc_s *ioc); |
389 | u64 bfa_ioc_get_adid(struct bfa_ioc_s *ioc); | ||
390 | 381 | ||
391 | /* | 382 | /* |
392 | * F/W Image Size & Chunk | 383 | * F/W Image Size & Chunk |
diff --git a/drivers/scsi/bfa/bfa_ioc_cb.c b/drivers/scsi/bfa/bfa_ioc_cb.c index 61f03cbe5431..e9c8554e356e 100644 --- a/drivers/scsi/bfa/bfa_ioc_cb.c +++ b/drivers/scsi/bfa/bfa_ioc_cb.c | |||
@@ -181,7 +181,7 @@ bfa_ioc_cb_ownership_reset(struct bfa_ioc_s *ioc) | |||
181 | * will lock it instead of clearing it. | 181 | * will lock it instead of clearing it. |
182 | */ | 182 | */ |
183 | readl(ioc->ioc_regs.ioc_sem_reg); | 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 | ||
diff --git a/drivers/scsi/bfa/bfa_ioc_ct.c b/drivers/scsi/bfa/bfa_ioc_ct.c index 79fb31203636..45d0ddc88c52 100644 --- a/drivers/scsi/bfa/bfa_ioc_ct.c +++ b/drivers/scsi/bfa/bfa_ioc_ct.c | |||
@@ -83,7 +83,7 @@ bfa_ioc_ct_firmware_lock(struct bfa_ioc_s *ioc) | |||
83 | */ | 83 | */ |
84 | if (usecnt == 0) { | 84 | if (usecnt == 0) { |
85 | writel(1, ioc->ioc_regs.ioc_usage_reg); | 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 | bfa_trc(ioc, usecnt); | 87 | bfa_trc(ioc, usecnt); |
88 | return BFA_TRUE; | 88 | return BFA_TRUE; |
89 | } | 89 | } |
@@ -101,7 +101,7 @@ bfa_ioc_ct_firmware_lock(struct bfa_ioc_s *ioc) | |||
101 | */ | 101 | */ |
102 | bfa_ioc_fwver_get(ioc, &fwhdr); | 102 | bfa_ioc_fwver_get(ioc, &fwhdr); |
103 | if (!bfa_ioc_fwver_cmp(ioc, &fwhdr)) { | 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 | bfa_trc(ioc, usecnt); | 105 | bfa_trc(ioc, usecnt); |
106 | return BFA_FALSE; | 106 | return BFA_FALSE; |
107 | } | 107 | } |
@@ -111,7 +111,7 @@ bfa_ioc_ct_firmware_lock(struct bfa_ioc_s *ioc) | |||
111 | */ | 111 | */ |
112 | usecnt++; | 112 | usecnt++; |
113 | writel(usecnt, ioc->ioc_regs.ioc_usage_reg); | 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 | bfa_trc(ioc, usecnt); | 115 | bfa_trc(ioc, usecnt); |
116 | return BFA_TRUE; | 116 | return BFA_TRUE; |
117 | } | 117 | } |
@@ -145,7 +145,7 @@ bfa_ioc_ct_firmware_unlock(struct bfa_ioc_s *ioc) | |||
145 | writel(usecnt, ioc->ioc_regs.ioc_usage_reg); | 145 | writel(usecnt, ioc->ioc_regs.ioc_usage_reg); |
146 | bfa_trc(ioc, usecnt); | 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,7 +313,7 @@ bfa_ioc_ct_ownership_reset(struct bfa_ioc_s *ioc) | |||
313 | if (ioc->cna) { | 313 | if (ioc->cna) { |
314 | bfa_ioc_sem_get(ioc->ioc_regs.ioc_usage_sem_reg); | 314 | bfa_ioc_sem_get(ioc->ioc_regs.ioc_usage_sem_reg); |
315 | writel(0, ioc->ioc_regs.ioc_usage_reg); | 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,7 +322,7 @@ bfa_ioc_ct_ownership_reset(struct bfa_ioc_s *ioc) | |||
322 | * will lock it instead of clearing it. | 322 | * will lock it instead of clearing it. |
323 | */ | 323 | */ |
324 | readl(ioc->ioc_regs.ioc_sem_reg); | 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 | ||
diff --git a/drivers/scsi/bfa/bfa_plog.h b/drivers/scsi/bfa/bfa_plog.h index bdcd8ecd4f4a..1c9baa68339b 100644 --- a/drivers/scsi/bfa/bfa_plog.h +++ b/drivers/scsi/bfa/bfa_plog.h | |||
@@ -151,6 +151,5 @@ void bfa_plog_fchdr(struct bfa_plog_s *plog, enum bfa_plog_mid mid, | |||
151 | void bfa_plog_fchdr_and_pl(struct bfa_plog_s *plog, enum bfa_plog_mid mid, | 151 | void bfa_plog_fchdr_and_pl(struct bfa_plog_s *plog, enum bfa_plog_mid mid, |
152 | enum bfa_plog_eid event, u16 misc, | 152 | enum bfa_plog_eid event, u16 misc, |
153 | struct fchs_s *fchdr, u32 pld_w0); | 153 | struct fchs_s *fchdr, u32 pld_w0); |
154 | bfa_boolean_t bfa_plog_get_setting(struct bfa_plog_s *plog); | ||
155 | 154 | ||
156 | #endif /* __BFA_PORTLOG_H__ */ | 155 | #endif /* __BFA_PORTLOG_H__ */ |
diff --git a/drivers/scsi/bfa/bfa_port.c b/drivers/scsi/bfa/bfa_port.c index fa57b128b3d8..76efb9a5c324 100644 --- a/drivers/scsi/bfa/bfa_port.c +++ b/drivers/scsi/bfa/bfa_port.c | |||
@@ -447,7 +447,7 @@ bfa_port_attach(struct bfa_port_s *port, struct bfa_ioc_s *ioc, | |||
447 | 447 | ||
448 | bfa_ioc_mbox_regisr(port->ioc, BFI_MC_PORT, bfa_port_isr, port); | 448 | bfa_ioc_mbox_regisr(port->ioc, BFI_MC_PORT, bfa_port_isr, port); |
449 | bfa_ioc_hbfail_init(&port->hbfail, bfa_port_hbfail, port); | 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 | * initialize time stamp for stats reset | 453 | * initialize time stamp for stats reset |
diff --git a/drivers/scsi/bfa/bfa_svc.c b/drivers/scsi/bfa/bfa_svc.c index 3a2bee4d42dd..c9192869c0fe 100644 --- a/drivers/scsi/bfa/bfa_svc.c +++ b/drivers/scsi/bfa/bfa_svc.c | |||
@@ -41,19 +41,6 @@ BFA_MODULE(uf); | |||
41 | #define BFA_LPS_MAX_VPORTS_SUPP_CB 255 | 41 | #define BFA_LPS_MAX_VPORTS_SUPP_CB 255 |
42 | #define BFA_LPS_MAX_VPORTS_SUPP_CT 190 | 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 | * FC PORT related definitions | 46 | * FC PORT related definitions |
@@ -113,19 +100,6 @@ enum bfa_fcport_ln_sm_event { | |||
113 | } \ | 100 | } \ |
114 | } while (0) | 101 | } while (0) |
115 | 102 | ||
116 | |||
117 | enum bfa_rport_event { | ||
118 | BFA_RPORT_SM_CREATE = 1, /* rport create event */ | ||
119 | BFA_RPORT_SM_DELETE = 2, /* deleting an existing rport */ | ||
120 | BFA_RPORT_SM_ONLINE = 3, /* rport is online */ | ||
121 | BFA_RPORT_SM_OFFLINE = 4, /* rport is offline */ | ||
122 | BFA_RPORT_SM_FWRSP = 5, /* firmware response */ | ||
123 | BFA_RPORT_SM_HWFAIL = 6, /* IOC h/w failure */ | ||
124 | BFA_RPORT_SM_QOS_SCN = 7, /* QoS SCN from firmware */ | ||
125 | BFA_RPORT_SM_SET_SPEED = 8, /* Set Rport Speed */ | ||
126 | BFA_RPORT_SM_QRESUME = 9, /* space in requeue queue */ | ||
127 | }; | ||
128 | |||
129 | /* | 103 | /* |
130 | * forward declarations FCXP related functions | 104 | * forward declarations FCXP related functions |
131 | */ | 105 | */ |
@@ -438,12 +412,6 @@ bfa_plog_fchdr_and_pl(struct bfa_plog_s *plog, enum bfa_plog_mid mid, | |||
438 | } | 412 | } |
439 | 413 | ||
440 | 414 | ||
441 | bfa_boolean_t | ||
442 | bfa_plog_get_setting(struct bfa_plog_s *plog) | ||
443 | { | ||
444 | return (bfa_boolean_t)plog->plog_enabled; | ||
445 | } | ||
446 | |||
447 | /* | 415 | /* |
448 | * fcxp_pvt BFA FCXP private functions | 416 | * fcxp_pvt BFA FCXP private functions |
449 | */ | 417 | */ |
@@ -1846,24 +1814,6 @@ bfa_lps_fdisclogo(struct bfa_lps_s *lps) | |||
1846 | bfa_sm_send_event(lps, BFA_LPS_SM_LOGOUT); | 1814 | bfa_sm_send_event(lps, BFA_LPS_SM_LOGOUT); |
1847 | } | 1815 | } |
1848 | 1816 | ||
1849 | /* | ||
1850 | * Discard a pending login request -- should be called only for | ||
1851 | * link down handling. | ||
1852 | */ | ||
1853 | void | ||
1854 | bfa_lps_discard(struct bfa_lps_s *lps) | ||
1855 | { | ||
1856 | bfa_sm_send_event(lps, BFA_LPS_SM_OFFLINE); | ||
1857 | } | ||
1858 | |||
1859 | /* | ||
1860 | * Return lport services tag | ||
1861 | */ | ||
1862 | u8 | ||
1863 | bfa_lps_get_tag(struct bfa_lps_s *lps) | ||
1864 | { | ||
1865 | return lps->lp_tag; | ||
1866 | } | ||
1867 | 1817 | ||
1868 | /* | 1818 | /* |
1869 | * Return lport services tag given the pid | 1819 | * Return lport services tag given the pid |
@@ -1884,55 +1834,6 @@ bfa_lps_get_tag_from_pid(struct bfa_s *bfa, u32 pid) | |||
1884 | return 0; | 1834 | return 0; |
1885 | } | 1835 | } |
1886 | 1836 | ||
1887 | /* | ||
1888 | * return if fabric login indicates support for NPIV | ||
1889 | */ | ||
1890 | bfa_boolean_t | ||
1891 | bfa_lps_is_npiv_en(struct bfa_lps_s *lps) | ||
1892 | { | ||
1893 | return lps->npiv_en; | ||
1894 | } | ||
1895 | |||
1896 | /* | ||
1897 | * Return TRUE if attached to F-Port, else return FALSE | ||
1898 | */ | ||
1899 | bfa_boolean_t | ||
1900 | bfa_lps_is_fport(struct bfa_lps_s *lps) | ||
1901 | { | ||
1902 | return lps->fport; | ||
1903 | } | ||
1904 | |||
1905 | /* | ||
1906 | * Return TRUE if attached to a Brocade Fabric | ||
1907 | */ | ||
1908 | bfa_boolean_t | ||
1909 | bfa_lps_is_brcd_fabric(struct bfa_lps_s *lps) | ||
1910 | { | ||
1911 | return lps->brcd_switch; | ||
1912 | } | ||
1913 | /* | ||
1914 | * return TRUE if authentication is required | ||
1915 | */ | ||
1916 | bfa_boolean_t | ||
1917 | bfa_lps_is_authreq(struct bfa_lps_s *lps) | ||
1918 | { | ||
1919 | return lps->auth_req; | ||
1920 | } | ||
1921 | |||
1922 | bfa_eproto_status_t | ||
1923 | bfa_lps_get_extstatus(struct bfa_lps_s *lps) | ||
1924 | { | ||
1925 | return lps->ext_status; | ||
1926 | } | ||
1927 | |||
1928 | /* | ||
1929 | * return port id assigned to the lport | ||
1930 | */ | ||
1931 | u32 | ||
1932 | bfa_lps_get_pid(struct bfa_lps_s *lps) | ||
1933 | { | ||
1934 | return lps->lp_pid; | ||
1935 | } | ||
1936 | 1837 | ||
1937 | /* | 1838 | /* |
1938 | * return port id assigned to the base lport | 1839 | * return port id assigned to the base lport |
@@ -1946,60 +1847,6 @@ bfa_lps_get_base_pid(struct bfa_s *bfa) | |||
1946 | } | 1847 | } |
1947 | 1848 | ||
1948 | /* | 1849 | /* |
1949 | * Return bb_credit assigned in FLOGI response | ||
1950 | */ | ||
1951 | u16 | ||
1952 | bfa_lps_get_peer_bbcredit(struct bfa_lps_s *lps) | ||
1953 | { | ||
1954 | return lps->pr_bbcred; | ||
1955 | } | ||
1956 | |||
1957 | /* | ||
1958 | * Return peer port name | ||
1959 | */ | ||
1960 | wwn_t | ||
1961 | bfa_lps_get_peer_pwwn(struct bfa_lps_s *lps) | ||
1962 | { | ||
1963 | return lps->pr_pwwn; | ||
1964 | } | ||
1965 | |||
1966 | /* | ||
1967 | * Return peer node name | ||
1968 | */ | ||
1969 | wwn_t | ||
1970 | bfa_lps_get_peer_nwwn(struct bfa_lps_s *lps) | ||
1971 | { | ||
1972 | return lps->pr_nwwn; | ||
1973 | } | ||
1974 | |||
1975 | /* | ||
1976 | * return reason code if login request is rejected | ||
1977 | */ | ||
1978 | u8 | ||
1979 | bfa_lps_get_lsrjt_rsn(struct bfa_lps_s *lps) | ||
1980 | { | ||
1981 | return lps->lsrjt_rsn; | ||
1982 | } | ||
1983 | |||
1984 | /* | ||
1985 | * return explanation code if login request is rejected | ||
1986 | */ | ||
1987 | u8 | ||
1988 | bfa_lps_get_lsrjt_expl(struct bfa_lps_s *lps) | ||
1989 | { | ||
1990 | return lps->lsrjt_expl; | ||
1991 | } | ||
1992 | |||
1993 | /* | ||
1994 | * Return fpma/spma MAC for lport | ||
1995 | */ | ||
1996 | mac_t | ||
1997 | bfa_lps_get_lp_mac(struct bfa_lps_s *lps) | ||
1998 | { | ||
1999 | return lps->lp_mac; | ||
2000 | } | ||
2001 | |||
2002 | /* | ||
2003 | * LPS firmware message class handler. | 1850 | * LPS firmware message class handler. |
2004 | */ | 1851 | */ |
2005 | void | 1852 | void |
@@ -3064,8 +2911,8 @@ bfa_fcport_send_disable(struct bfa_fcport_s *fcport) | |||
3064 | static void | 2911 | static void |
3065 | bfa_fcport_set_wwns(struct bfa_fcport_s *fcport) | 2912 | bfa_fcport_set_wwns(struct bfa_fcport_s *fcport) |
3066 | { | 2913 | { |
3067 | fcport->pwwn = bfa_ioc_get_pwwn(&fcport->bfa->ioc); | 2914 | fcport->pwwn = fcport->bfa->ioc.attr->pwwn; |
3068 | fcport->nwwn = bfa_ioc_get_nwwn(&fcport->bfa->ioc); | 2915 | fcport->nwwn = fcport->bfa->ioc.attr->nwwn; |
3069 | 2916 | ||
3070 | bfa_trc(fcport->bfa, fcport->pwwn); | 2917 | bfa_trc(fcport->bfa, fcport->pwwn); |
3071 | bfa_trc(fcport->bfa, fcport->nwwn); | 2918 | bfa_trc(fcport->bfa, fcport->nwwn); |
@@ -3707,8 +3554,8 @@ bfa_fcport_get_attr(struct bfa_s *bfa, struct bfa_port_attr_s *attr) | |||
3707 | attr->nwwn = fcport->nwwn; | 3554 | attr->nwwn = fcport->nwwn; |
3708 | attr->pwwn = fcport->pwwn; | 3555 | attr->pwwn = fcport->pwwn; |
3709 | 3556 | ||
3710 | attr->factorypwwn = bfa_ioc_get_mfg_pwwn(&bfa->ioc); | 3557 | attr->factorypwwn = bfa->ioc.attr->mfg_pwwn; |
3711 | attr->factorynwwn = bfa_ioc_get_mfg_nwwn(&bfa->ioc); | 3558 | attr->factorynwwn = bfa->ioc.attr->mfg_nwwn; |
3712 | 3559 | ||
3713 | memcpy(&attr->pport_cfg, &fcport->cfg, | 3560 | memcpy(&attr->pport_cfg, &fcport->cfg, |
3714 | sizeof(struct bfa_port_cfg_s)); | 3561 | sizeof(struct bfa_port_cfg_s)); |
@@ -3726,7 +3573,7 @@ bfa_fcport_get_attr(struct bfa_s *bfa, struct bfa_port_attr_s *attr) | |||
3726 | /* beacon attributes */ | 3573 | /* beacon attributes */ |
3727 | attr->beacon = fcport->beacon; | 3574 | attr->beacon = fcport->beacon; |
3728 | attr->link_e2e_beacon = fcport->link_e2e_beacon; | 3575 | attr->link_e2e_beacon = fcport->link_e2e_beacon; |
3729 | attr->plog_enabled = bfa_plog_get_setting(fcport->bfa->plog); | 3576 | attr->plog_enabled = (bfa_boolean_t)fcport->bfa->plog->plog_enabled; |
3730 | attr->io_profile = bfa_fcpim_get_io_profile(fcport->bfa); | 3577 | attr->io_profile = bfa_fcpim_get_io_profile(fcport->bfa); |
3731 | 3578 | ||
3732 | attr->pport_cfg.path_tov = bfa_fcpim_path_tov_get(bfa); | 3579 | attr->pport_cfg.path_tov = bfa_fcpim_path_tov_get(bfa); |
@@ -4584,7 +4431,7 @@ bfa_rport_create(struct bfa_s *bfa, void *rport_drv) | |||
4584 | 4431 | ||
4585 | rp->bfa = bfa; | 4432 | rp->bfa = bfa; |
4586 | rp->rport_drv = rport_drv; | 4433 | rp->rport_drv = rport_drv; |
4587 | bfa_rport_clear_stats(rp); | 4434 | memset(&rp->stats, 0, sizeof(rp->stats)); |
4588 | 4435 | ||
4589 | bfa_assert(bfa_sm_cmp_state(rp, bfa_rport_sm_uninit)); | 4436 | bfa_assert(bfa_sm_cmp_state(rp, bfa_rport_sm_uninit)); |
4590 | bfa_sm_send_event(rp, BFA_RPORT_SM_CREATE); | 4437 | bfa_sm_send_event(rp, BFA_RPORT_SM_CREATE); |
@@ -4593,12 +4440,6 @@ bfa_rport_create(struct bfa_s *bfa, void *rport_drv) | |||
4593 | } | 4440 | } |
4594 | 4441 | ||
4595 | void | 4442 | void |
4596 | bfa_rport_delete(struct bfa_rport_s *rport) | ||
4597 | { | ||
4598 | bfa_sm_send_event(rport, BFA_RPORT_SM_DELETE); | ||
4599 | } | ||
4600 | |||
4601 | void | ||
4602 | bfa_rport_online(struct bfa_rport_s *rport, struct bfa_rport_info_s *rport_info) | 4443 | bfa_rport_online(struct bfa_rport_s *rport, struct bfa_rport_info_s *rport_info) |
4603 | { | 4444 | { |
4604 | bfa_assert(rport_info->max_frmsz != 0); | 4445 | bfa_assert(rport_info->max_frmsz != 0); |
@@ -4617,12 +4458,6 @@ bfa_rport_online(struct bfa_rport_s *rport, struct bfa_rport_info_s *rport_info) | |||
4617 | } | 4458 | } |
4618 | 4459 | ||
4619 | void | 4460 | void |
4620 | bfa_rport_offline(struct bfa_rport_s *rport) | ||
4621 | { | ||
4622 | bfa_sm_send_event(rport, BFA_RPORT_SM_OFFLINE); | ||
4623 | } | ||
4624 | |||
4625 | void | ||
4626 | bfa_rport_speed(struct bfa_rport_s *rport, enum bfa_port_speed speed) | 4461 | bfa_rport_speed(struct bfa_rport_s *rport, enum bfa_port_speed speed) |
4627 | { | 4462 | { |
4628 | bfa_assert(speed != 0); | 4463 | bfa_assert(speed != 0); |
@@ -4632,12 +4467,6 @@ bfa_rport_speed(struct bfa_rport_s *rport, enum bfa_port_speed speed) | |||
4632 | bfa_sm_send_event(rport, BFA_RPORT_SM_SET_SPEED); | 4467 | bfa_sm_send_event(rport, BFA_RPORT_SM_SET_SPEED); |
4633 | } | 4468 | } |
4634 | 4469 | ||
4635 | void | ||
4636 | bfa_rport_clear_stats(struct bfa_rport_s *rport) | ||
4637 | { | ||
4638 | memset(&rport->stats, 0, sizeof(rport->stats)); | ||
4639 | } | ||
4640 | |||
4641 | 4470 | ||
4642 | /* | 4471 | /* |
4643 | * SGPG related functions | 4472 | * SGPG related functions |
@@ -5101,8 +4930,6 @@ bfa_uf_start(struct bfa_s *bfa) | |||
5101 | bfa_uf_post_all(BFA_UF_MOD(bfa)); | 4930 | bfa_uf_post_all(BFA_UF_MOD(bfa)); |
5102 | } | 4931 | } |
5103 | 4932 | ||
5104 | |||
5105 | |||
5106 | /* | 4933 | /* |
5107 | * hal_uf_api | 4934 | * hal_uf_api |
5108 | */ | 4935 | */ |
diff --git a/drivers/scsi/bfa/bfa_svc.h b/drivers/scsi/bfa/bfa_svc.h index 0e23c1bfcba0..29b091826e9b 100644 --- a/drivers/scsi/bfa/bfa_svc.h +++ b/drivers/scsi/bfa/bfa_svc.h | |||
@@ -220,6 +220,18 @@ void bfa_fcxp_isr(struct bfa_s *bfa, struct bfi_msg_s *msg); | |||
220 | /* | 220 | /* |
221 | * RPORT related defines | 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 | #define BFA_RPORT_MIN 4 | 235 | #define BFA_RPORT_MIN 4 |
224 | 236 | ||
225 | struct bfa_rport_mod_s { | 237 | struct bfa_rport_mod_s { |
@@ -516,12 +528,9 @@ bfa_boolean_t bfa_fcport_is_qos_enabled(struct bfa_s *bfa); | |||
516 | * bfa rport API functions | 528 | * bfa rport API functions |
517 | */ | 529 | */ |
518 | struct bfa_rport_s *bfa_rport_create(struct bfa_s *bfa, void *rport_drv); | 530 | struct bfa_rport_s *bfa_rport_create(struct bfa_s *bfa, void *rport_drv); |
519 | void bfa_rport_delete(struct bfa_rport_s *rport); | ||
520 | void bfa_rport_online(struct bfa_rport_s *rport, | 531 | void bfa_rport_online(struct bfa_rport_s *rport, |
521 | struct bfa_rport_info_s *rport_info); | 532 | struct bfa_rport_info_s *rport_info); |
522 | void bfa_rport_offline(struct bfa_rport_s *rport); | ||
523 | void bfa_rport_speed(struct bfa_rport_s *rport, enum bfa_port_speed speed); | 533 | void bfa_rport_speed(struct bfa_rport_s *rport, enum bfa_port_speed speed); |
524 | void bfa_rport_clear_stats(struct bfa_rport_s *rport); | ||
525 | void bfa_cb_rport_online(void *rport); | 534 | void bfa_cb_rport_online(void *rport); |
526 | void bfa_cb_rport_offline(void *rport); | 535 | void bfa_cb_rport_offline(void *rport); |
527 | void bfa_cb_rport_qos_scn_flowid(void *rport, | 536 | void bfa_cb_rport_qos_scn_flowid(void *rport, |
@@ -594,28 +603,14 @@ void bfa_uf_free(struct bfa_uf_s *uf); | |||
594 | u32 bfa_lps_get_max_vport(struct bfa_s *bfa); | 603 | u32 bfa_lps_get_max_vport(struct bfa_s *bfa); |
595 | struct bfa_lps_s *bfa_lps_alloc(struct bfa_s *bfa); | 604 | struct bfa_lps_s *bfa_lps_alloc(struct bfa_s *bfa); |
596 | void bfa_lps_delete(struct bfa_lps_s *lps); | 605 | void bfa_lps_delete(struct bfa_lps_s *lps); |
597 | void bfa_lps_discard(struct bfa_lps_s *lps); | ||
598 | void bfa_lps_flogi(struct bfa_lps_s *lps, void *uarg, u8 alpa, | 606 | void bfa_lps_flogi(struct bfa_lps_s *lps, void *uarg, u8 alpa, |
599 | u16 pdusz, wwn_t pwwn, wwn_t nwwn, | 607 | u16 pdusz, wwn_t pwwn, wwn_t nwwn, |
600 | bfa_boolean_t auth_en); | 608 | bfa_boolean_t auth_en); |
601 | void bfa_lps_fdisc(struct bfa_lps_s *lps, void *uarg, u16 pdusz, | 609 | void bfa_lps_fdisc(struct bfa_lps_s *lps, void *uarg, u16 pdusz, |
602 | wwn_t pwwn, wwn_t nwwn); | 610 | wwn_t pwwn, wwn_t nwwn); |
603 | void bfa_lps_fdisclogo(struct bfa_lps_s *lps); | 611 | void bfa_lps_fdisclogo(struct bfa_lps_s *lps); |
604 | u8 bfa_lps_get_tag(struct bfa_lps_s *lps); | ||
605 | bfa_boolean_t bfa_lps_is_npiv_en(struct bfa_lps_s *lps); | ||
606 | bfa_boolean_t bfa_lps_is_fport(struct bfa_lps_s *lps); | ||
607 | bfa_boolean_t bfa_lps_is_brcd_fabric(struct bfa_lps_s *lps); | ||
608 | bfa_boolean_t bfa_lps_is_authreq(struct bfa_lps_s *lps); | ||
609 | bfa_eproto_status_t bfa_lps_get_extstatus(struct bfa_lps_s *lps); | ||
610 | u32 bfa_lps_get_pid(struct bfa_lps_s *lps); | ||
611 | u32 bfa_lps_get_base_pid(struct bfa_s *bfa); | 612 | u32 bfa_lps_get_base_pid(struct bfa_s *bfa); |
612 | u8 bfa_lps_get_tag_from_pid(struct bfa_s *bfa, u32 pid); | 613 | u8 bfa_lps_get_tag_from_pid(struct bfa_s *bfa, u32 pid); |
613 | u16 bfa_lps_get_peer_bbcredit(struct bfa_lps_s *lps); | ||
614 | wwn_t bfa_lps_get_peer_pwwn(struct bfa_lps_s *lps); | ||
615 | wwn_t bfa_lps_get_peer_nwwn(struct bfa_lps_s *lps); | ||
616 | u8 bfa_lps_get_lsrjt_rsn(struct bfa_lps_s *lps); | ||
617 | u8 bfa_lps_get_lsrjt_expl(struct bfa_lps_s *lps); | ||
618 | mac_t bfa_lps_get_lp_mac(struct bfa_lps_s *lps); | ||
619 | void bfa_cb_lps_flogi_comp(void *bfad, void *uarg, bfa_status_t status); | 614 | void bfa_cb_lps_flogi_comp(void *bfad, void *uarg, bfa_status_t status); |
620 | void bfa_cb_lps_fdisc_comp(void *bfad, void *uarg, bfa_status_t status); | 615 | void bfa_cb_lps_fdisc_comp(void *bfad, void *uarg, bfa_status_t status); |
621 | void bfa_cb_lps_fdisclogo_comp(void *bfad, void *uarg); | 616 | void bfa_cb_lps_fdisclogo_comp(void *bfad, void *uarg); |
diff --git a/drivers/scsi/bfa/bfad.c b/drivers/scsi/bfa/bfad.c index 4239fdf0d2d1..2bc786212521 100644 --- a/drivers/scsi/bfa/bfad.c +++ b/drivers/scsi/bfa/bfad.c | |||
@@ -206,7 +206,7 @@ bfad_sm_created(struct bfad_s *bfad, enum bfad_sm_event event) | |||
206 | } | 206 | } |
207 | 207 | ||
208 | spin_lock_irqsave(&bfad->bfad_lock, flags); | 208 | spin_lock_irqsave(&bfad->bfad_lock, flags); |
209 | bfa_init(&bfad->bfa); | 209 | bfa_iocfc_init(&bfad->bfa); |
210 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); | 210 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); |
211 | 211 | ||
212 | /* Set up interrupt handler for each vectors */ | 212 | /* Set up interrupt handler for each vectors */ |
@@ -725,7 +725,7 @@ bfad_bfa_tmo(unsigned long data) | |||
725 | 725 | ||
726 | spin_lock_irqsave(&bfad->bfad_lock, flags); | 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 | bfa_comp_deq(&bfad->bfa, &doneq); | 730 | bfa_comp_deq(&bfad->bfa, &doneq); |
731 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); | 731 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); |
@@ -882,8 +882,8 @@ bfad_drv_init(struct bfad_s *bfad) | |||
882 | goto out_hal_mem_alloc_failure; | 882 | goto out_hal_mem_alloc_failure; |
883 | } | 883 | } |
884 | 884 | ||
885 | bfa_init_trc(&bfad->bfa, bfad->trcmod); | 885 | bfad->bfa.trcmod = bfad->trcmod; |
886 | bfa_init_plog(&bfad->bfa, &bfad->plog_buf); | 886 | bfad->bfa.plog = &bfad->plog_buf; |
887 | bfa_plog_init(&bfad->plog_buf); | 887 | bfa_plog_init(&bfad->plog_buf); |
888 | bfa_plog_str(&bfad->plog_buf, BFA_PL_MID_DRVR, BFA_PL_EID_DRIVER_START, | 888 | bfa_plog_str(&bfad->plog_buf, BFA_PL_MID_DRVR, BFA_PL_EID_DRIVER_START, |
889 | 0, "Driver Attach"); | 889 | 0, "Driver Attach"); |
@@ -893,9 +893,9 @@ bfad_drv_init(struct bfad_s *bfad) | |||
893 | 893 | ||
894 | /* FCS INIT */ | 894 | /* FCS INIT */ |
895 | spin_lock_irqsave(&bfad->bfad_lock, flags); | 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 | bfa_fcs_attach(&bfad->bfa_fcs, &bfad->bfa, bfad, BFA_FALSE); | 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 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); | 899 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); |
900 | 900 | ||
901 | bfad->bfad_flags |= BFAD_DRV_INIT_DONE; | 901 | bfad->bfad_flags |= BFAD_DRV_INIT_DONE; |
@@ -913,7 +913,7 @@ bfad_drv_uninit(struct bfad_s *bfad) | |||
913 | 913 | ||
914 | spin_lock_irqsave(&bfad->bfad_lock, flags); | 914 | spin_lock_irqsave(&bfad->bfad_lock, flags); |
915 | init_completion(&bfad->comp); | 915 | init_completion(&bfad->comp); |
916 | bfa_stop(&bfad->bfa); | 916 | bfa_iocfc_stop(&bfad->bfa); |
917 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); | 917 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); |
918 | wait_for_completion(&bfad->comp); | 918 | wait_for_completion(&bfad->comp); |
919 | 919 | ||
@@ -932,8 +932,8 @@ bfad_drv_start(struct bfad_s *bfad) | |||
932 | unsigned long flags; | 932 | unsigned long flags; |
933 | 933 | ||
934 | spin_lock_irqsave(&bfad->bfad_lock, flags); | 934 | spin_lock_irqsave(&bfad->bfad_lock, flags); |
935 | bfa_start(&bfad->bfa); | 935 | bfa_iocfc_start(&bfad->bfa); |
936 | bfa_fcs_start(&bfad->bfa_fcs); | 936 | bfa_fcs_fabric_modstart(&bfad->bfa_fcs); |
937 | bfad->bfad_flags |= BFAD_HAL_START_DONE; | 937 | bfad->bfad_flags |= BFAD_HAL_START_DONE; |
938 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); | 938 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); |
939 | 939 | ||
@@ -963,7 +963,7 @@ bfad_stop(struct bfad_s *bfad) | |||
963 | 963 | ||
964 | spin_lock_irqsave(&bfad->bfad_lock, flags); | 964 | spin_lock_irqsave(&bfad->bfad_lock, flags); |
965 | init_completion(&bfad->comp); | 965 | init_completion(&bfad->comp); |
966 | bfa_stop(&bfad->bfa); | 966 | bfa_iocfc_stop(&bfad->bfa); |
967 | bfad->bfad_flags &= ~BFAD_HAL_START_DONE; | 967 | bfad->bfad_flags &= ~BFAD_HAL_START_DONE; |
968 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); | 968 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); |
969 | wait_for_completion(&bfad->comp); | 969 | wait_for_completion(&bfad->comp); |
@@ -1524,7 +1524,7 @@ bfad_init(void) | |||
1524 | if (strcmp(FCPI_NAME, " fcpim") == 0) | 1524 | if (strcmp(FCPI_NAME, " fcpim") == 0) |
1525 | supported_fc4s |= BFA_LPORT_ROLE_FCP_IM; | 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 | bfa_fcs_rport_set_del_timeout(rport_del_timeout); | 1528 | bfa_fcs_rport_set_del_timeout(rport_del_timeout); |
1529 | 1529 | ||
1530 | error = pci_register_driver(&bfad_pci_driver); | 1530 | error = pci_register_driver(&bfad_pci_driver); |
diff --git a/drivers/scsi/bfa/bfad_debugfs.c b/drivers/scsi/bfa/bfad_debugfs.c index 0fbd620474c7..c66e32eced7b 100644 --- a/drivers/scsi/bfa/bfad_debugfs.c +++ b/drivers/scsi/bfa/bfad_debugfs.c | |||
@@ -90,7 +90,7 @@ bfad_debugfs_open_fwtrc(struct inode *inode, struct file *file) | |||
90 | memset(fw_debug->debug_buffer, 0, fw_debug->buffer_len); | 90 | memset(fw_debug->debug_buffer, 0, fw_debug->buffer_len); |
91 | 91 | ||
92 | spin_lock_irqsave(&bfad->bfad_lock, flags); | 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 | fw_debug->debug_buffer, | 94 | fw_debug->debug_buffer, |
95 | &fw_debug->buffer_len); | 95 | &fw_debug->buffer_len); |
96 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); | 96 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); |
@@ -134,7 +134,7 @@ bfad_debugfs_open_fwsave(struct inode *inode, struct file *file) | |||
134 | memset(fw_debug->debug_buffer, 0, fw_debug->buffer_len); | 134 | memset(fw_debug->debug_buffer, 0, fw_debug->buffer_len); |
135 | 135 | ||
136 | spin_lock_irqsave(&bfad->bfad_lock, flags); | 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 | fw_debug->debug_buffer, | 138 | fw_debug->debug_buffer, |
139 | &fw_debug->buffer_len); | 139 | &fw_debug->buffer_len); |
140 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); | 140 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); |
diff --git a/drivers/scsi/bfa/bfad_im.c b/drivers/scsi/bfa/bfad_im.c index fbad5e9b2402..bcab8912dd59 100644 --- a/drivers/scsi/bfa/bfad_im.c +++ b/drivers/scsi/bfa/bfad_im.c | |||
@@ -922,7 +922,7 @@ bfad_im_supported_speeds(struct bfa_s *bfa) | |||
922 | if (!ioc_attr) | 922 | if (!ioc_attr) |
923 | return 0; | 923 | return 0; |
924 | 924 | ||
925 | bfa_get_attr(bfa, ioc_attr); | 925 | bfa_ioc_get_attr(&bfa->ioc, ioc_attr); |
926 | if (ioc_attr->adapter_attr.max_speed == BFA_PORT_SPEED_8GBPS) { | 926 | if (ioc_attr->adapter_attr.max_speed == BFA_PORT_SPEED_8GBPS) { |
927 | if (ioc_attr->adapter_attr.is_mezz) { | 927 | if (ioc_attr->adapter_attr.is_mezz) { |
928 | supported_speed |= FC_PORTSPEED_8GBIT | | 928 | supported_speed |= FC_PORTSPEED_8GBIT | |