summaryrefslogtreecommitdiffstats
path: root/sys/dev/sio/sio_pccard.c
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2001-11-26 00:39:33 +0000
committerimp <imp@FreeBSD.org>2001-11-26 00:39:33 +0000
commitc62822dc9fdc77e8a9a8ee9a26b90811be89f26b (patch)
tree7d09d58f32b8ded66478fd96add26170b8b8e9fa /sys/dev/sio/sio_pccard.c
parentdb87601b0e5b25e1c588971b3a467cdb8a0bfe9a (diff)
downloadFreeBSD-src-c62822dc9fdc77e8a9a8ee9a26b90811be89f26b.zip
FreeBSD-src-c62822dc9fdc77e8a9a8ee9a26b90811be89f26b.tar.gz
First part of patches to make sio grok 16-bit serial cards under
NEWCARD. Other patches may be reqiured to sio to prevent a hang on eject. Also add commented out entries for sio_pccard.c in files.pc98 to match other architectures. Submitted by: yamamoto shigeru-san
Diffstat (limited to 'sys/dev/sio/sio_pccard.c')
-rw-r--r--sys/dev/sio/sio_pccard.c32
1 files changed, 30 insertions, 2 deletions
diff --git a/sys/dev/sio/sio_pccard.c b/sys/dev/sio/sio_pccard.c
index 3d15498..c25709d 100644
--- a/sys/dev/sio/sio_pccard.c
+++ b/sys/dev/sio/sio_pccard.c
@@ -40,18 +40,28 @@
#include <machine/resource.h>
#include <sys/timepps.h>
+#include <dev/pccard/pccardreg.h>
+#include <dev/pccard/pccardvar.h>
+#include <dev/pccard/pccarddevs.h>
+
#include <dev/sio/siovar.h>
static int sio_pccard_attach __P((device_t dev));
static int sio_pccard_detach __P((device_t dev));
+static int sio_pccard_match __P((device_t self));
static int sio_pccard_probe __P((device_t dev));
static device_method_t sio_pccard_methods[] = {
/* Device interface */
- DEVMETHOD(device_probe, sio_pccard_probe),
- DEVMETHOD(device_attach, sio_pccard_attach),
+ DEVMETHOD(device_probe, pccard_compat_probe),
+ DEVMETHOD(device_attach, pccard_compat_attach),
DEVMETHOD(device_detach, sio_pccard_detach),
+ /* Card interface */
+ DEVMETHOD(card_compat_match, sio_pccard_match),
+ DEVMETHOD(card_compat_probe, sio_pccard_probe),
+ DEVMETHOD(card_compat_attach, sio_pccard_attach),
+
{ 0, 0 }
};
@@ -62,6 +72,24 @@ static driver_t sio_pccard_driver = {
};
static int
+sio_pccard_match(device_t dev)
+{
+ int error = 0;
+ u_int32_t fcn = PCCARD_FUNCTION_UNSPEC;
+
+ error = pccard_get_function(dev, &fcn);
+ if (error != 0)
+ return (error);
+ /*
+ * If a serial card, we are likely the right driver.
+ */
+ if (fcn == PCCARD_FUNCTION_SERIAL)
+ return (0);
+
+ return(ENXIO);
+}
+
+static int
sio_pccard_probe(dev)
device_t dev;
{
OpenPOWER on IntegriCloud