make BGE_FAKE_AUTONEG a tunable.
This allows one to change the behavior of the driver pre-boot. NOTE: This patch was made for DragonFly BSD by Sepherosa Ziehau. PR: kern/94833 Submitted by: Devon H. O'Dell Obtained from: DragonFly MFC after: 1 month
This commit is contained in:
parent
6ff7518a85
commit
c4529f4161
@ -640,9 +640,6 @@ ED_SIC opt_ed.h
|
|||||||
# bce driver
|
# bce driver
|
||||||
BCE_DEBUG opt_bce.h
|
BCE_DEBUG opt_bce.h
|
||||||
|
|
||||||
# bge driver
|
|
||||||
BGE_FAKE_AUTONEG opt_bge.h
|
|
||||||
|
|
||||||
# wi driver
|
# wi driver
|
||||||
WI_SYMBOL_FIRMWARE opt_wi.h
|
WI_SYMBOL_FIRMWARE opt_wi.h
|
||||||
|
|
||||||
|
@ -306,6 +306,9 @@ static devclass_t bge_devclass;
|
|||||||
DRIVER_MODULE(bge, pci, bge_driver, bge_devclass, 0, 0);
|
DRIVER_MODULE(bge, pci, bge_driver, bge_devclass, 0, 0);
|
||||||
DRIVER_MODULE(miibus, bge, miibus_driver, miibus_devclass, 0, 0);
|
DRIVER_MODULE(miibus, bge, miibus_driver, miibus_devclass, 0, 0);
|
||||||
|
|
||||||
|
static int bge_fake_autoneg = 0;
|
||||||
|
TUNABLE_INT("hw.bge.fake_autoneg", &bge_fake_autoneg);
|
||||||
|
|
||||||
static u_int32_t
|
static u_int32_t
|
||||||
bge_readmem_ind(sc, off)
|
bge_readmem_ind(sc, off)
|
||||||
struct bge_softc *sc;
|
struct bge_softc *sc;
|
||||||
@ -3341,13 +3344,13 @@ bge_ifmedia_upd(ifp)
|
|||||||
return(EINVAL);
|
return(EINVAL);
|
||||||
switch(IFM_SUBTYPE(ifm->ifm_media)) {
|
switch(IFM_SUBTYPE(ifm->ifm_media)) {
|
||||||
case IFM_AUTO:
|
case IFM_AUTO:
|
||||||
#ifndef BGE_FAKE_AUTONEG
|
|
||||||
/*
|
/*
|
||||||
* The BCM5704 ASIC appears to have a special
|
* The BCM5704 ASIC appears to have a special
|
||||||
* mechanism for programming the autoneg
|
* mechanism for programming the autoneg
|
||||||
* advertisement registers in TBI mode.
|
* advertisement registers in TBI mode.
|
||||||
*/
|
*/
|
||||||
if (sc->bge_asicrev == BGE_ASICREV_BCM5704) {
|
if (bge_fake_autoneg == 0 &&
|
||||||
|
sc->bge_asicrev == BGE_ASICREV_BCM5704) {
|
||||||
uint32_t sgdig;
|
uint32_t sgdig;
|
||||||
CSR_WRITE_4(sc, BGE_TX_TBI_AUTONEG, 0);
|
CSR_WRITE_4(sc, BGE_TX_TBI_AUTONEG, 0);
|
||||||
sgdig = CSR_READ_4(sc, BGE_SGDIG_CFG);
|
sgdig = CSR_READ_4(sc, BGE_SGDIG_CFG);
|
||||||
@ -3359,7 +3362,6 @@ bge_ifmedia_upd(ifp)
|
|||||||
DELAY(5);
|
DELAY(5);
|
||||||
CSR_WRITE_4(sc, BGE_SGDIG_CFG, sgdig);
|
CSR_WRITE_4(sc, BGE_SGDIG_CFG, sgdig);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
break;
|
break;
|
||||||
case IFM_1000_SX:
|
case IFM_1000_SX:
|
||||||
if ((ifm->ifm_media & IFM_GMASK) == IFM_FDX) {
|
if ((ifm->ifm_media & IFM_GMASK) == IFM_FDX) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user