diff options
author | imp <imp@FreeBSD.org> | 2001-08-28 05:26:43 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2001-08-28 05:26:43 +0000 |
commit | 195632091780242ff1282881cb97c08a172748bc (patch) | |
tree | d9fe8f83739494bbe77f1b136a177b5669884078 /sys/dev/wi/if_wi.c | |
parent | 0306411838d552f5771dda6c2c2cfefd43ef7b04 (diff) | |
download | FreeBSD-src-195632091780242ff1282881cb97c08a172748bc.zip FreeBSD-src-195632091780242ff1282881cb97c08a172748bc.tar.gz |
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.
Diffstat (limited to 'sys/dev/wi/if_wi.c')
-rw-r--r-- | sys/dev/wi/if_wi.c | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/sys/dev/wi/if_wi.c b/sys/dev/wi/if_wi.c index 93183e1..cf9114d 100644 --- a/sys/dev/wi/if_wi.c +++ b/sys/dev/wi/if_wi.c @@ -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) |