diff options
author | sos <sos@FreeBSD.org> | 2002-01-28 13:12:16 +0000 |
---|---|---|
committer | sos <sos@FreeBSD.org> | 2002-01-28 13:12:16 +0000 |
commit | 7b3bdcb03c5a5246c6679bdd84c54b1a90d58822 (patch) | |
tree | d03b0d45e3f9cdfcfc08f775ea68bf42278b192f /sys/dev | |
parent | 446873d787dc614250fc5add721cf63c14848468 (diff) | |
download | FreeBSD-src-7b3bdcb03c5a5246c6679bdd84c54b1a90d58822.zip FreeBSD-src-7b3bdcb03c5a5246c6679bdd84c54b1a90d58822.tar.gz |
Add support for pccard.
submitted by: imp
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/ata/ata-card.c | 33 |
1 files changed, 30 insertions, 3 deletions
diff --git a/sys/dev/ata/ata-card.c b/sys/dev/ata/ata-card.c index d41da4b..f66ee27 100644 --- a/sys/dev/ata/ata-card.c +++ b/sys/dev/ata/ata-card.c @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1998,1999,2000,2001 Søren Schmidt <sos@FreeBSD.org> + * Copyright (c) 1998,1999,2000,2001,2002 Søren Schmidt <sos@FreeBSD.org> * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -43,6 +43,28 @@ #include <machine/bus.h> #include <sys/rman.h> #include <dev/ata/ata-all.h> +#include <dev/pccard/pccardreg.h> +#include <dev/pccard/pccardvar.h> +#include <dev/pccard/pccarddevs.h> + +static int +ata_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 it says its a disk we should register it */ + if (fcn == PCCARD_FUNCTION_DISK) + return (0); + + /* other devices might need to be matched here */ + + return(ENXIO); +} static int ata_pccard_probe(device_t dev) @@ -93,9 +115,14 @@ ata_pccard_probe(device_t dev) static device_method_t ata_pccard_methods[] = { /* device interface */ - DEVMETHOD(device_probe, ata_pccard_probe), - DEVMETHOD(device_attach, ata_attach), + DEVMETHOD(device_probe, pccard_compat_probe), + DEVMETHOD(device_attach, pccard_compat_attach), DEVMETHOD(device_detach, ata_detach), + + /* Card interface */ + DEVMETHOD(card_compat_match, ata_pccard_match), + DEVMETHOD(card_compat_probe, ata_pccard_probe), + DEVMETHOD(card_compat_attach, ata_attach), { 0, 0 } }; |