aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaggie Zhang <xmzhang@brocade.com>2010-12-09 22:13:20 -0500
committerJames Bottomley <James.Bottomley@suse.de>2010-12-21 13:32:58 -0500
commitda99dcc98dd66a2de4864645bcafffd93cf5a62f (patch)
treeda6286a7f91f2087f916f6949dbd67d46570fe58
parentf16a17507b09e10e0cccc4d675ccbfe030d51ef1 (diff)
[SCSI] bfa: remove unused functions and misc cleanups
Remove unused functions and fix checkpatch errors. Misc cleanups in comment and formatting. 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_core.c2
-rw-r--r--drivers/scsi/bfa/bfa_fcbuild.c7
-rw-r--r--drivers/scsi/bfa/bfa_fcpim.c340
-rw-r--r--drivers/scsi/bfa/bfa_fcpim.h158
-rw-r--r--drivers/scsi/bfa/bfa_fcs_lport.c3
-rw-r--r--drivers/scsi/bfa/bfa_fcs_rport.c3
-rw-r--r--drivers/scsi/bfa/bfa_ioc.c16
-rw-r--r--drivers/scsi/bfa/bfa_svc.c38
8 files changed, 110 insertions, 457 deletions
diff --git a/drivers/scsi/bfa/bfa_core.c b/drivers/scsi/bfa/bfa_core.c
index 02a5e04e365..3f7f3742e72 100644
--- a/drivers/scsi/bfa/bfa_core.c
+++ b/drivers/scsi/bfa/bfa_core.c
@@ -342,7 +342,7 @@ bfa_msix_lpu_err(struct bfa_s *bfa, int vec)
342 intr = readl(bfa->iocfc.bfa_regs.intr_status); 342 intr = readl(bfa->iocfc.bfa_regs.intr_status);
343 343
344 if (intr & (__HFN_INT_MBOX_LPU0 | __HFN_INT_MBOX_LPU1)) 344 if (intr & (__HFN_INT_MBOX_LPU0 | __HFN_INT_MBOX_LPU1))
345 bfa_ioc_mbox_isr(&bfa->ioc); 345 bfa_ioc_mbox_isr(&bfa->ioc);
346 346
347 intr &= (__HFN_INT_ERR_EMC | __HFN_INT_ERR_LPU0 | 347 intr &= (__HFN_INT_ERR_EMC | __HFN_INT_ERR_LPU0 |
348 __HFN_INT_ERR_LPU1 | __HFN_INT_ERR_PSS | __HFN_INT_LL_HALT); 348 __HFN_INT_ERR_LPU1 | __HFN_INT_ERR_PSS | __HFN_INT_LL_HALT);
diff --git a/drivers/scsi/bfa/bfa_fcbuild.c b/drivers/scsi/bfa/bfa_fcbuild.c
index 1ca5af75dd3..b7e25345165 100644
--- a/drivers/scsi/bfa/bfa_fcbuild.c
+++ b/drivers/scsi/bfa/bfa_fcbuild.c
@@ -456,7 +456,7 @@ fc_logo_build(struct fchs_s *fchs, struct fc_logo_s *logo, u32 d_id, u32 s_id,
456 return sizeof(struct fc_logo_s); 456 return sizeof(struct fc_logo_s);
457} 457}
458 458
459static u16 459static u16
460fc_adisc_x_build(struct fchs_s *fchs, struct fc_adisc_s *adisc, u32 d_id, 460fc_adisc_x_build(struct fchs_s *fchs, struct fc_adisc_s *adisc, u32 d_id,
461 u32 s_id, __be16 ox_id, wwn_t port_name, 461 u32 s_id, __be16 ox_id, wwn_t port_name,
462 wwn_t node_name, u8 els_code) 462 wwn_t node_name, u8 els_code)
@@ -807,11 +807,6 @@ fc_rpsc_acc_build(struct fchs_s *fchs, struct fc_rpsc_acc_s *rpsc_acc,
807 return sizeof(struct fc_rpsc_acc_s); 807 return sizeof(struct fc_rpsc_acc_s);
808} 808}
809 809
810/*
811 * TBD -
812 * . get rid of unnecessary memsets
813 */
814
815u16 810u16
816fc_logo_rsp_parse(struct fchs_s *fchs, int len) 811fc_logo_rsp_parse(struct fchs_s *fchs, int len)
817{ 812{
diff --git a/drivers/scsi/bfa/bfa_fcpim.c b/drivers/scsi/bfa/bfa_fcpim.c
index 506f1d326e5..314c9312298 100644
--- a/drivers/scsi/bfa/bfa_fcpim.c
+++ b/drivers/scsi/bfa/bfa_fcpim.c
@@ -21,11 +21,6 @@
21BFA_TRC_FILE(HAL, FCPIM); 21BFA_TRC_FILE(HAL, FCPIM);
22BFA_MODULE(fcpim); 22BFA_MODULE(fcpim);
23 23
24
25#define bfa_fcpim_add_iostats(__l, __r, __stats) \
26 (__l->__stats += __r->__stats)
27
28
29/* 24/*
30 * BFA ITNIM Related definitions 25 * BFA ITNIM Related definitions
31 */ 26 */
@@ -73,10 +68,8 @@ static void bfa_itnim_update_del_itn_stats(struct bfa_itnim_s *itnim);
73} while (0) 68} while (0)
74 69
75/* 70/*
76 * bfa_itnim_sm BFA itnim state machine 71 * itnim state machine event
77 */ 72 */
78
79
80enum bfa_itnim_event { 73enum bfa_itnim_event {
81 BFA_ITNIM_SM_CREATE = 1, /* itnim is created */ 74 BFA_ITNIM_SM_CREATE = 1, /* itnim is created */
82 BFA_ITNIM_SM_ONLINE = 2, /* itnim is online */ 75 BFA_ITNIM_SM_ONLINE = 2, /* itnim is online */
@@ -228,7 +221,6 @@ static void __bfa_cb_ioim_failed(void *cbarg, bfa_boolean_t complete);
228static void __bfa_cb_ioim_pathtov(void *cbarg, bfa_boolean_t complete); 221static void __bfa_cb_ioim_pathtov(void *cbarg, bfa_boolean_t complete);
229static bfa_boolean_t bfa_ioim_is_abortable(struct bfa_ioim_s *ioim); 222static bfa_boolean_t bfa_ioim_is_abortable(struct bfa_ioim_s *ioim);
230 223
231
232/* 224/*
233 * forward declaration of BFA IO state machine 225 * forward declaration of BFA IO state machine
234 */ 226 */
@@ -256,7 +248,6 @@ static void bfa_ioim_sm_resfree(struct bfa_ioim_s *ioim,
256 enum bfa_ioim_event event); 248 enum bfa_ioim_event event);
257static void bfa_ioim_sm_cmnd_retry(struct bfa_ioim_s *ioim, 249static void bfa_ioim_sm_cmnd_retry(struct bfa_ioim_s *ioim,
258 enum bfa_ioim_event event); 250 enum bfa_ioim_event event);
259
260/* 251/*
261 * forward declaration for BFA TSKIM functions 252 * forward declaration for BFA TSKIM functions
262 */ 253 */
@@ -271,7 +262,6 @@ static bfa_boolean_t bfa_tskim_send(struct bfa_tskim_s *tskim);
271static bfa_boolean_t bfa_tskim_send_abort(struct bfa_tskim_s *tskim); 262static bfa_boolean_t bfa_tskim_send_abort(struct bfa_tskim_s *tskim);
272static void bfa_tskim_iocdisable_ios(struct bfa_tskim_s *tskim); 263static void bfa_tskim_iocdisable_ios(struct bfa_tskim_s *tskim);
273 264
274
275/* 265/*
276 * forward declaration of BFA TSKIM state machine 266 * forward declaration of BFA TSKIM state machine
277 */ 267 */
@@ -289,13 +279,12 @@ static void bfa_tskim_sm_cleanup_qfull(struct bfa_tskim_s *tskim,
289 enum bfa_tskim_event event); 279 enum bfa_tskim_event event);
290static void bfa_tskim_sm_hcb(struct bfa_tskim_s *tskim, 280static void bfa_tskim_sm_hcb(struct bfa_tskim_s *tskim,
291 enum bfa_tskim_event event); 281 enum bfa_tskim_event event);
292
293/* 282/*
294 * BFA FCP Initiator Mode module 283 * BFA FCP Initiator Mode module
295 */ 284 */
296 285
297/* 286/*
298 * Compute and return memory needed by FCP(im) module. 287 * Compute and return memory needed by FCP(im) module.
299 */ 288 */
300static void 289static void
301bfa_fcpim_meminfo(struct bfa_iocfc_cfg_s *cfg, u32 *km_len, 290bfa_fcpim_meminfo(struct bfa_iocfc_cfg_s *cfg, u32 *km_len,
@@ -379,56 +368,6 @@ bfa_fcpim_iocdisable(struct bfa_s *bfa)
379} 368}
380 369
381void 370void
382bfa_fcpim_add_stats(struct bfa_itnim_iostats_s *lstats,
383 struct bfa_itnim_iostats_s *rstats)
384{
385 bfa_fcpim_add_iostats(lstats, rstats, total_ios);
386 bfa_fcpim_add_iostats(lstats, rstats, qresumes);
387 bfa_fcpim_add_iostats(lstats, rstats, no_iotags);
388 bfa_fcpim_add_iostats(lstats, rstats, io_aborts);
389 bfa_fcpim_add_iostats(lstats, rstats, no_tskims);
390 bfa_fcpim_add_iostats(lstats, rstats, iocomp_ok);
391 bfa_fcpim_add_iostats(lstats, rstats, iocomp_underrun);
392 bfa_fcpim_add_iostats(lstats, rstats, iocomp_overrun);
393 bfa_fcpim_add_iostats(lstats, rstats, iocomp_aborted);
394 bfa_fcpim_add_iostats(lstats, rstats, iocomp_timedout);
395 bfa_fcpim_add_iostats(lstats, rstats, iocom_nexus_abort);
396 bfa_fcpim_add_iostats(lstats, rstats, iocom_proto_err);
397 bfa_fcpim_add_iostats(lstats, rstats, iocom_dif_err);
398 bfa_fcpim_add_iostats(lstats, rstats, iocom_sqer_needed);
399 bfa_fcpim_add_iostats(lstats, rstats, iocom_res_free);
400 bfa_fcpim_add_iostats(lstats, rstats, iocom_hostabrts);
401 bfa_fcpim_add_iostats(lstats, rstats, iocom_utags);
402 bfa_fcpim_add_iostats(lstats, rstats, io_cleanups);
403 bfa_fcpim_add_iostats(lstats, rstats, io_tmaborts);
404 bfa_fcpim_add_iostats(lstats, rstats, onlines);
405 bfa_fcpim_add_iostats(lstats, rstats, offlines);
406 bfa_fcpim_add_iostats(lstats, rstats, creates);
407 bfa_fcpim_add_iostats(lstats, rstats, deletes);
408 bfa_fcpim_add_iostats(lstats, rstats, create_comps);
409 bfa_fcpim_add_iostats(lstats, rstats, delete_comps);
410 bfa_fcpim_add_iostats(lstats, rstats, sler_events);
411 bfa_fcpim_add_iostats(lstats, rstats, fw_create);
412 bfa_fcpim_add_iostats(lstats, rstats, fw_delete);
413 bfa_fcpim_add_iostats(lstats, rstats, ioc_disabled);
414 bfa_fcpim_add_iostats(lstats, rstats, cleanup_comps);
415 bfa_fcpim_add_iostats(lstats, rstats, tm_cmnds);
416 bfa_fcpim_add_iostats(lstats, rstats, tm_fw_rsps);
417 bfa_fcpim_add_iostats(lstats, rstats, tm_success);
418 bfa_fcpim_add_iostats(lstats, rstats, tm_failures);
419 bfa_fcpim_add_iostats(lstats, rstats, tm_io_comps);
420 bfa_fcpim_add_iostats(lstats, rstats, tm_qresumes);
421 bfa_fcpim_add_iostats(lstats, rstats, tm_iocdowns);
422 bfa_fcpim_add_iostats(lstats, rstats, tm_cleanups);
423 bfa_fcpim_add_iostats(lstats, rstats, tm_cleanup_comps);
424 bfa_fcpim_add_iostats(lstats, rstats, io_comps);
425 bfa_fcpim_add_iostats(lstats, rstats, input_reqs);
426 bfa_fcpim_add_iostats(lstats, rstats, output_reqs);
427 bfa_fcpim_add_iostats(lstats, rstats, rd_throughput);
428 bfa_fcpim_add_iostats(lstats, rstats, wr_throughput);
429}
430
431void
432bfa_fcpim_path_tov_set(struct bfa_s *bfa, u16 path_tov) 371bfa_fcpim_path_tov_set(struct bfa_s *bfa, u16 path_tov)
433{ 372{
434 struct bfa_fcpim_mod_s *fcpim = BFA_FCPIM_MOD(bfa); 373 struct bfa_fcpim_mod_s *fcpim = BFA_FCPIM_MOD(bfa);
@@ -446,128 +385,6 @@ bfa_fcpim_path_tov_get(struct bfa_s *bfa)
446 return fcpim->path_tov / 1000; 385 return fcpim->path_tov / 1000;
447} 386}
448 387
449bfa_status_t
450bfa_fcpim_port_iostats(struct bfa_s *bfa, struct bfa_itnim_iostats_s *stats,
451 u8 lp_tag)
452{
453 struct bfa_fcpim_mod_s *fcpim = BFA_FCPIM_MOD(bfa);
454 struct list_head *qe, *qen;
455 struct bfa_itnim_s *itnim;
456
457 /* accumulate IO stats from itnim */
458 memset(stats, 0, sizeof(struct bfa_itnim_iostats_s));
459 list_for_each_safe(qe, qen, &fcpim->itnim_q) {
460 itnim = (struct bfa_itnim_s *) qe;
461 if (itnim->rport->rport_info.lp_tag != lp_tag)
462 continue;
463 bfa_fcpim_add_stats(stats, &(itnim->stats));
464 }
465 return BFA_STATUS_OK;
466}
467bfa_status_t
468bfa_fcpim_get_modstats(struct bfa_s *bfa, struct bfa_itnim_iostats_s *modstats)
469{
470 struct bfa_fcpim_mod_s *fcpim = BFA_FCPIM_MOD(bfa);
471 struct list_head *qe, *qen;
472 struct bfa_itnim_s *itnim;
473
474 /* accumulate IO stats from itnim */
475 memset(modstats, 0, sizeof(struct bfa_itnim_iostats_s));
476 list_for_each_safe(qe, qen, &fcpim->itnim_q) {
477 itnim = (struct bfa_itnim_s *) qe;
478 bfa_fcpim_add_stats(modstats, &(itnim->stats));
479 }
480 return BFA_STATUS_OK;
481}
482
483bfa_status_t
484bfa_fcpim_get_del_itn_stats(struct bfa_s *bfa,
485 struct bfa_fcpim_del_itn_stats_s *modstats)
486{
487 struct bfa_fcpim_mod_s *fcpim = BFA_FCPIM_MOD(bfa);
488
489 *modstats = fcpim->del_itn_stats;
490
491 return BFA_STATUS_OK;
492}
493
494
495bfa_status_t
496bfa_fcpim_profile_on(struct bfa_s *bfa, u32 time)
497{
498 struct bfa_itnim_s *itnim;
499 struct bfa_fcpim_mod_s *fcpim = BFA_FCPIM_MOD(bfa);
500 struct list_head *qe, *qen;
501
502 /* accumulate IO stats from itnim */
503 list_for_each_safe(qe, qen, &fcpim->itnim_q) {
504 itnim = (struct bfa_itnim_s *) qe;
505 bfa_itnim_clear_stats(itnim);
506 }
507 fcpim->io_profile = BFA_TRUE;
508 fcpim->io_profile_start_time = time;
509 fcpim->profile_comp = bfa_ioim_profile_comp;
510 fcpim->profile_start = bfa_ioim_profile_start;
511
512 return BFA_STATUS_OK;
513}
514bfa_status_t
515bfa_fcpim_profile_off(struct bfa_s *bfa)
516{
517 struct bfa_fcpim_mod_s *fcpim = BFA_FCPIM_MOD(bfa);
518 fcpim->io_profile = BFA_FALSE;
519 fcpim->io_profile_start_time = 0;
520 fcpim->profile_comp = NULL;
521 fcpim->profile_start = NULL;
522 return BFA_STATUS_OK;
523}
524
525bfa_status_t
526bfa_fcpim_port_clear_iostats(struct bfa_s *bfa, u8 lp_tag)
527{
528 struct bfa_fcpim_mod_s *fcpim = BFA_FCPIM_MOD(bfa);
529 struct list_head *qe, *qen;
530 struct bfa_itnim_s *itnim;
531
532 /* clear IO stats from all active itnims */
533 list_for_each_safe(qe, qen, &fcpim->itnim_q) {
534 itnim = (struct bfa_itnim_s *) qe;
535 if (itnim->rport->rport_info.lp_tag != lp_tag)
536 continue;
537 bfa_itnim_clear_stats(itnim);
538 }
539 return BFA_STATUS_OK;
540
541}
542
543bfa_status_t
544bfa_fcpim_clr_modstats(struct bfa_s *bfa)
545{
546 struct bfa_fcpim_mod_s *fcpim = BFA_FCPIM_MOD(bfa);
547 struct list_head *qe, *qen;
548 struct bfa_itnim_s *itnim;
549
550 /* clear IO stats from all active itnims */
551 list_for_each_safe(qe, qen, &fcpim->itnim_q) {
552 itnim = (struct bfa_itnim_s *) qe;
553 bfa_itnim_clear_stats(itnim);
554 }
555 memset(&fcpim->del_itn_stats, 0,
556 sizeof(struct bfa_fcpim_del_itn_stats_s));
557
558 return BFA_STATUS_OK;
559}
560
561void
562bfa_fcpim_qdepth_set(struct bfa_s *bfa, u16 q_depth)
563{
564 struct bfa_fcpim_mod_s *fcpim = BFA_FCPIM_MOD(bfa);
565
566 bfa_assert(q_depth <= BFA_IOCFC_QDEPTH_MAX);
567
568 fcpim->q_depth = q_depth;
569}
570
571u16 388u16
572bfa_fcpim_qdepth_get(struct bfa_s *bfa) 389bfa_fcpim_qdepth_get(struct bfa_s *bfa)
573{ 390{
@@ -576,32 +393,12 @@ bfa_fcpim_qdepth_get(struct bfa_s *bfa)
576 return fcpim->q_depth; 393 return fcpim->q_depth;
577} 394}
578 395
579void
580bfa_fcpim_update_ioredirect(struct bfa_s *bfa)
581{
582 bfa_boolean_t ioredirect;
583
584 /*
585 * IO redirection is turned off when QoS is enabled and vice versa
586 */
587 ioredirect = bfa_fcport_is_qos_enabled(bfa) ? BFA_FALSE : BFA_TRUE;
588}
589
590void
591bfa_fcpim_set_ioredirect(struct bfa_s *bfa, bfa_boolean_t state)
592{
593 struct bfa_fcpim_mod_s *fcpim = BFA_FCPIM_MOD(bfa);
594 fcpim->ioredirect = state;
595}
596
597
598
599/* 396/*
600 * BFA ITNIM module state machine functions 397 * BFA ITNIM module state machine functions
601 */ 398 */
602 399
603/* 400/*
604 * Beginning/unallocated state - no events expected. 401 * Beginning/unallocated state - no events expected.
605 */ 402 */
606static void 403static void
607bfa_itnim_sm_uninit(struct bfa_itnim_s *itnim, enum bfa_itnim_event event) 404bfa_itnim_sm_uninit(struct bfa_itnim_s *itnim, enum bfa_itnim_event event)
@@ -622,7 +419,7 @@ bfa_itnim_sm_uninit(struct bfa_itnim_s *itnim, enum bfa_itnim_event event)
622} 419}
623 420
624/* 421/*
625 * Beginning state, only online event expected. 422 * Beginning state, only online event expected.
626 */ 423 */
627static void 424static void
628bfa_itnim_sm_created(struct bfa_itnim_s *itnim, enum bfa_itnim_event event) 425bfa_itnim_sm_created(struct bfa_itnim_s *itnim, enum bfa_itnim_event event)
@@ -725,7 +522,7 @@ bfa_itnim_sm_fwcreate_qfull(struct bfa_itnim_s *itnim,
725} 522}
726 523
727/* 524/*
728 * Waiting for itnim create response from firmware, a delete is pending. 525 * Waiting for itnim create response from firmware, a delete is pending.
729 */ 526 */
730static void 527static void
731bfa_itnim_sm_delete_pending(struct bfa_itnim_s *itnim, 528bfa_itnim_sm_delete_pending(struct bfa_itnim_s *itnim,
@@ -753,7 +550,7 @@ bfa_itnim_sm_delete_pending(struct bfa_itnim_s *itnim,
753} 550}
754 551
755/* 552/*
756 * Online state - normal parking state. 553 * Online state - normal parking state.
757 */ 554 */
758static void 555static void
759bfa_itnim_sm_online(struct bfa_itnim_s *itnim, enum bfa_itnim_event event) 556bfa_itnim_sm_online(struct bfa_itnim_s *itnim, enum bfa_itnim_event event)
@@ -795,7 +592,7 @@ bfa_itnim_sm_online(struct bfa_itnim_s *itnim, enum bfa_itnim_event event)
795} 592}
796 593
797/* 594/*
798 * Second level error recovery need. 595 * Second level error recovery need.
799 */ 596 */
800static void 597static void
801bfa_itnim_sm_sler(struct bfa_itnim_s *itnim, enum bfa_itnim_event event) 598bfa_itnim_sm_sler(struct bfa_itnim_s *itnim, enum bfa_itnim_event event)
@@ -826,7 +623,7 @@ bfa_itnim_sm_sler(struct bfa_itnim_s *itnim, enum bfa_itnim_event event)
826} 623}
827 624
828/* 625/*
829 * Going offline. Waiting for active IO cleanup. 626 * Going offline. Waiting for active IO cleanup.
830 */ 627 */
831static void 628static void
832bfa_itnim_sm_cleanup_offline(struct bfa_itnim_s *itnim, 629bfa_itnim_sm_cleanup_offline(struct bfa_itnim_s *itnim,
@@ -863,7 +660,7 @@ bfa_itnim_sm_cleanup_offline(struct bfa_itnim_s *itnim,
863} 660}
864 661
865/* 662/*
866 * Deleting itnim. Waiting for active IO cleanup. 663 * Deleting itnim. Waiting for active IO cleanup.
867 */ 664 */
868static void 665static void
869bfa_itnim_sm_cleanup_delete(struct bfa_itnim_s *itnim, 666bfa_itnim_sm_cleanup_delete(struct bfa_itnim_s *itnim,
@@ -948,7 +745,7 @@ bfa_itnim_sm_fwdelete_qfull(struct bfa_itnim_s *itnim,
948} 745}
949 746
950/* 747/*
951 * Offline state. 748 * Offline state.
952 */ 749 */
953static void 750static void
954bfa_itnim_sm_offline(struct bfa_itnim_s *itnim, enum bfa_itnim_event event) 751bfa_itnim_sm_offline(struct bfa_itnim_s *itnim, enum bfa_itnim_event event)
@@ -979,9 +776,6 @@ bfa_itnim_sm_offline(struct bfa_itnim_s *itnim, enum bfa_itnim_event event)
979 } 776 }
980} 777}
981 778
982/*
983 * IOC h/w failed state.
984 */
985static void 779static void
986bfa_itnim_sm_iocdisable(struct bfa_itnim_s *itnim, 780bfa_itnim_sm_iocdisable(struct bfa_itnim_s *itnim,
987 enum bfa_itnim_event event) 781 enum bfa_itnim_event event)
@@ -1016,7 +810,7 @@ bfa_itnim_sm_iocdisable(struct bfa_itnim_s *itnim,
1016} 810}
1017 811
1018/* 812/*
1019 * Itnim is deleted, waiting for firmware response to delete. 813 * Itnim is deleted, waiting for firmware response to delete.
1020 */ 814 */
1021static void 815static void
1022bfa_itnim_sm_deleting(struct bfa_itnim_s *itnim, enum bfa_itnim_event event) 816bfa_itnim_sm_deleting(struct bfa_itnim_s *itnim, enum bfa_itnim_event event)
@@ -1061,7 +855,7 @@ bfa_itnim_sm_deleting_qfull(struct bfa_itnim_s *itnim,
1061} 855}
1062 856
1063/* 857/*
1064 * Initiate cleanup of all IOs on an IOC failure. 858 * Initiate cleanup of all IOs on an IOC failure.
1065 */ 859 */
1066static void 860static void
1067bfa_itnim_iocdisable_cleanup(struct bfa_itnim_s *itnim) 861bfa_itnim_iocdisable_cleanup(struct bfa_itnim_s *itnim)
@@ -1095,7 +889,7 @@ bfa_itnim_iocdisable_cleanup(struct bfa_itnim_s *itnim)
1095} 889}
1096 890
1097/* 891/*
1098 * IO cleanup completion 892 * IO cleanup completion
1099 */ 893 */
1100static void 894static void
1101bfa_itnim_cleanp_comp(void *itnim_cbarg) 895bfa_itnim_cleanp_comp(void *itnim_cbarg)
@@ -1107,7 +901,7 @@ bfa_itnim_cleanp_comp(void *itnim_cbarg)
1107} 901}
1108 902
1109/* 903/*
1110 * Initiate cleanup of all IOs. 904 * Initiate cleanup of all IOs.
1111 */ 905 */
1112static void 906static void
1113bfa_itnim_cleanup(struct bfa_itnim_s *itnim) 907bfa_itnim_cleanup(struct bfa_itnim_s *itnim)
@@ -1179,9 +973,6 @@ bfa_itnim_qresume(void *cbarg)
1179 bfa_sm_send_event(itnim, BFA_ITNIM_SM_QRESUME); 973 bfa_sm_send_event(itnim, BFA_ITNIM_SM_QRESUME);
1180} 974}
1181 975
1182
1183
1184
1185/* 976/*
1186 * bfa_itnim_public 977 * bfa_itnim_public
1187 */ 978 */
@@ -1449,14 +1240,12 @@ bfa_itnim_update_del_itn_stats(struct bfa_itnim_s *itnim)
1449 fcpim->del_itn_stats.del_tm_iocdowns += itnim->stats.tm_iocdowns; 1240 fcpim->del_itn_stats.del_tm_iocdowns += itnim->stats.tm_iocdowns;
1450} 1241}
1451 1242
1452
1453
1454/* 1243/*
1455 * bfa_itnim_public 1244 * bfa_itnim_public
1456 */ 1245 */
1457 1246
1458/* 1247/*
1459 * Itnim interrupt processing. 1248 * Itnim interrupt processing.
1460 */ 1249 */
1461void 1250void
1462bfa_itnim_isr(struct bfa_s *bfa, struct bfi_msg_s *m) 1251bfa_itnim_isr(struct bfa_s *bfa, struct bfi_msg_s *m)
@@ -1499,10 +1288,8 @@ bfa_itnim_isr(struct bfa_s *bfa, struct bfi_msg_s *m)
1499 } 1288 }
1500} 1289}
1501 1290
1502
1503
1504/* 1291/*
1505 * bfa_itnim_api 1292 * bfa_itnim_api
1506 */ 1293 */
1507 1294
1508struct bfa_itnim_s * 1295struct bfa_itnim_s *
@@ -1575,7 +1362,7 @@ bfa_itnim_clear_stats(struct bfa_itnim_s *itnim)
1575 */ 1362 */
1576 1363
1577/* 1364/*
1578 * IO is not started (unallocated). 1365 * IO is not started (unallocated).
1579 */ 1366 */
1580static void 1367static void
1581bfa_ioim_sm_uninit(struct bfa_ioim_s *ioim, enum bfa_ioim_event event) 1368bfa_ioim_sm_uninit(struct bfa_ioim_s *ioim, enum bfa_ioim_event event)
@@ -1640,7 +1427,7 @@ bfa_ioim_sm_uninit(struct bfa_ioim_s *ioim, enum bfa_ioim_event event)
1640} 1427}
1641 1428
1642/* 1429/*
1643 * IO is waiting for SG pages. 1430 * IO is waiting for SG pages.
1644 */ 1431 */
1645static void 1432static void
1646bfa_ioim_sm_sgalloc(struct bfa_ioim_s *ioim, enum bfa_ioim_event event) 1433bfa_ioim_sm_sgalloc(struct bfa_ioim_s *ioim, enum bfa_ioim_event event)
@@ -1687,7 +1474,7 @@ bfa_ioim_sm_sgalloc(struct bfa_ioim_s *ioim, enum bfa_ioim_event event)
1687} 1474}
1688 1475
1689/* 1476/*
1690 * IO is active. 1477 * IO is active.
1691 */ 1478 */
1692static void 1479static void
1693bfa_ioim_sm_active(struct bfa_ioim_s *ioim, enum bfa_ioim_event event) 1480bfa_ioim_sm_active(struct bfa_ioim_s *ioim, enum bfa_ioim_event event)
@@ -1771,8 +1558,8 @@ bfa_ioim_sm_active(struct bfa_ioim_s *ioim, enum bfa_ioim_event event)
1771} 1558}
1772 1559
1773/* 1560/*
1774* IO is retried with new tag. 1561 * IO is retried with new tag.
1775*/ 1562 */
1776static void 1563static void
1777bfa_ioim_sm_cmnd_retry(struct bfa_ioim_s *ioim, enum bfa_ioim_event event) 1564bfa_ioim_sm_cmnd_retry(struct bfa_ioim_s *ioim, enum bfa_ioim_event event)
1778{ 1565{
@@ -1825,7 +1612,7 @@ bfa_ioim_sm_cmnd_retry(struct bfa_ioim_s *ioim, enum bfa_ioim_event event)
1825} 1612}
1826 1613
1827/* 1614/*
1828 * IO is being aborted, waiting for completion from firmware. 1615 * IO is being aborted, waiting for completion from firmware.
1829 */ 1616 */
1830static void 1617static void
1831bfa_ioim_sm_abort(struct bfa_ioim_s *ioim, enum bfa_ioim_event event) 1618bfa_ioim_sm_abort(struct bfa_ioim_s *ioim, enum bfa_ioim_event event)
@@ -1948,7 +1735,7 @@ bfa_ioim_sm_cleanup(struct bfa_ioim_s *ioim, enum bfa_ioim_event event)
1948} 1735}
1949 1736
1950/* 1737/*
1951 * IO is waiting for room in request CQ 1738 * IO is waiting for room in request CQ
1952 */ 1739 */
1953static void 1740static void
1954bfa_ioim_sm_qfull(struct bfa_ioim_s *ioim, enum bfa_ioim_event event) 1741bfa_ioim_sm_qfull(struct bfa_ioim_s *ioim, enum bfa_ioim_event event)
@@ -1992,7 +1779,7 @@ bfa_ioim_sm_qfull(struct bfa_ioim_s *ioim, enum bfa_ioim_event event)
1992} 1779}
1993 1780
1994/* 1781/*
1995 * Active IO is being aborted, waiting for room in request CQ. 1782 * Active IO is being aborted, waiting for room in request CQ.
1996 */ 1783 */
1997static void 1784static void
1998bfa_ioim_sm_abort_qfull(struct bfa_ioim_s *ioim, enum bfa_ioim_event event) 1785bfa_ioim_sm_abort_qfull(struct bfa_ioim_s *ioim, enum bfa_ioim_event event)
@@ -2043,7 +1830,7 @@ bfa_ioim_sm_abort_qfull(struct bfa_ioim_s *ioim, enum bfa_ioim_event event)
2043} 1830}
2044 1831
2045/* 1832/*
2046 * Active IO is being cleaned up, waiting for room in request CQ. 1833 * Active IO is being cleaned up, waiting for room in request CQ.
2047 */ 1834 */
2048static void 1835static void
2049bfa_ioim_sm_cleanup_qfull(struct bfa_ioim_s *ioim, enum bfa_ioim_event event) 1836bfa_ioim_sm_cleanup_qfull(struct bfa_ioim_s *ioim, enum bfa_ioim_event event)
@@ -2297,7 +2084,7 @@ bfa_ioim_send_ioreq(struct bfa_ioim_s *ioim)
2297{ 2084{
2298 struct bfa_itnim_s *itnim = ioim->itnim; 2085 struct bfa_itnim_s *itnim = ioim->itnim;
2299 struct bfi_ioim_req_s *m; 2086 struct bfi_ioim_req_s *m;
2300 static struct fcp_cmnd_s cmnd_z0 = {{{0}}}; 2087 static struct fcp_cmnd_s cmnd_z0 = { { { 0 } } };
2301 struct bfi_sge_s *sge, *sgpge; 2088 struct bfi_sge_s *sge, *sgpge;
2302 u32 pgdlen = 0; 2089 u32 pgdlen = 0;
2303 u32 fcp_dl; 2090 u32 fcp_dl;
@@ -2553,9 +2340,6 @@ bfa_ioim_is_abortable(struct bfa_ioim_s *ioim)
2553 return BFA_TRUE; 2340 return BFA_TRUE;
2554} 2341}
2555 2342
2556/*
2557 * or after the link comes back.
2558 */
2559void 2343void
2560bfa_ioim_delayed_comp(struct bfa_ioim_s *ioim, bfa_boolean_t iotov) 2344bfa_ioim_delayed_comp(struct bfa_ioim_s *ioim, bfa_boolean_t iotov)
2561{ 2345{
@@ -2750,32 +2534,6 @@ bfa_ioim_good_comp_isr(struct bfa_s *bfa, struct bfi_msg_s *m)
2750 bfa_sm_send_event(ioim, BFA_IOIM_SM_COMP_GOOD); 2534 bfa_sm_send_event(ioim, BFA_IOIM_SM_COMP_GOOD);
2751} 2535}
2752 2536
2753void
2754bfa_ioim_profile_start(struct bfa_ioim_s *ioim)
2755{
2756 ioim->start_time = jiffies;
2757}
2758
2759void
2760bfa_ioim_profile_comp(struct bfa_ioim_s *ioim)
2761{
2762 struct scsi_cmnd *cmnd = (struct scsi_cmnd *) ioim->dio;
2763 u32 fcp_dl = scsi_bufflen(cmnd);
2764 u32 index = bfa_ioim_get_index(fcp_dl);
2765 u64 end_time = jiffies;
2766 struct bfa_itnim_latency_s *io_lat =
2767 &(ioim->itnim->ioprofile.io_latency);
2768 u32 val = (u32)(end_time - ioim->start_time);
2769
2770 bfa_itnim_ioprofile_update(ioim->itnim, index);
2771
2772 io_lat->count[index]++;
2773 io_lat->min[index] = (io_lat->min[index] < val) ?
2774 io_lat->min[index] : val;
2775 io_lat->max[index] = (io_lat->max[index] > val) ?
2776 io_lat->max[index] : val;
2777 io_lat->avg[index] += val;
2778}
2779/* 2537/*
2780 * Called by itnim to clean up IO while going offline. 2538 * Called by itnim to clean up IO while going offline.
2781 */ 2539 */
@@ -2909,13 +2667,12 @@ bfa_ioim_abort(struct bfa_ioim_s *ioim)
2909 return BFA_STATUS_OK; 2667 return BFA_STATUS_OK;
2910} 2668}
2911 2669
2912
2913/* 2670/*
2914 * BFA TSKIM state machine functions 2671 * BFA TSKIM state machine functions
2915 */ 2672 */
2916 2673
2917/* 2674/*
2918 * Task management command beginning state. 2675 * Task management command beginning state.
2919 */ 2676 */
2920static void 2677static void
2921bfa_tskim_sm_uninit(struct bfa_tskim_s *tskim, enum bfa_tskim_event event) 2678bfa_tskim_sm_uninit(struct bfa_tskim_s *tskim, enum bfa_tskim_event event)
@@ -2952,9 +2709,8 @@ bfa_tskim_sm_uninit(struct bfa_tskim_s *tskim, enum bfa_tskim_event event)
2952} 2709}
2953 2710
2954/* 2711/*
2955 * brief 2712 * TM command is active, awaiting completion from firmware to
2956 * TM command is active, awaiting completion from firmware to 2713 * cleanup IO requests in TM scope.
2957 * cleanup IO requests in TM scope.
2958 */ 2714 */
2959static void 2715static void
2960bfa_tskim_sm_active(struct bfa_tskim_s *tskim, enum bfa_tskim_event event) 2716bfa_tskim_sm_active(struct bfa_tskim_s *tskim, enum bfa_tskim_event event)
@@ -2989,8 +2745,8 @@ bfa_tskim_sm_active(struct bfa_tskim_s *tskim, enum bfa_tskim_event event)
2989} 2745}
2990 2746
2991/* 2747/*
2992 * An active TM is being cleaned up since ITN is offline. Awaiting cleanup 2748 * An active TM is being cleaned up since ITN is offline. Awaiting cleanup
2993 * completion event from firmware. 2749 * completion event from firmware.
2994 */ 2750 */
2995static void 2751static void
2996bfa_tskim_sm_cleanup(struct bfa_tskim_s *tskim, enum bfa_tskim_event event) 2752bfa_tskim_sm_cleanup(struct bfa_tskim_s *tskim, enum bfa_tskim_event event)
@@ -3050,7 +2806,7 @@ bfa_tskim_sm_iocleanup(struct bfa_tskim_s *tskim, enum bfa_tskim_event event)
3050} 2806}
3051 2807
3052/* 2808/*
3053 * Task management command is waiting for room in request CQ 2809 * Task management command is waiting for room in request CQ
3054 */ 2810 */
3055static void 2811static void
3056bfa_tskim_sm_qfull(struct bfa_tskim_s *tskim, enum bfa_tskim_event event) 2812bfa_tskim_sm_qfull(struct bfa_tskim_s *tskim, enum bfa_tskim_event event)
@@ -3085,8 +2841,8 @@ bfa_tskim_sm_qfull(struct bfa_tskim_s *tskim, enum bfa_tskim_event event)
3085} 2841}
3086 2842
3087/* 2843/*
3088 * Task management command is active, awaiting for room in request CQ 2844 * Task management command is active, awaiting for room in request CQ
3089 * to send clean up request. 2845 * to send clean up request.
3090 */ 2846 */
3091static void 2847static void
3092bfa_tskim_sm_cleanup_qfull(struct bfa_tskim_s *tskim, 2848bfa_tskim_sm_cleanup_qfull(struct bfa_tskim_s *tskim,
@@ -3098,10 +2854,8 @@ bfa_tskim_sm_cleanup_qfull(struct bfa_tskim_s *tskim,
3098 case BFA_TSKIM_SM_DONE: 2854 case BFA_TSKIM_SM_DONE:
3099 bfa_reqq_wcancel(&tskim->reqq_wait); 2855 bfa_reqq_wcancel(&tskim->reqq_wait);
3100 /* 2856 /*
3101 *
3102 * Fall through !!! 2857 * Fall through !!!
3103 */ 2858 */
3104
3105 case BFA_TSKIM_SM_QRESUME: 2859 case BFA_TSKIM_SM_QRESUME:
3106 bfa_sm_set_state(tskim, bfa_tskim_sm_cleanup); 2860 bfa_sm_set_state(tskim, bfa_tskim_sm_cleanup);
3107 bfa_tskim_send_abort(tskim); 2861 bfa_tskim_send_abort(tskim);
@@ -3120,7 +2874,7 @@ bfa_tskim_sm_cleanup_qfull(struct bfa_tskim_s *tskim,
3120} 2874}
3121 2875
3122/* 2876/*
3123 * BFA callback is pending 2877 * BFA callback is pending
3124 */ 2878 */
3125static void 2879static void
3126bfa_tskim_sm_hcb(struct bfa_tskim_s *tskim, enum bfa_tskim_event event) 2880bfa_tskim_sm_hcb(struct bfa_tskim_s *tskim, enum bfa_tskim_event event)
@@ -3145,7 +2899,6 @@ bfa_tskim_sm_hcb(struct bfa_tskim_s *tskim, enum bfa_tskim_event event)
3145 } 2899 }
3146} 2900}
3147 2901
3148
3149static void 2902static void
3150__bfa_cb_tskim_done(void *cbarg, bfa_boolean_t complete) 2903__bfa_cb_tskim_done(void *cbarg, bfa_boolean_t complete)
3151{ 2904{
@@ -3175,7 +2928,7 @@ __bfa_cb_tskim_failed(void *cbarg, bfa_boolean_t complete)
3175 BFI_TSKIM_STS_FAILED); 2928 BFI_TSKIM_STS_FAILED);
3176} 2929}
3177 2930
3178static bfa_boolean_t 2931static bfa_boolean_t
3179bfa_tskim_match_scope(struct bfa_tskim_s *tskim, struct scsi_lun lun) 2932bfa_tskim_match_scope(struct bfa_tskim_s *tskim, struct scsi_lun lun)
3180{ 2933{
3181 switch (tskim->tm_cmnd) { 2934 switch (tskim->tm_cmnd) {
@@ -3186,7 +2939,7 @@ bfa_tskim_match_scope(struct bfa_tskim_s *tskim, struct scsi_lun lun)
3186 case FCP_TM_CLEAR_TASK_SET: 2939 case FCP_TM_CLEAR_TASK_SET:
3187 case FCP_TM_LUN_RESET: 2940 case FCP_TM_LUN_RESET:
3188 case FCP_TM_CLEAR_ACA: 2941 case FCP_TM_CLEAR_ACA:
3189 return (!memcmp(&tskim->lun, &lun, sizeof(lun))); 2942 return !memcmp(&tskim->lun, &lun, sizeof(lun));
3190 2943
3191 default: 2944 default:
3192 bfa_assert(0); 2945 bfa_assert(0);
@@ -3196,7 +2949,7 @@ bfa_tskim_match_scope(struct bfa_tskim_s *tskim, struct scsi_lun lun)
3196} 2949}
3197 2950
3198/* 2951/*
3199 * Gather affected IO requests and task management commands. 2952 * Gather affected IO requests and task management commands.
3200 */ 2953 */
3201static void 2954static void
3202bfa_tskim_gather_ios(struct bfa_tskim_s *tskim) 2955bfa_tskim_gather_ios(struct bfa_tskim_s *tskim)
@@ -3238,7 +2991,7 @@ bfa_tskim_gather_ios(struct bfa_tskim_s *tskim)
3238} 2991}
3239 2992
3240/* 2993/*
3241 * IO cleanup completion 2994 * IO cleanup completion
3242 */ 2995 */
3243static void 2996static void
3244bfa_tskim_cleanp_comp(void *tskim_cbarg) 2997bfa_tskim_cleanp_comp(void *tskim_cbarg)
@@ -3250,7 +3003,7 @@ bfa_tskim_cleanp_comp(void *tskim_cbarg)
3250} 3003}
3251 3004
3252/* 3005/*
3253 * Gather affected IO requests and task management commands. 3006 * Gather affected IO requests and task management commands.
3254 */ 3007 */
3255static void 3008static void
3256bfa_tskim_cleanup_ios(struct bfa_tskim_s *tskim) 3009bfa_tskim_cleanup_ios(struct bfa_tskim_s *tskim)
@@ -3270,7 +3023,7 @@ bfa_tskim_cleanup_ios(struct bfa_tskim_s *tskim)
3270} 3023}
3271 3024
3272/* 3025/*
3273 * Send task management request to firmware. 3026 * Send task management request to firmware.
3274 */ 3027 */
3275static bfa_boolean_t 3028static bfa_boolean_t
3276bfa_tskim_send(struct bfa_tskim_s *tskim) 3029bfa_tskim_send(struct bfa_tskim_s *tskim)
@@ -3305,7 +3058,7 @@ bfa_tskim_send(struct bfa_tskim_s *tskim)
3305} 3058}
3306 3059
3307/* 3060/*
3308 * Send abort request to cleanup an active TM to firmware. 3061 * Send abort request to cleanup an active TM to firmware.
3309 */ 3062 */
3310static bfa_boolean_t 3063static bfa_boolean_t
3311bfa_tskim_send_abort(struct bfa_tskim_s *tskim) 3064bfa_tskim_send_abort(struct bfa_tskim_s *tskim)
@@ -3336,7 +3089,7 @@ bfa_tskim_send_abort(struct bfa_tskim_s *tskim)
3336} 3089}
3337 3090
3338/* 3091/*
3339 * Call to resume task management cmnd waiting for room in request queue. 3092 * Call to resume task management cmnd waiting for room in request queue.
3340 */ 3093 */
3341static void 3094static void
3342bfa_tskim_qresume(void *cbarg) 3095bfa_tskim_qresume(void *cbarg)
@@ -3362,7 +3115,6 @@ bfa_tskim_iocdisable_ios(struct bfa_tskim_s *tskim)
3362 } 3115 }
3363} 3116}
3364 3117
3365
3366/* 3118/*
3367 * Notification on completions from related ioim. 3119 * Notification on completions from related ioim.
3368 */ 3120 */
@@ -3395,7 +3147,7 @@ bfa_tskim_cleanup(struct bfa_tskim_s *tskim)
3395} 3147}
3396 3148
3397/* 3149/*
3398 * Memory allocation and initialization. 3150 * Memory allocation and initialization.
3399 */ 3151 */
3400void 3152void
3401bfa_tskim_attach(struct bfa_fcpim_mod_s *fcpim, struct bfa_meminfo_s *minfo) 3153bfa_tskim_attach(struct bfa_fcpim_mod_s *fcpim, struct bfa_meminfo_s *minfo)
@@ -3477,7 +3229,7 @@ bfa_tskim_free(struct bfa_tskim_s *tskim)
3477} 3229}
3478 3230
3479/* 3231/*
3480 * Start a task management command. 3232 * Start a task management command.
3481 * 3233 *
3482 * @param[in] tskim BFA task management command instance 3234 * @param[in] tskim BFA task management command instance
3483 * @param[in] itnim i-t nexus for the task management command 3235 * @param[in] itnim i-t nexus for the task management command
diff --git a/drivers/scsi/bfa/bfa_fcpim.h b/drivers/scsi/bfa/bfa_fcpim.h
index 7d0eababa5d..f9334587e02 100644
--- a/drivers/scsi/bfa/bfa_fcpim.h
+++ b/drivers/scsi/bfa/bfa_fcpim.h
@@ -94,12 +94,12 @@ struct bfa_fcpim_mod_s {
94 struct list_head ioim_resfree_q; /* IOs waiting for f/w */ 94 struct list_head ioim_resfree_q; /* IOs waiting for f/w */
95 struct list_head ioim_comp_q; /* IO global comp Q */ 95 struct list_head ioim_comp_q; /* IO global comp Q */
96 struct list_head tskim_free_q; 96 struct list_head tskim_free_q;
97 u32 ios_active; /* current active IOs */ 97 u32 ios_active; /* current active IOs */
98 u32 delay_comp; 98 u32 delay_comp;
99 struct bfa_fcpim_del_itn_stats_s del_itn_stats; 99 struct bfa_fcpim_del_itn_stats_s del_itn_stats;
100 bfa_boolean_t ioredirect; 100 bfa_boolean_t ioredirect;
101 bfa_boolean_t io_profile; 101 bfa_boolean_t io_profile;
102 u32 io_profile_start_time; 102 u32 io_profile_start_time;
103 bfa_fcpim_profile_t profile_comp; 103 bfa_fcpim_profile_t profile_comp;
104 bfa_fcpim_profile_t profile_start; 104 bfa_fcpim_profile_t profile_start;
105}; 105};
@@ -114,25 +114,24 @@ struct bfa_ioim_s {
114 struct bfa_fcpim_mod_s *fcpim; /* parent fcpim module */ 114 struct bfa_fcpim_mod_s *fcpim; /* parent fcpim module */
115 struct bfa_itnim_s *itnim; /* i-t-n nexus for this IO */ 115 struct bfa_itnim_s *itnim; /* i-t-n nexus for this IO */
116 struct bfad_ioim_s *dio; /* driver IO handle */ 116 struct bfad_ioim_s *dio; /* driver IO handle */
117 u16 iotag; /* FWI IO tag */ 117 u16 iotag; /* FWI IO tag */
118 u16 abort_tag; /* unqiue abort request tag */ 118 u16 abort_tag; /* unqiue abort request tag */
119 u16 nsges; /* number of SG elements */ 119 u16 nsges; /* number of SG elements */
120 u16 nsgpgs; /* number of SG pages */ 120 u16 nsgpgs; /* number of SG pages */
121 struct bfa_sgpg_s *sgpg; /* first SG page */ 121 struct bfa_sgpg_s *sgpg; /* first SG page */
122 struct list_head sgpg_q; /* allocated SG pages */ 122 struct list_head sgpg_q; /* allocated SG pages */
123 struct bfa_cb_qe_s hcb_qe; /* bfa callback qelem */ 123 struct bfa_cb_qe_s hcb_qe; /* bfa callback qelem */
124 bfa_cb_cbfn_t io_cbfn; /* IO completion handler */ 124 bfa_cb_cbfn_t io_cbfn; /* IO completion handler */
125 struct bfa_ioim_sp_s *iosp; /* slow-path IO handling */ 125 struct bfa_ioim_sp_s *iosp; /* slow-path IO handling */
126 u8 reqq; /* Request queue for I/O */ 126 u8 reqq; /* Request queue for I/O */
127 u64 start_time; /* IO's Profile start val */ 127 u64 start_time; /* IO's Profile start val */
128}; 128};
129 129
130
131struct bfa_ioim_sp_s { 130struct bfa_ioim_sp_s {
132 struct bfi_msg_s comp_rspmsg; /* IO comp f/w response */ 131 struct bfi_msg_s comp_rspmsg; /* IO comp f/w response */
133 u8 *snsinfo; /* sense info for this IO */ 132 u8 *snsinfo; /* sense info for this IO */
134 struct bfa_sgpg_wqe_s sgpg_wqe; /* waitq elem for sgpg */ 133 struct bfa_sgpg_wqe_s sgpg_wqe; /* waitq elem for sgpg */
135 struct bfa_reqq_wait_s reqq_wait; /* to wait for room in reqq */ 134 struct bfa_reqq_wait_s reqq_wait; /* to wait for room in reqq */
136 bfa_boolean_t abort_explicit; /* aborted by OS */ 135 bfa_boolean_t abort_explicit; /* aborted by OS */
137 struct bfa_tskim_s *tskim; /* Relevant TM cmd */ 136 struct bfa_tskim_s *tskim; /* Relevant TM cmd */
138}; 137};
@@ -143,35 +142,34 @@ struct bfa_ioim_sp_s {
143struct bfa_tskim_s { 142struct bfa_tskim_s {
144 struct list_head qe; 143 struct list_head qe;
145 bfa_sm_t sm; 144 bfa_sm_t sm;
146 struct bfa_s *bfa; /* BFA module */ 145 struct bfa_s *bfa; /* BFA module */
147 struct bfa_fcpim_mod_s *fcpim; /* parent fcpim module */ 146 struct bfa_fcpim_mod_s *fcpim; /* parent fcpim module */
148 struct bfa_itnim_s *itnim; /* i-t-n nexus for this IO */ 147 struct bfa_itnim_s *itnim; /* i-t-n nexus for this IO */
149 struct bfad_tskim_s *dtsk; /* driver task mgmt cmnd */ 148 struct bfad_tskim_s *dtsk; /* driver task mgmt cmnd */
150 bfa_boolean_t notify; /* notify itnim on TM comp */ 149 bfa_boolean_t notify; /* notify itnim on TM comp */
151 struct scsi_lun lun; /* lun if applicable */ 150 struct scsi_lun lun; /* lun if applicable */
152 enum fcp_tm_cmnd tm_cmnd; /* task management command */ 151 enum fcp_tm_cmnd tm_cmnd; /* task management command */
153 u16 tsk_tag; /* FWI IO tag */ 152 u16 tsk_tag; /* FWI IO tag */
154 u8 tsecs; /* timeout in seconds */ 153 u8 tsecs; /* timeout in seconds */
155 struct bfa_reqq_wait_s reqq_wait; /* to wait for room in reqq */ 154 struct bfa_reqq_wait_s reqq_wait; /* to wait for room in reqq */
156 struct list_head io_q; /* queue of affected IOs */ 155 struct list_head io_q; /* queue of affected IOs */
157 struct bfa_wc_s wc; /* waiting counter */ 156 struct bfa_wc_s wc; /* waiting counter */
158 struct bfa_cb_qe_s hcb_qe; /* bfa callback qelem */ 157 struct bfa_cb_qe_s hcb_qe; /* bfa callback qelem */
159 enum bfi_tskim_status tsk_status; /* TM status */ 158 enum bfi_tskim_status tsk_status; /* TM status */
160}; 159};
161 160
162
163/* 161/*
164 * BFA i-t-n (initiator mode) 162 * BFA i-t-n (initiator mode)
165 */ 163 */
166struct bfa_itnim_s { 164struct bfa_itnim_s {
167 struct list_head qe; /* queue element */ 165 struct list_head qe; /* queue element */
168 bfa_sm_t sm; /* i-t-n im BFA state machine */ 166 bfa_sm_t sm; /* i-t-n im BFA state machine */
169 struct bfa_s *bfa; /* bfa instance */ 167 struct bfa_s *bfa; /* bfa instance */
170 struct bfa_rport_s *rport; /* bfa rport */ 168 struct bfa_rport_s *rport; /* bfa rport */
171 void *ditn; /* driver i-t-n structure */ 169 void *ditn; /* driver i-t-n structure */
172 struct bfi_mhdr_s mhdr; /* pre-built mhdr */ 170 struct bfi_mhdr_s mhdr; /* pre-built mhdr */
173 u8 msg_no; /* itnim/rport firmware handle */ 171 u8 msg_no; /* itnim/rport firmware handle */
174 u8 reqq; /* CQ for requests */ 172 u8 reqq; /* CQ for requests */
175 struct bfa_cb_qe_s hcb_qe; /* bfa callback qelem */ 173 struct bfa_cb_qe_s hcb_qe; /* bfa callback qelem */
176 struct list_head pending_q; /* queue of pending IO requests */ 174 struct list_head pending_q; /* queue of pending IO requests */
177 struct list_head io_q; /* queue of active IO requests */ 175 struct list_head io_q; /* queue of active IO requests */
@@ -181,15 +179,14 @@ struct bfa_itnim_s {
181 bfa_boolean_t seq_rec; /* SQER supported */ 179 bfa_boolean_t seq_rec; /* SQER supported */
182 bfa_boolean_t is_online; /* itnim is ONLINE for IO */ 180 bfa_boolean_t is_online; /* itnim is ONLINE for IO */
183 bfa_boolean_t iotov_active; /* IO TOV timer is active */ 181 bfa_boolean_t iotov_active; /* IO TOV timer is active */
184 struct bfa_wc_s wc; /* waiting counter */ 182 struct bfa_wc_s wc; /* waiting counter */
185 struct bfa_timer_s timer; /* pending IO TOV */ 183 struct bfa_timer_s timer; /* pending IO TOV */
186 struct bfa_reqq_wait_s reqq_wait; /* to wait for room in reqq */ 184 struct bfa_reqq_wait_s reqq_wait; /* to wait for room in reqq */
187 struct bfa_fcpim_mod_s *fcpim; /* fcpim module */ 185 struct bfa_fcpim_mod_s *fcpim; /* fcpim module */
188 struct bfa_itnim_iostats_s stats; 186 struct bfa_itnim_iostats_s stats;
189 struct bfa_itnim_ioprofile_s ioprofile; 187 struct bfa_itnim_ioprofile_s ioprofile;
190}; 188};
191 189
192
193#define bfa_itnim_is_online(_itnim) ((_itnim)->is_online) 190#define bfa_itnim_is_online(_itnim) ((_itnim)->is_online)
194#define BFA_FCPIM_MOD(_hal) (&(_hal)->modules.fcpim_mod) 191#define BFA_FCPIM_MOD(_hal) (&(_hal)->modules.fcpim_mod)
195#define BFA_IOIM_FROM_TAG(_fcpim, _iotag) \ 192#define BFA_IOIM_FROM_TAG(_fcpim, _iotag) \
@@ -246,32 +243,14 @@ void bfa_itnim_isr(struct bfa_s *bfa, struct bfi_msg_s *msg);
246void bfa_itnim_iodone(struct bfa_itnim_s *itnim); 243void bfa_itnim_iodone(struct bfa_itnim_s *itnim);
247void bfa_itnim_tskdone(struct bfa_itnim_s *itnim); 244void bfa_itnim_tskdone(struct bfa_itnim_s *itnim);
248bfa_boolean_t bfa_itnim_hold_io(struct bfa_itnim_s *itnim); 245bfa_boolean_t bfa_itnim_hold_io(struct bfa_itnim_s *itnim);
249void bfa_ioim_profile_comp(struct bfa_ioim_s *ioim);
250void bfa_ioim_profile_start(struct bfa_ioim_s *ioim);
251
252 246
253/* 247/*
254 * bfa fcpim module API functions 248 * bfa fcpim module API functions
255 */ 249 */
256void bfa_fcpim_path_tov_set(struct bfa_s *bfa, u16 path_tov); 250void bfa_fcpim_path_tov_set(struct bfa_s *bfa, u16 path_tov);
257u16 bfa_fcpim_path_tov_get(struct bfa_s *bfa); 251u16 bfa_fcpim_path_tov_get(struct bfa_s *bfa);
258void bfa_fcpim_qdepth_set(struct bfa_s *bfa, u16 q_depth);
259u16 bfa_fcpim_qdepth_get(struct bfa_s *bfa); 252u16 bfa_fcpim_qdepth_get(struct bfa_s *bfa);
260bfa_status_t bfa_fcpim_get_modstats(struct bfa_s *bfa, 253
261 struct bfa_itnim_iostats_s *modstats);
262bfa_status_t bfa_fcpim_port_iostats(struct bfa_s *bfa,
263 struct bfa_itnim_iostats_s *stats, u8 lp_tag);
264bfa_status_t bfa_fcpim_get_del_itn_stats(struct bfa_s *bfa,
265 struct bfa_fcpim_del_itn_stats_s *modstats);
266bfa_status_t bfa_fcpim_port_clear_iostats(struct bfa_s *bfa, u8 lp_tag);
267void bfa_fcpim_add_stats(struct bfa_itnim_iostats_s *fcpim_stats,
268 struct bfa_itnim_iostats_s *itnim_stats);
269bfa_status_t bfa_fcpim_clr_modstats(struct bfa_s *bfa);
270void bfa_fcpim_set_ioredirect(struct bfa_s *bfa,
271 bfa_boolean_t state);
272void bfa_fcpim_update_ioredirect(struct bfa_s *bfa);
273bfa_status_t bfa_fcpim_profile_on(struct bfa_s *bfa, u32 time);
274bfa_status_t bfa_fcpim_profile_off(struct bfa_s *bfa);
275#define bfa_fcpim_ioredirect_enabled(__bfa) \ 254#define bfa_fcpim_ioredirect_enabled(__bfa) \
276 (((struct bfa_fcpim_mod_s *)(BFA_FCPIM_MOD(__bfa)))->ioredirect) 255 (((struct bfa_fcpim_mod_s *)(BFA_FCPIM_MOD(__bfa)))->ioredirect)
277 256
@@ -289,46 +268,33 @@ bfa_status_t bfa_fcpim_profile_off(struct bfa_s *bfa);
289 * bfa itnim API functions 268 * bfa itnim API functions
290 */ 269 */
291struct bfa_itnim_s *bfa_itnim_create(struct bfa_s *bfa, 270struct bfa_itnim_s *bfa_itnim_create(struct bfa_s *bfa,
292 struct bfa_rport_s *rport, void *itnim); 271 struct bfa_rport_s *rport, void *itnim);
293void bfa_itnim_delete(struct bfa_itnim_s *itnim); 272void bfa_itnim_delete(struct bfa_itnim_s *itnim);
294void bfa_itnim_online(struct bfa_itnim_s *itnim, 273void bfa_itnim_online(struct bfa_itnim_s *itnim, bfa_boolean_t seq_rec);
295 bfa_boolean_t seq_rec); 274void bfa_itnim_offline(struct bfa_itnim_s *itnim);
296void bfa_itnim_offline(struct bfa_itnim_s *itnim); 275void bfa_itnim_clear_stats(struct bfa_itnim_s *itnim);
297void bfa_itnim_clear_stats(struct bfa_itnim_s *itnim); 276bfa_status_t bfa_itnim_get_ioprofile(struct bfa_itnim_s *itnim,
298bfa_status_t bfa_itnim_get_ioprofile(struct bfa_itnim_s *itnim, 277 struct bfa_itnim_ioprofile_s *ioprofile);
299 struct bfa_itnim_ioprofile_s *ioprofile); 278
300#define bfa_itnim_get_reqq(__ioim) (((struct bfa_ioim_s *)__ioim)->itnim->reqq) 279#define bfa_itnim_get_reqq(__ioim) (((struct bfa_ioim_s *)__ioim)->itnim->reqq)
301 280
302/* 281/*
303 * BFA completion callback for bfa_itnim_online(). 282 * BFA completion callback for bfa_itnim_online().
304 *
305 * @param[in] itnim FCS or driver itnim instance
306 *
307 * return None
308 */ 283 */
309void bfa_cb_itnim_online(void *itnim); 284void bfa_cb_itnim_online(void *itnim);
310 285
311/* 286/*
312 * BFA completion callback for bfa_itnim_offline(). 287 * BFA completion callback for bfa_itnim_offline().
313 *
314 * @param[in] itnim FCS or driver itnim instance
315 *
316 * return None
317 */ 288 */
318void bfa_cb_itnim_offline(void *itnim); 289void bfa_cb_itnim_offline(void *itnim);
319void bfa_cb_itnim_tov_begin(void *itnim); 290void bfa_cb_itnim_tov_begin(void *itnim);
320void bfa_cb_itnim_tov(void *itnim); 291void bfa_cb_itnim_tov(void *itnim);
321 292
322/* 293/*
323 * BFA notification to FCS/driver for second level error recovery. 294 * BFA notification to FCS/driver for second level error recovery.
324 *
325 * Atleast one I/O request has timedout and target is unresponsive to 295 * Atleast one I/O request has timedout and target is unresponsive to
326 * repeated abort requests. Second level error recovery should be initiated 296 * repeated abort requests. Second level error recovery should be initiated
327 * by starting implicit logout and recovery procedures. 297 * by starting implicit logout and recovery procedures.
328 *
329 * @param[in] itnim FCS or driver itnim instance
330 *
331 * return None
332 */ 298 */
333void bfa_cb_itnim_sler(void *itnim); 299void bfa_cb_itnim_sler(void *itnim);
334 300
@@ -345,10 +311,8 @@ void bfa_ioim_start(struct bfa_ioim_s *ioim);
345bfa_status_t bfa_ioim_abort(struct bfa_ioim_s *ioim); 311bfa_status_t bfa_ioim_abort(struct bfa_ioim_s *ioim);
346void bfa_ioim_delayed_comp(struct bfa_ioim_s *ioim, 312void bfa_ioim_delayed_comp(struct bfa_ioim_s *ioim,
347 bfa_boolean_t iotov); 313 bfa_boolean_t iotov);
348
349
350/* 314/*
351 * I/O completion notification. 315 * I/O completion notification.
352 * 316 *
353 * @param[in] dio driver IO structure 317 * @param[in] dio driver IO structure
354 * @param[in] io_status IO completion status 318 * @param[in] io_status IO completion status
@@ -359,39 +323,31 @@ void bfa_ioim_delayed_comp(struct bfa_ioim_s *ioim,
359 * 323 *
360 * @return None 324 * @return None
361 */ 325 */
362void bfa_cb_ioim_done(void *bfad, struct bfad_ioim_s *dio, 326void bfa_cb_ioim_done(void *bfad, struct bfad_ioim_s *dio,
363 enum bfi_ioim_status io_status, 327 enum bfi_ioim_status io_status,
364 u8 scsi_status, int sns_len, 328 u8 scsi_status, int sns_len,
365 u8 *sns_info, s32 residue); 329 u8 *sns_info, s32 residue);
366 330
367/* 331/*
368 * I/O good completion notification. 332 * I/O good completion notification.
369 *
370 * @param[in] dio driver IO structure
371 *
372 * @return None
373 */ 333 */
374void bfa_cb_ioim_good_comp(void *bfad, struct bfad_ioim_s *dio); 334void bfa_cb_ioim_good_comp(void *bfad, struct bfad_ioim_s *dio);
375 335
376/* 336/*
377 * I/O abort completion notification 337 * I/O abort completion notification
378 *
379 * @param[in] dio driver IO that was aborted
380 *
381 * @return None
382 */ 338 */
383void bfa_cb_ioim_abort(void *bfad, struct bfad_ioim_s *dio); 339void bfa_cb_ioim_abort(void *bfad, struct bfad_ioim_s *dio);
384 340
385/* 341/*
386 * bfa tskim API functions 342 * bfa tskim API functions
387 */ 343 */
388struct bfa_tskim_s *bfa_tskim_alloc(struct bfa_s *bfa, 344struct bfa_tskim_s *bfa_tskim_alloc(struct bfa_s *bfa,
389 struct bfad_tskim_s *dtsk); 345 struct bfad_tskim_s *dtsk);
390void bfa_tskim_free(struct bfa_tskim_s *tskim); 346void bfa_tskim_free(struct bfa_tskim_s *tskim);
391void bfa_tskim_start(struct bfa_tskim_s *tskim, 347void bfa_tskim_start(struct bfa_tskim_s *tskim,
392 struct bfa_itnim_s *itnim, struct scsi_lun lun, 348 struct bfa_itnim_s *itnim, struct scsi_lun lun,
393 enum fcp_tm_cmnd tm, u8 t_secs); 349 enum fcp_tm_cmnd tm, u8 t_secs);
394void bfa_cb_tskim_done(void *bfad, struct bfad_tskim_s *dtsk, 350void bfa_cb_tskim_done(void *bfad, struct bfad_tskim_s *dtsk,
395 enum bfi_tskim_status tsk_status); 351 enum bfi_tskim_status tsk_status);
396 352
397#endif /* __BFA_FCPIM_H__ */ 353#endif /* __BFA_FCPIM_H__ */
diff --git a/drivers/scsi/bfa/bfa_fcs_lport.c b/drivers/scsi/bfa/bfa_fcs_lport.c
index 7a2cf7713a9..aa4516672ee 100644
--- a/drivers/scsi/bfa/bfa_fcs_lport.c
+++ b/drivers/scsi/bfa/bfa_fcs_lport.c
@@ -883,7 +883,8 @@ bfa_fcs_lport_get_attr(
883 883
884 if (port->fabric) { 884 if (port->fabric) {
885 port_attr->port_type = port->fabric->oper_type; 885 port_attr->port_type = port->fabric->oper_type;
886 port_attr->loopback = bfa_sm_cmp_state(port->fabric, bfa_fcs_fabric_sm_loopback); 886 port_attr->loopback = bfa_sm_cmp_state(port->fabric,
887 bfa_fcs_fabric_sm_loopback);
887 port_attr->authfail = 888 port_attr->authfail =
888 bfa_sm_cmp_state(port->fabric, 889 bfa_sm_cmp_state(port->fabric,
889 bfa_fcs_fabric_sm_auth_failed); 890 bfa_fcs_fabric_sm_auth_failed);
diff --git a/drivers/scsi/bfa/bfa_fcs_rport.c b/drivers/scsi/bfa/bfa_fcs_rport.c
index fbfcac7615b..711f2d992a9 100644
--- a/drivers/scsi/bfa/bfa_fcs_rport.c
+++ b/drivers/scsi/bfa/bfa_fcs_rport.c
@@ -1974,7 +1974,8 @@ bfa_fcs_rport_alloc(struct bfa_fcs_lport_s *port, wwn_t pwwn, u32 rpid)
1974 rport->itnim = bfa_fcs_itnim_create(rport); 1974 rport->itnim = bfa_fcs_itnim_create(rport);
1975 if (!rport->itnim) { 1975 if (!rport->itnim) {
1976 bfa_trc(fcs, rpid); 1976 bfa_trc(fcs, rpid);
1977 bfa_sm_send_event(rport->bfa_rport, BFA_RPORT_SM_DELETE); 1977 bfa_sm_send_event(rport->bfa_rport,
1978 BFA_RPORT_SM_DELETE);
1978 kfree(rport_drv); 1979 kfree(rport_drv);
1979 return NULL; 1980 return NULL;
1980 } 1981 }
diff --git a/drivers/scsi/bfa/bfa_ioc.c b/drivers/scsi/bfa/bfa_ioc.c
index cd532444ffd..c4d56506e96 100644
--- a/drivers/scsi/bfa/bfa_ioc.c
+++ b/drivers/scsi/bfa/bfa_ioc.c
@@ -586,13 +586,10 @@ bfa_ioc_sm_fail(struct bfa_ioc_s *ioc, enum ioc_event event)
586 } 586 }
587} 587}
588 588
589
590
591/* 589/*
592 * IOCPF State Machine 590 * IOCPF State Machine
593 */ 591 */
594 592
595
596/* 593/*
597 * Reset entry actions -- initialize state machine 594 * Reset entry actions -- initialize state machine
598 */ 595 */
@@ -754,7 +751,6 @@ bfa_iocpf_sm_semwait(struct bfa_iocpf_s *iocpf, enum iocpf_event event)
754 } 751 }
755} 752}
756 753
757
758static void 754static void
759bfa_iocpf_sm_hwinit_entry(struct bfa_iocpf_s *iocpf) 755bfa_iocpf_sm_hwinit_entry(struct bfa_iocpf_s *iocpf)
760{ 756{
@@ -811,7 +807,6 @@ bfa_iocpf_sm_hwinit(struct bfa_iocpf_s *iocpf, enum iocpf_event event)
811 } 807 }
812} 808}
813 809
814
815static void 810static void
816bfa_iocpf_sm_enabling_entry(struct bfa_iocpf_s *iocpf) 811bfa_iocpf_sm_enabling_entry(struct bfa_iocpf_s *iocpf)
817{ 812{
@@ -873,8 +868,6 @@ bfa_iocpf_sm_enabling(struct bfa_iocpf_s *iocpf, enum iocpf_event event)
873 } 868 }
874} 869}
875 870
876
877
878static void 871static void
879bfa_iocpf_sm_ready_entry(struct bfa_iocpf_s *iocpf) 872bfa_iocpf_sm_ready_entry(struct bfa_iocpf_s *iocpf)
880{ 873{
@@ -915,7 +908,6 @@ bfa_iocpf_sm_ready(struct bfa_iocpf_s *iocpf, enum iocpf_event event)
915 } 908 }
916} 909}
917 910
918
919static void 911static void
920bfa_iocpf_sm_disabling_entry(struct bfa_iocpf_s *iocpf) 912bfa_iocpf_sm_disabling_entry(struct bfa_iocpf_s *iocpf)
921{ 913{
@@ -990,7 +982,6 @@ bfa_iocpf_sm_disabled(struct bfa_iocpf_s *iocpf, enum iocpf_event event)
990 } 982 }
991} 983}
992 984
993
994static void 985static void
995bfa_iocpf_sm_initfail_entry(struct bfa_iocpf_s *iocpf) 986bfa_iocpf_sm_initfail_entry(struct bfa_iocpf_s *iocpf)
996{ 987{
@@ -1028,7 +1019,6 @@ bfa_iocpf_sm_initfail(struct bfa_iocpf_s *iocpf, enum iocpf_event event)
1028 } 1019 }
1029} 1020}
1030 1021
1031
1032static void 1022static void
1033bfa_iocpf_sm_fail_entry(struct bfa_iocpf_s *iocpf) 1023bfa_iocpf_sm_fail_entry(struct bfa_iocpf_s *iocpf)
1034{ 1024{
@@ -1078,8 +1068,6 @@ bfa_iocpf_sm_fail(struct bfa_iocpf_s *iocpf, enum iocpf_event event)
1078 } 1068 }
1079} 1069}
1080 1070
1081
1082
1083/* 1071/*
1084 * BFA IOC private functions 1072 * BFA IOC private functions
1085 */ 1073 */
@@ -1123,7 +1111,6 @@ bfa_ioc_sem_get(void __iomem *sem_reg)
1123 return BFA_FALSE; 1111 return BFA_FALSE;
1124} 1112}
1125 1113
1126
1127static void 1114static void
1128bfa_ioc_hw_sem_get(struct bfa_ioc_s *ioc) 1115bfa_ioc_hw_sem_get(struct bfa_ioc_s *ioc)
1129{ 1116{
@@ -1305,7 +1292,6 @@ bfa_ioc_msgflush(struct bfa_ioc_s *ioc)
1305 writel(1, ioc->ioc_regs.lpu_mbox_cmd); 1292 writel(1, ioc->ioc_regs.lpu_mbox_cmd);
1306} 1293}
1307 1294
1308
1309static void 1295static void
1310bfa_ioc_hwinit(struct bfa_ioc_s *ioc, bfa_boolean_t force) 1296bfa_ioc_hwinit(struct bfa_ioc_s *ioc, bfa_boolean_t force)
1311{ 1297{
@@ -1738,7 +1724,6 @@ bfa_ioc_smem_clr(struct bfa_ioc_s *ioc, u32 soff, u32 sz)
1738 return BFA_STATUS_OK; 1724 return BFA_STATUS_OK;
1739} 1725}
1740 1726
1741
1742static void 1727static void
1743bfa_ioc_pf_fwmismatch(struct bfa_ioc_s *ioc) 1728bfa_ioc_pf_fwmismatch(struct bfa_ioc_s *ioc)
1744{ 1729{
@@ -1752,7 +1737,6 @@ bfa_ioc_pf_fwmismatch(struct bfa_ioc_s *ioc)
1752 "with the driver version\n"); 1737 "with the driver version\n");
1753} 1738}
1754 1739
1755
1756bfa_status_t 1740bfa_status_t
1757bfa_ioc_pll_init(struct bfa_ioc_s *ioc) 1741bfa_ioc_pll_init(struct bfa_ioc_s *ioc)
1758{ 1742{
diff --git a/drivers/scsi/bfa/bfa_svc.c b/drivers/scsi/bfa/bfa_svc.c
index 1d5432b42a9..8dc2e7752e4 100644
--- a/drivers/scsi/bfa/bfa_svc.c
+++ b/drivers/scsi/bfa/bfa_svc.c
@@ -52,7 +52,6 @@ BFA_MODULE(uf);
52 ((bfa_fcport_is_disabled(bfa) == BFA_TRUE) || \ 52 ((bfa_fcport_is_disabled(bfa) == BFA_TRUE) || \
53 (bfa_ioc_is_disabled(&bfa->ioc) == BFA_TRUE)) 53 (bfa_ioc_is_disabled(&bfa->ioc) == BFA_TRUE))
54 54
55
56/* 55/*
57 * BFA port state machine events 56 * BFA port state machine events
58 */ 57 */
@@ -917,10 +916,6 @@ bfa_fcxp_queue(struct bfa_fcxp_s *fcxp, struct bfi_fcxp_send_req_s *send_req)
917} 916}
918 917
919/* 918/*
920 * hal_fcxp_api BFA FCXP API
921 */
922
923/*
924 * Allocate an FCXP instance to send a response or to send a request 919 * Allocate an FCXP instance to send a response or to send a request
925 * that has a response. Request/response buffers are allocated by caller. 920 * that has a response. Request/response buffers are allocated by caller.
926 * 921 *
@@ -1014,7 +1009,7 @@ bfa_fcxp_get_rspbuf(struct bfa_fcxp_s *fcxp)
1014} 1009}
1015 1010
1016/* 1011/*
1017 * Free the BFA FCXP 1012 * Free the BFA FCXP
1018 * 1013 *
1019 * @param[in] fcxp BFA fcxp pointer 1014 * @param[in] fcxp BFA fcxp pointer
1020 * 1015 *
@@ -1161,12 +1156,6 @@ bfa_fcxp_discard(struct bfa_fcxp_s *fcxp)
1161 fcxp->send_cbfn = bfa_fcxp_null_comp; 1156 fcxp->send_cbfn = bfa_fcxp_null_comp;
1162} 1157}
1163 1158
1164
1165
1166/*
1167 * hal_fcxp_public BFA FCXP public functions
1168 */
1169
1170void 1159void
1171bfa_fcxp_isr(struct bfa_s *bfa, struct bfi_msg_s *msg) 1160bfa_fcxp_isr(struct bfa_s *bfa, struct bfi_msg_s *msg)
1172{ 1161{
@@ -2636,12 +2625,6 @@ bfa_fcport_ln_sm_up_dn_up_nf(struct bfa_fcport_ln_s *ln,
2636 } 2625 }
2637} 2626}
2638 2627
2639
2640
2641/*
2642 * hal_port_private
2643 */
2644
2645static void 2628static void
2646__bfa_cb_fcport_event(void *cbarg, bfa_boolean_t complete) 2629__bfa_cb_fcport_event(void *cbarg, bfa_boolean_t complete)
2647{ 2630{
@@ -3229,12 +3212,6 @@ bfa_trunk_iocdisable(struct bfa_s *bfa)
3229 } 3212 }
3230} 3213}
3231 3214
3232
3233
3234/*
3235 * hal_port_public
3236 */
3237
3238/* 3215/*
3239 * Called to initialize port attributes 3216 * Called to initialize port attributes
3240 */ 3217 */
@@ -3336,12 +3313,6 @@ bfa_fcport_isr(struct bfa_s *bfa, struct bfi_msg_s *msg)
3336 } 3313 }
3337} 3314}
3338 3315
3339
3340
3341/*
3342 * hal_port_api
3343 */
3344
3345/* 3316/*
3346 * Registered callback for port events. 3317 * Registered callback for port events.
3347 */ 3318 */
@@ -3674,7 +3645,6 @@ bfa_fcport_is_ratelim(struct bfa_s *bfa)
3674 3645
3675} 3646}
3676 3647
3677
3678/* 3648/*
3679 * Get default minimum ratelim speed 3649 * Get default minimum ratelim speed
3680 */ 3650 */
@@ -4573,12 +4543,6 @@ bfa_sgpg_iocdisable(struct bfa_s *bfa)
4573{ 4543{
4574} 4544}
4575 4545
4576
4577
4578/*
4579 * hal_sgpg_public BFA SGPG public functions
4580 */
4581
4582bfa_status_t 4546bfa_status_t
4583bfa_sgpg_malloc(struct bfa_s *bfa, struct list_head *sgpg_q, int nsgpgs) 4547bfa_sgpg_malloc(struct bfa_s *bfa, struct list_head *sgpg_q, int nsgpgs)
4584{ 4548{