summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoryongari <yongari@FreeBSD.org>2007-11-16 10:32:10 +0000
committeryongari <yongari@FreeBSD.org>2007-11-16 10:32:10 +0000
commitf73243cb8c1b9d46b7c9f8610c2016ee76b0b267 (patch)
tree579fcbf6e990029ca24cf4ec5fcb4cb7e161cea8
parent21faca2ee7f073e31d345fd7f2af8494d7060517 (diff)
downloadFreeBSD-src-f73243cb8c1b9d46b7c9f8610c2016ee76b0b267.zip
FreeBSD-src-f73243cb8c1b9d46b7c9f8610c2016ee76b0b267.tar.gz
Read MII_ANAR register and get common denominator ability.
PR: 92599
-rw-r--r--sys/dev/txp/if_txp.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/dev/txp/if_txp.c b/sys/dev/txp/if_txp.c
index 3478970..455c97c 100644
--- a/sys/dev/txp/if_txp.c
+++ b/sys/dev/txp/if_txp.c
@@ -1655,7 +1655,7 @@ txp_ifmedia_sts(ifp, ifmr)
{
struct txp_softc *sc = ifp->if_softc;
struct ifmedia *ifm = &sc->sc_ifmedia;
- u_int16_t bmsr, bmcr, anlpar;
+ u_int16_t bmsr, bmcr, anar, anlpar;
ifmr->ifm_status = IFM_AVALID;
ifmr->ifm_active = IFM_ETHER;
@@ -1675,6 +1675,10 @@ txp_ifmedia_sts(ifp, ifmr)
if (txp_command(sc, TXP_CMD_PHY_MGMT_READ, 0, MII_ANLPAR, 0,
&anlpar, NULL, NULL, 1))
goto bail;
+
+ if (txp_command(sc, TXP_CMD_PHY_MGMT_READ, 0, MII_ANAR, 0,
+ &anar, NULL, NULL, 1))
+ goto bail;
TXP_UNLOCK(sc);
if (bmsr & BMSR_LINK)
@@ -1695,6 +1699,7 @@ txp_ifmedia_sts(ifp, ifmr)
return;
}
+ anlpar &= anar;
if (anlpar & ANLPAR_TX_FD)
ifmr->ifm_active |= IFM_100_TX|IFM_FDX;
else if (anlpar & ANLPAR_T4)
OpenPOWER on IntegriCloud