- Don't announce PAUSE support for half-duplex when MIIF_FORCEPAUSE is

set.
- Let mii_phy_auto() also announce PAUSE support for 10baseT-FDX.

MFC after:	1 week
This commit is contained in:
Marius Strobl 2011-01-14 19:33:58 +00:00
parent 87a303dc63
commit 5c39059aaf
2 changed files with 8 additions and 6 deletions

View File

@ -373,10 +373,10 @@ jmphy_setmedia(struct mii_softc *sc, struct ifmedia_entry *ife)
bmcr |= BMCR_LOOP;
anar = jmphy_anar(ife);
if (((IFM_SUBTYPE(ife->ifm_media) == IFM_AUTO ||
if ((IFM_SUBTYPE(ife->ifm_media) == IFM_AUTO ||
(ife->ifm_media & IFM_FDX) != 0) &&
(ife->ifm_media & IFM_FLOW) != 0) ||
(sc->mii_flags & MIIF_FORCEPAUSE) != 0)
((ife->ifm_media & IFM_FLOW) != 0 ||
(sc->mii_flags & MIIF_FORCEPAUSE) != 0))
anar |= ANAR_PAUSE_TOWARDS;
if ((sc->mii_flags & MIIF_HAVE_GTCR) != 0) {

View File

@ -135,8 +135,9 @@ mii_phy_setmedia(struct mii_softc *sc)
gtcr |= GTCR_ADV_MS;
}
if ((ife->ifm_media & IFM_GMASK) == (IFM_FDX | IFM_FLOW) ||
(sc->mii_flags & MIIF_FORCEPAUSE) != 0) {
if ((ife->ifm_media & IFM_FDX) != 0 &&
((ife->ifm_media & IFM_FLOW) != 0 ||
(sc->mii_flags & MIIF_FORCEPAUSE) != 0)) {
if ((sc->mii_flags & MIIF_IS_1000X) != 0)
anar |= ANAR_X_PAUSE_TOWARDS;
else {
@ -184,7 +185,8 @@ mii_phy_auto(struct mii_softc *sc)
ANAR_CSMA;
if ((ife->ifm_media & IFM_FLOW) != 0 ||
(sc->mii_flags & MIIF_FORCEPAUSE) != 0) {
if ((sc->mii_capabilities & BMSR_100TXFDX) != 0)
if ((sc->mii_capabilities &
(BMSR_10TFDX | BMSR_100TXFDX)) != 0)
anar |= ANAR_FC;
/* XXX Only 1000BASE-T has PAUSE_ASYM? */
if (((sc->mii_flags & MIIF_HAVE_GTCR) != 0) &&