1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-11-26 07:55:01 +00:00

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
This commit is contained in:
Navdeep Parhar 2010-03-09 19:57:44 +00:00
parent 24081291d2
commit cd5c70b2ba
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=204921
2 changed files with 14 additions and 2 deletions

View File

@ -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;

View File

@ -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;