Read MII_ANAR register and get common denominator ability.

PR:	92599
This commit is contained in:
Pyun YongHyeon 2007-11-16 10:32:10 +00:00
parent d612cc5947
commit 55da31830a

View File

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