summaryrefslogtreecommitdiffstats
path: root/sys/dev/sn
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2000-09-28 07:35:06 +0000
committerimp <imp@FreeBSD.org>2000-09-28 07:35:06 +0000
commitc3af029613d4175c3e9a8200b58cddf41e3d984d (patch)
treeea49f1e179eb54f5bc5d378e539502931fefa612 /sys/dev/sn
parente0110bc62acbda910da7d522e182f7ff828e27af (diff)
downloadFreeBSD-src-c3af029613d4175c3e9a8200b58cddf41e3d984d.zip
FreeBSD-src-c3af029613d4175c3e9a8200b58cddf41e3d984d.tar.gz
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.
Diffstat (limited to 'sys/dev/sn')
-rw-r--r--sys/dev/sn/if_sn_pccard.c35
1 files changed, 24 insertions, 11 deletions
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),
OpenPOWER on IntegriCloud