svn commit: r204921 - in head/sys/dev/cxgb: . common

Navdeep Parhar np at FreeBSD.org
Tue Mar 9 19:57:44 UTC 2010


Author: np
Date: Tue Mar  9 19:57:44 2010
New Revision: 204921
URL: http://svn.freebsd.org/changeset/base/204921

Log:
  Better TwinAx transceiver detection.
  
  Originally submitted by: <Bruno dot Bittner at isilon dot com>
  (This is a rewritten, corrected version of that patch)
  
  MFC after:    1 week

Modified:
  head/sys/dev/cxgb/common/cxgb_ael1002.c
  head/sys/dev/cxgb/cxgb_main.c

Modified: head/sys/dev/cxgb/common/cxgb_ael1002.c
==============================================================================
--- head/sys/dev/cxgb/common/cxgb_ael1002.c	Tue Mar  9 19:39:52 2010	(r204920)
+++ head/sys/dev/cxgb/common/cxgb_ael1002.c	Tue Mar  9 19:57:44 2010	(r204921)
@@ -446,7 +446,7 @@ static int ael2xxx_get_module_type(struc
 			return v;
 
 		if (v == 0x1)
-			return phy_modtype_twinax;
+			goto twinax;
 		if (v == 0x10)
 			return phy_modtype_sr;
 		if (v == 0x20)
@@ -454,6 +454,17 @@ static int ael2xxx_get_module_type(struc
 		if (v == 0x40)
 			return phy_modtype_lrm;
 
+		v = ael_i2c_rd(phy, MODULE_DEV_ADDR, 8);
+		if (v < 0)
+			return v;
+		if (v == 4) {
+			v = ael_i2c_rd(phy, MODULE_DEV_ADDR, 60);
+			if (v < 0)
+				return v;
+			if (v & 0x1)
+				goto twinax;
+		}
+
 		v = ael_i2c_rd(phy, MODULE_DEV_ADDR, 6);
 		if (v < 0)
 			return v;
@@ -465,6 +476,7 @@ static int ael2xxx_get_module_type(struc
 			return v;
 
 		if (v & 0x80) {
+twinax:
 			v = ael_i2c_rd(phy, MODULE_DEV_ADDR, 0x12);
 			if (v < 0)
 				return v;

Modified: head/sys/dev/cxgb/cxgb_main.c
==============================================================================
--- head/sys/dev/cxgb/cxgb_main.c	Tue Mar  9 19:39:52 2010	(r204920)
+++ head/sys/dev/cxgb/cxgb_main.c	Tue Mar  9 19:57:44 2010	(r204921)
@@ -1229,7 +1229,7 @@ t3_os_link_changed(adapter_t *adapter, i
 void t3_os_phymod_changed(struct adapter *adap, int port_id)
 {
 	static const char *mod_str[] = {
-		NULL, "SR", "LR", "LRM", "TWINAX", "TWINAX", "unknown"
+		NULL, "SR", "LR", "LRM", "TWINAX", "TWINAX-L", "unknown"
 	};
 	struct port_info *pi = &adap->port[port_id];
 	int mod = pi->phy.modtype;


More information about the svn-src-head mailing list