From 2ca37b5a4f09092eb0626d56af67b399b9136cbf Mon Sep 17 00:00:00 2001 From: Peter Wemm Date: Wed, 17 Jan 2001 12:31:59 +0000 Subject: [PATCH] Add NEWCARD hooks. This seems to work just fine. --- sys/dev/wi/if_wi.c | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/sys/dev/wi/if_wi.c b/sys/dev/wi/if_wi.c index 76f7d4c6dc4..70330f1798a 100644 --- a/sys/dev/wi/if_wi.c +++ b/sys/dev/wi/if_wi.c @@ -100,9 +100,14 @@ #include +#include +#include + #include #include +#include "card_if.h" + #if !defined(lint) static const char rcsid[] = "$FreeBSD$"; @@ -143,6 +148,7 @@ void wi_cache_store __P((struct wi_softc *, struct ether_header *, struct mbuf *, unsigned short)); #endif +static int wi_pccard_match __P((device_t)); static int wi_pccard_probe __P((device_t)); static int wi_pccard_attach __P((device_t)); static int wi_pccard_detach __P((device_t)); @@ -153,11 +159,16 @@ static void wi_free __P((device_t)); static device_method_t wi_pccard_methods[] = { /* Device interface */ - DEVMETHOD(device_probe, wi_pccard_probe), - DEVMETHOD(device_attach, wi_pccard_attach), + DEVMETHOD(device_probe, pccard_compat_probe), + DEVMETHOD(device_attach, pccard_compat_attach), DEVMETHOD(device_detach, wi_pccard_detach), DEVMETHOD(device_shutdown, wi_shutdown), + /* Card interface */ + DEVMETHOD(card_compat_match, wi_pccard_match), + DEVMETHOD(card_compat_probe, wi_pccard_probe), + DEVMETHOD(card_compat_attach, wi_pccard_attach), + { 0, 0 } }; @@ -171,6 +182,25 @@ static devclass_t wi_pccard_devclass; DRIVER_MODULE(if_wi, pccard, wi_pccard_driver, wi_pccard_devclass, 0, 0); +static const struct pccard_product wi_pccard_products[] = { + { PCCARD_STR_LUCENT_WAVELAN_IEEE, PCCARD_VENDOR_LUCENT, + PCCARD_PRODUCT_LUCENT_WAVELAN_IEEE, 0, NULL, NULL }, + { NULL } +}; + +static int wi_pccard_match(dev) + device_t dev; +{ + const struct pccard_product *pp; + + if ((pp = pccard_product_lookup(dev, wi_pccard_products, + sizeof(wi_pccard_products[0]), NULL)) != NULL) { + device_set_desc(dev, pp->pp_name); + return 0; + } + return ENXIO; +} + static int wi_pccard_probe(dev) device_t dev; {