[Open-FCoE] [PATCH] fcoe, libfc: Setting the correct lport fabric_name in /sys

Steve Ma steve.ma at intel.com
Thu Sep 11 00:00:51 UTC 2008


Removed fc_get_host_fabric_name() in libfc.h and fc_attr.c.
Removed .get_host_fabric_name in fcoe_transport_function of fcoeinit.c.
Collect the fabric_name into struct fc_host_attrs by calling
fc_host_fabric_name(lp->host) in fc_lport_flogi_resp of fc_lport.c.
Also set fc_host_fabric_name(lp->host) to 0 in fc_lport_enter_reset.

Signed-off-by: Steve Ma <steve.ma at intel.com>
---

 drivers/scsi/fcoe/fcoeinit.c  |    1 -
 drivers/scsi/libfc/fc_attr.c  |    8 --------
 drivers/scsi/libfc/fc_lport.c |    3 +++
 include/scsi/libfc/libfc.h    |    1 -
 4 files changed, 3 insertions(+), 10 deletions(-)

diff --git a/drivers/scsi/fcoe/fcoeinit.c b/drivers/scsi/fcoe/fcoeinit.c
index 86680b8..90fed37 100644
--- a/drivers/scsi/fcoe/fcoeinit.c
+++ b/drivers/scsi/fcoe/fcoeinit.c
@@ -78,7 +78,6 @@ struct fc_function_template fcoe_transport_function = {
 	.show_rport_maxframe_size = 1,
 	.show_rport_supported_classes = 1,
 
-	.get_host_fabric_name = fc_get_host_fabric_name,
 	.show_host_fabric_name = 1,
 	.show_starget_node_name = 1,
 	.show_starget_port_name = 1,
diff --git a/drivers/scsi/libfc/fc_attr.c b/drivers/scsi/libfc/fc_attr.c
index 6539e41..0a99f83 100644
--- a/drivers/scsi/libfc/fc_attr.c
+++ b/drivers/scsi/libfc/fc_attr.c
@@ -42,14 +42,6 @@ void fc_get_host_port_type(struct Scsi_Host *shost)
 }
 EXPORT_SYMBOL(fc_get_host_port_type);
 
-void fc_get_host_fabric_name(struct Scsi_Host *shost)
-{
-	struct fc_lport *lp = shost_priv(shost);
-
-	fc_host_fabric_name(shost) = lp->wwnn;
-}
-EXPORT_SYMBOL(fc_get_host_fabric_name);
-
 void fc_set_rport_loss_tmo(struct fc_rport *rport, u32 timeout)
 {
 	if (timeout)
diff --git a/drivers/scsi/libfc/fc_lport.c b/drivers/scsi/libfc/fc_lport.c
index 0ffdc67..1a77604 100644
--- a/drivers/scsi/libfc/fc_lport.c
+++ b/drivers/scsi/libfc/fc_lport.c
@@ -676,6 +676,7 @@ int fc_lport_enter_reset(struct fc_lport *lp)
 	fc_lport_state_enter(lp, LPORT_ST_RESET);
 	lp->tt.exch_mgr_reset(lp->emp, 0, 0);
 	fc_lport_set_fid(lp, 0);
+	fc_host_fabric_name(lp->host) = 0;
 	if ((lp->link_status & FC_LINK_UP) == FC_LINK_UP)
 		fc_lport_enter_flogi(lp);
 	return 0;
@@ -831,6 +832,8 @@ fc_lport_flogi_resp(struct fc_seq *sp, struct fc_frame *fp, void *lp_arg)
 			} else {
 				lp->e_d_tov = e_d_tov;
 				lp->r_a_tov = r_a_tov;
+				fc_host_fabric_name(lp->host) =
+					get_unaligned_be64(&flp->fl_wwnn);
 				lp->tt.dns_register(lp);
 			}
 		}
diff --git a/include/scsi/libfc/libfc.h b/include/scsi/libfc/libfc.h
index 1eb5b8d..604d012 100644
--- a/include/scsi/libfc/libfc.h
+++ b/include/scsi/libfc/libfc.h
@@ -744,7 +744,6 @@ void fc_seq_set_rec_data(struct fc_seq *sp, u32 rec_data);
 void fc_get_host_port_id(struct Scsi_Host *shost);
 void fc_get_host_speed(struct Scsi_Host *shost);
 void fc_get_host_port_type(struct Scsi_Host *shost);
-void fc_get_host_fabric_name(struct Scsi_Host *shost);
 void fc_set_rport_loss_tmo(struct fc_rport *rport, u32 timeout);
 struct fc_host_statistics *fc_get_host_stats(struct Scsi_Host *);
 




More information about the devel mailing list