mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 07:12:09 +00:00
[SCSI] libfc: Move the port_id into lport
This patch creates a port_id member in struct fc_lport. This allows libfc to just deal with fc_lport instances instead of calling into the fc_host to get the port_id. This change helps in only using symbols necessary for operation from the libfc structures. libfc still needs to change the fc_host_port_id() if the port_id changes so the presentation layer (scsi_transport_fc) can provide the user with the correct value, but libfc shouldn't rely on the presentation layer for operational values. Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
This commit is contained in:
parent
5e4f8fe7b5
commit
7b2787ec15
10 changed files with 36 additions and 35 deletions
|
@ -74,7 +74,7 @@ static inline void fc_adisc_fill(struct fc_lport *lport, struct fc_frame *fp)
|
|||
adisc->adisc_cmd = ELS_ADISC;
|
||||
put_unaligned_be64(lport->wwpn, &adisc->adisc_wwpn);
|
||||
put_unaligned_be64(lport->wwnn, &adisc->adisc_wwnn);
|
||||
hton24(adisc->adisc_port_id, fc_host_port_id(lport->host));
|
||||
hton24(adisc->adisc_port_id, lport->port_id);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -127,15 +127,13 @@ static inline int fc_ct_fill(struct fc_lport *lport,
|
|||
|
||||
case FC_NS_RFT_ID:
|
||||
ct = fc_ct_hdr_fill(fp, op, sizeof(struct fc_ns_rft));
|
||||
hton24(ct->payload.rft.fid.fp_fid,
|
||||
fc_host_port_id(lport->host));
|
||||
hton24(ct->payload.rft.fid.fp_fid, lport->port_id);
|
||||
ct->payload.rft.fts = lport->fcts;
|
||||
break;
|
||||
|
||||
case FC_NS_RFF_ID:
|
||||
ct = fc_ct_hdr_fill(fp, op, sizeof(struct fc_ns_rff_id));
|
||||
hton24(ct->payload.rff.fr_fid.fp_fid,
|
||||
fc_host_port_id(lport->host));
|
||||
hton24(ct->payload.rff.fr_fid.fp_fid, lport->port_id);
|
||||
ct->payload.rff.fr_type = FC_TYPE_FCP;
|
||||
if (lport->service_params & FCP_SPPF_INIT_FCN)
|
||||
ct->payload.rff.fr_feat = FCP_FEAT_INIT;
|
||||
|
@ -145,16 +143,14 @@ static inline int fc_ct_fill(struct fc_lport *lport,
|
|||
|
||||
case FC_NS_RNN_ID:
|
||||
ct = fc_ct_hdr_fill(fp, op, sizeof(struct fc_ns_rn_id));
|
||||
hton24(ct->payload.rn.fr_fid.fp_fid,
|
||||
fc_host_port_id(lport->host));
|
||||
hton24(ct->payload.rn.fr_fid.fp_fid, lport->port_id);
|
||||
put_unaligned_be64(lport->wwnn, &ct->payload.rn.fr_wwn);
|
||||
break;
|
||||
|
||||
case FC_NS_RSPN_ID:
|
||||
len = strnlen(fc_host_symbolic_name(lport->host), 255);
|
||||
ct = fc_ct_hdr_fill(fp, op, sizeof(struct fc_ns_rspn) + len);
|
||||
hton24(ct->payload.spn.fr_fid.fp_fid,
|
||||
fc_host_port_id(lport->host));
|
||||
hton24(ct->payload.spn.fr_fid.fp_fid, lport->port_id);
|
||||
strncpy(ct->payload.spn.fr_name,
|
||||
fc_host_symbolic_name(lport->host), len);
|
||||
ct->payload.spn.fr_name_len = len;
|
||||
|
@ -268,7 +264,7 @@ static inline void fc_logo_fill(struct fc_lport *lport, struct fc_frame *fp)
|
|||
logo = fc_frame_payload_get(fp, sizeof(*logo));
|
||||
memset(logo, 0, sizeof(*logo));
|
||||
logo->fl_cmd = ELS_LOGO;
|
||||
hton24(logo->fl_n_port_id, fc_host_port_id(lport->host));
|
||||
hton24(logo->fl_n_port_id, lport->port_id);
|
||||
logo->fl_n_port_wwn = htonll(lport->wwpn);
|
||||
}
|
||||
|
||||
|
@ -295,7 +291,7 @@ static inline void fc_rec_fill(struct fc_lport *lport, struct fc_frame *fp)
|
|||
rec = fc_frame_payload_get(fp, sizeof(*rec));
|
||||
memset(rec, 0, sizeof(*rec));
|
||||
rec->rec_cmd = ELS_REC;
|
||||
hton24(rec->rec_s_id, fc_host_port_id(lport->host));
|
||||
hton24(rec->rec_s_id, lport->port_id);
|
||||
rec->rec_ox_id = htons(ep->oxid);
|
||||
rec->rec_rx_id = htons(ep->rxid);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue