[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>
This commit is contained in:
Joe Eykholt
2009-08-25 14:00:55 -07:00
committed by James Bottomley
parent 9fb9d32831
commit a46f327aa5
7 changed files with 24 additions and 39 deletions

View File

@ -79,8 +79,9 @@ static inline struct fc_ct_req *fc_ct_hdr_fill(const struct fc_frame *fp,
/**
* fc_ct_fill - Fill in a name service request frame
*/
static inline int fc_ct_fill(struct fc_lport *lport, struct fc_frame *fp,
unsigned int op, enum fc_rctl *r_ctl, u32 *did,
static inline int fc_ct_fill(struct fc_lport *lport,
struct fc_frame *fp,
unsigned int op, enum fc_rctl *r_ctl,
enum fc_fh_type *fh_type)
{
struct fc_ct_req *ct;
@ -110,7 +111,6 @@ static inline int fc_ct_fill(struct fc_lport *lport, struct fc_frame *fp,
return -EINVAL;
}
*r_ctl = FC_RCTL_DD_UNSOL_CTL;
*did = FC_FID_DIR_SERV;
*fh_type = FC_TYPE_CT;
return 0;
}
@ -250,53 +250,37 @@ static inline void fc_scr_fill(struct fc_lport *lport, struct fc_frame *fp)
* fc_els_fill - Fill in an ELS request frame
*/
static inline int fc_els_fill(struct fc_lport *lport,
struct fc_rport_priv *rdata,
u32 did,
struct fc_frame *fp, unsigned int op,
enum fc_rctl *r_ctl, u32 *did, enum fc_fh_type *fh_type)
enum fc_rctl *r_ctl, enum fc_fh_type *fh_type)
{
struct fc_rport *rport = PRIV_TO_RPORT(rdata);
switch (op) {
case ELS_PLOGI:
fc_plogi_fill(lport, fp, ELS_PLOGI);
*did = rport->port_id;
break;
case ELS_FLOGI:
fc_flogi_fill(lport, fp);
*did = FC_FID_FLOGI;
break;
case ELS_LOGO:
fc_logo_fill(lport, fp);
*did = FC_FID_FLOGI;
/*
* if rport is valid then it
* is port logo, therefore
* set did to rport id.
*/
if (rdata)
*did = rport->port_id;
break;
case ELS_RTV:
fc_rtv_fill(lport, fp);
*did = rport->port_id;
break;
case ELS_REC:
fc_rec_fill(lport, fp);
*did = rport->port_id;
break;
case ELS_PRLI:
fc_prli_fill(lport, fp);
*did = rport->port_id;
break;
case ELS_SCR:
fc_scr_fill(lport, fp);
*did = FC_FID_FCTRL;
break;
default:

View File

@ -424,7 +424,7 @@ struct libfc_function_template {
* STATUS: OPTIONAL
*/
struct fc_seq *(*elsct_send)(struct fc_lport *lport,
struct fc_rport_priv *,
u32 did,
struct fc_frame *fp,
unsigned int op,
void (*resp)(struct fc_seq *,