diff options
author | Christian Weisgerber <naddy@cvs.openbsd.org> | 2008-11-14 20:49:36 +0000 |
---|---|---|
committer | Christian Weisgerber <naddy@cvs.openbsd.org> | 2008-11-14 20:49:36 +0000 |
commit | ddb591ece60a81e22e93cca2e1d7804da7799288 (patch) | |
tree | cde2cb3e3838e0b439f68683087c49e26c72942a /sys/dev | |
parent | f79fc6e28017b5dfaf824f84d4cc212ba68cb593 (diff) |
Revert the reduction in the delays in the miibus read/write routines,
which broke on-board RTL8111C adapters.
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/ic/re.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/sys/dev/ic/re.c b/sys/dev/ic/re.c index 32fcda48fb2..44aa415e919 100644 --- a/sys/dev/ic/re.c +++ b/sys/dev/ic/re.c @@ -1,4 +1,4 @@ -/* $OpenBSD: re.c,v 1.99 2008/11/09 15:08:25 naddy Exp $ */ +/* $OpenBSD: re.c,v 1.100 2008/11/14 20:49:35 naddy Exp $ */ /* $FreeBSD: if_re.c,v 1.31 2004/09/04 07:54:05 ru Exp $ */ /* * Copyright (c) 1997, 1998-2003 @@ -342,21 +342,23 @@ re_gmii_readreg(struct device *self, int phy, int reg) return (0); /* 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); - for (i = 0; i < RL_PHY_TIMEOUT; i++) { + for (i = 0; i < RL_TIMEOUT; i++) { rval = CSR_READ_4(sc, RL_PHYAR); if (rval & RL_PHYAR_BUSY) break; - DELAY(25); + DELAY(100); } - if (i == RL_PHY_TIMEOUT) { + if (i == RL_TIMEOUT) { printf ("%s: PHY read failed\n", sc->sc_dev.dv_xname); return (0); } @@ -373,15 +375,16 @@ re_gmii_writereg(struct device *dev, int phy, int reg, int data) CSR_WRITE_4(sc, RL_PHYAR, (reg << 16) | (data & RL_PHYAR_PHYDATA) | RL_PHYAR_BUSY); + DELAY(1000); - for (i = 0; i < RL_PHY_TIMEOUT; i++) { + for (i = 0; i < RL_TIMEOUT; i++) { rval = CSR_READ_4(sc, RL_PHYAR); if (!(rval & RL_PHYAR_BUSY)) break; - DELAY(25); + DELAY(100); } - if (i == RL_PHY_TIMEOUT) + if (i == RL_TIMEOUT) printf ("%s: PHY write failed\n", sc->sc_dev.dv_xname); } |