aboutsummaryrefslogtreecommitdiffstats
path: root/include/scsi
diff options
context:
space:
mode:
authorJoe Eykholt <jeykholt@cisco.com>2009-08-25 17:00:55 -0400
committerJames Bottomley <James.Bottomley@suse.de>2009-09-10 13:07:41 -0400
commita46f327aa5caf2cce138e98ddd863b6cca0e71e2 (patch)
treedbb230e8d4e024085e126445e6d819d5088e0406 /include/scsi
parent9fb9d32831fd687e427ec5b147bb690f468b99a0 (diff)
[SCSI] libfc: change elsct to use FC_ID instead of rdata
tt.elsct_send is used by both FCP and by the rport state machine. After further patches, these two modules will use different structures for the remote port. So, change elsct_send to use the FC_ID instead of the fc_rport_priv as its argument. It currently only uses the FC_ID anyway. For CT requests the destination FC_ID is still implicitly 0xfffffc. After further patches the did arg on CT requests will be used to specify the FC_ID being inquired about for GPN_ID or other queries. Signed-off-by: Joe Eykholt <jeykholt@cisco.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'include/scsi')
-rw-r--r--include/scsi/fc_encode.h26
-rw-r--r--include/scsi/libfc.h2
2 files changed, 6 insertions, 22 deletions
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 *,