Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/ipw/if_ipw.c
Show First 20 Lines • Show All 96 Lines • ▼ Show 20 Lines | |||||
MODULE_DEPEND(ipw, firmware, 1, 1, 1); | MODULE_DEPEND(ipw, firmware, 1, 1, 1); | ||||
struct ipw_ident { | struct ipw_ident { | ||||
uint16_t vendor; | uint16_t vendor; | ||||
uint16_t device; | uint16_t device; | ||||
const char *name; | const char *name; | ||||
}; | }; | ||||
static const struct ipw_ident ipw_ident_table[] = { | struct pci_device_table ipw_ident_table[] = { | ||||
{ 0x8086, 0x1043, "Intel(R) PRO/Wireless 2100 MiniPCI" }, | {PCI_DEV(0x8086, 0x1043), | ||||
PCI_DESCR("Intel(R) PRO/Wireless 2100 MiniPCI")} | |||||
{ 0, 0, NULL } | |||||
}; | }; | ||||
static struct ieee80211vap *ipw_vap_create(struct ieee80211com *, | static struct ieee80211vap *ipw_vap_create(struct ieee80211com *, | ||||
const char [IFNAMSIZ], int, enum ieee80211_opmode, int, | const char [IFNAMSIZ], int, enum ieee80211_opmode, int, | ||||
const uint8_t [IEEE80211_ADDR_LEN], | const uint8_t [IEEE80211_ADDR_LEN], | ||||
const uint8_t [IEEE80211_ADDR_LEN]); | const uint8_t [IEEE80211_ADDR_LEN]); | ||||
static void ipw_vap_delete(struct ieee80211vap *); | static void ipw_vap_delete(struct ieee80211vap *); | ||||
static int ipw_dma_alloc(struct ipw_softc *); | static int ipw_dma_alloc(struct ipw_softc *); | ||||
▲ Show 20 Lines • Show All 80 Lines • ▼ Show 20 Lines | static driver_t ipw_driver = { | ||||
"ipw", | "ipw", | ||||
ipw_methods, | ipw_methods, | ||||
sizeof (struct ipw_softc) | sizeof (struct ipw_softc) | ||||
}; | }; | ||||
static devclass_t ipw_devclass; | static devclass_t ipw_devclass; | ||||
DRIVER_MODULE(ipw, pci, ipw_driver, ipw_devclass, NULL, NULL); | DRIVER_MODULE(ipw, pci, ipw_driver, ipw_devclass, NULL, NULL); | ||||
MODULE_PNP_INFO("U16:vendor;U16:device;D:#", pci, ipw, ipw_ident_table, | PCI_PNP_INFO(ipw_ident_table); | ||||
sizeof(ipw_ident_table[0]), nitems(ipw_ident_table) - 1); | |||||
MODULE_VERSION(ipw, 1); | MODULE_VERSION(ipw, 1); | ||||
static int | static int | ||||
ipw_probe(device_t dev) | ipw_probe(device_t dev) | ||||
{ | { | ||||
const struct ipw_ident *ident; | const struct pci_device_table *ident; | ||||
for (ident = ipw_ident_table; ident->name != NULL; ident++) { | ident = PCI_MATCH(dev, ipw_ident_table); | ||||
if (pci_get_vendor(dev) == ident->vendor && | if (ident == NULL) | ||||
pci_get_device(dev) == ident->device) { | return (ENXIO); | ||||
device_set_desc(dev, ident->name); | device_set_desc(dev, ident->descr); | ||||
return (BUS_PROBE_DEFAULT); | return (BUS_PROBE_DEFAULT); | ||||
} | |||||
} | |||||
return ENXIO; | |||||
} | } | ||||
/* Base Address Register */ | /* Base Address Register */ | ||||
static int | static int | ||||
ipw_attach(device_t dev) | ipw_attach(device_t dev) | ||||
{ | { | ||||
struct ipw_softc *sc = device_get_softc(dev); | struct ipw_softc *sc = device_get_softc(dev); | ||||
struct ieee80211com *ic = &sc->sc_ic; | struct ieee80211com *ic = &sc->sc_ic; | ||||
▲ Show 20 Lines • Show All 2,453 Lines • Show Last 20 Lines |