changeset 9844:1a350b338662

6833563 PortState does not represent current FCA link state in fct
author allan <Allan.Ou@Sun.COM>
date Thu, 11 Jun 2009 17:01:03 +0800
parents e1f475c3a5f6
children 0d705da26956
files usr/src/uts/common/io/comstar/port/fct/fct.c
diffstat 1 files changed, 5 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/uts/common/io/comstar/port/fct/fct.c	Thu Jun 11 11:54:59 2009 +0530
+++ b/usr/src/uts/common/io/comstar/port/fct/fct.c	Thu Jun 11 17:01:03 2009 +0800
@@ -430,16 +430,11 @@
 	    sizeof (port_attr->PortWWN));
 	bzero(port_attr->FabricName, sizeof (port_attr->FabricName));
 	port_attr->PortFcId = iport->iport_link_info.portid;
-	switch (iport->iport_state) {
-		case FCT_STATE_ONLINE:
-			port_attr->PortState = FC_HBA_PORTSTATE_ONLINE;
-			break;
-		case FCT_STATE_OFFLINE:
-			port_attr->PortState = FC_HBA_PORTSTATE_OFFLINE;
-			break;
-		default:
-			port_attr->PortState = FC_HBA_PORTSTATE_UNKNOWN;
-			break;
+	if ((iport->iport_link_state & S_LINK_ONLINE) ||
+	    (iport->iport_link_state & S_RCVD_LINK_UP)) {
+		port_attr->PortState = FC_HBA_PORTSTATE_ONLINE;
+	} else {
+		port_attr->PortState = FC_HBA_PORTSTATE_OFFLINE;
 	}
 	switch (iport->iport_link_info.port_topology) {
 		case PORT_TOPOLOGY_PT_TO_PT: