diff options
author | dim <dim@FreeBSD.org> | 2010-11-16 10:33:41 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2010-11-16 10:33:41 +0000 |
commit | b0df1c137c1d7cc6c086e8c3de63b91a97e180c7 (patch) | |
tree | 56f0dadc92981a1efbf66b53a434baa21a8c2c82 /sys/dev/xl | |
parent | b355314642d1e24edf4e05d08b793f8b9ea76458 (diff) | |
download | FreeBSD-src-b0df1c137c1d7cc6c086e8c3de63b91a97e180c7.zip FreeBSD-src-b0df1c137c1d7cc6c086e8c3de63b91a97e180c7.tar.gz |
Sync: merge r215319 through r215395 from ^/head, so ports can actually
build! :)
Diffstat (limited to 'sys/dev/xl')
-rw-r--r-- | sys/dev/xl/if_xl.c | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/sys/dev/xl/if_xl.c b/sys/dev/xl/if_xl.c index d99109f..ad54d79 100644 --- a/sys/dev/xl/if_xl.c +++ b/sys/dev/xl/if_xl.c @@ -555,6 +555,7 @@ xl_miibus_statchg(device_t dev) { struct xl_softc *sc; struct mii_data *mii; + uint8_t macctl; sc = device_get_softc(dev); mii = device_get_softc(sc->xl_miibus); @@ -563,11 +564,22 @@ xl_miibus_statchg(device_t dev) /* Set ASIC's duplex mode to match the PHY. */ XL_SEL_WIN(3); - if ((mii->mii_media_active & IFM_GMASK) == IFM_FDX) - CSR_WRITE_1(sc, XL_W3_MAC_CTRL, XL_MACCTRL_DUPLEX); - else - CSR_WRITE_1(sc, XL_W3_MAC_CTRL, - (CSR_READ_1(sc, XL_W3_MAC_CTRL) & ~XL_MACCTRL_DUPLEX)); + macctl = CSR_READ_1(sc, XL_W3_MAC_CTRL); + if ((IFM_OPTIONS(mii->mii_media_active) & IFM_FDX) != 0) { + macctl |= XL_MACCTRL_DUPLEX; + if (sc->xl_type == XL_TYPE_905B) { + if ((IFM_OPTIONS(mii->mii_media_active) & + IFM_ETH_RXPAUSE) != 0) + macctl |= XL_MACCTRL_FLOW_CONTROL_ENB; + else + macctl &= ~XL_MACCTRL_FLOW_CONTROL_ENB; + } + } else { + macctl &= ~XL_MACCTRL_DUPLEX; + if (sc->xl_type == XL_TYPE_905B) + macctl &= ~XL_MACCTRL_FLOW_CONTROL_ENB; + } + CSR_WRITE_1(sc, XL_W3_MAC_CTRL, macctl); } /* @@ -1464,7 +1476,8 @@ xl_attach(device_t dev) if ((sc->xl_flags & XL_FLAG_PHYOK) == 0) phy = 24; error = mii_attach(dev, &sc->xl_miibus, ifp, xl_ifmedia_upd, - xl_ifmedia_sts, BMSR_DEFCAPMASK, phy, MII_OFFSET_ANY, 0); + xl_ifmedia_sts, BMSR_DEFCAPMASK, phy, MII_OFFSET_ANY, + sc->xl_type == XL_TYPE_905B ? MIIF_DOPAUSE : 0); if (error != 0) { device_printf(dev, "attaching PHYs failed\n"); goto fail; |