summaryrefslogtreecommitdiffstats
path: root/sys/dev/re
diff options
context:
space:
mode:
authorwpaul <wpaul@FreeBSD.org>2003-09-11 03:53:46 +0000
committerwpaul <wpaul@FreeBSD.org>2003-09-11 03:53:46 +0000
commit99df7d00b68527fa99cdc340c3f0dfb64c52cbb8 (patch)
treec608e05afba48f38cfd6da674b83b964485513c4 /sys/dev/re
parent507c61e2567c01f86e8bea87a37b173318779fb4 (diff)
downloadFreeBSD-src-99df7d00b68527fa99cdc340c3f0dfb64c52cbb8.zip
FreeBSD-src-99df7d00b68527fa99cdc340c3f0dfb64c52cbb8.tar.gz
Add a PHY driver to support the built-in gigE PHY in the 8169S/8110S
ethernet chips. This driver is pretty simple, however it contains special DSP initialization code which is needed in order to get the chip to negotiate a gigE link. (This special initialization may not be needed in subsequent chip revs.) Also: - Fix typo in if_rlreg.h (RL_GMEDIASTAT_1000MPS -> RL_GMEDIASTAT_1000MBPS) - Deal with shared interrupts in re_intr(): if interface isn't up, return. - Fix another bug in re_gmii_writereg() (properly apply data field mask) - Allow PHY driver to read the RL_GMEDIASTAT register via the re_gmii_readreg() register (this is register needed to determine real time link/media status).
Diffstat (limited to 'sys/dev/re')
-rw-r--r--sys/dev/re/if_re.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/sys/dev/re/if_re.c b/sys/dev/re/if_re.c
index cdf30ed..af763eb 100644
--- a/sys/dev/re/if_re.c
+++ b/sys/dev/re/if_re.c
@@ -393,6 +393,13 @@ re_gmii_readreg(dev, phy, reg)
sc = device_get_softc(dev);
+ /* Let the rgephy driver read the GMEDIASTAT register */
+
+ if (reg == RL_GMEDIASTAT) {
+ rval = CSR_READ_1(sc, RL_GMEDIASTAT);
+ return(rval);
+ }
+
CSR_WRITE_4(sc, RL_PHYAR, reg << 16);
DELAY(1000);
@@ -423,7 +430,7 @@ re_gmii_writereg(dev, phy, reg, data)
sc = device_get_softc(dev);
CSR_WRITE_4(sc, RL_PHYAR, (reg << 16) |
- (data | RL_PHYAR_PHYDATA) | RL_PHYAR_BUSY);
+ (data & RL_PHYAR_PHYDATA) | RL_PHYAR_BUSY);
DELAY(1000);
for (i = 0; i < RL_TIMEOUT; i++) {
@@ -1148,6 +1155,7 @@ re_attach(dev)
/* Reset the adapter. */
re_reset(sc);
+ CSR_WRITE_1(sc, RL_EECMD, RL_EEMODE_PROGRAM);
sc->rl_eecmd_read = RL_EECMD_READ_6BIT;
re_read_eeprom(sc, (caddr_t)&re_did, 0, 1, 0);
if (re_did != 0x8129)
@@ -1162,6 +1170,8 @@ re_attach(dev)
eaddr[(i * 2) + 1] = as[i] >> 8;
}
+ CSR_WRITE_1(sc, RL_EECMD, RL_EEMODE_OFF);
+
/*
* A RealTek chip was detected. Inform the world.
*/
@@ -1780,6 +1790,11 @@ re_intr(arg)
RL_LOCK(sc);
ifp = &sc->arpcom.ac_if;
+ if (!(ifp->if_flags & IFF_UP)) {
+ RL_UNLOCK(sc);
+ return;
+ }
+
#ifdef DEVICE_POLLING
if (ifp->if_flags & IFF_POLLING)
goto done;
OpenPOWER on IntegriCloud