From f1a7e6d559de3d7f8b8e406b6054597c77301a22 Mon Sep 17 00:00:00 2001 From: Scott Long Date: Sat, 23 Sep 2006 18:55:49 +0000 Subject: [PATCH] Allow the ASF feature to be disabled via a tunable. On one of my systems, bringing up the bge interface results in a complete system freeze when this feature is enabled. Leave it enabled by default. --- sys/dev/bge/if_bge.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/sys/dev/bge/if_bge.c b/sys/dev/bge/if_bge.c index 06b15652cbfb..ae98e07c03c9 100644 --- a/sys/dev/bge/if_bge.c +++ b/sys/dev/bge/if_bge.c @@ -79,6 +79,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -419,7 +420,16 @@ 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"); static uint32_t bge_readmem_ind(struct bge_softc *sc, int off) @@ -2179,8 +2189,8 @@ bge_attach(device_t dev) } sc->bge_asf_mode = 0; - if (bge_readmem_ind(sc, BGE_SOFTWARE_GENCOMM_SIG) - == BGE_MAGIC_NUMBER) { + if (bge_allow_asf && (bge_readmem_ind(sc, BGE_SOFTWARE_GENCOMM_SIG) + == BGE_MAGIC_NUMBER)) { if (bge_readmem_ind(sc, BGE_SOFTWARE_GENCOMM_NICCFG) & BGE_HWCFG_ASF) { sc->bge_asf_mode |= ASF_ENABLE;