summaryrefslogtreecommitdiffstats
path: root/sys/pccard/pccard_nbk.c
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2000-09-19 04:39:20 +0000
committerimp <imp@FreeBSD.org>2000-09-19 04:39:20 +0000
commit222e32bc4941211d514ad22676414f71c1360b50 (patch)
tree0f24f269148f98c6cc905cfdaff28f51b9f78ecf /sys/pccard/pccard_nbk.c
parent2186ce0d36ca105027459f0241b56f0740595d42 (diff)
downloadFreeBSD-src-222e32bc4941211d514ad22676414f71c1360b50.zip
FreeBSD-src-222e32bc4941211d514ad22676414f71c1360b50.tar.gz
Implement indirection in the pccard probe/attach. This should make it
possible to have different probe/attach semantics between the two systems and yet still use the same driver for both. Compatibility methods for OLDCARD drivers. We use these routines to make it possible to call the OLDCARD driver's probe routine in the context that it expects. For OLDCARD these are implemented as pass throughs to the device_{probe,attach} routines. For NEWCARD they are implemented such such that probe becomes strictly a matching routine and attach does both the old probe and old attach. compat devices should use the following: /* Device interface */ DEVMETHOD(device_probe), pccard_compat_probe), DEVMETHOD(device_attach), pccard_compat_attach), /* Card interface */ DEVMETHOD(card_compat_match, foo_match), /* newly written */ DEVMETHOD(card_compat_probe, foo_probe), /* old probe */ DEVMETHOD(card_compat_attach, foo_attach), /* old attach */ This will allow a single driver binary image to be used for both OLDCARD and NEWCARD. Drivers wishing to not retain OLDCARD compatibility needn't do this. ep driver minorly updated. sn driver updated more than minorly. Add module dependencies to allow module to load. Also change name to if_sn. Add some debugging code. attempt to fix the cannot allocate memory problem I'd been seeing. Minor formatting nits.
Diffstat (limited to 'sys/pccard/pccard_nbk.c')
-rw-r--r--sys/pccard/pccard_nbk.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/sys/pccard/pccard_nbk.c b/sys/pccard/pccard_nbk.c
index 37e9557..5d86e9b 100644
--- a/sys/pccard/pccard_nbk.c
+++ b/sys/pccard/pccard_nbk.c
@@ -81,6 +81,21 @@ devclass_t pccard_devclass;
#define PCCARD_DEVINFO(d) (struct pccard_devinfo *) device_get_ivars(d)
+/*
+ * glue for NEWCARD/OLDCARD compat layer
+ */
+int
+pccard_compat_probe(device_t dev)
+{
+ return (CARD_COMPAT_PROBE(dev));
+}
+
+int
+pccard_compat_attach(device_t dev)
+{
+ return (CARD_COMPAT_ATTACH(dev));
+}
+
static int
pccard_probe(device_t dev)
{
@@ -371,3 +386,4 @@ static driver_t pccard_driver = {
DRIVER_MODULE(pccard, pcic, pccard_driver, pccard_devclass, 0, 0);
DRIVER_MODULE(pccard, pc98pcic, pccard_driver, pccard_devclass, 0, 0);
DRIVER_MODULE(pccard, cbb, pccard_driver, pccard_devclass, 0, 0);
+MODULE_VERSION(pccard, 1);
OpenPOWER on IntegriCloud