summaryrefslogtreecommitdiffstats
path: root/sys/dev/mii/e1000phy.c
diff options
context:
space:
mode:
authormarius <marius@FreeBSD.org>2011-01-14 19:16:59 +0000
committermarius <marius@FreeBSD.org>2011-01-14 19:16:59 +0000
commit0ea473c75dcd3a00de2311af816135520b29f4c9 (patch)
tree04e903f2fd32165c7109491a57fd5d0b3a679eff /sys/dev/mii/e1000phy.c
parentb92da6d9e230dcfd668f375fdb6ea6d66d69a1da (diff)
downloadFreeBSD-src-0ea473c75dcd3a00de2311af816135520b29f4c9.zip
FreeBSD-src-0ea473c75dcd3a00de2311af816135520b29f4c9.tar.gz
- Masking IFM_GMASK when also masking IFM_FDX is redundant and just
complicates the code. - Don't let atphy_setmedia() announce PAUSE support for half-duplex when MIIF_FORCEPAUSE is set. - Simplify e1000phy_service() and ip1000phy_service() to only set the manual configuration bits once after we have figured them all out. For ip1000phy_service() this also means we no longer unnecessarily update the hardware along the road. MFC after: 1 week
Diffstat (limited to 'sys/dev/mii/e1000phy.c')
-rw-r--r--sys/dev/mii/e1000phy.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/mii/e1000phy.c b/sys/dev/mii/e1000phy.c
index 45fd4d0..bd54a11 100644
--- a/sys/dev/mii/e1000phy.c
+++ b/sys/dev/mii/e1000phy.c
@@ -358,7 +358,7 @@ e1000phy_service(struct mii_softc *sc, struct mii_data *mii, int cmd)
return (EINVAL);
}
- if (((ife->ifm_media & IFM_GMASK) & IFM_FDX) != 0) {
+ if ((ife->ifm_media & IFM_FDX) != 0) {
speed |= E1000_CR_FULL_DUPLEX;
gig = E1000_1GCR_1000T_FD;
} else
@@ -372,10 +372,10 @@ e1000phy_service(struct mii_softc *sc, struct mii_data *mii, int cmd)
gig |= E1000_1GCR_MS_ENABLE;
if ((ife->ifm_media & IFM_ETH_MASTER) != 0)
gig |= E1000_1GCR_MS_VALUE;
- PHY_WRITE(sc, E1000_1GCR, gig);
} else if ((sc->mii_extcapabilities &
(EXTSR_1000TFDX | EXTSR_1000THDX)) != 0)
- PHY_WRITE(sc, E1000_1GCR, 0);
+ gig = 0;
+ PHY_WRITE(sc, E1000_1GCR, gig);
PHY_WRITE(sc, E1000_AR, E1000_AR_SELECTOR_FIELD);
PHY_WRITE(sc, E1000_CR, speed | E1000_CR_RESET);
done:
OpenPOWER on IntegriCloud