diff options
author | Marius Strobl <marius@FreeBSD.org> | 2011-11-18 21:23:13 +0000 |
---|---|---|
committer | Marius Strobl <marius@FreeBSD.org> | 2011-11-18 21:23:13 +0000 |
commit | bab10b961ffccc0ade52b5a7a1e4d920b6464e5d (patch) | |
tree | be8feddf7141782eeac3b3e5ff534a5682f7c1c1 /sys/dev | |
parent | 166e31d988b6f5a5383018797d03ef4ab1820c13 (diff) | |
download | src-bab10b961ffccc0ade52b5a7a1e4d920b6464e5d.tar.gz src-bab10b961ffccc0ade52b5a7a1e4d920b6464e5d.zip |
There's no need to read DC_10BTSTAT twice in dcphy_status().
Notes
Notes:
svn path=/head/; revision=227686
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/dc/dcphy.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/sys/dev/dc/dcphy.c b/sys/dev/dc/dcphy.c index 5c60ad55f545..ab449937b641 100644 --- a/sys/dev/dc/dcphy.c +++ b/sys/dev/dc/dcphy.c @@ -294,7 +294,7 @@ static void dcphy_status(struct mii_softc *sc) { struct mii_data *mii = sc->mii_pdata; - int reg, anlpar, tstat = 0; + int anlpar, tstat; struct dc_softc *dc_sc; dc_sc = mii->mii_ifp->if_softc; @@ -305,13 +305,12 @@ dcphy_status(struct mii_softc *sc) if ((mii->mii_ifp->if_flags & IFF_UP) == 0) return; - reg = CSR_READ_4(dc_sc, DC_10BTSTAT); - if (!(reg & DC_TSTAT_LS10) || !(reg & DC_TSTAT_LS100)) + tstat = CSR_READ_4(dc_sc, DC_10BTSTAT); + if (!(tstat & DC_TSTAT_LS10) || !(tstat & DC_TSTAT_LS100)) mii->mii_media_status |= IFM_ACTIVE; if (CSR_READ_4(dc_sc, DC_10BTCTRL) & DC_TCTL_AUTONEGENBL) { /* Erg, still trying, I guess... */ - tstat = CSR_READ_4(dc_sc, DC_10BTSTAT); if ((tstat & DC_TSTAT_ANEGSTAT) != DC_ASTAT_AUTONEGCMP) { if ((DC_IS_MACRONIX(dc_sc) || DC_IS_PNICII(dc_sc)) && (tstat & DC_TSTAT_ANEGSTAT) == DC_ASTAT_DISABLE) @@ -351,9 +350,9 @@ dcphy_status(struct mii_softc *sc) * and hope that the user is clever enough to manually * change the media settings if we're wrong. */ - if (!(reg & DC_TSTAT_LS100)) + if (!(tstat & DC_TSTAT_LS100)) mii->mii_media_active |= IFM_100_TX | IFM_HDX; - else if (!(reg & DC_TSTAT_LS10)) + else if (!(tstat & DC_TSTAT_LS10)) mii->mii_media_active |= IFM_10_T | IFM_HDX; else mii->mii_media_active |= IFM_NONE; |