diff options
author | Jung-uk Kim <jkim@FreeBSD.org> | 2007-05-22 19:35:34 +0000 |
---|---|---|
committer | Jung-uk Kim <jkim@FreeBSD.org> | 2007-05-22 19:35:34 +0000 |
commit | 0f89fde22c68ad34d181069a68aee6da0edbc355 (patch) | |
tree | 0804a067d4ff94fe8483bb18649633edc2a76839 /sys/dev/bge/if_bge.c | |
parent | 186f842beb777b9d8be238e5e3cf07fddf205539 (diff) | |
download | src-0f89fde22c68ad34d181069a68aee6da0edbc355.tar.gz src-0f89fde22c68ad34d181069a68aee6da0edbc355.zip |
Remove BCM5704S specific tunable (hw.bge.fake_autoneg) and
auto-detect the condition.
Notes
Notes:
svn path=/head/; revision=169881
Diffstat (limited to 'sys/dev/bge/if_bge.c')
-rw-r--r-- | sys/dev/bge/if_bge.c | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/sys/dev/bge/if_bge.c b/sys/dev/bge/if_bge.c index 7215bcb7920b..75daad7fbb70 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: |