summaryrefslogtreecommitdiffstats
path: root/sys/dev/ep/if_ep_pccard.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/dev/ep/if_ep_pccard.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/dev/ep/if_ep_pccard.c')
-rw-r--r--sys/dev/ep/if_ep_pccard.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/sys/dev/ep/if_ep_pccard.c b/sys/dev/ep/if_ep_pccard.c
index 6b39711..d27d5fd 100644
--- a/sys/dev/ep/if_ep_pccard.c
+++ b/sys/dev/ep/if_ep_pccard.c
@@ -58,6 +58,9 @@
#include <dev/ep/if_epreg.h>
#include <dev/ep/if_epvar.h>
+#include "card_if.h"
+#include <dev/pccard/pccardvar.h>
+
static const char *ep_pccard_identify(u_short id);
/*
@@ -238,12 +241,23 @@ ep_pccard_detach(device_t dev)
return (0);
}
+static int
+ep_pccard_match(device_t dev)
+{
+ return EIO;
+}
+
static device_method_t ep_pccard_methods[] = {
/* Device interface */
- DEVMETHOD(device_probe, ep_pccard_probe),
- DEVMETHOD(device_attach, ep_pccard_attach),
+ DEVMETHOD(device_probe, pccard_compat_probe),
+ DEVMETHOD(device_attach, pccard_compat_attach),
DEVMETHOD(device_detach, ep_pccard_detach),
+ /* Card interface */
+ DEVMETHOD(card_compat_match, ep_pccard_match),
+ DEVMETHOD(card_compat_probe, ep_pccard_probe),
+ DEVMETHOD(card_compat_attach, ep_pccard_attach),
+
{ 0, 0 }
};
OpenPOWER on IntegriCloud