summaryrefslogtreecommitdiffstats
path: root/sys/dev/cxgb
diff options
context:
space:
mode:
authornp <np@FreeBSD.org>2010-03-09 19:57:44 +0000
committernp <np@FreeBSD.org>2010-03-09 19:57:44 +0000
commit0e0df8873f4a49fc9be37190d3767dd4dafdb40b (patch)
treeb08f0cb01097f121d3e77f3a7140458c7f61683f /sys/dev/cxgb
parentf113de4c54a20fdc00751347fc885af20259101d (diff)
downloadFreeBSD-src-0e0df8873f4a49fc9be37190d3767dd4dafdb40b.zip
FreeBSD-src-0e0df8873f4a49fc9be37190d3767dd4dafdb40b.tar.gz
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
Diffstat (limited to 'sys/dev/cxgb')
-rw-r--r--sys/dev/cxgb/common/cxgb_ael1002.c14
-rw-r--r--sys/dev/cxgb/cxgb_main.c2
2 files changed, 14 insertions, 2 deletions
diff --git a/sys/dev/cxgb/common/cxgb_ael1002.c b/sys/dev/cxgb/common/cxgb_ael1002.c
index ec5ffe7..54120bd 100644
--- a/sys/dev/cxgb/common/cxgb_ael1002.c
+++ b/sys/dev/cxgb/common/cxgb_ael1002.c
@@ -446,7 +446,7 @@ static int ael2xxx_get_module_type(struct cphy *phy, int delay_ms)
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(struct cphy *phy, int delay_ms)
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(struct cphy *phy, int delay_ms)
return v;
if (v & 0x80) {
+twinax:
v = ael_i2c_rd(phy, MODULE_DEV_ADDR, 0x12);
if (v < 0)
return v;
diff --git a/sys/dev/cxgb/cxgb_main.c b/sys/dev/cxgb/cxgb_main.c
index 5493b75d..28160b1 100644
--- a/sys/dev/cxgb/cxgb_main.c
+++ b/sys/dev/cxgb/cxgb_main.c
@@ -1229,7 +1229,7 @@ t3_os_link_changed(adapter_t *adapter, int port_id, int link_status, int speed,
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;
OpenPOWER on IntegriCloud