aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/scsi/bfa/bfa_core.c2
-rw-r--r--drivers/scsi/bfa/bfa_defs_svc.h2
-rw-r--r--drivers/scsi/bfa/bfa_fc.h9
-rw-r--r--drivers/scsi/bfa/bfa_fcpim.c16
-rw-r--r--drivers/scsi/bfa/bfa_fcs.c4
-rw-r--r--drivers/scsi/bfa/bfa_fcs.h1
-rw-r--r--drivers/scsi/bfa/bfa_fcs_lport.c147
-rw-r--r--drivers/scsi/bfa/bfi.h2
-rw-r--r--drivers/scsi/bfa/bfi_ms.h42
9 files changed, 181 insertions, 44 deletions
diff --git a/drivers/scsi/bfa/bfa_core.c b/drivers/scsi/bfa/bfa_core.c
index 5a00217ee5be..4c9e83803cb6 100644
--- a/drivers/scsi/bfa/bfa_core.c
+++ b/drivers/scsi/bfa/bfa_core.c
@@ -51,7 +51,7 @@ static bfa_isr_func_t bfa_isrs[BFI_MC_MAX] = {
51 bfa_fcxp_isr, /* BFI_MC_FCXP */ 51 bfa_fcxp_isr, /* BFI_MC_FCXP */
52 bfa_lps_isr, /* BFI_MC_LPS */ 52 bfa_lps_isr, /* BFI_MC_LPS */
53 bfa_rport_isr, /* BFI_MC_RPORT */ 53 bfa_rport_isr, /* BFI_MC_RPORT */
54 bfa_itnim_isr, /* BFI_MC_ITNIM */ 54 bfa_itnim_isr, /* BFI_MC_ITN */
55 bfa_isr_unhandled, /* BFI_MC_IOIM_READ */ 55 bfa_isr_unhandled, /* BFI_MC_IOIM_READ */
56 bfa_isr_unhandled, /* BFI_MC_IOIM_WRITE */ 56 bfa_isr_unhandled, /* BFI_MC_IOIM_WRITE */
57 bfa_isr_unhandled, /* BFI_MC_IOIM_IO */ 57 bfa_isr_unhandled, /* BFI_MC_IOIM_IO */
diff --git a/drivers/scsi/bfa/bfa_defs_svc.h b/drivers/scsi/bfa/bfa_defs_svc.h
index 207f598877c7..bcc919c4a503 100644
--- a/drivers/scsi/bfa/bfa_defs_svc.h
+++ b/drivers/scsi/bfa/bfa_defs_svc.h
@@ -47,8 +47,6 @@ struct bfa_iocfc_fwcfg_s {
47 u16 num_rports; /* number of remote ports */ 47 u16 num_rports; /* number of remote ports */
48 u16 num_ioim_reqs; /* number of IO reqs */ 48 u16 num_ioim_reqs; /* number of IO reqs */
49 u16 num_tskim_reqs; /* task management requests */ 49 u16 num_tskim_reqs; /* task management requests */
50 u16 num_iotm_reqs; /* number of TM IO reqs */
51 u16 num_tsktm_reqs; /* TM task management requests*/
52 u16 num_fcxp_reqs; /* unassisted FC exchanges */ 50 u16 num_fcxp_reqs; /* unassisted FC exchanges */
53 u16 num_uf_bufs; /* unsolicited recv buffers */ 51 u16 num_uf_bufs; /* unsolicited recv buffers */
54 u8 num_cqs; 52 u8 num_cqs;
diff --git a/drivers/scsi/bfa/bfa_fc.h b/drivers/scsi/bfa/bfa_fc.h
index bf0067e0fd0d..7bc020855be0 100644
--- a/drivers/scsi/bfa/bfa_fc.h
+++ b/drivers/scsi/bfa/bfa_fc.h
@@ -1049,15 +1049,6 @@ struct fc_vft_s {
1049}; 1049};
1050 1050
1051/* 1051/*
1052 * FCP
1053 */
1054enum {
1055 FCP_RJT = 0x01000000, /* SRR reject */
1056 FCP_SRR_ACCEPT = 0x02000000, /* SRR accept */
1057 FCP_SRR = 0x14000000, /* Sequence Retransmission Request */
1058};
1059
1060/*
1061 * FCP_CMND definitions 1052 * FCP_CMND definitions
1062 */ 1053 */
1063#define FCP_CMND_CDB_LEN 16 1054#define FCP_CMND_CDB_LEN 16
diff --git a/drivers/scsi/bfa/bfa_fcpim.c b/drivers/scsi/bfa/bfa_fcpim.c
index c0353cdca929..874cd79855ea 100644
--- a/drivers/scsi/bfa/bfa_fcpim.c
+++ b/drivers/scsi/bfa/bfa_fcpim.c
@@ -1043,7 +1043,7 @@ bfa_itnim_iocdisable(struct bfa_itnim_s *itnim)
1043static bfa_boolean_t 1043static bfa_boolean_t
1044bfa_itnim_send_fwcreate(struct bfa_itnim_s *itnim) 1044bfa_itnim_send_fwcreate(struct bfa_itnim_s *itnim)
1045{ 1045{
1046 struct bfi_itnim_create_req_s *m; 1046 struct bfi_itn_create_req_s *m;
1047 1047
1048 itnim->msg_no++; 1048 itnim->msg_no++;
1049 1049
@@ -1056,7 +1056,7 @@ bfa_itnim_send_fwcreate(struct bfa_itnim_s *itnim)
1056 return BFA_FALSE; 1056 return BFA_FALSE;
1057 } 1057 }
1058 1058
1059 bfi_h2i_set(m->mh, BFI_MC_ITNIM, BFI_ITNIM_H2I_CREATE_REQ, 1059 bfi_h2i_set(m->mh, BFI_MC_ITN, BFI_ITN_H2I_CREATE_REQ,
1060 bfa_lpuid(itnim->bfa)); 1060 bfa_lpuid(itnim->bfa));
1061 m->fw_handle = itnim->rport->fw_handle; 1061 m->fw_handle = itnim->rport->fw_handle;
1062 m->class = FC_CLASS_3; 1062 m->class = FC_CLASS_3;
@@ -1074,7 +1074,7 @@ bfa_itnim_send_fwcreate(struct bfa_itnim_s *itnim)
1074static bfa_boolean_t 1074static bfa_boolean_t
1075bfa_itnim_send_fwdelete(struct bfa_itnim_s *itnim) 1075bfa_itnim_send_fwdelete(struct bfa_itnim_s *itnim)
1076{ 1076{
1077 struct bfi_itnim_delete_req_s *m; 1077 struct bfi_itn_delete_req_s *m;
1078 1078
1079 /* 1079 /*
1080 * check for room in queue to send request now 1080 * check for room in queue to send request now
@@ -1085,7 +1085,7 @@ bfa_itnim_send_fwdelete(struct bfa_itnim_s *itnim)
1085 return BFA_FALSE; 1085 return BFA_FALSE;
1086 } 1086 }
1087 1087
1088 bfi_h2i_set(m->mh, BFI_MC_ITNIM, BFI_ITNIM_H2I_DELETE_REQ, 1088 bfi_h2i_set(m->mh, BFI_MC_ITN, BFI_ITN_H2I_DELETE_REQ,
1089 bfa_lpuid(itnim->bfa)); 1089 bfa_lpuid(itnim->bfa));
1090 m->fw_handle = itnim->rport->fw_handle; 1090 m->fw_handle = itnim->rport->fw_handle;
1091 bfa_stats(itnim, fw_delete); 1091 bfa_stats(itnim, fw_delete);
@@ -1251,7 +1251,7 @@ void
1251bfa_itnim_isr(struct bfa_s *bfa, struct bfi_msg_s *m) 1251bfa_itnim_isr(struct bfa_s *bfa, struct bfi_msg_s *m)
1252{ 1252{
1253 struct bfa_fcpim_mod_s *fcpim = BFA_FCPIM_MOD(bfa); 1253 struct bfa_fcpim_mod_s *fcpim = BFA_FCPIM_MOD(bfa);
1254 union bfi_itnim_i2h_msg_u msg; 1254 union bfi_itn_i2h_msg_u msg;
1255 struct bfa_itnim_s *itnim; 1255 struct bfa_itnim_s *itnim;
1256 1256
1257 bfa_trc(bfa, m->mhdr.msg_id); 1257 bfa_trc(bfa, m->mhdr.msg_id);
@@ -1259,7 +1259,7 @@ bfa_itnim_isr(struct bfa_s *bfa, struct bfi_msg_s *m)
1259 msg.msg = m; 1259 msg.msg = m;
1260 1260
1261 switch (m->mhdr.msg_id) { 1261 switch (m->mhdr.msg_id) {
1262 case BFI_ITNIM_I2H_CREATE_RSP: 1262 case BFI_ITN_I2H_CREATE_RSP:
1263 itnim = BFA_ITNIM_FROM_TAG(fcpim, 1263 itnim = BFA_ITNIM_FROM_TAG(fcpim,
1264 msg.create_rsp->bfa_handle); 1264 msg.create_rsp->bfa_handle);
1265 WARN_ON(msg.create_rsp->status != BFA_STATUS_OK); 1265 WARN_ON(msg.create_rsp->status != BFA_STATUS_OK);
@@ -1267,7 +1267,7 @@ bfa_itnim_isr(struct bfa_s *bfa, struct bfi_msg_s *m)
1267 bfa_sm_send_event(itnim, BFA_ITNIM_SM_FWRSP); 1267 bfa_sm_send_event(itnim, BFA_ITNIM_SM_FWRSP);
1268 break; 1268 break;
1269 1269
1270 case BFI_ITNIM_I2H_DELETE_RSP: 1270 case BFI_ITN_I2H_DELETE_RSP:
1271 itnim = BFA_ITNIM_FROM_TAG(fcpim, 1271 itnim = BFA_ITNIM_FROM_TAG(fcpim,
1272 msg.delete_rsp->bfa_handle); 1272 msg.delete_rsp->bfa_handle);
1273 WARN_ON(msg.delete_rsp->status != BFA_STATUS_OK); 1273 WARN_ON(msg.delete_rsp->status != BFA_STATUS_OK);
@@ -1275,7 +1275,7 @@ bfa_itnim_isr(struct bfa_s *bfa, struct bfi_msg_s *m)
1275 bfa_sm_send_event(itnim, BFA_ITNIM_SM_FWRSP); 1275 bfa_sm_send_event(itnim, BFA_ITNIM_SM_FWRSP);
1276 break; 1276 break;
1277 1277
1278 case BFI_ITNIM_I2H_SLER_EVENT: 1278 case BFI_ITN_I2H_SLER_EVENT:
1279 itnim = BFA_ITNIM_FROM_TAG(fcpim, 1279 itnim = BFA_ITNIM_FROM_TAG(fcpim,
1280 msg.sler_event->bfa_handle); 1280 msg.sler_event->bfa_handle);
1281 bfa_stats(itnim, sler_events); 1281 bfa_stats(itnim, sler_events);
diff --git a/drivers/scsi/bfa/bfa_fcs.c b/drivers/scsi/bfa/bfa_fcs.c
index 9b43ca4b6778..eb42e74ed423 100644
--- a/drivers/scsi/bfa/bfa_fcs.c
+++ b/drivers/scsi/bfa/bfa_fcs.c
@@ -269,8 +269,8 @@ bfa_fcs_fabric_sm_created(struct bfa_fcs_fabric_s *fabric,
269 break; 269 break;
270 270
271 case BFA_FCS_FABRIC_SM_DELETE: 271 case BFA_FCS_FABRIC_SM_DELETE:
272 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_uninit); 272 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_deleting);
273 bfa_wc_down(&fabric->fcs->wc); 273 bfa_fcs_fabric_delete(fabric);
274 break; 274 break;
275 275
276 default: 276 default:
diff --git a/drivers/scsi/bfa/bfa_fcs.h b/drivers/scsi/bfa/bfa_fcs.h
index 61cdce4bd913..a9942b46b508 100644
--- a/drivers/scsi/bfa/bfa_fcs.h
+++ b/drivers/scsi/bfa/bfa_fcs.h
@@ -379,6 +379,7 @@ void bfa_fcs_vport_online(struct bfa_fcs_vport_s *vport);
379void bfa_fcs_vport_offline(struct bfa_fcs_vport_s *vport); 379void bfa_fcs_vport_offline(struct bfa_fcs_vport_s *vport);
380void bfa_fcs_vport_delete_comp(struct bfa_fcs_vport_s *vport); 380void bfa_fcs_vport_delete_comp(struct bfa_fcs_vport_s *vport);
381void bfa_fcs_vport_fcs_delete(struct bfa_fcs_vport_s *vport); 381void bfa_fcs_vport_fcs_delete(struct bfa_fcs_vport_s *vport);
382void bfa_fcs_vport_stop_comp(struct bfa_fcs_vport_s *vport);
382 383
383#define BFA_FCS_RPORT_DEF_DEL_TIMEOUT 90 /* in secs */ 384#define BFA_FCS_RPORT_DEF_DEL_TIMEOUT 90 /* in secs */
384#define BFA_FCS_RPORT_MAX_RETRIES (5) 385#define BFA_FCS_RPORT_MAX_RETRIES (5)
diff --git a/drivers/scsi/bfa/bfa_fcs_lport.c b/drivers/scsi/bfa/bfa_fcs_lport.c
index 1d6be8c14473..a0c6f960b992 100644
--- a/drivers/scsi/bfa/bfa_fcs_lport.c
+++ b/drivers/scsi/bfa/bfa_fcs_lport.c
@@ -74,6 +74,7 @@ enum bfa_fcs_lport_event {
74 BFA_FCS_PORT_SM_OFFLINE = 3, 74 BFA_FCS_PORT_SM_OFFLINE = 3,
75 BFA_FCS_PORT_SM_DELETE = 4, 75 BFA_FCS_PORT_SM_DELETE = 4,
76 BFA_FCS_PORT_SM_DELRPORT = 5, 76 BFA_FCS_PORT_SM_DELRPORT = 5,
77 BFA_FCS_PORT_SM_STOP = 6,
77}; 78};
78 79
79static void bfa_fcs_lport_sm_uninit(struct bfa_fcs_lport_s *port, 80static void bfa_fcs_lport_sm_uninit(struct bfa_fcs_lport_s *port,
@@ -86,6 +87,8 @@ static void bfa_fcs_lport_sm_offline(struct bfa_fcs_lport_s *port,
86 enum bfa_fcs_lport_event event); 87 enum bfa_fcs_lport_event event);
87static void bfa_fcs_lport_sm_deleting(struct bfa_fcs_lport_s *port, 88static void bfa_fcs_lport_sm_deleting(struct bfa_fcs_lport_s *port,
88 enum bfa_fcs_lport_event event); 89 enum bfa_fcs_lport_event event);
90static void bfa_fcs_lport_sm_stopping(struct bfa_fcs_lport_s *port,
91 enum bfa_fcs_lport_event event);
89 92
90static void 93static void
91bfa_fcs_lport_sm_uninit( 94bfa_fcs_lport_sm_uninit(
@@ -123,6 +126,12 @@ bfa_fcs_lport_sm_init(struct bfa_fcs_lport_s *port,
123 bfa_fcs_lport_deleted(port); 126 bfa_fcs_lport_deleted(port);
124 break; 127 break;
125 128
129 case BFA_FCS_PORT_SM_STOP:
130 /* If vport - send completion call back */
131 if (port->vport)
132 bfa_fcs_vport_stop_comp(port->vport);
133 break;
134
126 case BFA_FCS_PORT_SM_OFFLINE: 135 case BFA_FCS_PORT_SM_OFFLINE:
127 break; 136 break;
128 137
@@ -148,6 +157,23 @@ bfa_fcs_lport_sm_online(
148 bfa_fcs_lport_offline_actions(port); 157 bfa_fcs_lport_offline_actions(port);
149 break; 158 break;
150 159
160 case BFA_FCS_PORT_SM_STOP:
161 __port_action[port->fabric->fab_type].offline(port);
162
163 if (port->num_rports == 0) {
164 bfa_sm_set_state(port, bfa_fcs_lport_sm_init);
165 /* If vport - send completion call back */
166 if (port->vport)
167 bfa_fcs_vport_stop_comp(port->vport);
168 } else {
169 bfa_sm_set_state(port, bfa_fcs_lport_sm_stopping);
170 list_for_each_safe(qe, qen, &port->rport_q) {
171 rport = (struct bfa_fcs_rport_s *) qe;
172 bfa_sm_send_event(rport, RPSM_EVENT_DELETE);
173 }
174 }
175 break;
176
151 case BFA_FCS_PORT_SM_DELETE: 177 case BFA_FCS_PORT_SM_DELETE:
152 178
153 __port_action[port->fabric->fab_type].offline(port); 179 __port_action[port->fabric->fab_type].offline(port);
@@ -189,6 +215,21 @@ bfa_fcs_lport_sm_offline(
189 bfa_fcs_lport_online_actions(port); 215 bfa_fcs_lport_online_actions(port);
190 break; 216 break;
191 217
218 case BFA_FCS_PORT_SM_STOP:
219 if (port->num_rports == 0) {
220 bfa_sm_set_state(port, bfa_fcs_lport_sm_init);
221 /* If vport - send completion call back */
222 if (port->vport)
223 bfa_fcs_vport_stop_comp(port->vport);
224 } else {
225 bfa_sm_set_state(port, bfa_fcs_lport_sm_stopping);
226 list_for_each_safe(qe, qen, &port->rport_q) {
227 rport = (struct bfa_fcs_rport_s *) qe;
228 bfa_sm_send_event(rport, RPSM_EVENT_DELETE);
229 }
230 }
231 break;
232
192 case BFA_FCS_PORT_SM_DELETE: 233 case BFA_FCS_PORT_SM_DELETE:
193 if (port->num_rports == 0) { 234 if (port->num_rports == 0) {
194 bfa_sm_set_state(port, bfa_fcs_lport_sm_uninit); 235 bfa_sm_set_state(port, bfa_fcs_lport_sm_uninit);
@@ -212,6 +253,28 @@ bfa_fcs_lport_sm_offline(
212} 253}
213 254
214static void 255static void
256bfa_fcs_lport_sm_stopping(struct bfa_fcs_lport_s *port,
257 enum bfa_fcs_lport_event event)
258{
259 bfa_trc(port->fcs, port->port_cfg.pwwn);
260 bfa_trc(port->fcs, event);
261
262 switch (event) {
263 case BFA_FCS_PORT_SM_DELRPORT:
264 if (port->num_rports == 0) {
265 bfa_sm_set_state(port, bfa_fcs_lport_sm_init);
266 /* If vport - send completion call back */
267 if (port->vport)
268 bfa_fcs_vport_stop_comp(port->vport);
269 }
270 break;
271
272 default:
273 bfa_sm_fault(port->fcs, event);
274 }
275}
276
277static void
215bfa_fcs_lport_sm_deleting( 278bfa_fcs_lport_sm_deleting(
216 struct bfa_fcs_lport_s *port, 279 struct bfa_fcs_lport_s *port,
217 enum bfa_fcs_lport_event event) 280 enum bfa_fcs_lport_event event)
@@ -1672,7 +1735,7 @@ bfa_fcs_lport_fdmi_build_rhba_pyld(struct bfa_fcs_lport_fdmi_s *fdmi, u8 *pyld)
1672 memcpy(attr->value, fcs_hba_attr->driver_version, templen); 1735 memcpy(attr->value, fcs_hba_attr->driver_version, templen);
1673 templen = fc_roundup(templen, sizeof(u32)); 1736 templen = fc_roundup(templen, sizeof(u32));
1674 curr_ptr += sizeof(attr->type) + sizeof(templen) + templen; 1737 curr_ptr += sizeof(attr->type) + sizeof(templen) + templen;
1675 len += templen;; 1738 len += templen;
1676 count++; 1739 count++;
1677 attr->len = cpu_to_be16(templen + sizeof(attr->type) + 1740 attr->len = cpu_to_be16(templen + sizeof(attr->type) +
1678 sizeof(templen)); 1741 sizeof(templen));
@@ -4918,6 +4981,7 @@ enum bfa_fcs_vport_event {
4918 BFA_FCS_VPORT_SM_DELCOMP = 11, /* lport delete completion */ 4981 BFA_FCS_VPORT_SM_DELCOMP = 11, /* lport delete completion */
4919 BFA_FCS_VPORT_SM_RSP_DUP_WWN = 12, /* Dup wnn error*/ 4982 BFA_FCS_VPORT_SM_RSP_DUP_WWN = 12, /* Dup wnn error*/
4920 BFA_FCS_VPORT_SM_RSP_FAILED = 13, /* non-retryable failure */ 4983 BFA_FCS_VPORT_SM_RSP_FAILED = 13, /* non-retryable failure */
4984 BFA_FCS_VPORT_SM_STOPCOMP = 14, /* vport delete completion */
4921}; 4985};
4922 4986
4923static void bfa_fcs_vport_sm_uninit(struct bfa_fcs_vport_s *vport, 4987static void bfa_fcs_vport_sm_uninit(struct bfa_fcs_vport_s *vport,
@@ -4940,6 +5004,10 @@ static void bfa_fcs_vport_sm_logo(struct bfa_fcs_vport_s *vport,
4940 enum bfa_fcs_vport_event event); 5004 enum bfa_fcs_vport_event event);
4941static void bfa_fcs_vport_sm_error(struct bfa_fcs_vport_s *vport, 5005static void bfa_fcs_vport_sm_error(struct bfa_fcs_vport_s *vport,
4942 enum bfa_fcs_vport_event event); 5006 enum bfa_fcs_vport_event event);
5007static void bfa_fcs_vport_sm_stopping(struct bfa_fcs_vport_s *vport,
5008 enum bfa_fcs_vport_event event);
5009static void bfa_fcs_vport_sm_logo_for_stop(struct bfa_fcs_vport_s *vport,
5010 enum bfa_fcs_vport_event event);
4943 5011
4944static struct bfa_sm_table_s vport_sm_table[] = { 5012static struct bfa_sm_table_s vport_sm_table[] = {
4945 {BFA_SM(bfa_fcs_vport_sm_uninit), BFA_FCS_VPORT_UNINIT}, 5013 {BFA_SM(bfa_fcs_vport_sm_uninit), BFA_FCS_VPORT_UNINIT},
@@ -5042,6 +5110,11 @@ bfa_fcs_vport_sm_offline(struct bfa_fcs_vport_s *vport,
5042 bfa_fcs_vport_do_fdisc(vport); 5110 bfa_fcs_vport_do_fdisc(vport);
5043 break; 5111 break;
5044 5112
5113 case BFA_FCS_VPORT_SM_STOP:
5114 bfa_sm_set_state(vport, bfa_fcs_vport_sm_cleanup);
5115 bfa_sm_send_event(&vport->lport, BFA_FCS_PORT_SM_STOP);
5116 break;
5117
5045 case BFA_FCS_VPORT_SM_OFFLINE: 5118 case BFA_FCS_VPORT_SM_OFFLINE:
5046 /* 5119 /*
5047 * This can happen if the vport couldn't be initialzied 5120 * This can happen if the vport couldn't be initialzied
@@ -5155,6 +5228,11 @@ bfa_fcs_vport_sm_online(struct bfa_fcs_vport_s *vport,
5155 bfa_fcs_lport_delete(&vport->lport); 5228 bfa_fcs_lport_delete(&vport->lport);
5156 break; 5229 break;
5157 5230
5231 case BFA_FCS_VPORT_SM_STOP:
5232 bfa_sm_set_state(vport, bfa_fcs_vport_sm_stopping);
5233 bfa_sm_send_event(&vport->lport, BFA_FCS_PORT_SM_STOP);
5234 break;
5235
5158 case BFA_FCS_VPORT_SM_OFFLINE: 5236 case BFA_FCS_VPORT_SM_OFFLINE:
5159 bfa_sm_set_state(vport, bfa_fcs_vport_sm_offline); 5237 bfa_sm_set_state(vport, bfa_fcs_vport_sm_offline);
5160 bfa_sm_send_event(vport->lps, BFA_LPS_SM_OFFLINE); 5238 bfa_sm_send_event(vport->lps, BFA_LPS_SM_OFFLINE);
@@ -5167,6 +5245,32 @@ bfa_fcs_vport_sm_online(struct bfa_fcs_vport_s *vport,
5167} 5245}
5168 5246
5169/* 5247/*
5248 * Vport is being stopped - awaiting lport stop completion to send
5249 * LOGO to fabric.
5250 */
5251static void
5252bfa_fcs_vport_sm_stopping(struct bfa_fcs_vport_s *vport,
5253 enum bfa_fcs_vport_event event)
5254{
5255 bfa_trc(__vport_fcs(vport), __vport_pwwn(vport));
5256 bfa_trc(__vport_fcs(vport), event);
5257
5258 switch (event) {
5259 case BFA_FCS_VPORT_SM_STOPCOMP:
5260 bfa_sm_set_state(vport, bfa_fcs_vport_sm_logo_for_stop);
5261 bfa_fcs_vport_do_logo(vport);
5262 break;
5263
5264 case BFA_FCS_VPORT_SM_OFFLINE:
5265 bfa_sm_set_state(vport, bfa_fcs_vport_sm_cleanup);
5266 break;
5267
5268 default:
5269 bfa_sm_fault(__vport_fcs(vport), event);
5270 }
5271}
5272
5273/*
5170 * Vport is being deleted - awaiting lport delete completion to send 5274 * Vport is being deleted - awaiting lport delete completion to send
5171 * LOGO to fabric. 5275 * LOGO to fabric.
5172 */ 5276 */
@@ -5236,6 +5340,10 @@ bfa_fcs_vport_sm_cleanup(struct bfa_fcs_vport_s *vport,
5236 bfa_fcs_vport_free(vport); 5340 bfa_fcs_vport_free(vport);
5237 break; 5341 break;
5238 5342
5343 case BFA_FCS_VPORT_SM_STOPCOMP:
5344 bfa_sm_set_state(vport, bfa_fcs_vport_sm_created);
5345 break;
5346
5239 case BFA_FCS_VPORT_SM_DELETE: 5347 case BFA_FCS_VPORT_SM_DELETE:
5240 break; 5348 break;
5241 5349
@@ -5245,6 +5353,34 @@ bfa_fcs_vport_sm_cleanup(struct bfa_fcs_vport_s *vport,
5245} 5353}
5246 5354
5247/* 5355/*
5356 * LOGO is sent to fabric. Vport stop is in progress. Lport stop cleanup
5357 * is done.
5358 */
5359static void
5360bfa_fcs_vport_sm_logo_for_stop(struct bfa_fcs_vport_s *vport,
5361 enum bfa_fcs_vport_event event)
5362{
5363 bfa_trc(__vport_fcs(vport), __vport_pwwn(vport));
5364 bfa_trc(__vport_fcs(vport), event);
5365
5366 switch (event) {
5367 case BFA_FCS_VPORT_SM_OFFLINE:
5368 bfa_sm_send_event(vport->lps, BFA_LPS_SM_OFFLINE);
5369 /*
5370 * !!! fall through !!!
5371 */
5372
5373 case BFA_FCS_VPORT_SM_RSP_OK:
5374 case BFA_FCS_VPORT_SM_RSP_ERROR:
5375 bfa_sm_set_state(vport, bfa_fcs_vport_sm_created);
5376 break;
5377
5378 default:
5379 bfa_sm_fault(__vport_fcs(vport), event);
5380 }
5381}
5382
5383/*
5248 * LOGO is sent to fabric. Vport delete is in progress. Lport delete cleanup 5384 * LOGO is sent to fabric. Vport delete is in progress. Lport delete cleanup
5249 * is done. 5385 * is done.
5250 */ 5386 */
@@ -5422,6 +5558,15 @@ bfa_fcs_vport_fcs_delete(struct bfa_fcs_vport_s *vport)
5422} 5558}
5423 5559
5424/* 5560/*
5561 * Stop completion callback from associated lport
5562 */
5563void
5564bfa_fcs_vport_stop_comp(struct bfa_fcs_vport_s *vport)
5565{
5566 bfa_sm_send_event(vport, BFA_FCS_VPORT_SM_STOPCOMP);
5567}
5568
5569/*
5425 * Delete completion callback from associated lport 5570 * Delete completion callback from associated lport
5426 */ 5571 */
5427void 5572void
diff --git a/drivers/scsi/bfa/bfi.h b/drivers/scsi/bfa/bfi.h
index 391796710c8f..7096c5fd2ba0 100644
--- a/drivers/scsi/bfa/bfi.h
+++ b/drivers/scsi/bfa/bfi.h
@@ -172,7 +172,7 @@ enum bfi_mclass {
172 BFI_MC_FCXP = 9, /* FC Transport */ 172 BFI_MC_FCXP = 9, /* FC Transport */
173 BFI_MC_LPS = 10, /* lport fc login services */ 173 BFI_MC_LPS = 10, /* lport fc login services */
174 BFI_MC_RPORT = 11, /* Remote port */ 174 BFI_MC_RPORT = 11, /* Remote port */
175 BFI_MC_ITNIM = 12, /* I-T nexus (Initiator mode) */ 175 BFI_MC_ITN = 12, /* I-T nexus (Initiator mode) */
176 BFI_MC_IOIM_READ = 13, /* read IO (Initiator mode) */ 176 BFI_MC_IOIM_READ = 13, /* read IO (Initiator mode) */
177 BFI_MC_IOIM_WRITE = 14, /* write IO (Initiator mode) */ 177 BFI_MC_IOIM_WRITE = 14, /* write IO (Initiator mode) */
178 BFI_MC_IOIM_IO = 15, /* IO (Initiator mode) */ 178 BFI_MC_IOIM_IO = 15, /* IO (Initiator mode) */
diff --git a/drivers/scsi/bfa/bfi_ms.h b/drivers/scsi/bfa/bfi_ms.h
index c9c8e8da5bd1..d43bf6a08a66 100644
--- a/drivers/scsi/bfa/bfi_ms.h
+++ b/drivers/scsi/bfa/bfi_ms.h
@@ -373,7 +373,8 @@ struct bfi_lps_login_req_s {
373 wwn_t nwwn; 373 wwn_t nwwn;
374 u8 fdisc; 374 u8 fdisc;
375 u8 auth_en; 375 u8 auth_en;
376 u8 rsvd[2]; 376 u8 lps_role;
377 u8 rsvd[1];
377}; 378};
378 379
379struct bfi_lps_login_rsp_s { 380struct bfi_lps_login_rsp_s {
@@ -515,62 +516,63 @@ union bfi_rport_i2h_msg_u {
515 * Initiator mode I-T nexus interface defines. 516 * Initiator mode I-T nexus interface defines.
516 */ 517 */
517 518
518enum bfi_itnim_h2i { 519enum bfi_itn_h2i {
519 BFI_ITNIM_H2I_CREATE_REQ = 1, /* i-t nexus creation */ 520 BFI_ITN_H2I_CREATE_REQ = 1, /* i-t nexus creation */
520 BFI_ITNIM_H2I_DELETE_REQ = 2, /* i-t nexus deletion */ 521 BFI_ITN_H2I_DELETE_REQ = 2, /* i-t nexus deletion */
521}; 522};
522 523
523enum bfi_itnim_i2h { 524enum bfi_itn_i2h {
524 BFI_ITNIM_I2H_CREATE_RSP = BFA_I2HM(1), 525 BFI_ITN_I2H_CREATE_RSP = BFA_I2HM(1),
525 BFI_ITNIM_I2H_DELETE_RSP = BFA_I2HM(2), 526 BFI_ITN_I2H_DELETE_RSP = BFA_I2HM(2),
526 BFI_ITNIM_I2H_SLER_EVENT = BFA_I2HM(3), 527 BFI_ITN_I2H_SLER_EVENT = BFA_I2HM(3),
527}; 528};
528 529
529struct bfi_itnim_create_req_s { 530struct bfi_itn_create_req_s {
530 struct bfi_mhdr_s mh; /* common msg header */ 531 struct bfi_mhdr_s mh; /* common msg header */
531 u16 fw_handle; /* f/w handle for itnim */ 532 u16 fw_handle; /* f/w handle for itnim */
532 u8 class; /* FC class for IO */ 533 u8 class; /* FC class for IO */
533 u8 seq_rec; /* sequence recovery support */ 534 u8 seq_rec; /* sequence recovery support */
534 u8 msg_no; /* seq id of the msg */ 535 u8 msg_no; /* seq id of the msg */
536 u8 role;
535}; 537};
536 538
537struct bfi_itnim_create_rsp_s { 539struct bfi_itn_create_rsp_s {
538 struct bfi_mhdr_s mh; /* common msg header */ 540 struct bfi_mhdr_s mh; /* common msg header */
539 u16 bfa_handle; /* bfa handle for itnim */ 541 u16 bfa_handle; /* bfa handle for itnim */
540 u8 status; /* fcp request status */ 542 u8 status; /* fcp request status */
541 u8 seq_id; /* seq id of the msg */ 543 u8 seq_id; /* seq id of the msg */
542}; 544};
543 545
544struct bfi_itnim_delete_req_s { 546struct bfi_itn_delete_req_s {
545 struct bfi_mhdr_s mh; /* common msg header */ 547 struct bfi_mhdr_s mh; /* common msg header */
546 u16 fw_handle; /* f/w itnim handle */ 548 u16 fw_handle; /* f/w itnim handle */
547 u8 seq_id; /* seq id of the msg */ 549 u8 seq_id; /* seq id of the msg */
548 u8 rsvd; 550 u8 rsvd;
549}; 551};
550 552
551struct bfi_itnim_delete_rsp_s { 553struct bfi_itn_delete_rsp_s {
552 struct bfi_mhdr_s mh; /* common msg header */ 554 struct bfi_mhdr_s mh; /* common msg header */
553 u16 bfa_handle; /* bfa handle for itnim */ 555 u16 bfa_handle; /* bfa handle for itnim */
554 u8 status; /* fcp request status */ 556 u8 status; /* fcp request status */
555 u8 seq_id; /* seq id of the msg */ 557 u8 seq_id; /* seq id of the msg */
556}; 558};
557 559
558struct bfi_itnim_sler_event_s { 560struct bfi_itn_sler_event_s {
559 struct bfi_mhdr_s mh; /* common msg header */ 561 struct bfi_mhdr_s mh; /* common msg header */
560 u16 bfa_handle; /* bfa handle for itnim */ 562 u16 bfa_handle; /* bfa handle for itnim */
561 u16 rsvd; 563 u16 rsvd;
562}; 564};
563 565
564union bfi_itnim_h2i_msg_u { 566union bfi_itn_h2i_msg_u {
565 struct bfi_itnim_create_req_s *create_req; 567 struct bfi_itn_create_req_s *create_req;
566 struct bfi_itnim_delete_req_s *delete_req; 568 struct bfi_itn_delete_req_s *delete_req;
567 struct bfi_msg_s *msg; 569 struct bfi_msg_s *msg;
568}; 570};
569 571
570union bfi_itnim_i2h_msg_u { 572union bfi_itn_i2h_msg_u {
571 struct bfi_itnim_create_rsp_s *create_rsp; 573 struct bfi_itn_create_rsp_s *create_rsp;
572 struct bfi_itnim_delete_rsp_s *delete_rsp; 574 struct bfi_itn_delete_rsp_s *delete_rsp;
573 struct bfi_itnim_sler_event_s *sler_event; 575 struct bfi_itn_sler_event_s *sler_event;
574 struct bfi_msg_s *msg; 576 struct bfi_msg_s *msg;
575}; 577};
576 578