From c3af029613d4175c3e9a8200b58cddf41e3d984d Mon Sep 17 00:00:00 2001 From: imp Date: Thu, 28 Sep 2000 07:35:06 +0000 Subject: Implement sn_pccard_match. The match routines are the compromise matching methods so that we can run the same driver on both NEWCARD and OLDCARD. Also set the device description to the card that we found, if any. The sn driver should be ready when the NEWCARD catches up. There's a config activation issue as well as a kernel thread issue to resolve first. --- sys/dev/sn/if_sn_pccard.c | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) (limited to 'sys/dev/sn') diff --git a/sys/dev/sn/if_sn_pccard.c b/sys/dev/sn/if_sn_pccard.c index 4ab09b3..61a3000 100644 --- a/sys/dev/sn/if_sn_pccard.c +++ b/sys/dev/sn/if_sn_pccard.c @@ -56,17 +56,36 @@ #include "card_if.h" -/* - * Initialize the device - called from Slot manager. - */ +const struct pccard_product sn_pccard_products[] = { + { PCCARD_STR_MEGAHERTZ2_XJACK, PCCARD_VENDOR_MEGAHERTZ2, + PCCARD_PRODUCT_MEGAHERTZ2_XJACK, 0, NULL, NULL }, + { PCCARD_STR_NEWMEDIA_BASICS, PCCARD_VENDOR_NEWMEDIA, + PCCARD_PRODUCT_NEWMEDIA_BASICS, 0, NULL, NULL }, +#if 0 + { PCCARD_STR_SMC_8020BT, PCCARD_VENDOR_SMC, + PCCARD_PRODUCT_SMC_8020BT, 0, NULL, NULL}, +#endif + { NULL } +}; +static int +sn_pccard_match(device_t dev) +{ + const struct pccard_product *pp; + + if ((pp = pccard_product_lookup(dev, sn_pccard_products, + sizeof(sn_pccard_products[0]), NULL)) != NULL) { + device_set_desc(dev, pp->pp_name); + return 0; + } + return EIO; +} + static int sn_pccard_probe(device_t dev) { int err; - printf ("Probing sn driver\n"); err = sn_probe(dev, 1); - printf("sn_probe says %d\n", err); return (err); } @@ -100,12 +119,6 @@ sn_pccard_detach(device_t dev) return 0; } -static int -sn_pccard_match(device_t dev) -{ - return EIO; -} - static device_method_t sn_pccard_methods[] = { /* Device interface */ DEVMETHOD(device_probe, pccard_compat_probe), -- cgit v1.1