summaryrefslogtreecommitdiffstats
path: root/sys/dev/bge
diff options
context:
space:
mode:
authorjkim <jkim@FreeBSD.org>2007-05-22 19:35:34 +0000
committerjkim <jkim@FreeBSD.org>2007-05-22 19:35:34 +0000
commit5a606c95866d0fe69e683900bb94939c6cb335d3 (patch)
tree0804a067d4ff94fe8483bb18649633edc2a76839 /sys/dev/bge
parent33d961a28a01f69a9136ec9b1b941e3aa65b8a83 (diff)
downloadFreeBSD-src-5a606c95866d0fe69e683900bb94939c6cb335d3.zip
FreeBSD-src-5a606c95866d0fe69e683900bb94939c6cb335d3.tar.gz
Remove BCM5704S specific tunable (hw.bge.fake_autoneg) and
auto-detect the condition.
Diffstat (limited to 'sys/dev/bge')
-rw-r--r--sys/dev/bge/if_bge.c28
1 files changed, 13 insertions, 15 deletions
diff --git a/sys/dev/bge/if_bge.c b/sys/dev/bge/if_bge.c
index 7215bcb..75daad7 100644
--- a/sys/dev/bge/if_bge.c
+++ b/sys/dev/bge/if_bge.c
@@ -424,15 +424,11 @@ static devclass_t bge_devclass;
DRIVER_MODULE(bge, pci, bge_driver, bge_devclass, 0, 0);
DRIVER_MODULE(miibus, bge, miibus_driver, miibus_devclass, 0, 0);
-static int bge_fake_autoneg = 0;
static int bge_allow_asf = 1;
-TUNABLE_INT("hw.bge.fake_autoneg", &bge_fake_autoneg);
TUNABLE_INT("hw.bge.allow_asf", &bge_allow_asf);
SYSCTL_NODE(_hw, OID_AUTO, bge, CTLFLAG_RD, 0, "BGE driver parameters");
-SYSCTL_INT(_hw_bge, OID_AUTO, fake_autoneg, CTLFLAG_RD, &bge_fake_autoneg, 0,
- "Enable fake autonegotiation for certain blade systems");
SYSCTL_INT(_hw_bge, OID_AUTO, allow_asf, CTLFLAG_RD, &bge_allow_asf, 0,
"Allow ASF mode if available");
@@ -3724,18 +3720,20 @@ bge_ifmedia_upd_locked(struct ifnet *ifp)
* mechanism for programming the autoneg
* advertisement registers in TBI mode.
*/
- if (bge_fake_autoneg == 0 &&
- sc->bge_asicrev == BGE_ASICREV_BCM5704) {
+ if (sc->bge_asicrev == BGE_ASICREV_BCM5704) {
uint32_t sgdig;
- CSR_WRITE_4(sc, BGE_TX_TBI_AUTONEG, 0);
- sgdig = CSR_READ_4(sc, BGE_SGDIG_CFG);
- sgdig |= BGE_SGDIGCFG_AUTO |
- BGE_SGDIGCFG_PAUSE_CAP |
- BGE_SGDIGCFG_ASYM_PAUSE;
- CSR_WRITE_4(sc, BGE_SGDIG_CFG,
- sgdig | BGE_SGDIGCFG_SEND);
- DELAY(5);
- CSR_WRITE_4(sc, BGE_SGDIG_CFG, sgdig);
+ sgdig = CSR_READ_4(sc, BGE_SGDIG_STS);
+ if (sgdig & BGE_SGDIGSTS_DONE) {
+ CSR_WRITE_4(sc, BGE_TX_TBI_AUTONEG, 0);
+ sgdig = CSR_READ_4(sc, BGE_SGDIG_CFG);
+ sgdig |= BGE_SGDIGCFG_AUTO |
+ BGE_SGDIGCFG_PAUSE_CAP |
+ BGE_SGDIGCFG_ASYM_PAUSE;
+ CSR_WRITE_4(sc, BGE_SGDIG_CFG,
+ sgdig | BGE_SGDIGCFG_SEND);
+ DELAY(5);
+ CSR_WRITE_4(sc, BGE_SGDIG_CFG, sgdig);
+ }
}
break;
case IFM_1000_SX:
OpenPOWER on IntegriCloud