diff --git a/sys/dev/mii/ip1000phy.c b/sys/dev/mii/ip1000phy.c index 500156b1161c..8e81d810b90c 100644 --- a/sys/dev/mii/ip1000phy.c +++ b/sys/dev/mii/ip1000phy.c @@ -391,18 +391,24 @@ ip1000phy_status(struct mii_softc *sc) } static int -ip1000phy_mii_phy_auto(struct mii_softc *mii) +ip1000phy_mii_phy_auto(struct mii_softc *sc) { + struct ip1000phy_softc *isc; uint32_t reg; - PHY_WRITE(mii, IP1000PHY_MII_ANAR, - IP1000PHY_ANAR_10T | IP1000PHY_ANAR_10T_FDX | + isc = (struct ip1000phy_softc *)sc; + reg = 0; + if (isc->model == MII_MODEL_ICPLUS_IP1001) + reg = PHY_READ(sc, IP1000PHY_MII_ANAR); + reg |= IP1000PHY_ANAR_10T | IP1000PHY_ANAR_10T_FDX | IP1000PHY_ANAR_100TX | IP1000PHY_ANAR_100TX_FDX | - IP1000PHY_ANAR_PAUSE | IP1000PHY_ANAR_APAUSE); + IP1000PHY_ANAR_PAUSE | IP1000PHY_ANAR_APAUSE; + PHY_WRITE(sc, IP1000PHY_MII_ANAR, reg | IP1000PHY_ANAR_CSMA); + reg = IP1000PHY_1000CR_1000T | IP1000PHY_1000CR_1000T_FDX; reg |= IP1000PHY_1000CR_MASTER; - PHY_WRITE(mii, IP1000PHY_MII_1000CR, reg); - PHY_WRITE(mii, IP1000PHY_MII_BMCR, (IP1000PHY_BMCR_FDX | + PHY_WRITE(sc, IP1000PHY_MII_1000CR, reg); + PHY_WRITE(sc, IP1000PHY_MII_BMCR, (IP1000PHY_BMCR_FDX | IP1000PHY_BMCR_AUTOEN | IP1000PHY_BMCR_STARTNEG)); return (EJUSTRETURN); diff --git a/sys/dev/mii/ip1000phyreg.h b/sys/dev/mii/ip1000phyreg.h index f69ab012cb0d..27add4fe516c 100644 --- a/sys/dev/mii/ip1000phyreg.h +++ b/sys/dev/mii/ip1000phyreg.h @@ -61,6 +61,7 @@ /* Autonegotiation advertisement register */ #define IP1000PHY_MII_ANAR 0x04 +#define IP1000PHY_ANAR_CSMA 0x0001 #define IP1000PHY_ANAR_10T 0x0020 #define IP1000PHY_ANAR_10T_FDX 0x0040 #define IP1000PHY_ANAR_100TX 0x0080