Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/bwn/if_bwn_pci.c
Show First 20 Lines • Show All 48 Lines • ▼ Show 20 Lines | |||||
#include "bhndb_bus_if.h" | #include "bhndb_bus_if.h" | ||||
#include "if_bwn_pcivar.h" | #include "if_bwn_pcivar.h" | ||||
/* If non-zero, enable attachment of BWN_QUIRK_UNTESTED devices */ | /* If non-zero, enable attachment of BWN_QUIRK_UNTESTED devices */ | ||||
static int attach_untested = 0; | static int attach_untested = 0; | ||||
TUNABLE_INT("hw.bwn_pci.attach_untested", &attach_untested); | TUNABLE_INT("hw.bwn_pci.attach_untested", &attach_untested); | ||||
/* If non-zero, probe at a higher priority than the stable if_bwn driver. */ | |||||
static int prefer_new_driver = 1; | |||||
TUNABLE_INT("hw.bwn_pci.preferred", &prefer_new_driver); | |||||
/* SIBA Devices */ | /* SIBA Devices */ | ||||
static const struct bwn_pci_device siba_devices[] = { | static const struct bwn_pci_device siba_devices[] = { | ||||
BWN_BCM_DEV(BCM4306_D11A, "BCM4306 802.11a", | BWN_BCM_DEV(BCM4306_D11A, "BCM4306 802.11a", | ||||
BWN_QUIRK_WLAN_DUALCORE|BWN_QUIRK_SOFTMODEM_UNPOPULATED), | BWN_QUIRK_WLAN_DUALCORE|BWN_QUIRK_SOFTMODEM_UNPOPULATED), | ||||
BWN_BCM_DEV(BCM4306_D11G, "BCM4306 802.11b/g", | BWN_BCM_DEV(BCM4306_D11G, "BCM4306 802.11b/g", | ||||
BWN_QUIRK_SOFTMODEM_UNPOPULATED), | BWN_QUIRK_SOFTMODEM_UNPOPULATED), | ||||
BWN_BCM_DEV(BCM4306_D11G_ID2, "BCM4306 802.11b/g", | BWN_BCM_DEV(BCM4306_D11G_ID2, "BCM4306 802.11b/g", | ||||
BWN_QUIRK_SOFTMODEM_UNPOPULATED), | BWN_QUIRK_SOFTMODEM_UNPOPULATED), | ||||
▲ Show 20 Lines • Show All 95 Lines • ▼ Show 20 Lines | bwn_pci_probe(device_t dev) | ||||
if (bwn_pci_find_devcfg(dev, NULL, &ident)) | if (bwn_pci_find_devcfg(dev, NULL, &ident)) | ||||
return (ENXIO); | return (ENXIO); | ||||
/* Skip untested devices */ | /* Skip untested devices */ | ||||
if (ident->quirks & BWN_QUIRK_UNTESTED && !attach_untested) | if (ident->quirks & BWN_QUIRK_UNTESTED && !attach_untested) | ||||
return (ENXIO); | return (ENXIO); | ||||
device_set_desc(dev, ident->desc); | device_set_desc(dev, ident->desc); | ||||
return (BUS_PROBE_DEFAULT); | |||||
/* Until this driver is complete, require explicit opt-in before | |||||
* superceding if_bwn/siba_bwn. */ | |||||
if (prefer_new_driver) | |||||
return (BUS_PROBE_DEFAULT+1); | |||||
else | |||||
return (BUS_PROBE_LOW_PRIORITY); | |||||
// return (BUS_PROBE_DEFAULT); | |||||
} | } | ||||
static int | static int | ||||
bwn_pci_attach(device_t dev) | bwn_pci_attach(device_t dev) | ||||
{ | { | ||||
struct bwn_pci_softc *sc; | struct bwn_pci_softc *sc; | ||||
const struct bwn_pci_device *ident; | const struct bwn_pci_device *ident; | ||||
int error; | int error; | ||||
▲ Show 20 Lines • Show All 115 Lines • ▼ Show 20 Lines | |||||
static devclass_t bwn_pci_devclass; | static devclass_t bwn_pci_devclass; | ||||
DEFINE_CLASS_0(bwn_pci, bwn_pci_driver, bwn_pci_methods, | DEFINE_CLASS_0(bwn_pci, bwn_pci_driver, bwn_pci_methods, | ||||
sizeof(struct bwn_pci_softc)); | sizeof(struct bwn_pci_softc)); | ||||
DRIVER_MODULE_ORDERED(bwn_pci, pci, bwn_pci_driver, bwn_pci_devclass, NULL, | DRIVER_MODULE_ORDERED(bwn_pci, pci, bwn_pci_driver, bwn_pci_devclass, NULL, | ||||
NULL, SI_ORDER_ANY); | NULL, SI_ORDER_ANY); | ||||
DRIVER_MODULE(bhndb, bwn_pci, bhndb_pci_driver, bhndb_devclass, NULL, NULL); | DRIVER_MODULE(bhndb, bwn_pci, bhndb_pci_driver, bhndb_devclass, NULL, NULL); | ||||
MODULE_DEPEND(bwn_pci, bwn, 1, 1, 1); | |||||
MODULE_DEPEND(bwn_pci, bhnd, 1, 1, 1); | MODULE_DEPEND(bwn_pci, bhnd, 1, 1, 1); | ||||
MODULE_DEPEND(bwn_pci, bhndb, 1, 1, 1); | MODULE_DEPEND(bwn_pci, bhndb, 1, 1, 1); | ||||
MODULE_DEPEND(bwn_pci, bhndb_pci, 1, 1, 1); | MODULE_DEPEND(bwn_pci, bhndb_pci, 1, 1, 1); | ||||
MODULE_DEPEND(bwn_pci, bcma_bhndb, 1, 1, 1); | MODULE_DEPEND(bwn_pci, bcma_bhndb, 1, 1, 1); | ||||
MODULE_DEPEND(bwn_pci, siba_bhndb, 1, 1, 1); | MODULE_DEPEND(bwn_pci, siba_bhndb, 1, 1, 1); | ||||
MODULE_VERSION(bwn_pci, 1); | MODULE_VERSION(bwn_pci, 1); |