The local port id is not showing correctly in /sys.
This patch is to allow the most recent local port id setting
to show in /sys.
Signed-off-by: Steve Ma <[EMAIL PROTECTED]>
---
drivers/scsi/libfc/fc_lport.c | 20 ++++++++------------
include/scsi/libfc/libfc.h | 5 -----
2 files changed, 8 insertions(+), 17 deletions(-)
diff --git a/drivers/scsi/libfc/fc_lport.c b/drivers/scsi/libfc/fc_lport.c
index 569fdc1..d6136ee 100644
--- a/drivers/scsi/libfc/fc_lport.c
+++ b/drivers/scsi/libfc/fc_lport.c
@@ -180,18 +180,6 @@ static void fc_lport_ptp_setup(struct fc_lport *lport,
fc_lport_enter_ready(lport);
}
-/**
- * fc_get_host_port_state - supports fc_function_template
- * @shost: The host whose port state should be returned
- */
-void fc_get_host_port_id(struct Scsi_Host *shost)
-{
- struct fc_lport *lp = shost_priv(shost);
-
- fc_host_port_id(shost) = lp->fid;
-}
-EXPORT_SYMBOL(fc_get_host_port_id);
-
void fc_get_host_port_type(struct Scsi_Host *shost)
{
/* TODO - currently just NPORT */
@@ -199,6 +187,10 @@ void fc_get_host_port_type(struct Scsi_Host *shost)
}
EXPORT_SYMBOL(fc_get_host_port_type);
+/**
+ * fc_get_host_port_state - supports fc_function_template
+ * @shost: The host whose port state should be returned
+ */
void fc_get_host_port_state(struct Scsi_Host *shost)
{
struct fc_lport *lp = shost_priv(shost);
@@ -675,6 +667,7 @@ static void fc_lport_recv_flogi_req(struct fc_seq *sp_in,
}
lport->fid = local_fid;
+ fc_host_port_id(lport->host) = lport->fid;
fp = fc_frame_alloc(lport, sizeof(*flp));
if (fp) {
@@ -856,6 +849,7 @@ static void fc_lport_enter_reset(struct fc_lport *lport)
lport->tt.exch_mgr_reset(lport->emp, 0, 0);
fc_host_fabric_name(lport->host) = 0;
lport->fid = 0;
+ fc_host_port_id(lport->host) = 0;
if ((lport->link_status & FC_LINK_UP) == FC_LINK_UP)
fc_lport_enter_flogi(lport);
@@ -1406,6 +1400,8 @@ static void fc_lport_flogi_resp(struct fc_seq *sp, struct
fc_frame *fp,
FC_DBG("Assigned fid %x\n", did);
lport->fid = did;
+ fc_host_port_id(lport->host) = lport->fid;
+
flp = fc_frame_payload_get(fp, sizeof(*flp));
if (flp) {
mfs = ntohs(flp->fl_csp.sp_bb_data) &
diff --git a/include/scsi/libfc/libfc.h b/include/scsi/libfc/libfc.h
index 0c38a3b..055bddc 100644
--- a/include/scsi/libfc/libfc.h
+++ b/include/scsi/libfc/libfc.h
@@ -489,11 +489,6 @@ static inline int fc_lport_test_ready(struct fc_lport *lp)
return lp->state == LPORT_ST_READY;
}
-static inline u32 fc_lport_get_fid(const struct fc_lport *lp)
-{
- return lp->fid;
-}
-
static inline void fc_set_wwnn(struct fc_lport *lp, u64 wwnn)
{
lp->wwnn = wwnn;
_______________________________________________
devel mailing list
[email protected]
http://www.open-fcoe.org/mailman/listinfo/devel