[Open-FCoE] [PATCH] fcoe: Turn on show_host_maxframe_size and show_host_port_state

Steve Ma steve.ma at intel.com
Mon Sep 8 17:32:38 UTC 2008


Set .show_host_maxframe_size = 1 and set .show_host_port_state = 1 in
struct fc_function_template fcoe_transport_function. Add routine
fc_get_host_port_state for .get_host_port_state.

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

 drivers/scsi/fcoe/fcoeinit.c  |    3 +++
 drivers/scsi/libfc/fc_lport.c |   14 ++++++++++++++
 include/scsi/libfc/libfc.h    |    1 +
 3 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/drivers/scsi/fcoe/fcoeinit.c b/drivers/scsi/fcoe/fcoeinit.c
index ac98159..10301cf 100644
--- a/drivers/scsi/fcoe/fcoeinit.c
+++ b/drivers/scsi/fcoe/fcoeinit.c
@@ -64,6 +64,7 @@ struct fc_function_template fcoe_transport_function = {
 	.show_host_supported_classes = 1,
 	.show_host_supported_fc4s = 1,
 	.show_host_active_fc4s = 1,
+	.show_host_maxframe_size = 1,
 
 	.get_host_port_id = fc_get_host_port_id,
 	.show_host_port_id = 1,
@@ -71,6 +72,8 @@ struct fc_function_template fcoe_transport_function = {
 	.show_host_speed = 1,
 	.get_host_port_type = fc_get_host_port_type,
 	.show_host_port_type = 1,
+	.get_host_port_state = fc_get_host_port_state,
+	.show_host_port_state = 1,
 	.show_host_symbolic_name = 1,
 
 	.dd_fcrport_size = sizeof(struct fc_rport_libfc_priv),
diff --git a/drivers/scsi/libfc/fc_lport.c b/drivers/scsi/libfc/fc_lport.c
index 1cbc2b4..3eb9ae2 100644
--- a/drivers/scsi/libfc/fc_lport.c
+++ b/drivers/scsi/libfc/fc_lport.c
@@ -105,6 +105,20 @@ static void fc_lport_ptp_clear(struct fc_lport *lp)
 }
 
 /*
+ * Routines to support struct fc_function_template
+ */
+void fc_get_host_port_state(struct Scsi_Host *shost)
+{
+	struct fc_lport *lp = shost_priv(shost);
+
+	if ((lp->link_status & FC_LINK_UP) == FC_LINK_UP)
+		fc_host_port_state(shost) = FC_PORTSTATE_ONLINE;
+	else
+		fc_host_port_state(shost) = FC_PORTSTATE_OFFLINE;
+}
+EXPORT_SYMBOL(fc_get_host_port_state);
+
+/*
  * Fill in FLOGI command for request.
  */
 static void
diff --git a/include/scsi/libfc/libfc.h b/include/scsi/libfc/libfc.h
index 104e2a6..b19a721 100644
--- a/include/scsi/libfc/libfc.h
+++ b/include/scsi/libfc/libfc.h
@@ -744,6 +744,7 @@ void fc_attr_init(struct fc_lport *);
 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_port_state(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