aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVijaya Mohan Guvva <vmohan@brocade.com>2013-05-13 05:33:19 -0400
committerJames Bottomley <JBottomley@Parallels.com>2013-06-26 14:40:12 -0400
commitbbe37a67d9da18e40dfd9232586612424b1466f7 (patch)
tree28d5bbda3455f1606d7dac76c20ea00cb673b2d3
parent32d3d793fb2d40d2a255af64ffa17cfb2132c323 (diff)
[SCSI] bfa: Support for FC BB credit recovery
This patch includes changes to 1) Enable/disable fc credit recovery on Brocade FC adapter port operating at max supported speed. 2) Get credit recovery status and stats related to credit loss and recovered credits Signed-off-by: Vijaya Mohan Guvva <vmohan@brocade.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
-rw-r--r--drivers/scsi/bfa/bfa_defs.h10
-rw-r--r--drivers/scsi/bfa/bfa_defs_svc.h49
-rw-r--r--drivers/scsi/bfa/bfa_fcs.c62
-rw-r--r--drivers/scsi/bfa/bfa_fcs.h5
-rw-r--r--drivers/scsi/bfa/bfa_fcs_rport.c2
-rw-r--r--drivers/scsi/bfa/bfa_svc.c95
-rw-r--r--drivers/scsi/bfa/bfa_svc.h12
-rw-r--r--drivers/scsi/bfa/bfad_bsg.c47
-rw-r--r--drivers/scsi/bfa/bfad_bsg.h19
-rw-r--r--drivers/scsi/bfa/bfi_ms.h5
10 files changed, 202 insertions, 104 deletions
diff --git a/drivers/scsi/bfa/bfa_defs.h b/drivers/scsi/bfa/bfa_defs.h
index 0efdf312b42c..bdd1bae971ef 100644
--- a/drivers/scsi/bfa/bfa_defs.h
+++ b/drivers/scsi/bfa/bfa_defs.h
@@ -185,6 +185,8 @@ enum bfa_status {
185 BFA_STATUS_FAA_DISABLED = 198, /* FAA is already disabled */ 185 BFA_STATUS_FAA_DISABLED = 198, /* FAA is already disabled */
186 BFA_STATUS_FAA_ACQUIRED = 199, /* FAA is already acquired */ 186 BFA_STATUS_FAA_ACQUIRED = 199, /* FAA is already acquired */
187 BFA_STATUS_FAA_ACQ_ADDR = 200, /* Acquiring addr */ 187 BFA_STATUS_FAA_ACQ_ADDR = 200, /* Acquiring addr */
188 BFA_STATUS_BBCR_FC_ONLY = 201, /*!< BBCredit Recovery is supported for *
189 * FC mode only */
188 BFA_STATUS_ERROR_TRUNK_ENABLED = 203, /* Trunk enabled on adapter */ 190 BFA_STATUS_ERROR_TRUNK_ENABLED = 203, /* Trunk enabled on adapter */
189 BFA_STATUS_MAX_ENTRY_REACHED = 212, /* MAX entry reached */ 191 BFA_STATUS_MAX_ENTRY_REACHED = 212, /* MAX entry reached */
190 BFA_STATUS_TOPOLOGY_LOOP = 230, /* Topology is set to Loop */ 192 BFA_STATUS_TOPOLOGY_LOOP = 230, /* Topology is set to Loop */
@@ -198,6 +200,14 @@ enum bfa_status {
198 BFA_STATUS_CMD_NOTSUPP_MEZZ = 239, /* Cmd not supported for MEZZ card */ 200 BFA_STATUS_CMD_NOTSUPP_MEZZ = 239, /* Cmd not supported for MEZZ card */
199 BFA_STATUS_FRU_NOT_PRESENT = 240, /* fru module not present */ 201 BFA_STATUS_FRU_NOT_PRESENT = 240, /* fru module not present */
200 BFA_STATUS_DPORT_ERR = 245, /* D-port mode is enabled */ 202 BFA_STATUS_DPORT_ERR = 245, /* D-port mode is enabled */
203 BFA_STATUS_ERR_BBCR_SPEED_UNSUPPORT = 258, /*!< BB credit recovery is
204 * supported at max port speed alone */
205 BFA_STATUS_ERROR_BBCR_ENABLED = 259, /*!< BB credit recovery
206 * is enabled */
207 BFA_STATUS_INVALID_BBSCN = 260, /*!< Invalid BBSCN value.
208 * Valid range is [1-15] */
209 BFA_STATUS_BBCR_CFG_NO_CHANGE = 265, /*!< BBCR is operational.
210 * Disable BBCR and try this operation again. */
201 BFA_STATUS_MAX_VAL /* Unknown error code */ 211 BFA_STATUS_MAX_VAL /* Unknown error code */
202}; 212};
203#define bfa_status_t enum bfa_status 213#define bfa_status_t enum bfa_status
diff --git a/drivers/scsi/bfa/bfa_defs_svc.h b/drivers/scsi/bfa/bfa_defs_svc.h
index ec03c8cd8dac..c06359b76c4d 100644
--- a/drivers/scsi/bfa/bfa_defs_svc.h
+++ b/drivers/scsi/bfa/bfa_defs_svc.h
@@ -257,8 +257,6 @@ struct bfa_fw_port_lksm_stats_s {
257 u32 nos_tx; /* No. of times NOS tx started */ 257 u32 nos_tx; /* No. of times NOS tx started */
258 u32 hwsm_lrr_rx; /* No. of times LRR rx-ed by HWSM */ 258 u32 hwsm_lrr_rx; /* No. of times LRR rx-ed by HWSM */
259 u32 hwsm_lr_rx; /* No. of times LR rx-ed by HWSM */ 259 u32 hwsm_lr_rx; /* No. of times LR rx-ed by HWSM */
260 u32 bbsc_lr; /* LKSM LR tx for credit recovery */
261 u32 rsvd;
262}; 260};
263 261
264struct bfa_fw_port_snsm_stats_s { 262struct bfa_fw_port_snsm_stats_s {
@@ -409,7 +407,7 @@ struct bfa_fw_trunk_stats_s {
409 u32 rsvd; /* padding for 64 bit alignment */ 407 u32 rsvd; /* padding for 64 bit alignment */
410}; 408};
411 409
412struct bfa_fw_advsm_stats_s { 410struct bfa_fw_aport_stats_s {
413 u32 flogi_sent; /* Flogi sent */ 411 u32 flogi_sent; /* Flogi sent */
414 u32 flogi_acc_recvd; /* Flogi Acc received */ 412 u32 flogi_acc_recvd; /* Flogi Acc received */
415 u32 flogi_rjt_recvd; /* Flogi rejects received */ 413 u32 flogi_rjt_recvd; /* Flogi rejects received */
@@ -419,6 +417,12 @@ struct bfa_fw_advsm_stats_s {
419 u32 elp_accepted; /* ELP Accepted */ 417 u32 elp_accepted; /* ELP Accepted */
420 u32 elp_rejected; /* ELP rejected */ 418 u32 elp_rejected; /* ELP rejected */
421 u32 elp_dropped; /* ELP dropped */ 419 u32 elp_dropped; /* ELP dropped */
420
421 u32 bbcr_lr_count; /*!< BBCR Link Resets */
422 u32 frame_lost_intrs; /*!< BBCR Frame loss intrs */
423 u32 rrdy_lost_intrs; /*!< BBCR Rrdy loss intrs */
424
425 u32 rsvd;
422}; 426};
423 427
424/* 428/*
@@ -489,7 +493,7 @@ struct bfa_fw_stats_s {
489 struct bfa_fw_fcxchg_stats_s fcxchg_stats; 493 struct bfa_fw_fcxchg_stats_s fcxchg_stats;
490 struct bfa_fw_lps_stats_s lps_stats; 494 struct bfa_fw_lps_stats_s lps_stats;
491 struct bfa_fw_trunk_stats_s trunk_stats; 495 struct bfa_fw_trunk_stats_s trunk_stats;
492 struct bfa_fw_advsm_stats_s advsm_stats; 496 struct bfa_fw_aport_stats_s aport_stats;
493 struct bfa_fw_mac_mod_stats_s macmod_stats; 497 struct bfa_fw_mac_mod_stats_s macmod_stats;
494 struct bfa_fw_ct_mod_stats_s ctmod_stats; 498 struct bfa_fw_ct_mod_stats_s ctmod_stats;
495 struct bfa_fw_eth_sndrcv_stats_s ethsndrcv_stats; 499 struct bfa_fw_eth_sndrcv_stats_s ethsndrcv_stats;
@@ -545,6 +549,27 @@ struct bfa_qos_attr_s {
545 struct bfa_qos_bw_s qos_bw_op; /* QOS bw operational */ 549 struct bfa_qos_bw_s qos_bw_op; /* QOS bw operational */
546}; 550};
547 551
552enum bfa_bbcr_state {
553 BFA_BBCR_DISABLED, /*!< BBCR is disable */
554 BFA_BBCR_ONLINE, /*!< BBCR is online */
555 BFA_BBCR_OFFLINE, /*!< BBCR is offline */
556};
557
558enum bfa_bbcr_err_reason {
559 BFA_BBCR_ERR_REASON_NONE, /*!< Unknown */
560 BFA_BBCR_ERR_REASON_SPEED_UNSUP, /*!< Port speed < max sup_speed */
561 BFA_BBCR_ERR_REASON_PEER_UNSUP, /*!< BBCR is disable on peer port */
562 BFA_BBCR_ERR_REASON_NON_BRCD_SW, /*!< Connected to non BRCD switch */
563 BFA_BBCR_ERR_REASON_FLOGI_RJT, /*!< Login rejected by the switch */
564};
565
566struct bfa_bbcr_attr_s {
567 u8 state;
568 u8 peer_bb_scn;
569 u8 reason;
570 u8 rsvd;
571};
572
548/* 573/*
549 * These fields should be displayed only from the CLI. 574 * These fields should be displayed only from the CLI.
550 * There will be a separate BFAL API (get_qos_vc_attr ?) 575 * There will be a separate BFAL API (get_qos_vc_attr ?)
@@ -892,6 +917,9 @@ struct bfa_defs_fcpim_throttle_s {
892 u16 rsvd; 917 u16 rsvd;
893}; 918};
894 919
920#define BFA_BB_SCN_DEF 3
921#define BFA_BB_SCN_MAX 0x0F
922
895/* 923/*
896 * Physical port configuration 924 * Physical port configuration
897 */ 925 */
@@ -907,8 +935,8 @@ struct bfa_port_cfg_s {
907 u8 tx_bbcredit; /* transmit buffer credits */ 935 u8 tx_bbcredit; /* transmit buffer credits */
908 u8 ratelimit; /* ratelimit enabled or not */ 936 u8 ratelimit; /* ratelimit enabled or not */
909 u8 trl_def_speed; /* ratelimit default speed */ 937 u8 trl_def_speed; /* ratelimit default speed */
910 u8 bb_scn; /* BB_SCN value from FLOGI Exchg */ 938 u8 bb_cr_enabled; /*!< Config state of BB_SCN */
911 u8 bb_scn_state; /* Config state of BB_SCN */ 939 u8 bb_scn; /*!< BB_SCN value for FLOGI Exchg */
912 u8 faa_state; /* FAA enabled/disabled */ 940 u8 faa_state; /* FAA enabled/disabled */
913 u8 rsvd1; 941 u8 rsvd1;
914 u16 path_tov; /* device path timeout */ 942 u16 path_tov; /* device path timeout */
@@ -1052,6 +1080,7 @@ struct bfa_port_link_s {
1052 struct bfa_qos_attr_s qos_attr; /* QoS Attributes */ 1080 struct bfa_qos_attr_s qos_attr; /* QoS Attributes */
1053 union { 1081 union {
1054 struct bfa_fcport_loop_info_s loop_info; 1082 struct bfa_fcport_loop_info_s loop_info;
1083 struct bfa_bbcr_attr_s bbcr_attr;
1055 union { 1084 union {
1056 struct bfa_qos_vc_attr_s qos_vc_attr; 1085 struct bfa_qos_vc_attr_s qos_vc_attr;
1057 /* VC info from ELP */ 1086 /* VC info from ELP */
@@ -1215,9 +1244,11 @@ struct bfa_port_fc_stats_s {
1215 u64 bad_os_count; /* Invalid ordered sets */ 1244 u64 bad_os_count; /* Invalid ordered sets */
1216 u64 err_enc_out; /* Encoding err nonframe_8b10b */ 1245 u64 err_enc_out; /* Encoding err nonframe_8b10b */
1217 u64 err_enc; /* Encoding err frame_8b10b */ 1246 u64 err_enc; /* Encoding err frame_8b10b */
1218 u64 bbsc_frames_lost; /* Credit Recovery-Frames Lost */ 1247 u64 bbcr_frames_lost; /*!< BBCR Frames Lost */
1219 u64 bbsc_credits_lost; /* Credit Recovery-Credits Lost */ 1248 u64 bbcr_rrdys_lost; /*!< BBCR RRDYs Lost */
1220 u64 bbsc_link_resets; /* Credit Recovery-Link Resets */ 1249 u64 bbcr_link_resets; /*!< BBCR Link Resets */
1250 u64 bbcr_frame_lost_intrs; /*!< BBCR Frame loss intrs */
1251 u64 bbcr_rrdy_lost_intrs; /*!< BBCR Rrdy loss intrs */
1221 u64 loop_timeouts; /* Loop timeouts */ 1252 u64 loop_timeouts; /* Loop timeouts */
1222}; 1253};
1223 1254
diff --git a/drivers/scsi/bfa/bfa_fcs.c b/drivers/scsi/bfa/bfa_fcs.c
index d428808fb37e..a3ab5cce4208 100644
--- a/drivers/scsi/bfa/bfa_fcs.c
+++ b/drivers/scsi/bfa/bfa_fcs.c
@@ -240,9 +240,6 @@ static void bfa_fcs_fabric_flogiacc_comp(void *fcsarg,
240 u32 rsp_len, 240 u32 rsp_len,
241 u32 resid_len, 241 u32 resid_len,
242 struct fchs_s *rspfchs); 242 struct fchs_s *rspfchs);
243static u8 bfa_fcs_fabric_oper_bbscn(struct bfa_fcs_fabric_s *fabric);
244static bfa_boolean_t bfa_fcs_fabric_is_bbscn_enabled(
245 struct bfa_fcs_fabric_s *fabric);
246 243
247static void bfa_fcs_fabric_sm_uninit(struct bfa_fcs_fabric_s *fabric, 244static void bfa_fcs_fabric_sm_uninit(struct bfa_fcs_fabric_s *fabric,
248 enum bfa_fcs_fabric_event event); 245 enum bfa_fcs_fabric_event event);
@@ -404,8 +401,7 @@ bfa_fcs_fabric_sm_flogi(struct bfa_fcs_fabric_s *fabric,
404 case BFA_FCS_FABRIC_SM_CONT_OP: 401 case BFA_FCS_FABRIC_SM_CONT_OP:
405 402
406 bfa_fcport_set_tx_bbcredit(fabric->fcs->bfa, 403 bfa_fcport_set_tx_bbcredit(fabric->fcs->bfa,
407 fabric->bb_credit, 404 fabric->bb_credit);
408 bfa_fcs_fabric_oper_bbscn(fabric));
409 fabric->fab_type = BFA_FCS_FABRIC_SWITCHED; 405 fabric->fab_type = BFA_FCS_FABRIC_SWITCHED;
410 406
411 if (fabric->auth_reqd && fabric->is_auth) { 407 if (fabric->auth_reqd && fabric->is_auth) {
@@ -433,8 +429,7 @@ bfa_fcs_fabric_sm_flogi(struct bfa_fcs_fabric_s *fabric,
433 case BFA_FCS_FABRIC_SM_NO_FABRIC: 429 case BFA_FCS_FABRIC_SM_NO_FABRIC:
434 fabric->fab_type = BFA_FCS_FABRIC_N2N; 430 fabric->fab_type = BFA_FCS_FABRIC_N2N;
435 bfa_fcport_set_tx_bbcredit(fabric->fcs->bfa, 431 bfa_fcport_set_tx_bbcredit(fabric->fcs->bfa,
436 fabric->bb_credit, 432 fabric->bb_credit);
437 bfa_fcs_fabric_oper_bbscn(fabric));
438 bfa_fcs_fabric_notify_online(fabric); 433 bfa_fcs_fabric_notify_online(fabric);
439 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_nofabric); 434 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_nofabric);
440 break; 435 break;
@@ -602,8 +597,7 @@ bfa_fcs_fabric_sm_nofabric(struct bfa_fcs_fabric_s *fabric,
602 case BFA_FCS_FABRIC_SM_NO_FABRIC: 597 case BFA_FCS_FABRIC_SM_NO_FABRIC:
603 bfa_trc(fabric->fcs, fabric->bb_credit); 598 bfa_trc(fabric->fcs, fabric->bb_credit);
604 bfa_fcport_set_tx_bbcredit(fabric->fcs->bfa, 599 bfa_fcport_set_tx_bbcredit(fabric->fcs->bfa,
605 fabric->bb_credit, 600 fabric->bb_credit);
606 bfa_fcs_fabric_oper_bbscn(fabric));
607 break; 601 break;
608 602
609 case BFA_FCS_FABRIC_SM_RETRY_OP: 603 case BFA_FCS_FABRIC_SM_RETRY_OP:
@@ -965,10 +959,6 @@ bfa_cb_lps_flogi_comp(void *bfad, void *uarg, bfa_status_t status)
965 959
966 case BFA_STATUS_FABRIC_RJT: 960 case BFA_STATUS_FABRIC_RJT:
967 fabric->stats.flogi_rejects++; 961 fabric->stats.flogi_rejects++;
968 if (fabric->lps->lsrjt_rsn == FC_LS_RJT_RSN_LOGICAL_ERROR &&
969 fabric->lps->lsrjt_expl == FC_LS_RJT_EXP_NO_ADDL_INFO)
970 fabric->fcs->bbscn_flogi_rjt = BFA_TRUE;
971
972 bfa_sm_send_event(fabric, BFA_FCS_FABRIC_SM_RETRY_OP); 962 bfa_sm_send_event(fabric, BFA_FCS_FABRIC_SM_RETRY_OP);
973 return; 963 return;
974 964
@@ -1014,14 +1004,11 @@ bfa_fcs_fabric_login(struct bfa_fcs_fabric_s *fabric)
1014{ 1004{
1015 struct bfa_s *bfa = fabric->fcs->bfa; 1005 struct bfa_s *bfa = fabric->fcs->bfa;
1016 struct bfa_lport_cfg_s *pcfg = &fabric->bport.port_cfg; 1006 struct bfa_lport_cfg_s *pcfg = &fabric->bport.port_cfg;
1017 u8 alpa = 0, bb_scn = 0; 1007 u8 alpa = 0;
1018 1008
1019 if (bfa_fcs_fabric_is_bbscn_enabled(fabric) &&
1020 (!fabric->fcs->bbscn_flogi_rjt))
1021 bb_scn = BFA_FCS_PORT_DEF_BB_SCN;
1022 1009
1023 bfa_lps_flogi(fabric->lps, fabric, alpa, bfa_fcport_get_maxfrsize(bfa), 1010 bfa_lps_flogi(fabric->lps, fabric, alpa, bfa_fcport_get_maxfrsize(bfa),
1024 pcfg->pwwn, pcfg->nwwn, fabric->auth_reqd, bb_scn); 1011 pcfg->pwwn, pcfg->nwwn, fabric->auth_reqd);
1025 1012
1026 fabric->stats.flogi_sent++; 1013 fabric->stats.flogi_sent++;
1027} 1014}
@@ -1102,40 +1089,6 @@ bfa_fcs_fabric_stop(struct bfa_fcs_fabric_s *fabric)
1102} 1089}
1103 1090
1104/* 1091/*
1105 * Computes operating BB_SCN value
1106 */
1107static u8
1108bfa_fcs_fabric_oper_bbscn(struct bfa_fcs_fabric_s *fabric)
1109{
1110 u8 pr_bbscn = fabric->lps->pr_bbscn;
1111 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(fabric->fcs->bfa);
1112
1113 if (!(fcport->cfg.bb_scn_state && pr_bbscn))
1114 return 0;
1115
1116 /* return max of local/remote bb_scn values */
1117 return ((pr_bbscn > BFA_FCS_PORT_DEF_BB_SCN) ?
1118 pr_bbscn : BFA_FCS_PORT_DEF_BB_SCN);
1119}
1120
1121/*
1122 * Check if BB_SCN can be enabled.
1123 */
1124static bfa_boolean_t
1125bfa_fcs_fabric_is_bbscn_enabled(struct bfa_fcs_fabric_s *fabric)
1126{
1127 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(fabric->fcs->bfa);
1128
1129 if (bfa_ioc_get_fcmode(&fabric->fcs->bfa->ioc) &&
1130 fcport->cfg.bb_scn_state &&
1131 !bfa_fcport_is_qos_enabled(fabric->fcs->bfa) &&
1132 !bfa_fcport_is_trunk_enabled(fabric->fcs->bfa))
1133 return BFA_TRUE;
1134 else
1135 return BFA_FALSE;
1136}
1137
1138/*
1139 * Delete all vports and wait for vport delete completions. 1092 * Delete all vports and wait for vport delete completions.
1140 */ 1093 */
1141static void 1094static void
@@ -1273,7 +1226,6 @@ void
1273bfa_fcs_fabric_link_down(struct bfa_fcs_fabric_s *fabric) 1226bfa_fcs_fabric_link_down(struct bfa_fcs_fabric_s *fabric)
1274{ 1227{
1275 bfa_trc(fabric->fcs, fabric->bport.port_cfg.pwwn); 1228 bfa_trc(fabric->fcs, fabric->bport.port_cfg.pwwn);
1276 fabric->fcs->bbscn_flogi_rjt = BFA_FALSE;
1277 bfa_sm_send_event(fabric, BFA_FCS_FABRIC_SM_LINK_DOWN); 1229 bfa_sm_send_event(fabric, BFA_FCS_FABRIC_SM_LINK_DOWN);
1278} 1230}
1279 1231
@@ -1480,7 +1432,6 @@ bfa_fcs_fabric_process_flogi(struct bfa_fcs_fabric_s *fabric,
1480 } 1432 }
1481 1433
1482 fabric->bb_credit = be16_to_cpu(flogi->csp.bbcred); 1434 fabric->bb_credit = be16_to_cpu(flogi->csp.bbcred);
1483 fabric->lps->pr_bbscn = (be16_to_cpu(flogi->csp.rxsz) >> 12);
1484 bport->port_topo.pn2n.rem_port_wwn = flogi->port_name; 1435 bport->port_topo.pn2n.rem_port_wwn = flogi->port_name;
1485 bport->port_topo.pn2n.reply_oxid = fchs->ox_id; 1436 bport->port_topo.pn2n.reply_oxid = fchs->ox_id;
1486 1437
@@ -1513,8 +1464,7 @@ bfa_fcs_fabric_send_flogi_acc(struct bfa_fcs_fabric_s *fabric)
1513 n2n_port->reply_oxid, pcfg->pwwn, 1464 n2n_port->reply_oxid, pcfg->pwwn,
1514 pcfg->nwwn, 1465 pcfg->nwwn,
1515 bfa_fcport_get_maxfrsize(bfa), 1466 bfa_fcport_get_maxfrsize(bfa),
1516 bfa_fcport_get_rx_bbcredit(bfa), 1467 bfa_fcport_get_rx_bbcredit(bfa), 0);
1517 bfa_fcs_fabric_oper_bbscn(fabric));
1518 1468
1519 bfa_fcxp_send(fcxp, NULL, fabric->vf_id, fabric->lps->bfa_tag, 1469 bfa_fcxp_send(fcxp, NULL, fabric->vf_id, fabric->lps->bfa_tag,
1520 BFA_FALSE, FC_CLASS_3, 1470 BFA_FALSE, FC_CLASS_3,
diff --git a/drivers/scsi/bfa/bfa_fcs.h b/drivers/scsi/bfa/bfa_fcs.h
index a449706c6bc0..1369682f63de 100644
--- a/drivers/scsi/bfa/bfa_fcs.h
+++ b/drivers/scsi/bfa/bfa_fcs.h
@@ -258,9 +258,6 @@ struct bfa_fcs_fabric_s;
258#define BFA_FCS_PORT_SYMBNAME_OSINFO_SZ 48 258#define BFA_FCS_PORT_SYMBNAME_OSINFO_SZ 48
259#define BFA_FCS_PORT_SYMBNAME_OSPATCH_SZ 16 259#define BFA_FCS_PORT_SYMBNAME_OSPATCH_SZ 16
260 260
261/* bb_scn value in 2^bb_scn */
262#define BFA_FCS_PORT_DEF_BB_SCN 3
263
264/* 261/*
265 * Get FC port ID for a logical port. 262 * Get FC port ID for a logical port.
266 */ 263 */
@@ -683,8 +680,6 @@ struct bfa_fcs_s {
683 struct bfa_trc_mod_s *trcmod; /* tracing module */ 680 struct bfa_trc_mod_s *trcmod; /* tracing module */
684 bfa_boolean_t vf_enabled; /* VF mode is enabled */ 681 bfa_boolean_t vf_enabled; /* VF mode is enabled */
685 bfa_boolean_t fdmi_enabled; /* FDMI is enabled */ 682 bfa_boolean_t fdmi_enabled; /* FDMI is enabled */
686 bfa_boolean_t bbscn_enabled; /* Driver Config Parameter */
687 bfa_boolean_t bbscn_flogi_rjt;/* FLOGI reject due to BB_SCN */
688 bfa_boolean_t min_cfg; /* min cfg enabled/disabled */ 683 bfa_boolean_t min_cfg; /* min cfg enabled/disabled */
689 u16 port_vfid; /* port default VF ID */ 684 u16 port_vfid; /* port default VF ID */
690 struct bfa_fcs_driver_info_s driver_info; 685 struct bfa_fcs_driver_info_s driver_info;
diff --git a/drivers/scsi/bfa/bfa_fcs_rport.c b/drivers/scsi/bfa/bfa_fcs_rport.c
index 610ca9500aac..62713a7c2daf 100644
--- a/drivers/scsi/bfa/bfa_fcs_rport.c
+++ b/drivers/scsi/bfa/bfa_fcs_rport.c
@@ -2577,7 +2577,7 @@ bfa_fcs_rport_update(struct bfa_fcs_rport_s *rport, struct fc_logi_s *plogi)
2577 2577
2578 port->fabric->bb_credit = be16_to_cpu(plogi->csp.bbcred); 2578 port->fabric->bb_credit = be16_to_cpu(plogi->csp.bbcred);
2579 bfa_fcport_set_tx_bbcredit(port->fcs->bfa, 2579 bfa_fcport_set_tx_bbcredit(port->fcs->bfa,
2580 port->fabric->bb_credit, 0); 2580 port->fabric->bb_credit);
2581 } 2581 }
2582 2582
2583} 2583}
diff --git a/drivers/scsi/bfa/bfa_svc.c b/drivers/scsi/bfa/bfa_svc.c
index 7ed2c57d8736..6ed60425dd34 100644
--- a/drivers/scsi/bfa/bfa_svc.c
+++ b/drivers/scsi/bfa/bfa_svc.c
@@ -1614,7 +1614,6 @@ bfa_lps_login_rsp(struct bfa_s *bfa, struct bfi_lps_login_rsp_s *rsp)
1614 lps->lp_mac = rsp->lp_mac; 1614 lps->lp_mac = rsp->lp_mac;
1615 lps->brcd_switch = rsp->brcd_switch; 1615 lps->brcd_switch = rsp->brcd_switch;
1616 lps->fcf_mac = rsp->fcf_mac; 1616 lps->fcf_mac = rsp->fcf_mac;
1617 lps->pr_bbscn = rsp->bb_scn;
1618 1617
1619 break; 1618 break;
1620 1619
@@ -1744,7 +1743,6 @@ bfa_lps_send_login(struct bfa_lps_s *lps)
1744 m->nwwn = lps->nwwn; 1743 m->nwwn = lps->nwwn;
1745 m->fdisc = lps->fdisc; 1744 m->fdisc = lps->fdisc;
1746 m->auth_en = lps->auth_en; 1745 m->auth_en = lps->auth_en;
1747 m->bb_scn = lps->bb_scn;
1748 1746
1749 bfa_reqq_produce(lps->bfa, lps->reqq, m->mh); 1747 bfa_reqq_produce(lps->bfa, lps->reqq, m->mh);
1750 list_del(&lps->qe); 1748 list_del(&lps->qe);
@@ -1940,7 +1938,7 @@ bfa_lps_delete(struct bfa_lps_s *lps)
1940 */ 1938 */
1941void 1939void
1942bfa_lps_flogi(struct bfa_lps_s *lps, void *uarg, u8 alpa, u16 pdusz, 1940bfa_lps_flogi(struct bfa_lps_s *lps, void *uarg, u8 alpa, u16 pdusz,
1943 wwn_t pwwn, wwn_t nwwn, bfa_boolean_t auth_en, uint8_t bb_scn) 1941 wwn_t pwwn, wwn_t nwwn, bfa_boolean_t auth_en)
1944{ 1942{
1945 lps->uarg = uarg; 1943 lps->uarg = uarg;
1946 lps->alpa = alpa; 1944 lps->alpa = alpa;
@@ -1949,7 +1947,6 @@ bfa_lps_flogi(struct bfa_lps_s *lps, void *uarg, u8 alpa, u16 pdusz,
1949 lps->nwwn = nwwn; 1947 lps->nwwn = nwwn;
1950 lps->fdisc = BFA_FALSE; 1948 lps->fdisc = BFA_FALSE;
1951 lps->auth_en = auth_en; 1949 lps->auth_en = auth_en;
1952 lps->bb_scn = bb_scn;
1953 bfa_sm_send_event(lps, BFA_LPS_SM_LOGIN); 1950 bfa_sm_send_event(lps, BFA_LPS_SM_LOGIN);
1954} 1951}
1955 1952
@@ -3158,6 +3155,8 @@ bfa_fcport_update_linkinfo(struct bfa_fcport_s *fcport)
3158 fcport->qos_attr = pevent->link_state.qos_attr; 3155 fcport->qos_attr = pevent->link_state.qos_attr;
3159 fcport->qos_vc_attr = pevent->link_state.attr.vc_fcf.qos_vc_attr; 3156 fcport->qos_vc_attr = pevent->link_state.attr.vc_fcf.qos_vc_attr;
3160 3157
3158 if (fcport->cfg.bb_cr_enabled)
3159 fcport->bbcr_attr = pevent->link_state.attr.bbcr_attr;
3161 /* 3160 /*
3162 * update trunk state if applicable 3161 * update trunk state if applicable
3163 */ 3162 */
@@ -3177,7 +3176,6 @@ bfa_fcport_reset_linkinfo(struct bfa_fcport_s *fcport)
3177{ 3176{
3178 fcport->speed = BFA_PORT_SPEED_UNKNOWN; 3177 fcport->speed = BFA_PORT_SPEED_UNKNOWN;
3179 fcport->topology = BFA_PORT_TOPOLOGY_NONE; 3178 fcport->topology = BFA_PORT_TOPOLOGY_NONE;
3180 fcport->bbsc_op_state = BFA_FALSE;
3181} 3179}
3182 3180
3183/* 3181/*
@@ -3629,6 +3627,11 @@ bfa_fcport_isr(struct bfa_s *bfa, struct bfi_msg_s *msg)
3629 fcport->qos_attr.qos_bw_op = 3627 fcport->qos_attr.qos_bw_op =
3630 i2hmsg.penable_rsp->port_cfg.qos_bw; 3628 i2hmsg.penable_rsp->port_cfg.qos_bw;
3631 3629
3630 if (fcport->cfg.bb_cr_enabled)
3631 fcport->bbcr_attr.state = BFA_BBCR_OFFLINE;
3632 else
3633 fcport->bbcr_attr.state = BFA_BBCR_DISABLED;
3634
3632 bfa_sm_send_event(fcport, BFA_FCPORT_SM_FWRSP); 3635 bfa_sm_send_event(fcport, BFA_FCPORT_SM_FWRSP);
3633 } 3636 }
3634 break; 3637 break;
@@ -3639,6 +3642,11 @@ bfa_fcport_isr(struct bfa_s *bfa, struct bfi_msg_s *msg)
3639 break; 3642 break;
3640 3643
3641 case BFI_FCPORT_I2H_EVENT: 3644 case BFI_FCPORT_I2H_EVENT:
3645 if (fcport->cfg.bb_cr_enabled)
3646 fcport->bbcr_attr.state = BFA_BBCR_OFFLINE;
3647 else
3648 fcport->bbcr_attr.state = BFA_BBCR_DISABLED;
3649
3642 if (i2hmsg.event->link_state.linkstate == BFA_PORT_LINKUP) 3650 if (i2hmsg.event->link_state.linkstate == BFA_PORT_LINKUP)
3643 bfa_sm_send_event(fcport, BFA_FCPORT_SM_LINKUP); 3651 bfa_sm_send_event(fcport, BFA_FCPORT_SM_LINKUP);
3644 else { 3652 else {
@@ -3964,14 +3972,11 @@ bfa_fcport_get_rx_bbcredit(struct bfa_s *bfa)
3964} 3972}
3965 3973
3966void 3974void
3967bfa_fcport_set_tx_bbcredit(struct bfa_s *bfa, u16 tx_bbcredit, u8 bb_scn) 3975bfa_fcport_set_tx_bbcredit(struct bfa_s *bfa, u16 tx_bbcredit)
3968{ 3976{
3969 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); 3977 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
3970 3978
3971 fcport->cfg.tx_bbcredit = (u8)tx_bbcredit; 3979 fcport->cfg.tx_bbcredit = (u8)tx_bbcredit;
3972 fcport->cfg.bb_scn = bb_scn;
3973 if (bb_scn)
3974 fcport->bbsc_op_state = BFA_TRUE;
3975} 3980}
3976 3981
3977/* 3982/*
@@ -4021,7 +4026,6 @@ bfa_fcport_get_attr(struct bfa_s *bfa, struct bfa_port_attr_s *attr)
4021 attr->pport_cfg.path_tov = bfa_fcpim_path_tov_get(bfa); 4026 attr->pport_cfg.path_tov = bfa_fcpim_path_tov_get(bfa);
4022 attr->pport_cfg.q_depth = bfa_fcpim_qdepth_get(bfa); 4027 attr->pport_cfg.q_depth = bfa_fcpim_qdepth_get(bfa);
4023 attr->port_state = bfa_sm_to_state(hal_port_sm_table, fcport->sm); 4028 attr->port_state = bfa_sm_to_state(hal_port_sm_table, fcport->sm);
4024 attr->bbsc_op_status = fcport->bbsc_op_state;
4025 4029
4026 /* PBC Disabled State */ 4030 /* PBC Disabled State */
4027 if (bfa_fcport_is_pbcdisabled(bfa)) 4031 if (bfa_fcport_is_pbcdisabled(bfa))
@@ -4217,6 +4221,77 @@ bfa_fcport_is_trunk_enabled(struct bfa_s *bfa)
4217 return fcport->cfg.trunked; 4221 return fcport->cfg.trunked;
4218} 4222}
4219 4223
4224bfa_status_t
4225bfa_fcport_cfg_bbcr(struct bfa_s *bfa, bfa_boolean_t on_off, u8 bb_scn)
4226{
4227 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
4228
4229 bfa_trc(bfa, on_off);
4230
4231 if (bfa_ioc_get_type(&fcport->bfa->ioc) != BFA_IOC_TYPE_FC)
4232 return BFA_STATUS_BBCR_FC_ONLY;
4233
4234 if (bfa_mfg_is_mezz(bfa->ioc.attr->card_type) &&
4235 (bfa->ioc.attr->card_type != BFA_MFG_TYPE_CHINOOK))
4236 return BFA_STATUS_CMD_NOTSUPP_MEZZ;
4237
4238 if (on_off) {
4239 if (fcport->cfg.topology == BFA_PORT_TOPOLOGY_LOOP)
4240 return BFA_STATUS_TOPOLOGY_LOOP;
4241
4242 if (fcport->cfg.qos_enabled)
4243 return BFA_STATUS_ERROR_QOS_ENABLED;
4244
4245 if (fcport->cfg.trunked)
4246 return BFA_STATUS_TRUNK_ENABLED;
4247
4248 if ((fcport->cfg.speed != BFA_PORT_SPEED_AUTO) &&
4249 (fcport->cfg.speed < bfa_ioc_speed_sup(&bfa->ioc)))
4250 return BFA_STATUS_ERR_BBCR_SPEED_UNSUPPORT;
4251
4252 if (bfa_ioc_speed_sup(&bfa->ioc) < BFA_PORT_SPEED_8GBPS)
4253 return BFA_STATUS_FEATURE_NOT_SUPPORTED;
4254
4255 if (fcport->cfg.bb_cr_enabled) {
4256 if (bb_scn != fcport->cfg.bb_scn)
4257 return BFA_STATUS_BBCR_CFG_NO_CHANGE;
4258 else
4259 return BFA_STATUS_NO_CHANGE;
4260 }
4261
4262 if ((bb_scn == 0) || (bb_scn > BFA_BB_SCN_MAX))
4263 bb_scn = BFA_BB_SCN_DEF;
4264
4265 fcport->cfg.bb_cr_enabled = on_off;
4266 fcport->cfg.bb_scn = bb_scn;
4267 } else {
4268 if (!fcport->cfg.bb_cr_enabled)
4269 return BFA_STATUS_NO_CHANGE;
4270
4271 fcport->cfg.bb_cr_enabled = on_off;
4272 fcport->cfg.bb_scn = 0;
4273 }
4274
4275 return BFA_STATUS_OK;
4276}
4277
4278bfa_status_t
4279bfa_fcport_get_bbcr_attr(struct bfa_s *bfa,
4280 struct bfa_bbcr_attr_s *bbcr_attr)
4281{
4282 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
4283
4284 if (bfa_ioc_get_type(&fcport->bfa->ioc) != BFA_IOC_TYPE_FC)
4285 return BFA_STATUS_BBCR_FC_ONLY;
4286
4287 if (fcport->cfg.topology == BFA_PORT_TOPOLOGY_LOOP)
4288 return BFA_STATUS_TOPOLOGY_LOOP;
4289
4290 *bbcr_attr = fcport->bbcr_attr;
4291
4292 return BFA_STATUS_OK;
4293}
4294
4220void 4295void
4221bfa_fcport_dportenable(struct bfa_s *bfa) 4296bfa_fcport_dportenable(struct bfa_s *bfa)
4222{ 4297{
diff --git a/drivers/scsi/bfa/bfa_svc.h b/drivers/scsi/bfa/bfa_svc.h
index 8d7fbecfcb22..768ed6ac18fd 100644
--- a/drivers/scsi/bfa/bfa_svc.h
+++ b/drivers/scsi/bfa/bfa_svc.h
@@ -405,8 +405,6 @@ struct bfa_lps_s {
405 bfa_status_t status; /* login status */ 405 bfa_status_t status; /* login status */
406 u16 pdusz; /* max receive PDU size */ 406 u16 pdusz; /* max receive PDU size */
407 u16 pr_bbcred; /* BB_CREDIT from peer */ 407 u16 pr_bbcred; /* BB_CREDIT from peer */
408 u8 pr_bbscn; /* BB_SCN from peer */
409 u8 bb_scn; /* local BB_SCN */
410 u8 lsrjt_rsn; /* LSRJT reason */ 408 u8 lsrjt_rsn; /* LSRJT reason */
411 u8 lsrjt_expl; /* LSRJT explanation */ 409 u8 lsrjt_expl; /* LSRJT explanation */
412 u8 lun_mask; /* LUN mask flag */ 410 u8 lun_mask; /* LUN mask flag */
@@ -510,11 +508,11 @@ struct bfa_fcport_s {
510 bfa_boolean_t diag_busy; /* diag busy status */ 508 bfa_boolean_t diag_busy; /* diag busy status */
511 bfa_boolean_t beacon; /* port beacon status */ 509 bfa_boolean_t beacon; /* port beacon status */
512 bfa_boolean_t link_e2e_beacon; /* link beacon status */ 510 bfa_boolean_t link_e2e_beacon; /* link beacon status */
513 bfa_boolean_t bbsc_op_state; /* Cred recov Oper State */
514 struct bfa_fcport_trunk_s trunk; 511 struct bfa_fcport_trunk_s trunk;
515 u16 fcoe_vlan; 512 u16 fcoe_vlan;
516 struct bfa_mem_dma_s fcport_dma; 513 struct bfa_mem_dma_s fcport_dma;
517 bfa_boolean_t stats_dma_ready; 514 bfa_boolean_t stats_dma_ready;
515 struct bfa_bbcr_attr_s bbcr_attr;
518}; 516};
519 517
520#define BFA_FCPORT_MOD(__bfa) (&(__bfa)->modules.fcport) 518#define BFA_FCPORT_MOD(__bfa) (&(__bfa)->modules.fcport)
@@ -556,7 +554,7 @@ bfa_status_t bfa_fcport_set_qos_bw(struct bfa_s *bfa,
556 struct bfa_qos_bw_s *qos_bw); 554 struct bfa_qos_bw_s *qos_bw);
557enum bfa_port_speed bfa_fcport_get_ratelim_speed(struct bfa_s *bfa); 555enum bfa_port_speed bfa_fcport_get_ratelim_speed(struct bfa_s *bfa);
558 556
559void bfa_fcport_set_tx_bbcredit(struct bfa_s *bfa, u16 tx_bbcredit, u8 bb_scn); 557void bfa_fcport_set_tx_bbcredit(struct bfa_s *bfa, u16 tx_bbcredit);
560bfa_boolean_t bfa_fcport_is_ratelim(struct bfa_s *bfa); 558bfa_boolean_t bfa_fcport_is_ratelim(struct bfa_s *bfa);
561void bfa_fcport_beacon(void *dev, bfa_boolean_t beacon, 559void bfa_fcport_beacon(void *dev, bfa_boolean_t beacon,
562 bfa_boolean_t link_e2e_beacon); 560 bfa_boolean_t link_e2e_beacon);
@@ -571,6 +569,10 @@ void bfa_fcport_dportenable(struct bfa_s *bfa);
571void bfa_fcport_dportdisable(struct bfa_s *bfa); 569void bfa_fcport_dportdisable(struct bfa_s *bfa);
572bfa_status_t bfa_fcport_is_pbcdisabled(struct bfa_s *bfa); 570bfa_status_t bfa_fcport_is_pbcdisabled(struct bfa_s *bfa);
573void bfa_fcport_cfg_faa(struct bfa_s *bfa, u8 state); 571void bfa_fcport_cfg_faa(struct bfa_s *bfa, u8 state);
572bfa_status_t bfa_fcport_cfg_bbcr(struct bfa_s *bfa,
573 bfa_boolean_t on_off, u8 bb_scn);
574bfa_status_t bfa_fcport_get_bbcr_attr(struct bfa_s *bfa,
575 struct bfa_bbcr_attr_s *bbcr_attr);
574 576
575/* 577/*
576 * bfa rport API functions 578 * bfa rport API functions
@@ -667,7 +669,7 @@ struct bfa_lps_s *bfa_lps_alloc(struct bfa_s *bfa);
667void bfa_lps_delete(struct bfa_lps_s *lps); 669void bfa_lps_delete(struct bfa_lps_s *lps);
668void bfa_lps_flogi(struct bfa_lps_s *lps, void *uarg, u8 alpa, 670void bfa_lps_flogi(struct bfa_lps_s *lps, void *uarg, u8 alpa,
669 u16 pdusz, wwn_t pwwn, wwn_t nwwn, 671 u16 pdusz, wwn_t pwwn, wwn_t nwwn,
670 bfa_boolean_t auth_en, u8 bb_scn); 672 bfa_boolean_t auth_en);
671void bfa_lps_fdisc(struct bfa_lps_s *lps, void *uarg, u16 pdusz, 673void bfa_lps_fdisc(struct bfa_lps_s *lps, void *uarg, u16 pdusz,
672 wwn_t pwwn, wwn_t nwwn); 674 wwn_t pwwn, wwn_t nwwn);
673void bfa_lps_fdisclogo(struct bfa_lps_s *lps); 675void bfa_lps_fdisclogo(struct bfa_lps_s *lps);
diff --git a/drivers/scsi/bfa/bfad_bsg.c b/drivers/scsi/bfa/bfad_bsg.c
index 555e7db94a1c..bda1500e1a20 100644
--- a/drivers/scsi/bfa/bfad_bsg.c
+++ b/drivers/scsi/bfa/bfad_bsg.c
@@ -402,25 +402,43 @@ bfad_iocmd_port_cfg_maxfrsize(struct bfad_s *bfad, void *cmd)
402} 402}
403 403
404int 404int
405bfad_iocmd_port_cfg_bbsc(struct bfad_s *bfad, void *cmd, unsigned int v_cmd) 405bfad_iocmd_port_cfg_bbcr(struct bfad_s *bfad, unsigned int cmd, void *pcmd)
406{ 406{
407 struct bfa_bsg_gen_s *iocmd = (struct bfa_bsg_gen_s *)cmd; 407 struct bfa_bsg_bbcr_enable_s *iocmd =
408 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(&bfad->bfa); 408 (struct bfa_bsg_bbcr_enable_s *)pcmd;
409 unsigned long flags; 409 unsigned long flags;
410 int rc;
410 411
411 spin_lock_irqsave(&bfad->bfad_lock, flags); 412 spin_lock_irqsave(&bfad->bfad_lock, flags);
412 if (bfa_ioc_get_type(&bfad->bfa.ioc) == BFA_IOC_TYPE_FC) { 413 if (cmd == IOCMD_PORT_BBCR_ENABLE)
413 if (v_cmd == IOCMD_PORT_BBSC_ENABLE) 414 rc = bfa_fcport_cfg_bbcr(&bfad->bfa, BFA_TRUE, iocmd->bb_scn);
414 fcport->cfg.bb_scn_state = BFA_TRUE; 415 else if (cmd == IOCMD_PORT_BBCR_DISABLE)
415 else if (v_cmd == IOCMD_PORT_BBSC_DISABLE) 416 rc = bfa_fcport_cfg_bbcr(&bfad->bfa, BFA_FALSE, 0);
416 fcport->cfg.bb_scn_state = BFA_FALSE; 417 else {
418 spin_unlock_irqrestore(&bfad->bfad_lock, flags);
419 return -EINVAL;
417 } 420 }
418 spin_unlock_irqrestore(&bfad->bfad_lock, flags); 421 spin_unlock_irqrestore(&bfad->bfad_lock, flags);
419 422
420 iocmd->status = BFA_STATUS_OK; 423 iocmd->status = rc;
421 return 0; 424 return 0;
422} 425}
423 426
427int
428bfad_iocmd_port_get_bbcr_attr(struct bfad_s *bfad, void *pcmd)
429{
430 struct bfa_bsg_bbcr_attr_s *iocmd = (struct bfa_bsg_bbcr_attr_s *) pcmd;
431 unsigned long flags;
432
433 spin_lock_irqsave(&bfad->bfad_lock, flags);
434 iocmd->status =
435 bfa_fcport_get_bbcr_attr(&bfad->bfa, &iocmd->attr);
436 spin_unlock_irqrestore(&bfad->bfad_lock, flags);
437
438 return 0;
439}
440
441
424static int 442static int
425bfad_iocmd_lport_get_attr(struct bfad_s *bfad, void *cmd) 443bfad_iocmd_lport_get_attr(struct bfad_s *bfad, void *cmd)
426{ 444{
@@ -2750,9 +2768,12 @@ bfad_iocmd_handler(struct bfad_s *bfad, unsigned int cmd, void *iocmd,
2750 case IOCMD_PORT_CFG_MAXFRSZ: 2768 case IOCMD_PORT_CFG_MAXFRSZ:
2751 rc = bfad_iocmd_port_cfg_maxfrsize(bfad, iocmd); 2769 rc = bfad_iocmd_port_cfg_maxfrsize(bfad, iocmd);
2752 break; 2770 break;
2753 case IOCMD_PORT_BBSC_ENABLE: 2771 case IOCMD_PORT_BBCR_ENABLE:
2754 case IOCMD_PORT_BBSC_DISABLE: 2772 case IOCMD_PORT_BBCR_DISABLE:
2755 rc = bfad_iocmd_port_cfg_bbsc(bfad, iocmd, cmd); 2773 rc = bfad_iocmd_port_cfg_bbcr(bfad, cmd, iocmd);
2774 break;
2775 case IOCMD_PORT_BBCR_GET_ATTR:
2776 rc = bfad_iocmd_port_get_bbcr_attr(bfad, iocmd);
2756 break; 2777 break;
2757 case IOCMD_LPORT_GET_ATTR: 2778 case IOCMD_LPORT_GET_ATTR:
2758 rc = bfad_iocmd_lport_get_attr(bfad, iocmd); 2779 rc = bfad_iocmd_lport_get_attr(bfad, iocmd);
diff --git a/drivers/scsi/bfa/bfad_bsg.h b/drivers/scsi/bfa/bfad_bsg.h
index 15e1fc8e796b..612463b60061 100644
--- a/drivers/scsi/bfa/bfad_bsg.h
+++ b/drivers/scsi/bfa/bfad_bsg.h
@@ -46,8 +46,9 @@ enum {
46 IOCMD_PORT_CFG_ALPA, 46 IOCMD_PORT_CFG_ALPA,
47 IOCMD_PORT_CFG_MAXFRSZ, 47 IOCMD_PORT_CFG_MAXFRSZ,
48 IOCMD_PORT_CLR_ALPA, 48 IOCMD_PORT_CLR_ALPA,
49 IOCMD_PORT_BBSC_ENABLE, 49 IOCMD_PORT_BBCR_ENABLE,
50 IOCMD_PORT_BBSC_DISABLE, 50 IOCMD_PORT_BBCR_DISABLE,
51 IOCMD_PORT_BBCR_GET_ATTR,
51 IOCMD_LPORT_GET_ATTR, 52 IOCMD_LPORT_GET_ATTR,
52 IOCMD_LPORT_GET_RPORTS, 53 IOCMD_LPORT_GET_RPORTS,
53 IOCMD_LPORT_GET_STATS, 54 IOCMD_LPORT_GET_STATS,
@@ -495,6 +496,20 @@ struct bfa_bsg_port_cfg_mode_s {
495 struct bfa_port_cfg_mode_s cfg; 496 struct bfa_port_cfg_mode_s cfg;
496}; 497};
497 498
499struct bfa_bsg_bbcr_enable_s {
500 bfa_status_t status;
501 u16 bfad_num;
502 u8 bb_scn;
503 u8 rsvd;
504};
505
506struct bfa_bsg_bbcr_attr_s {
507 bfa_status_t status;
508 u16 bfad_num;
509 u16 rsvd;
510 struct bfa_bbcr_attr_s attr;
511};
512
498struct bfa_bsg_faa_attr_s { 513struct bfa_bsg_faa_attr_s {
499 bfa_status_t status; 514 bfa_status_t status;
500 u16 bfad_num; 515 u16 bfad_num;
diff --git a/drivers/scsi/bfa/bfi_ms.h b/drivers/scsi/bfa/bfi_ms.h
index 5ae2c167b2c8..1a3fe5ad58fa 100644
--- a/drivers/scsi/bfa/bfi_ms.h
+++ b/drivers/scsi/bfa/bfi_ms.h
@@ -276,8 +276,7 @@ struct bfi_fcport_enable_req_s {
276struct bfi_fcport_set_svc_params_req_s { 276struct bfi_fcport_set_svc_params_req_s {
277 struct bfi_mhdr_s mh; /* msg header */ 277 struct bfi_mhdr_s mh; /* msg header */
278 __be16 tx_bbcredit; /* Tx credits */ 278 __be16 tx_bbcredit; /* Tx credits */
279 u8 bb_scn; /* BB_SC FC credit recovery */ 279 u8 rsvd[2];
280 u8 rsvd;
281}; 280};
282 281
283/* 282/*
@@ -446,8 +445,8 @@ struct bfi_lps_login_rsp_s {
446 mac_t fcf_mac; 445 mac_t fcf_mac;
447 u8 ext_status; 446 u8 ext_status;
448 u8 brcd_switch; /* attached peer is brcd switch */ 447 u8 brcd_switch; /* attached peer is brcd switch */
449 u8 bb_scn; /* atatched port's bb_scn */
450 u8 bfa_tag; 448 u8 bfa_tag;
449 u8 rsvd;
451}; 450};
452 451
453struct bfi_lps_logout_req_s { 452struct bfi_lps_logout_req_s {