Make this compile when there is no pci bus in your kernel.
Note: This should be multiple files, but since it is also broken in stable, I thought I'd do a fix that could be MFC'd. This is a MFC candidate.
This commit is contained in:
parent
4bcbade869
commit
47e83d86d1
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=82453
@ -66,6 +66,8 @@
|
||||
#define WI_HERMES_STATS_WAR /* Work around stats counter bug. */
|
||||
#define WICACHE /* turn on signal strength cache code */
|
||||
|
||||
#include "pci.h"
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/sockio.h>
|
||||
@ -83,8 +85,10 @@
|
||||
#include <machine/bus_pio.h>
|
||||
#include <sys/rman.h>
|
||||
|
||||
#if NPCI > 0
|
||||
#include <pci/pcireg.h>
|
||||
#include <pci/pcivar.h>
|
||||
#endif
|
||||
|
||||
#include <net/if.h>
|
||||
#include <net/if_arp.h>
|
||||
@ -153,9 +157,11 @@ void wi_cache_store __P((struct wi_softc *, struct ether_header *,
|
||||
static int wi_generic_attach __P((device_t));
|
||||
static int wi_pccard_match __P((device_t));
|
||||
static int wi_pccard_probe __P((device_t));
|
||||
static int wi_pci_probe __P((device_t));
|
||||
static int wi_pccard_attach __P((device_t));
|
||||
#if NPCI > 0
|
||||
static int wi_pci_probe __P((device_t));
|
||||
static int wi_pci_attach __P((device_t));
|
||||
#endif
|
||||
static int wi_pccard_detach __P((device_t));
|
||||
static void wi_shutdown __P((device_t));
|
||||
|
||||
@ -181,6 +187,7 @@ static device_method_t wi_pccard_methods[] = {
|
||||
{ 0, 0 }
|
||||
};
|
||||
|
||||
#if NPCI > 0
|
||||
static device_method_t wi_pci_methods[] = {
|
||||
/* Device interface */
|
||||
DEVMETHOD(device_probe, wi_pci_probe),
|
||||
@ -190,6 +197,7 @@ static device_method_t wi_pci_methods[] = {
|
||||
|
||||
{ 0, 0 }
|
||||
};
|
||||
#endif
|
||||
|
||||
static driver_t wi_pccard_driver = {
|
||||
"wi",
|
||||
@ -197,6 +205,7 @@ static driver_t wi_pccard_driver = {
|
||||
sizeof(struct wi_softc)
|
||||
};
|
||||
|
||||
#if NPCI > 0
|
||||
static driver_t wi_pci_driver = {
|
||||
"wi",
|
||||
wi_pci_methods,
|
||||
@ -211,12 +220,14 @@ static struct {
|
||||
{0x1385, 0x4100, "Netgear MA301 PCI IEEE 802.11b"},
|
||||
{0, 0, NULL}
|
||||
};
|
||||
#endif
|
||||
|
||||
static devclass_t wi_pccard_devclass;
|
||||
static devclass_t wi_pci_devclass;
|
||||
static devclass_t wi_devclass;
|
||||
|
||||
DRIVER_MODULE(if_wi, pccard, wi_pccard_driver, wi_pccard_devclass, 0, 0);
|
||||
DRIVER_MODULE(if_wi, pci, wi_pci_driver, wi_pci_devclass, 0, 0);
|
||||
DRIVER_MODULE(if_wi, pccard, wi_pccard_driver, wi_devclass, 0, 0);
|
||||
#if NPCI > 0
|
||||
DRIVER_MODULE(if_wi, pci, wi_pci_driver, wi_devclass, 0, 0);
|
||||
#endif
|
||||
|
||||
static const struct pccard_product wi_pccard_products[] = {
|
||||
{ PCCARD_STR_LUCENT_WAVELAN_IEEE, PCCARD_VENDOR_LUCENT,
|
||||
@ -259,6 +270,7 @@ static int wi_pccard_probe(dev)
|
||||
return (0);
|
||||
}
|
||||
|
||||
#if NPCI > 0
|
||||
static int
|
||||
wi_pci_probe(dev)
|
||||
device_t dev;
|
||||
@ -277,6 +289,7 @@ wi_pci_probe(dev)
|
||||
}
|
||||
return(ENXIO);
|
||||
}
|
||||
#endif
|
||||
|
||||
static int wi_pccard_detach(dev)
|
||||
device_t dev;
|
||||
@ -349,6 +362,7 @@ static int wi_pccard_attach(device_t dev)
|
||||
return (wi_generic_attach(dev));
|
||||
}
|
||||
|
||||
#if NPCI > 0
|
||||
static int
|
||||
wi_pci_attach(device_t dev)
|
||||
{
|
||||
@ -427,6 +441,7 @@ wi_pci_attach(device_t dev)
|
||||
|
||||
return (0);
|
||||
}
|
||||
#endif
|
||||
|
||||
static int
|
||||
wi_generic_attach(device_t dev)
|
||||
|
Loading…
Reference in New Issue
Block a user