aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/bfa
diff options
context:
space:
mode:
authorKrishna Gudipati <kgudipat@brocade.com>2011-06-24 23:24:52 -0400
committerJames Bottomley <JBottomley@Parallels.com>2011-06-29 18:12:11 -0400
commitd7be54cc5c5f6f9cb9ac67462aadda57813698b8 (patch)
tree2f77812fe06a7ed59172a51f11166aadd6a262d8 /drivers/scsi/bfa
parent4507025d01149aea8705e43508d0ef11e7010cfd (diff)
[SCSI] bfa: FCS bug fixes.
- Added logic to initiate a PLOGI to the target, while processing a LOGO from the same target in Direct attach mode. - Added logic to generate a FCCT Reject indicating unsupported command, upon receiving FCCT/FCGS requests. - Added logic to set the fcpim in offline state and avoid any PRLI retries if a PRLI response is a reject with a reason Command Not Supported. - Updated the FDMI Supported/Current speeds. - Added logic to wait for the response from the firmware before sending ACC to PLOGI and transitioning to subsequent states - while processing an Incoming PLOGI in online state. - Added a wait state in the fcs_vport state machine - For case where FDISC is in progress and we get a vport delete request we wait for fdisc response and will transition to the appropriate state based on rsp status, else its causing both driver/fw resources to be not freed. - Remove the fc_credit_recovery module param. Signed-off-by: Krishna Gudipati <kgudipat@brocade.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/bfa')
-rw-r--r--drivers/scsi/bfa/bfa_defs_fcs.h25
-rw-r--r--drivers/scsi/bfa/bfa_defs_svc.h10
-rw-r--r--drivers/scsi/bfa/bfa_fcbuild.c31
-rw-r--r--drivers/scsi/bfa/bfa_fcbuild.h4
-rw-r--r--drivers/scsi/bfa/bfa_fcs.c20
-rw-r--r--drivers/scsi/bfa/bfa_fcs.h20
-rw-r--r--drivers/scsi/bfa/bfa_fcs_fcpim.c10
-rw-r--r--drivers/scsi/bfa/bfa_fcs_lport.c170
-rw-r--r--drivers/scsi/bfa/bfa_fcs_rport.c45
-rw-r--r--drivers/scsi/bfa/bfa_svc.c2
-rw-r--r--drivers/scsi/bfa/bfad.c5
-rw-r--r--drivers/scsi/bfa/bfad_drv.h1
12 files changed, 288 insertions, 55 deletions
diff --git a/drivers/scsi/bfa/bfa_defs_fcs.h b/drivers/scsi/bfa/bfa_defs_fcs.h
index 191d34a58b9c..5e95976d81b8 100644
--- a/drivers/scsi/bfa/bfa_defs_fcs.h
+++ b/drivers/scsi/bfa/bfa_defs_fcs.h
@@ -90,12 +90,12 @@ enum bfa_lport_role {
90 * FCS port configuration. 90 * FCS port configuration.
91 */ 91 */
92struct bfa_lport_cfg_s { 92struct bfa_lport_cfg_s {
93 wwn_t pwwn; /* port wwn */ 93 wwn_t pwwn; /* port wwn */
94 wwn_t nwwn; /* node wwn */ 94 wwn_t nwwn; /* node wwn */
95 struct bfa_lport_symname_s sym_name; /* vm port symbolic name */ 95 struct bfa_lport_symname_s sym_name; /* vm port symbolic name */
96 bfa_boolean_t preboot_vp; /* vport created from PBC */ 96 bfa_boolean_t preboot_vp; /* vport created from PBC */
97 enum bfa_lport_role roles; /* FCS port roles */ 97 enum bfa_lport_role roles; /* FCS port roles */
98 u8 tag[16]; /* opaque tag from application */ 98 u8 tag[16]; /* opaque tag from application */
99}; 99};
100 100
101/* 101/*
@@ -249,12 +249,13 @@ enum bfa_vport_state {
249 BFA_FCS_VPORT_FDISC_SEND = 2, 249 BFA_FCS_VPORT_FDISC_SEND = 2,
250 BFA_FCS_VPORT_FDISC = 3, 250 BFA_FCS_VPORT_FDISC = 3,
251 BFA_FCS_VPORT_FDISC_RETRY = 4, 251 BFA_FCS_VPORT_FDISC_RETRY = 4,
252 BFA_FCS_VPORT_ONLINE = 5, 252 BFA_FCS_VPORT_FDISC_RSP_WAIT = 5,
253 BFA_FCS_VPORT_DELETING = 6, 253 BFA_FCS_VPORT_ONLINE = 6,
254 BFA_FCS_VPORT_CLEANUP = 6, 254 BFA_FCS_VPORT_DELETING = 7,
255 BFA_FCS_VPORT_LOGO_SEND = 7, 255 BFA_FCS_VPORT_CLEANUP = 8,
256 BFA_FCS_VPORT_LOGO = 8, 256 BFA_FCS_VPORT_LOGO_SEND = 9,
257 BFA_FCS_VPORT_ERROR = 9, 257 BFA_FCS_VPORT_LOGO = 10,
258 BFA_FCS_VPORT_ERROR = 11,
258 BFA_FCS_VPORT_MAX_STATE, 259 BFA_FCS_VPORT_MAX_STATE,
259}; 260};
260 261
diff --git a/drivers/scsi/bfa/bfa_defs_svc.h b/drivers/scsi/bfa/bfa_defs_svc.h
index d8861872ac70..7f3584380a42 100644
--- a/drivers/scsi/bfa/bfa_defs_svc.h
+++ b/drivers/scsi/bfa/bfa_defs_svc.h
@@ -748,9 +748,10 @@ struct bfa_port_cfg_s {
748 u8 tx_bbcredit; /* transmit buffer credits */ 748 u8 tx_bbcredit; /* transmit buffer credits */
749 u8 ratelimit; /* ratelimit enabled or not */ 749 u8 ratelimit; /* ratelimit enabled or not */
750 u8 trl_def_speed; /* ratelimit default speed */ 750 u8 trl_def_speed; /* ratelimit default speed */
751 u8 bb_scn; 751 u8 bb_scn; /* BB_SCN value from FLOGI Exchg */
752 u8 bb_scn_state; /* Config state of BB_SCN */
752 u8 faa_state; /* FAA enabled/disabled */ 753 u8 faa_state; /* FAA enabled/disabled */
753 u8 rsvd[2]; 754 u8 rsvd[1];
754 u16 path_tov; /* device path timeout */ 755 u16 path_tov; /* device path timeout */
755 u16 q_depth; /* SCSI Queue depth */ 756 u16 q_depth; /* SCSI Queue depth */
756}; 757};
@@ -786,7 +787,6 @@ struct bfa_port_attr_s {
786 enum bfa_port_topology topology; /* current topology */ 787 enum bfa_port_topology topology; /* current topology */
787 bfa_boolean_t beacon; /* current beacon status */ 788 bfa_boolean_t beacon; /* current beacon status */
788 bfa_boolean_t link_e2e_beacon; /* link beacon is on */ 789 bfa_boolean_t link_e2e_beacon; /* link beacon is on */
789 bfa_boolean_t plog_enabled; /* portlog is enabled */
790 bfa_boolean_t bbsc_op_status; /* fc credit recovery oper state */ 790 bfa_boolean_t bbsc_op_status; /* fc credit recovery oper state */
791 791
792 /* 792 /*
@@ -796,12 +796,10 @@ struct bfa_port_attr_s {
796 enum bfa_port_type port_type; /* current topology */ 796 enum bfa_port_type port_type; /* current topology */
797 u32 loopback; /* external loopback */ 797 u32 loopback; /* external loopback */
798 u32 authfail; /* auth fail state */ 798 u32 authfail; /* auth fail state */
799 bfa_boolean_t io_profile; /* get it from fcpim mod */
800 u8 pad[4]; /* for 64-bit alignement */
801 799
802 /* FCoE specific */ 800 /* FCoE specific */
803 u16 fcoe_vlan; 801 u16 fcoe_vlan;
804 u8 rsvd1[6]; 802 u8 rsvd1[2];
805}; 803};
806 804
807/* 805/*
diff --git a/drivers/scsi/bfa/bfa_fcbuild.c b/drivers/scsi/bfa/bfa_fcbuild.c
index 08fba370cf4f..17b59b8b5644 100644
--- a/drivers/scsi/bfa/bfa_fcbuild.c
+++ b/drivers/scsi/bfa/bfa_fcbuild.c
@@ -155,6 +155,22 @@ fc_gs_fchdr_build(struct fchs_s *fchs, u32 d_id, u32 s_id, u32 ox_id)
155 */ 155 */
156} 156}
157 157
158static void
159fc_gsresp_fchdr_build(struct fchs_s *fchs, u32 d_id, u32 s_id, u16 ox_id)
160{
161 memset(fchs, 0, sizeof(struct fchs_s));
162
163 fchs->routing = FC_RTG_FC4_DEV_DATA;
164 fchs->cat_info = FC_CAT_SOLICIT_CTRL;
165 fchs->type = FC_TYPE_SERVICES;
166 fchs->f_ctl =
167 bfa_hton3b(FCTL_EC_RESP | FCTL_SEQ_INI | FCTL_LS_EXCH |
168 FCTL_END_SEQ | FCTL_SI_XFER);
169 fchs->d_id = d_id;
170 fchs->s_id = s_id;
171 fchs->ox_id = ox_id;
172}
173
158void 174void
159fc_els_req_build(struct fchs_s *fchs, u32 d_id, u32 s_id, __be16 ox_id) 175fc_els_req_build(struct fchs_s *fchs, u32 d_id, u32 s_id, __be16 ox_id)
160{ 176{
@@ -1098,6 +1114,21 @@ fc_ct_rsp_parse(struct ct_hdr_s *cthdr)
1098} 1114}
1099 1115
1100u16 1116u16
1117fc_gs_rjt_build(struct fchs_s *fchs, struct ct_hdr_s *cthdr,
1118 u32 d_id, u32 s_id, u16 ox_id, u8 reason_code,
1119 u8 reason_code_expl)
1120{
1121 fc_gsresp_fchdr_build(fchs, d_id, s_id, ox_id);
1122
1123 cthdr->cmd_rsp_code = cpu_to_be16(CT_RSP_REJECT);
1124 cthdr->rev_id = CT_GS3_REVISION;
1125
1126 cthdr->reason_code = reason_code;
1127 cthdr->exp_code = reason_code_expl;
1128 return sizeof(struct ct_hdr_s);
1129}
1130
1131u16
1101fc_scr_build(struct fchs_s *fchs, struct fc_scr_s *scr, 1132fc_scr_build(struct fchs_s *fchs, struct fc_scr_s *scr,
1102 u8 set_br_reg, u32 s_id, u16 ox_id) 1133 u8 set_br_reg, u32 s_id, u16 ox_id)
1103{ 1134{
diff --git a/drivers/scsi/bfa/bfa_fcbuild.h b/drivers/scsi/bfa/bfa_fcbuild.h
index 9ba24c724f4c..42cd9d4da697 100644
--- a/drivers/scsi/bfa/bfa_fcbuild.h
+++ b/drivers/scsi/bfa/bfa_fcbuild.h
@@ -183,6 +183,10 @@ u16 fc_gidpn_build(struct fchs_s *fchs, void *pyld, u32 s_id,
183u16 fc_gpnid_build(struct fchs_s *fchs, void *pld, u32 s_id, 183u16 fc_gpnid_build(struct fchs_s *fchs, void *pld, u32 s_id,
184 u16 ox_id, u32 port_id); 184 u16 ox_id, u32 port_id);
185 185
186u16 fc_gs_rjt_build(struct fchs_s *fchs, struct ct_hdr_s *cthdr,
187 u32 d_id, u32 s_id, u16 ox_id,
188 u8 reason_code, u8 reason_code_expl);
189
186u16 fc_scr_build(struct fchs_s *fchs, struct fc_scr_s *scr, 190u16 fc_scr_build(struct fchs_s *fchs, struct fc_scr_s *scr,
187 u8 set_br_reg, u32 s_id, u16 ox_id); 191 u8 set_br_reg, u32 s_id, u16 ox_id);
188 192
diff --git a/drivers/scsi/bfa/bfa_fcs.c b/drivers/scsi/bfa/bfa_fcs.c
index 5bbb76b8e2ec..a9b22bc48bc3 100644
--- a/drivers/scsi/bfa/bfa_fcs.c
+++ b/drivers/scsi/bfa/bfa_fcs.c
@@ -192,11 +192,14 @@ bfa_fcs_exit(struct bfa_fcs_s *fcs)
192#define BFA_FCS_FABRIC_CLEANUP_DELAY (10000) /* Milliseconds */ 192#define BFA_FCS_FABRIC_CLEANUP_DELAY (10000) /* Milliseconds */
193 193
194#define bfa_fcs_fabric_set_opertype(__fabric) do { \ 194#define bfa_fcs_fabric_set_opertype(__fabric) do { \
195 if (bfa_fcport_get_topology((__fabric)->fcs->bfa) \ 195 if (bfa_fcport_get_topology((__fabric)->fcs->bfa) \
196 == BFA_PORT_TOPOLOGY_P2P) \ 196 == BFA_PORT_TOPOLOGY_P2P) { \
197 if (fabric->fab_type == BFA_FCS_FABRIC_SWITCHED) \
197 (__fabric)->oper_type = BFA_PORT_TYPE_NPORT; \ 198 (__fabric)->oper_type = BFA_PORT_TYPE_NPORT; \
198 else \ 199 else \
199 (__fabric)->oper_type = BFA_PORT_TYPE_NLPORT; \ 200 (__fabric)->oper_type = BFA_PORT_TYPE_P2P; \
201 } else \
202 (__fabric)->oper_type = BFA_PORT_TYPE_NLPORT; \
200} while (0) 203} while (0)
201 204
202/* 205/*
@@ -551,6 +554,9 @@ bfa_fcs_fabric_sm_nofabric(struct bfa_fcs_fabric_s *fabric,
551 bfa_fcs_fabric_oper_bbscn(fabric)); 554 bfa_fcs_fabric_oper_bbscn(fabric));
552 break; 555 break;
553 556
557 case BFA_FCS_FABRIC_SM_RETRY_OP:
558 break;
559
554 default: 560 default:
555 bfa_sm_fault(fabric->fcs, event); 561 bfa_sm_fault(fabric->fcs, event);
556 } 562 }
@@ -827,6 +833,7 @@ bfa_cb_lps_flogi_comp(void *bfad, void *uarg, bfa_status_t status)
827 */ 833 */
828 fabric->bport.port_topo.pn2n.rem_port_wwn = 834 fabric->bport.port_topo.pn2n.rem_port_wwn =
829 fabric->lps->pr_pwwn; 835 fabric->lps->pr_pwwn;
836 fabric->fab_type = BFA_FCS_FABRIC_N2N;
830 bfa_sm_send_event(fabric, BFA_FCS_FABRIC_SM_NO_FABRIC); 837 bfa_sm_send_event(fabric, BFA_FCS_FABRIC_SM_NO_FABRIC);
831 } 838 }
832 839
@@ -917,8 +924,9 @@ static u8
917bfa_fcs_fabric_oper_bbscn(struct bfa_fcs_fabric_s *fabric) 924bfa_fcs_fabric_oper_bbscn(struct bfa_fcs_fabric_s *fabric)
918{ 925{
919 u8 pr_bbscn = fabric->lps->pr_bbscn; 926 u8 pr_bbscn = fabric->lps->pr_bbscn;
927 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(fabric->fcs->bfa);
920 928
921 if (!(fabric->fcs->bbscn_enabled && pr_bbscn)) 929 if (!(fcport->cfg.bb_scn_state && pr_bbscn))
922 return 0; 930 return 0;
923 931
924 /* return max of local/remote bb_scn values */ 932 /* return max of local/remote bb_scn values */
@@ -932,8 +940,10 @@ bfa_fcs_fabric_oper_bbscn(struct bfa_fcs_fabric_s *fabric)
932static bfa_boolean_t 940static bfa_boolean_t
933bfa_fcs_fabric_is_bbscn_enabled(struct bfa_fcs_fabric_s *fabric) 941bfa_fcs_fabric_is_bbscn_enabled(struct bfa_fcs_fabric_s *fabric)
934{ 942{
943 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(fabric->fcs->bfa);
944
935 if (bfa_ioc_get_fcmode(&fabric->fcs->bfa->ioc) && 945 if (bfa_ioc_get_fcmode(&fabric->fcs->bfa->ioc) &&
936 fabric->fcs->bbscn_enabled && 946 fcport->cfg.bb_scn_state &&
937 !bfa_fcport_is_qos_enabled(fabric->fcs->bfa) && 947 !bfa_fcport_is_qos_enabled(fabric->fcs->bfa) &&
938 !bfa_fcport_is_trunk_enabled(fabric->fcs->bfa)) 948 !bfa_fcport_is_trunk_enabled(fabric->fcs->bfa))
939 return BFA_TRUE; 949 return BFA_TRUE;
diff --git a/drivers/scsi/bfa/bfa_fcs.h b/drivers/scsi/bfa/bfa_fcs.h
index 5873d9942aa7..e32cb19e32c3 100644
--- a/drivers/scsi/bfa/bfa_fcs.h
+++ b/drivers/scsi/bfa/bfa_fcs.h
@@ -424,6 +424,7 @@ struct bfa_fcs_rport_s {
424 enum fc_cos fc_cos; /* FC classes of service supp */ 424 enum fc_cos fc_cos; /* FC classes of service supp */
425 bfa_boolean_t cisc; /* CISC capable device */ 425 bfa_boolean_t cisc; /* CISC capable device */
426 bfa_boolean_t prlo; /* processing prlo or LOGO */ 426 bfa_boolean_t prlo; /* processing prlo or LOGO */
427 bfa_boolean_t plogi_pending; /* Rx Plogi Pending */
427 wwn_t pwwn; /* port wwn of rport */ 428 wwn_t pwwn; /* port wwn of rport */
428 wwn_t nwwn; /* node wwn of rport */ 429 wwn_t nwwn; /* node wwn of rport */
429 struct bfa_rport_symname_s psym_name; /* port symbolic name */ 430 struct bfa_rport_symname_s psym_name; /* port symbolic name */
@@ -595,10 +596,21 @@ void bfa_fcs_itnim_is_initiator(struct bfa_fcs_itnim_s *itnim);
595void bfa_fcs_fcpim_uf_recv(struct bfa_fcs_itnim_s *itnim, 596void bfa_fcs_fcpim_uf_recv(struct bfa_fcs_itnim_s *itnim,
596 struct fchs_s *fchs, u16 len); 597 struct fchs_s *fchs, u16 len);
597 598
598#define BFA_FCS_FDMI_SUPORTED_SPEEDS (FDMI_TRANS_SPEED_1G | \ 599#define BFA_FCS_FDMI_SUPP_SPEEDS_4G (FDMI_TRANS_SPEED_1G | \
599 FDMI_TRANS_SPEED_2G | \ 600 FDMI_TRANS_SPEED_2G | \
600 FDMI_TRANS_SPEED_4G | \ 601 FDMI_TRANS_SPEED_4G)
601 FDMI_TRANS_SPEED_8G) 602
603#define BFA_FCS_FDMI_SUPP_SPEEDS_8G (FDMI_TRANS_SPEED_1G | \
604 FDMI_TRANS_SPEED_2G | \
605 FDMI_TRANS_SPEED_4G | \
606 FDMI_TRANS_SPEED_8G)
607
608#define BFA_FCS_FDMI_SUPP_SPEEDS_16G (FDMI_TRANS_SPEED_2G | \
609 FDMI_TRANS_SPEED_4G | \
610 FDMI_TRANS_SPEED_8G | \
611 FDMI_TRANS_SPEED_16G)
612
613#define BFA_FCS_FDMI_SUPP_SPEEDS_10G FDMI_TRANS_SPEED_10G
602 614
603/* 615/*
604 * HBA Attribute Block : BFA internal representation. Note : Some variable 616 * HBA Attribute Block : BFA internal representation. Note : Some variable
diff --git a/drivers/scsi/bfa/bfa_fcs_fcpim.c b/drivers/scsi/bfa/bfa_fcs_fcpim.c
index e7b49f4cb51f..29b4108be269 100644
--- a/drivers/scsi/bfa/bfa_fcs_fcpim.c
+++ b/drivers/scsi/bfa/bfa_fcs_fcpim.c
@@ -54,6 +54,7 @@ enum bfa_fcs_itnim_event {
54 BFA_FCS_ITNIM_SM_INITIATOR = 9, /* rport is initiator */ 54 BFA_FCS_ITNIM_SM_INITIATOR = 9, /* rport is initiator */
55 BFA_FCS_ITNIM_SM_DELETE = 10, /* delete event from rport */ 55 BFA_FCS_ITNIM_SM_DELETE = 10, /* delete event from rport */
56 BFA_FCS_ITNIM_SM_PRLO = 11, /* delete event from rport */ 56 BFA_FCS_ITNIM_SM_PRLO = 11, /* delete event from rport */
57 BFA_FCS_ITNIM_SM_RSP_NOT_SUPP = 12, /* cmd not supported rsp */
57}; 58};
58 59
59static void bfa_fcs_itnim_sm_offline(struct bfa_fcs_itnim_s *itnim, 60static void bfa_fcs_itnim_sm_offline(struct bfa_fcs_itnim_s *itnim,
@@ -178,6 +179,10 @@ bfa_fcs_itnim_sm_prli(struct bfa_fcs_itnim_s *itnim,
178 BFA_FCS_RETRY_TIMEOUT); 179 BFA_FCS_RETRY_TIMEOUT);
179 break; 180 break;
180 181
182 case BFA_FCS_ITNIM_SM_RSP_NOT_SUPP:
183 bfa_sm_set_state(itnim, bfa_fcs_itnim_sm_offline);
184 break;
185
181 case BFA_FCS_ITNIM_SM_OFFLINE: 186 case BFA_FCS_ITNIM_SM_OFFLINE:
182 bfa_sm_set_state(itnim, bfa_fcs_itnim_sm_offline); 187 bfa_sm_set_state(itnim, bfa_fcs_itnim_sm_offline);
183 bfa_fcxp_discard(itnim->fcxp); 188 bfa_fcxp_discard(itnim->fcxp);
@@ -447,6 +452,7 @@ bfa_fcs_itnim_prli_response(void *fcsarg, struct bfa_fcxp_s *fcxp, void *cbarg,
447 itnim->rport->scsi_function = 452 itnim->rport->scsi_function =
448 BFA_RPORT_INITIATOR; 453 BFA_RPORT_INITIATOR;
449 itnim->stats.prli_rsp_acc++; 454 itnim->stats.prli_rsp_acc++;
455 itnim->stats.initiator++;
450 bfa_sm_send_event(itnim, 456 bfa_sm_send_event(itnim,
451 BFA_FCS_ITNIM_SM_RSP_OK); 457 BFA_FCS_ITNIM_SM_RSP_OK);
452 return; 458 return;
@@ -472,6 +478,10 @@ bfa_fcs_itnim_prli_response(void *fcsarg, struct bfa_fcxp_s *fcxp, void *cbarg,
472 bfa_trc(itnim->fcs, ls_rjt->reason_code_expl); 478 bfa_trc(itnim->fcs, ls_rjt->reason_code_expl);
473 479
474 itnim->stats.prli_rsp_rjt++; 480 itnim->stats.prli_rsp_rjt++;
481 if (ls_rjt->reason_code == FC_LS_RJT_RSN_CMD_NOT_SUPP) {
482 bfa_sm_send_event(itnim, BFA_FCS_ITNIM_SM_RSP_NOT_SUPP);
483 return;
484 }
475 bfa_sm_send_event(itnim, BFA_FCS_ITNIM_SM_RSP_ERROR); 485 bfa_sm_send_event(itnim, BFA_FCS_ITNIM_SM_RSP_ERROR);
476 } 486 }
477} 487}
diff --git a/drivers/scsi/bfa/bfa_fcs_lport.c b/drivers/scsi/bfa/bfa_fcs_lport.c
index 942443e711e5..f8251a91ba91 100644
--- a/drivers/scsi/bfa/bfa_fcs_lport.c
+++ b/drivers/scsi/bfa/bfa_fcs_lport.c
@@ -328,6 +328,40 @@ bfa_fcs_lport_send_ls_rjt(struct bfa_fcs_lport_s *port, struct fchs_s *rx_fchs,
328} 328}
329 329
330/* 330/*
331 * Send a FCCT Reject
332 */
333static void
334bfa_fcs_lport_send_fcgs_rjt(struct bfa_fcs_lport_s *port,
335 struct fchs_s *rx_fchs, u8 reason_code, u8 reason_code_expl)
336{
337 struct fchs_s fchs;
338 struct bfa_fcxp_s *fcxp;
339 struct bfa_rport_s *bfa_rport = NULL;
340 int len;
341 struct ct_hdr_s *rx_cthdr = (struct ct_hdr_s *)(rx_fchs + 1);
342 struct ct_hdr_s *ct_hdr;
343
344 bfa_trc(port->fcs, rx_fchs->d_id);
345 bfa_trc(port->fcs, rx_fchs->s_id);
346
347 fcxp = bfa_fcs_fcxp_alloc(port->fcs);
348 if (!fcxp)
349 return;
350
351 ct_hdr = bfa_fcxp_get_reqbuf(fcxp);
352 ct_hdr->gs_type = rx_cthdr->gs_type;
353 ct_hdr->gs_sub_type = rx_cthdr->gs_sub_type;
354
355 len = fc_gs_rjt_build(&fchs, ct_hdr, rx_fchs->s_id,
356 bfa_fcs_lport_get_fcid(port),
357 rx_fchs->ox_id, reason_code, reason_code_expl);
358
359 bfa_fcxp_send(fcxp, bfa_rport, port->fabric->vf_id, port->lp_tag,
360 BFA_FALSE, FC_CLASS_3, len, &fchs, NULL, NULL,
361 FC_MAX_PDUSZ, 0);
362}
363
364/*
331 * Process incoming plogi from a remote port. 365 * Process incoming plogi from a remote port.
332 */ 366 */
333static void 367static void
@@ -710,6 +744,16 @@ bfa_fcs_lport_uf_recv(struct bfa_fcs_lport_s *lport,
710 bfa_fcs_lport_abts_acc(lport, fchs); 744 bfa_fcs_lport_abts_acc(lport, fchs);
711 return; 745 return;
712 } 746 }
747
748 if (fchs->type == FC_TYPE_SERVICES) {
749 /*
750 * Unhandled FC-GS frames. Send a FC-CT Reject
751 */
752 bfa_fcs_lport_send_fcgs_rjt(lport, fchs, CT_RSN_NOT_SUPP,
753 CT_NS_EXP_NOADDITIONAL);
754 return;
755 }
756
713 /* 757 /*
714 * look for a matching remote port ID 758 * look for a matching remote port ID
715 */ 759 */
@@ -1137,6 +1181,8 @@ static void bfa_fcs_fdmi_get_hbaattr(struct bfa_fcs_lport_fdmi_s *fdmi,
1137 struct bfa_fcs_fdmi_hba_attr_s *hba_attr); 1181 struct bfa_fcs_fdmi_hba_attr_s *hba_attr);
1138static void bfa_fcs_fdmi_get_portattr(struct bfa_fcs_lport_fdmi_s *fdmi, 1182static void bfa_fcs_fdmi_get_portattr(struct bfa_fcs_lport_fdmi_s *fdmi,
1139 struct bfa_fcs_fdmi_port_attr_s *port_attr); 1183 struct bfa_fcs_fdmi_port_attr_s *port_attr);
1184u32 bfa_fcs_fdmi_convert_speed(enum bfa_port_speed pport_speed);
1185
1140/* 1186/*
1141 * fcs_fdmi_sm FCS FDMI state machine 1187 * fcs_fdmi_sm FCS FDMI state machine
1142 */ 1188 */
@@ -2223,12 +2269,36 @@ bfa_fcs_fdmi_get_portattr(struct bfa_fcs_lport_fdmi_s *fdmi,
2223 /* 2269 /*
2224 * Supported Speeds 2270 * Supported Speeds
2225 */ 2271 */
2226 port_attr->supp_speed = cpu_to_be32(BFA_FCS_FDMI_SUPORTED_SPEEDS); 2272 switch (pport_attr.speed_supported) {
2273 case BFA_PORT_SPEED_16GBPS:
2274 port_attr->supp_speed =
2275 cpu_to_be32(BFA_FCS_FDMI_SUPP_SPEEDS_16G);
2276 break;
2277
2278 case BFA_PORT_SPEED_10GBPS:
2279 port_attr->supp_speed =
2280 cpu_to_be32(BFA_FCS_FDMI_SUPP_SPEEDS_10G);
2281 break;
2282
2283 case BFA_PORT_SPEED_8GBPS:
2284 port_attr->supp_speed =
2285 cpu_to_be32(BFA_FCS_FDMI_SUPP_SPEEDS_8G);
2286 break;
2287
2288 case BFA_PORT_SPEED_4GBPS:
2289 port_attr->supp_speed =
2290 cpu_to_be32(BFA_FCS_FDMI_SUPP_SPEEDS_4G);
2291 break;
2292
2293 default:
2294 bfa_sm_fault(port->fcs, pport_attr.speed_supported);
2295 }
2227 2296
2228 /* 2297 /*
2229 * Current Speed 2298 * Current Speed
2230 */ 2299 */
2231 port_attr->curr_speed = cpu_to_be32(pport_attr.speed); 2300 port_attr->curr_speed = cpu_to_be32(
2301 bfa_fcs_fdmi_convert_speed(pport_attr.speed));
2232 2302
2233 /* 2303 /*
2234 * Max PDU Size. 2304 * Max PDU Size.
@@ -2249,6 +2319,41 @@ bfa_fcs_fdmi_get_portattr(struct bfa_fcs_lport_fdmi_s *fdmi,
2249 2319
2250} 2320}
2251 2321
2322/*
2323 * Convert BFA speed to FDMI format.
2324 */
2325u32
2326bfa_fcs_fdmi_convert_speed(bfa_port_speed_t pport_speed)
2327{
2328 u32 ret;
2329
2330 switch (pport_speed) {
2331 case BFA_PORT_SPEED_1GBPS:
2332 case BFA_PORT_SPEED_2GBPS:
2333 ret = pport_speed;
2334 break;
2335
2336 case BFA_PORT_SPEED_4GBPS:
2337 ret = FDMI_TRANS_SPEED_4G;
2338 break;
2339
2340 case BFA_PORT_SPEED_8GBPS:
2341 ret = FDMI_TRANS_SPEED_8G;
2342 break;
2343
2344 case BFA_PORT_SPEED_10GBPS:
2345 ret = FDMI_TRANS_SPEED_10G;
2346 break;
2347
2348 case BFA_PORT_SPEED_16GBPS:
2349 ret = FDMI_TRANS_SPEED_16G;
2350 break;
2351
2352 default:
2353 ret = FDMI_TRANS_SPEED_UNKNOWN;
2354 }
2355 return ret;
2356}
2252 2357
2253void 2358void
2254bfa_fcs_lport_fdmi_init(struct bfa_fcs_lport_ms_s *ms) 2359bfa_fcs_lport_fdmi_init(struct bfa_fcs_lport_ms_s *ms)
@@ -4827,8 +4932,8 @@ bfa_fcs_lport_get_rport_max_speed(bfa_fcs_lport_t *port)
4827 while (qe != qh) { 4932 while (qe != qh) {
4828 rport = (struct bfa_fcs_rport_s *) qe; 4933 rport = (struct bfa_fcs_rport_s *) qe;
4829 if ((bfa_ntoh3b(rport->pid) > 0xFFF000) || 4934 if ((bfa_ntoh3b(rport->pid) > 0xFFF000) ||
4830 (bfa_fcs_rport_get_state(rport) == 4935 (bfa_fcs_rport_get_state(rport) == BFA_RPORT_OFFLINE) ||
4831 BFA_RPORT_OFFLINE)) { 4936 (rport->scsi_function != BFA_RPORT_TARGET)) {
4832 qe = bfa_q_next(qe); 4937 qe = bfa_q_next(qe);
4833 continue; 4938 continue;
4834 } 4939 }
@@ -4841,17 +4946,15 @@ bfa_fcs_lport_get_rport_max_speed(bfa_fcs_lport_t *port)
4841 bfa_fcport_get_ratelim_speed(port->fcs->bfa); 4946 bfa_fcport_get_ratelim_speed(port->fcs->bfa);
4842 } 4947 }
4843 4948
4844 if ((rport_speed == BFA_PORT_SPEED_8GBPS) || 4949 if (rport_speed > max_speed)
4845 (rport_speed > port_speed)) {
4846 max_speed = rport_speed;
4847 break;
4848 } else if (rport_speed > max_speed) {
4849 max_speed = rport_speed; 4950 max_speed = rport_speed;
4850 }
4851 4951
4852 qe = bfa_q_next(qe); 4952 qe = bfa_q_next(qe);
4853 } 4953 }
4854 4954
4955 if (max_speed > port_speed)
4956 max_speed = port_speed;
4957
4855 bfa_trc(fcs, max_speed); 4958 bfa_trc(fcs, max_speed);
4856 return max_speed; 4959 return max_speed;
4857} 4960}
@@ -4996,6 +5099,8 @@ static void bfa_fcs_vport_sm_fdisc(struct bfa_fcs_vport_s *vport,
4996 enum bfa_fcs_vport_event event); 5099 enum bfa_fcs_vport_event event);
4997static void bfa_fcs_vport_sm_fdisc_retry(struct bfa_fcs_vport_s *vport, 5100static void bfa_fcs_vport_sm_fdisc_retry(struct bfa_fcs_vport_s *vport,
4998 enum bfa_fcs_vport_event event); 5101 enum bfa_fcs_vport_event event);
5102static void bfa_fcs_vport_sm_fdisc_rsp_wait(struct bfa_fcs_vport_s *vport,
5103 enum bfa_fcs_vport_event event);
4999static void bfa_fcs_vport_sm_online(struct bfa_fcs_vport_s *vport, 5104static void bfa_fcs_vport_sm_online(struct bfa_fcs_vport_s *vport,
5000 enum bfa_fcs_vport_event event); 5105 enum bfa_fcs_vport_event event);
5001static void bfa_fcs_vport_sm_deleting(struct bfa_fcs_vport_s *vport, 5106static void bfa_fcs_vport_sm_deleting(struct bfa_fcs_vport_s *vport,
@@ -5017,6 +5122,7 @@ static struct bfa_sm_table_s vport_sm_table[] = {
5017 {BFA_SM(bfa_fcs_vport_sm_offline), BFA_FCS_VPORT_OFFLINE}, 5122 {BFA_SM(bfa_fcs_vport_sm_offline), BFA_FCS_VPORT_OFFLINE},
5018 {BFA_SM(bfa_fcs_vport_sm_fdisc), BFA_FCS_VPORT_FDISC}, 5123 {BFA_SM(bfa_fcs_vport_sm_fdisc), BFA_FCS_VPORT_FDISC},
5019 {BFA_SM(bfa_fcs_vport_sm_fdisc_retry), BFA_FCS_VPORT_FDISC_RETRY}, 5124 {BFA_SM(bfa_fcs_vport_sm_fdisc_retry), BFA_FCS_VPORT_FDISC_RETRY},
5125 {BFA_SM(bfa_fcs_vport_sm_fdisc_rsp_wait), BFA_FCS_VPORT_FDISC_RSP_WAIT},
5020 {BFA_SM(bfa_fcs_vport_sm_online), BFA_FCS_VPORT_ONLINE}, 5126 {BFA_SM(bfa_fcs_vport_sm_online), BFA_FCS_VPORT_ONLINE},
5021 {BFA_SM(bfa_fcs_vport_sm_deleting), BFA_FCS_VPORT_DELETING}, 5127 {BFA_SM(bfa_fcs_vport_sm_deleting), BFA_FCS_VPORT_DELETING},
5022 {BFA_SM(bfa_fcs_vport_sm_cleanup), BFA_FCS_VPORT_CLEANUP}, 5128 {BFA_SM(bfa_fcs_vport_sm_cleanup), BFA_FCS_VPORT_CLEANUP},
@@ -5145,9 +5251,7 @@ bfa_fcs_vport_sm_fdisc(struct bfa_fcs_vport_s *vport,
5145 5251
5146 switch (event) { 5252 switch (event) {
5147 case BFA_FCS_VPORT_SM_DELETE: 5253 case BFA_FCS_VPORT_SM_DELETE:
5148 bfa_sm_set_state(vport, bfa_fcs_vport_sm_cleanup); 5254 bfa_sm_set_state(vport, bfa_fcs_vport_sm_fdisc_rsp_wait);
5149 bfa_sm_send_event(vport->lps, BFA_LPS_SM_OFFLINE);
5150 bfa_fcs_lport_delete(&vport->lport);
5151 break; 5255 break;
5152 5256
5153 case BFA_FCS_VPORT_SM_OFFLINE: 5257 case BFA_FCS_VPORT_SM_OFFLINE:
@@ -5215,6 +5319,41 @@ bfa_fcs_vport_sm_fdisc_retry(struct bfa_fcs_vport_s *vport,
5215} 5319}
5216 5320
5217/* 5321/*
5322 * FDISC is in progress and we got a vport delete request -
5323 * this is a wait state while we wait for fdisc response and
5324 * we will transition to the appropriate state - on rsp status.
5325 */
5326static void
5327bfa_fcs_vport_sm_fdisc_rsp_wait(struct bfa_fcs_vport_s *vport,
5328 enum bfa_fcs_vport_event event)
5329{
5330 bfa_trc(__vport_fcs(vport), __vport_pwwn(vport));
5331 bfa_trc(__vport_fcs(vport), event);
5332
5333 switch (event) {
5334 case BFA_FCS_VPORT_SM_RSP_OK:
5335 bfa_sm_set_state(vport, bfa_fcs_vport_sm_deleting);
5336 bfa_fcs_lport_delete(&vport->lport);
5337 break;
5338
5339 case BFA_FCS_VPORT_SM_DELETE:
5340 break;
5341
5342 case BFA_FCS_VPORT_SM_OFFLINE:
5343 case BFA_FCS_VPORT_SM_RSP_ERROR:
5344 case BFA_FCS_VPORT_SM_RSP_FAILED:
5345 case BFA_FCS_VPORT_SM_RSP_DUP_WWN:
5346 bfa_sm_set_state(vport, bfa_fcs_vport_sm_cleanup);
5347 bfa_sm_send_event(vport->lps, BFA_LPS_SM_OFFLINE);
5348 bfa_fcs_lport_delete(&vport->lport);
5349 break;
5350
5351 default:
5352 bfa_sm_fault(__vport_fcs(vport), event);
5353 }
5354}
5355
5356/*
5218 * Vport is online (FDISC is complete). 5357 * Vport is online (FDISC is complete).
5219 */ 5358 */
5220static void 5359static void
@@ -5529,7 +5668,10 @@ void
5529bfa_fcs_vport_online(struct bfa_fcs_vport_s *vport) 5668bfa_fcs_vport_online(struct bfa_fcs_vport_s *vport)
5530{ 5669{
5531 vport->vport_stats.fab_online++; 5670 vport->vport_stats.fab_online++;
5532 bfa_sm_send_event(vport, BFA_FCS_VPORT_SM_ONLINE); 5671 if (bfa_fcs_fabric_npiv_capable(__vport_fabric(vport)))
5672 bfa_sm_send_event(vport, BFA_FCS_VPORT_SM_ONLINE);
5673 else
5674 vport->vport_stats.fab_no_npiv++;
5533} 5675}
5534 5676
5535/* 5677/*
diff --git a/drivers/scsi/bfa/bfa_fcs_rport.c b/drivers/scsi/bfa/bfa_fcs_rport.c
index 2ec5719b654d..a42949d045eb 100644
--- a/drivers/scsi/bfa/bfa_fcs_rport.c
+++ b/drivers/scsi/bfa/bfa_fcs_rport.c
@@ -262,6 +262,7 @@ bfa_fcs_rport_sm_plogiacc_sending(struct bfa_fcs_rport_s *rport,
262 break; 262 break;
263 263
264 case RPSM_EVENT_PLOGI_RCVD: 264 case RPSM_EVENT_PLOGI_RCVD:
265 case RPSM_EVENT_PLOGI_COMP:
265 case RPSM_EVENT_SCN: 266 case RPSM_EVENT_SCN:
266 /* 267 /*
267 * Ignore, SCN is possibly online notification. 268 * Ignore, SCN is possibly online notification.
@@ -470,6 +471,7 @@ bfa_fcs_rport_sm_hal_online(struct bfa_fcs_rport_s *rport,
470 break; 471 break;
471 472
472 case RPSM_EVENT_PRLO_RCVD: 473 case RPSM_EVENT_PRLO_RCVD:
474 case RPSM_EVENT_PLOGI_COMP:
473 break; 475 break;
474 476
475 case RPSM_EVENT_LOGO_RCVD: 477 case RPSM_EVENT_LOGO_RCVD:
@@ -484,9 +486,9 @@ bfa_fcs_rport_sm_hal_online(struct bfa_fcs_rport_s *rport,
484 break; 486 break;
485 487
486 case RPSM_EVENT_PLOGI_RCVD: 488 case RPSM_EVENT_PLOGI_RCVD:
487 bfa_sm_set_state(rport, bfa_fcs_rport_sm_plogiacc_sending); 489 rport->plogi_pending = BFA_TRUE;
490 bfa_sm_set_state(rport, bfa_fcs_rport_sm_hcb_offline);
488 bfa_sm_send_event(rport->bfa_rport, BFA_RPORT_SM_OFFLINE); 491 bfa_sm_send_event(rport->bfa_rport, BFA_RPORT_SM_OFFLINE);
489 bfa_fcs_rport_send_plogiacc(rport, NULL);
490 break; 492 break;
491 493
492 case RPSM_EVENT_DELETE: 494 case RPSM_EVENT_DELETE:
@@ -891,6 +893,18 @@ bfa_fcs_rport_sm_hcb_offline(struct bfa_fcs_rport_s *rport,
891 893
892 switch (event) { 894 switch (event) {
893 case RPSM_EVENT_HCB_OFFLINE: 895 case RPSM_EVENT_HCB_OFFLINE:
896 if (bfa_fcs_lport_is_online(rport->port) &&
897 (rport->plogi_pending)) {
898 rport->plogi_pending = BFA_FALSE;
899 bfa_sm_set_state(rport,
900 bfa_fcs_rport_sm_plogiacc_sending);
901 bfa_fcs_rport_send_plogiacc(rport, NULL);
902 break;
903 }
904 /*
905 * !! fall through !!
906 */
907
894 case RPSM_EVENT_ADDRESS_CHANGE: 908 case RPSM_EVENT_ADDRESS_CHANGE:
895 if (bfa_fcs_lport_is_online(rport->port)) { 909 if (bfa_fcs_lport_is_online(rport->port)) {
896 if (bfa_fcs_fabric_is_switched(rport->port->fabric)) { 910 if (bfa_fcs_fabric_is_switched(rport->port->fabric)) {
@@ -921,6 +935,8 @@ bfa_fcs_rport_sm_hcb_offline(struct bfa_fcs_rport_s *rport,
921 case RPSM_EVENT_SCN: 935 case RPSM_EVENT_SCN:
922 case RPSM_EVENT_LOGO_RCVD: 936 case RPSM_EVENT_LOGO_RCVD:
923 case RPSM_EVENT_PRLO_RCVD: 937 case RPSM_EVENT_PRLO_RCVD:
938 case RPSM_EVENT_PLOGI_RCVD:
939 case RPSM_EVENT_LOGO_IMP:
924 /* 940 /*
925 * Ignore, already offline. 941 * Ignore, already offline.
926 */ 942 */
@@ -957,10 +973,18 @@ bfa_fcs_rport_sm_hcb_logorcv(struct bfa_fcs_rport_s *rport,
957 */ 973 */
958 if (bfa_fcs_lport_is_online(rport->port) && 974 if (bfa_fcs_lport_is_online(rport->port) &&
959 (!BFA_FCS_PID_IS_WKA(rport->pid))) { 975 (!BFA_FCS_PID_IS_WKA(rport->pid))) {
960 bfa_sm_set_state(rport, 976 if (bfa_fcs_fabric_is_switched(rport->port->fabric)) {
961 bfa_fcs_rport_sm_nsdisc_sending); 977 bfa_sm_set_state(rport,
962 rport->ns_retries = 0; 978 bfa_fcs_rport_sm_nsdisc_sending);
963 bfa_fcs_rport_send_nsdisc(rport, NULL); 979 rport->ns_retries = 0;
980 bfa_fcs_rport_send_nsdisc(rport, NULL);
981 } else {
982 /* For N2N Direct Attach, try to re-login */
983 bfa_sm_set_state(rport,
984 bfa_fcs_rport_sm_plogi_sending);
985 rport->plogi_retries = 0;
986 bfa_fcs_rport_send_plogi(rport, NULL);
987 }
964 } else { 988 } else {
965 /* 989 /*
966 * if it is not a well known address, reset the 990 * if it is not a well known address, reset the
@@ -2026,6 +2050,11 @@ bfa_fcs_rport_online_action(struct bfa_fcs_rport_s *rport)
2026 2050
2027 rport->stats.onlines++; 2051 rport->stats.onlines++;
2028 2052
2053 if ((!rport->pid) || (!rport->pwwn)) {
2054 bfa_trc(rport->fcs, rport->pid);
2055 bfa_sm_fault(rport->fcs, rport->pid);
2056 }
2057
2029 if (bfa_fcs_lport_is_initiator(port)) { 2058 if (bfa_fcs_lport_is_initiator(port)) {
2030 bfa_fcs_itnim_rport_online(rport->itnim); 2059 bfa_fcs_itnim_rport_online(rport->itnim);
2031 if (!BFA_FCS_PID_IS_WKA(rport->pid)) 2060 if (!BFA_FCS_PID_IS_WKA(rport->pid))
@@ -2049,6 +2078,7 @@ bfa_fcs_rport_offline_action(struct bfa_fcs_rport_s *rport)
2049 char rpwwn_buf[BFA_STRING_32]; 2078 char rpwwn_buf[BFA_STRING_32];
2050 2079
2051 rport->stats.offlines++; 2080 rport->stats.offlines++;
2081 rport->plogi_pending = BFA_FALSE;
2052 2082
2053 wwn2str(lpwwn_buf, bfa_fcs_lport_get_pwwn(port)); 2083 wwn2str(lpwwn_buf, bfa_fcs_lport_get_pwwn(port));
2054 wwn2str(rpwwn_buf, rport->pwwn); 2084 wwn2str(rpwwn_buf, rport->pwwn);
@@ -2252,6 +2282,9 @@ bfa_fcs_rport_plogi(struct bfa_fcs_rport_s *rport, struct fchs_s *rx_fchs,
2252 rport->reply_oxid = rx_fchs->ox_id; 2282 rport->reply_oxid = rx_fchs->ox_id;
2253 bfa_trc(rport->fcs, rport->reply_oxid); 2283 bfa_trc(rport->fcs, rport->reply_oxid);
2254 2284
2285 rport->pid = rx_fchs->s_id;
2286 bfa_trc(rport->fcs, rport->pid);
2287
2255 rport->stats.plogi_rcvd++; 2288 rport->stats.plogi_rcvd++;
2256 bfa_sm_send_event(rport, RPSM_EVENT_PLOGI_RCVD); 2289 bfa_sm_send_event(rport, RPSM_EVENT_PLOGI_RCVD);
2257} 2290}
diff --git a/drivers/scsi/bfa/bfa_svc.c b/drivers/scsi/bfa/bfa_svc.c
index 4dcf9b9a34d0..d7853e698d01 100644
--- a/drivers/scsi/bfa/bfa_svc.c
+++ b/drivers/scsi/bfa/bfa_svc.c
@@ -3750,8 +3750,6 @@ bfa_fcport_get_attr(struct bfa_s *bfa, struct bfa_port_attr_s *attr)
3750 /* beacon attributes */ 3750 /* beacon attributes */
3751 attr->beacon = fcport->beacon; 3751 attr->beacon = fcport->beacon;
3752 attr->link_e2e_beacon = fcport->link_e2e_beacon; 3752 attr->link_e2e_beacon = fcport->link_e2e_beacon;
3753 attr->plog_enabled = (bfa_boolean_t)fcport->bfa->plog->plog_enabled;
3754 attr->io_profile = bfa_fcpim_get_io_profile(fcport->bfa);
3755 3753
3756 attr->pport_cfg.path_tov = bfa_fcpim_path_tov_get(bfa); 3754 attr->pport_cfg.path_tov = bfa_fcpim_path_tov_get(bfa);
3757 attr->pport_cfg.q_depth = bfa_fcpim_qdepth_get(bfa); 3755 attr->pport_cfg.q_depth = bfa_fcpim_qdepth_get(bfa);
diff --git a/drivers/scsi/bfa/bfad.c b/drivers/scsi/bfa/bfad.c
index 872c9df590b9..0ed260852159 100644
--- a/drivers/scsi/bfa/bfad.c
+++ b/drivers/scsi/bfa/bfad.c
@@ -53,7 +53,6 @@ int bfa_log_level = 3; /* WARNING log level */
53int ioc_auto_recover = BFA_TRUE; 53int ioc_auto_recover = BFA_TRUE;
54int bfa_linkup_delay = -1; 54int bfa_linkup_delay = -1;
55int fdmi_enable = BFA_TRUE; 55int fdmi_enable = BFA_TRUE;
56int fc_credit_recovery = BFA_TRUE;
57int pcie_max_read_reqsz; 56int pcie_max_read_reqsz;
58int bfa_debugfs_enable = 1; 57int bfa_debugfs_enable = 1;
59int msix_disable_cb = 0, msix_disable_ct = 0; 58int msix_disable_cb = 0, msix_disable_ct = 0;
@@ -139,9 +138,6 @@ MODULE_PARM_DESC(msix_disable_ct, "Disable Message Signaled Interrupts "
139module_param(fdmi_enable, int, S_IRUGO | S_IWUSR); 138module_param(fdmi_enable, int, S_IRUGO | S_IWUSR);
140MODULE_PARM_DESC(fdmi_enable, "Enables fdmi registration, default=1, " 139MODULE_PARM_DESC(fdmi_enable, "Enables fdmi registration, default=1, "
141 "Range[false:0|true:1]"); 140 "Range[false:0|true:1]");
142module_param(fc_credit_recovery, int, S_IRUGO | S_IWUSR);
143MODULE_PARM_DESC(fc_credit_recovery, "Enables FC Credit Recovery, default=1, "
144 "Range[false:0|true:1]");
145module_param(pcie_max_read_reqsz, int, S_IRUGO | S_IWUSR); 141module_param(pcie_max_read_reqsz, int, S_IRUGO | S_IWUSR);
146MODULE_PARM_DESC(pcie_max_read_reqsz, "PCIe max read request size, default=0 " 142MODULE_PARM_DESC(pcie_max_read_reqsz, "PCIe max read request size, default=0 "
147 "(use system setting), Range[128|256|512|1024|2048|4096]"); 143 "(use system setting), Range[128|256|512|1024|2048|4096]");
@@ -877,7 +873,6 @@ bfad_drv_init(struct bfad_s *bfad)
877 bfad->bfa_fcs.trcmod = bfad->trcmod; 873 bfad->bfa_fcs.trcmod = bfad->trcmod;
878 bfa_fcs_attach(&bfad->bfa_fcs, &bfad->bfa, bfad, BFA_FALSE); 874 bfa_fcs_attach(&bfad->bfa_fcs, &bfad->bfa, bfad, BFA_FALSE);
879 bfad->bfa_fcs.fdmi_enabled = fdmi_enable; 875 bfad->bfa_fcs.fdmi_enabled = fdmi_enable;
880 bfad->bfa_fcs.bbscn_enabled = fc_credit_recovery;
881 bfa_fcs_init(&bfad->bfa_fcs); 876 bfa_fcs_init(&bfad->bfa_fcs);
882 spin_unlock_irqrestore(&bfad->bfad_lock, flags); 877 spin_unlock_irqrestore(&bfad->bfad_lock, flags);
883 878
diff --git a/drivers/scsi/bfa/bfad_drv.h b/drivers/scsi/bfa/bfad_drv.h
index e5163c7d3958..35bf0a630a68 100644
--- a/drivers/scsi/bfa/bfad_drv.h
+++ b/drivers/scsi/bfa/bfad_drv.h
@@ -340,7 +340,6 @@ extern int bfa_linkup_delay;
340extern int msix_disable_cb; 340extern int msix_disable_cb;
341extern int msix_disable_ct; 341extern int msix_disable_ct;
342extern int fdmi_enable; 342extern int fdmi_enable;
343extern int fc_credit_recovery;
344extern int supported_fc4s; 343extern int supported_fc4s;
345extern int pcie_max_read_reqsz; 344extern int pcie_max_read_reqsz;
346extern int bfa_debugfs_enable; 345extern int bfa_debugfs_enable;