aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/scsi/libfc/fc_disc.c2
-rw-r--r--drivers/scsi/libfc/fc_elsct.c11
-rw-r--r--drivers/scsi/libfc/fc_fcp.c2
-rw-r--r--drivers/scsi/libfc/fc_lport.c12
-rw-r--r--drivers/scsi/libfc/fc_rport.c8
-rw-r--r--include/scsi/fc_encode.h26
-rw-r--r--include/scsi/libfc.h2
7 files changed, 24 insertions, 39 deletions
diff --git a/drivers/scsi/libfc/fc_disc.c b/drivers/scsi/libfc/fc_disc.c
index 448ffc388656..4b1f9faf639a 100644
--- a/drivers/scsi/libfc/fc_disc.c
+++ b/drivers/scsi/libfc/fc_disc.c
@@ -526,7 +526,7 @@ static void fc_disc_gpn_ft_req(struct fc_disc *disc)
526 if (!fp) 526 if (!fp)
527 goto err; 527 goto err;
528 528
529 if (lport->tt.elsct_send(lport, NULL, fp, 529 if (lport->tt.elsct_send(lport, 0, fp,
530 FC_NS_GPN_FT, 530 FC_NS_GPN_FT,
531 fc_disc_gpn_ft_resp, 531 fc_disc_gpn_ft_resp,
532 disc, lport->e_d_tov)) 532 disc, lport->e_d_tov))
diff --git a/drivers/scsi/libfc/fc_elsct.c b/drivers/scsi/libfc/fc_elsct.c
index 2b8a3bbc0399..5e8b011af50e 100644
--- a/drivers/scsi/libfc/fc_elsct.c
+++ b/drivers/scsi/libfc/fc_elsct.c
@@ -32,7 +32,7 @@
32 * fc_elsct_send - sends ELS/CT frame 32 * fc_elsct_send - sends ELS/CT frame
33 */ 33 */
34static struct fc_seq *fc_elsct_send(struct fc_lport *lport, 34static struct fc_seq *fc_elsct_send(struct fc_lport *lport,
35 struct fc_rport_priv *rdata, 35 u32 did,
36 struct fc_frame *fp, 36 struct fc_frame *fp,
37 unsigned int op, 37 unsigned int op,
38 void (*resp)(struct fc_seq *, 38 void (*resp)(struct fc_seq *,
@@ -41,16 +41,17 @@ static struct fc_seq *fc_elsct_send(struct fc_lport *lport,
41 void *arg, u32 timer_msec) 41 void *arg, u32 timer_msec)
42{ 42{
43 enum fc_rctl r_ctl; 43 enum fc_rctl r_ctl;
44 u32 did = FC_FID_NONE;
45 enum fc_fh_type fh_type; 44 enum fc_fh_type fh_type;
46 int rc; 45 int rc;
47 46
48 /* ELS requests */ 47 /* ELS requests */
49 if ((op >= ELS_LS_RJT) && (op <= ELS_AUTH_ELS)) 48 if ((op >= ELS_LS_RJT) && (op <= ELS_AUTH_ELS))
50 rc = fc_els_fill(lport, rdata, fp, op, &r_ctl, &did, &fh_type); 49 rc = fc_els_fill(lport, did, fp, op, &r_ctl, &fh_type);
51 else 50 else {
52 /* CT requests */ 51 /* CT requests */
53 rc = fc_ct_fill(lport, fp, op, &r_ctl, &did, &fh_type); 52 rc = fc_ct_fill(lport, fp, op, &r_ctl, &fh_type);
53 did = FC_FID_DIR_SERV;
54 }
54 55
55 if (rc) 56 if (rc)
56 return NULL; 57 return NULL;
diff --git a/drivers/scsi/libfc/fc_fcp.c b/drivers/scsi/libfc/fc_fcp.c
index a622096eb315..59a4408b27b5 100644
--- a/drivers/scsi/libfc/fc_fcp.c
+++ b/drivers/scsi/libfc/fc_fcp.c
@@ -1308,7 +1308,7 @@ static void fc_fcp_rec(struct fc_fcp_pkt *fsp)
1308 fc_fill_fc_hdr(fp, FC_RCTL_ELS_REQ, rport->port_id, 1308 fc_fill_fc_hdr(fp, FC_RCTL_ELS_REQ, rport->port_id,
1309 fc_host_port_id(rp->local_port->host), FC_TYPE_ELS, 1309 fc_host_port_id(rp->local_port->host), FC_TYPE_ELS,
1310 FC_FC_FIRST_SEQ | FC_FC_END_SEQ | FC_FC_SEQ_INIT, 0); 1310 FC_FC_FIRST_SEQ | FC_FC_END_SEQ | FC_FC_SEQ_INIT, 0);
1311 if (lp->tt.elsct_send(lp, rport->dd_data, fp, ELS_REC, fc_fcp_rec_resp, 1311 if (lp->tt.elsct_send(lp, rport->port_id, fp, ELS_REC, fc_fcp_rec_resp,
1312 fsp, jiffies_to_msecs(FC_SCSI_REC_TOV))) { 1312 fsp, jiffies_to_msecs(FC_SCSI_REC_TOV))) {
1313 fc_fcp_pkt_hold(fsp); /* hold while REC outstanding */ 1313 fc_fcp_pkt_hold(fsp); /* hold while REC outstanding */
1314 return; 1314 return;
diff --git a/drivers/scsi/libfc/fc_lport.c b/drivers/scsi/libfc/fc_lport.c
index 3c15abd35ffa..aa605d2012e0 100644
--- a/drivers/scsi/libfc/fc_lport.c
+++ b/drivers/scsi/libfc/fc_lport.c
@@ -1217,7 +1217,7 @@ static void fc_lport_enter_scr(struct fc_lport *lport)
1217 return; 1217 return;
1218 } 1218 }
1219 1219
1220 if (!lport->tt.elsct_send(lport, NULL, fp, ELS_SCR, 1220 if (!lport->tt.elsct_send(lport, FC_FID_FCTRL, fp, ELS_SCR,
1221 fc_lport_scr_resp, lport, lport->e_d_tov)) 1221 fc_lport_scr_resp, lport, lport->e_d_tov))
1222 fc_lport_error(lport, fp); 1222 fc_lport_error(lport, fp);
1223} 1223}
@@ -1258,7 +1258,7 @@ static void fc_lport_enter_rft_id(struct fc_lport *lport)
1258 return; 1258 return;
1259 } 1259 }
1260 1260
1261 if (!lport->tt.elsct_send(lport, NULL, fp, FC_NS_RFT_ID, 1261 if (!lport->tt.elsct_send(lport, FC_FID_DIR_SERV, fp, FC_NS_RFT_ID,
1262 fc_lport_rft_id_resp, 1262 fc_lport_rft_id_resp,
1263 lport, lport->e_d_tov)) 1263 lport, lport->e_d_tov))
1264 fc_lport_error(lport, fp); 1264 fc_lport_error(lport, fp);
@@ -1287,7 +1287,7 @@ static void fc_lport_enter_rpn_id(struct fc_lport *lport)
1287 return; 1287 return;
1288 } 1288 }
1289 1289
1290 if (!lport->tt.elsct_send(lport, NULL, fp, FC_NS_RPN_ID, 1290 if (!lport->tt.elsct_send(lport, FC_FID_DIR_SERV, fp, FC_NS_RPN_ID,
1291 fc_lport_rpn_id_resp, 1291 fc_lport_rpn_id_resp,
1292 lport, lport->e_d_tov)) 1292 lport, lport->e_d_tov))
1293 fc_lport_error(lport, fp); 1293 fc_lport_error(lport, fp);
@@ -1443,8 +1443,8 @@ static void fc_lport_enter_logo(struct fc_lport *lport)
1443 return; 1443 return;
1444 } 1444 }
1445 1445
1446 if (!lport->tt.elsct_send(lport, NULL, fp, ELS_LOGO, fc_lport_logo_resp, 1446 if (!lport->tt.elsct_send(lport, FC_FID_FLOGI, fp, ELS_LOGO,
1447 lport, lport->e_d_tov)) 1447 fc_lport_logo_resp, lport, lport->e_d_tov))
1448 fc_lport_error(lport, fp); 1448 fc_lport_error(lport, fp);
1449} 1449}
1450 1450
@@ -1567,7 +1567,7 @@ void fc_lport_enter_flogi(struct fc_lport *lport)
1567 if (!fp) 1567 if (!fp)
1568 return fc_lport_error(lport, fp); 1568 return fc_lport_error(lport, fp);
1569 1569
1570 if (!lport->tt.elsct_send(lport, NULL, fp, ELS_FLOGI, 1570 if (!lport->tt.elsct_send(lport, FC_FID_FLOGI, fp, ELS_FLOGI,
1571 fc_lport_flogi_resp, lport, lport->e_d_tov)) 1571 fc_lport_flogi_resp, lport, lport->e_d_tov))
1572 fc_lport_error(lport, fp); 1572 fc_lport_error(lport, fp);
1573} 1573}
diff --git a/drivers/scsi/libfc/fc_rport.c b/drivers/scsi/libfc/fc_rport.c
index 13d3d758fb0e..20371b445bb1 100644
--- a/drivers/scsi/libfc/fc_rport.c
+++ b/drivers/scsi/libfc/fc_rport.c
@@ -593,7 +593,7 @@ static void fc_rport_enter_plogi(struct fc_rport_priv *rdata)
593 } 593 }
594 rdata->e_d_tov = lport->e_d_tov; 594 rdata->e_d_tov = lport->e_d_tov;
595 595
596 if (!lport->tt.elsct_send(lport, rdata, fp, ELS_PLOGI, 596 if (!lport->tt.elsct_send(lport, rport->port_id, fp, ELS_PLOGI,
597 fc_rport_plogi_resp, rdata, lport->e_d_tov)) 597 fc_rport_plogi_resp, rdata, lport->e_d_tov))
598 fc_rport_error_retry(rdata, fp); 598 fc_rport_error_retry(rdata, fp);
599 else 599 else
@@ -747,7 +747,7 @@ static void fc_rport_enter_prli(struct fc_rport_priv *rdata)
747 return; 747 return;
748 } 748 }
749 749
750 if (!lport->tt.elsct_send(lport, rdata, fp, ELS_PRLI, 750 if (!lport->tt.elsct_send(lport, rport->port_id, fp, ELS_PRLI,
751 fc_rport_prli_resp, rdata, lport->e_d_tov)) 751 fc_rport_prli_resp, rdata, lport->e_d_tov))
752 fc_rport_error_retry(rdata, fp); 752 fc_rport_error_retry(rdata, fp);
753 else 753 else
@@ -845,7 +845,7 @@ static void fc_rport_enter_rtv(struct fc_rport_priv *rdata)
845 return; 845 return;
846 } 846 }
847 847
848 if (!lport->tt.elsct_send(lport, rdata, fp, ELS_RTV, 848 if (!lport->tt.elsct_send(lport, rport->port_id, fp, ELS_RTV,
849 fc_rport_rtv_resp, rdata, lport->e_d_tov)) 849 fc_rport_rtv_resp, rdata, lport->e_d_tov))
850 fc_rport_error_retry(rdata, fp); 850 fc_rport_error_retry(rdata, fp);
851 else 851 else
@@ -876,7 +876,7 @@ static void fc_rport_enter_logo(struct fc_rport_priv *rdata)
876 return; 876 return;
877 } 877 }
878 878
879 if (!lport->tt.elsct_send(lport, rdata, fp, ELS_LOGO, 879 if (!lport->tt.elsct_send(lport, rport->port_id, fp, ELS_LOGO,
880 fc_rport_logo_resp, rdata, lport->e_d_tov)) 880 fc_rport_logo_resp, rdata, lport->e_d_tov))
881 fc_rport_error_retry(rdata, fp); 881 fc_rport_error_retry(rdata, fp);
882 else 882 else
diff --git a/include/scsi/fc_encode.h b/include/scsi/fc_encode.h
index 3ede1abad4b7..24bf764f9884 100644
--- a/include/scsi/fc_encode.h
+++ b/include/scsi/fc_encode.h
@@ -79,8 +79,9 @@ static inline struct fc_ct_req *fc_ct_hdr_fill(const struct fc_frame *fp,
79/** 79/**
80 * fc_ct_fill - Fill in a name service request frame 80 * fc_ct_fill - Fill in a name service request frame
81 */ 81 */
82static inline int fc_ct_fill(struct fc_lport *lport, struct fc_frame *fp, 82static inline int fc_ct_fill(struct fc_lport *lport,
83 unsigned int op, enum fc_rctl *r_ctl, u32 *did, 83 struct fc_frame *fp,
84 unsigned int op, enum fc_rctl *r_ctl,
84 enum fc_fh_type *fh_type) 85 enum fc_fh_type *fh_type)
85{ 86{
86 struct fc_ct_req *ct; 87 struct fc_ct_req *ct;
@@ -110,7 +111,6 @@ static inline int fc_ct_fill(struct fc_lport *lport, struct fc_frame *fp,
110 return -EINVAL; 111 return -EINVAL;
111 } 112 }
112 *r_ctl = FC_RCTL_DD_UNSOL_CTL; 113 *r_ctl = FC_RCTL_DD_UNSOL_CTL;
113 *did = FC_FID_DIR_SERV;
114 *fh_type = FC_TYPE_CT; 114 *fh_type = FC_TYPE_CT;
115 return 0; 115 return 0;
116} 116}
@@ -250,53 +250,37 @@ static inline void fc_scr_fill(struct fc_lport *lport, struct fc_frame *fp)
250 * fc_els_fill - Fill in an ELS request frame 250 * fc_els_fill - Fill in an ELS request frame
251 */ 251 */
252static inline int fc_els_fill(struct fc_lport *lport, 252static inline int fc_els_fill(struct fc_lport *lport,
253 struct fc_rport_priv *rdata, 253 u32 did,
254 struct fc_frame *fp, unsigned int op, 254 struct fc_frame *fp, unsigned int op,
255 enum fc_rctl *r_ctl, u32 *did, enum fc_fh_type *fh_type) 255 enum fc_rctl *r_ctl, enum fc_fh_type *fh_type)
256{ 256{
257 struct fc_rport *rport = PRIV_TO_RPORT(rdata);
258
259 switch (op) { 257 switch (op) {
260 case ELS_PLOGI: 258 case ELS_PLOGI:
261 fc_plogi_fill(lport, fp, ELS_PLOGI); 259 fc_plogi_fill(lport, fp, ELS_PLOGI);
262 *did = rport->port_id;
263 break; 260 break;
264 261
265 case ELS_FLOGI: 262 case ELS_FLOGI:
266 fc_flogi_fill(lport, fp); 263 fc_flogi_fill(lport, fp);
267 *did = FC_FID_FLOGI;
268 break; 264 break;
269 265
270 case ELS_LOGO: 266 case ELS_LOGO:
271 fc_logo_fill(lport, fp); 267 fc_logo_fill(lport, fp);
272 *did = FC_FID_FLOGI;
273 /*
274 * if rport is valid then it
275 * is port logo, therefore
276 * set did to rport id.
277 */
278 if (rdata)
279 *did = rport->port_id;
280 break; 268 break;
281 269
282 case ELS_RTV: 270 case ELS_RTV:
283 fc_rtv_fill(lport, fp); 271 fc_rtv_fill(lport, fp);
284 *did = rport->port_id;
285 break; 272 break;
286 273
287 case ELS_REC: 274 case ELS_REC:
288 fc_rec_fill(lport, fp); 275 fc_rec_fill(lport, fp);
289 *did = rport->port_id;
290 break; 276 break;
291 277
292 case ELS_PRLI: 278 case ELS_PRLI:
293 fc_prli_fill(lport, fp); 279 fc_prli_fill(lport, fp);
294 *did = rport->port_id;
295 break; 280 break;
296 281
297 case ELS_SCR: 282 case ELS_SCR:
298 fc_scr_fill(lport, fp); 283 fc_scr_fill(lport, fp);
299 *did = FC_FID_FCTRL;
300 break; 284 break;
301 285
302 default: 286 default:
diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h
index df57cb762dc2..2473167464c2 100644
--- a/include/scsi/libfc.h
+++ b/include/scsi/libfc.h
@@ -424,7 +424,7 @@ struct libfc_function_template {
424 * STATUS: OPTIONAL 424 * STATUS: OPTIONAL
425 */ 425 */
426 struct fc_seq *(*elsct_send)(struct fc_lport *lport, 426 struct fc_seq *(*elsct_send)(struct fc_lport *lport,
427 struct fc_rport_priv *, 427 u32 did,
428 struct fc_frame *fp, 428 struct fc_frame *fp,
429 unsigned int op, 429 unsigned int op,
430 void (*resp)(struct fc_seq *, 430 void (*resp)(struct fc_seq *,