diff options
author | imp <imp@FreeBSD.org> | 2001-01-08 01:59:15 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2001-01-08 01:59:15 +0000 |
commit | cebce29aeedaf5817383d2fc94f5e099d9d733f8 (patch) | |
tree | edb8527d6a2c4e9744f826b176a8bbb30a07d562 | |
parent | b87b91a453a7baf7ed2f1cd7d84fdc079068e2aa (diff) | |
download | FreeBSD-src-cebce29aeedaf5817383d2fc94f5e099d9d733f8.zip FreeBSD-src-cebce29aeedaf5817383d2fc94f5e099d9d733f8.tar.gz |
Add aic to the list of drivers that might work with NEWCARD. I've added
the same config lines that NetBSD has. This builds with both NEWCARD
and GENERIC config files.
-rw-r--r-- | sys/conf/files | 1 | ||||
-rw-r--r-- | sys/dev/aic/aic_pccard.c | 49 | ||||
-rw-r--r-- | sys/modules/aic/Makefile | 2 |
3 files changed, 45 insertions, 7 deletions
diff --git a/sys/conf/files b/sys/conf/files index 076bbd3..e419231 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -219,6 +219,7 @@ dev/aha/aha_mca.c optional aha mca dev/ahb/ahb.c optional ahb eisa dev/aic/aic.c optional aic dev/aic/aic_pccard.c optional aic card +dev/aic/aic_pccard.c optional aic pccard dev/aic7xxx/aic7770.c optional ahc eisa dev/aic7xxx/ahc_eisa.c optional ahc eisa #dev/aic7xxx/ahc_isa.c optional ahc isa diff --git a/sys/dev/aic/aic_pccard.c b/sys/dev/aic/aic_pccard.c index 947afe7..104a86d 100644 --- a/sys/dev/aic/aic_pccard.c +++ b/sys/dev/aic/aic_pccard.c @@ -37,6 +37,10 @@ #include <sys/rman.h> #include <dev/aic/aicvar.h> +#include <dev/pccard/pccardvar.h> +#include <dev/pccard/pccarddevs.h> + +#include "card_if.h" struct aic_pccard_softc { struct aic_softc sc_aic; @@ -45,10 +49,24 @@ struct aic_pccard_softc { void *sc_ih; }; -static int aic_pccard_alloc_resources __P((device_t)); -static void aic_pccard_release_resources __P((device_t)); -static int aic_pccard_probe __P((device_t)); -static int aic_pccard_attach __P((device_t)); +static int aic_pccard_alloc_resources(device_t); +static void aic_pccard_release_resources(device_t); +static int aic_pccard_match(device_t); +static int aic_pccard_probe(device_t); +static int aic_pccard_attach(device_t); + +const struct pccard_product aic_pccard_products[] = { + { PCCARD_STR_ADAPTEC_APA1460, PCCARD_VENDOR_ADAPTEC, + PCCARD_PRODUCT_ADAPTEC_APA1460, 0, NULL, NULL }, + + { PCCARD_STR_ADAPTEC_APA1460A, PCCARD_VENDOR_ADAPTEC, + PCCARD_PRODUCT_ADAPTEC_APA1460A, 0, NULL, NULL }, + + { PCCARD_STR_NEWMEDIA_BUSTOASTER, PCCARD_VENDOR_NEWMEDIA, + PCCARD_PRODUCT_NEWMEDIA_BUSTOASTER, 0, NULL, NULL }, + + { NULL } +}; #define AIC_PCCARD_PORTSIZE 0x20 @@ -93,6 +111,19 @@ aic_pccard_release_resources(device_t dev) } static int +aic_pccard_match(device_t dev) +{ + const struct pccard_product *pp; + + if ((pp = pccard_product_lookup(dev, aic_pccard_products, + sizeof(aic_pccard_products[0]), NULL)) != NULL) { + device_set_desc(dev, pp->pp_name); + return 0; + } + return EIO; +} + +static int aic_pccard_probe(device_t dev) { struct aic_pccard_softc *sc = device_get_softc(dev); @@ -164,9 +195,15 @@ aic_pccard_detach(device_t dev) static device_method_t aic_pccard_methods[] = { /* Device interface */ - DEVMETHOD(device_probe, aic_pccard_probe), - DEVMETHOD(device_attach, aic_pccard_attach), + DEVMETHOD(device_probe, pccard_compat_probe), + DEVMETHOD(device_attach, pccard_compat_attach), DEVMETHOD(device_detach, aic_pccard_detach), + + /* Card interface */ + DEVMETHOD(card_compat_match, aic_pccard_match), + DEVMETHOD(card_compat_probe, aic_pccard_probe), + DEVMETHOD(card_compat_attach, aic_pccard_attach), + { 0, 0 } }; diff --git a/sys/modules/aic/Makefile b/sys/modules/aic/Makefile index e0fb1ad..5a42be8 100644 --- a/sys/modules/aic/Makefile +++ b/sys/modules/aic/Makefile @@ -4,7 +4,7 @@ KMOD= aic SRCS= aic.c aic_pccard.c -SRCS+= opt_bdg.h device_if.h bus_if.h pci_if.h isa_if.h +SRCS+= opt_bdg.h device_if.h bus_if.h pci_if.h isa_if.h card_if.h SRCS+= opt_cam.h opt_scsi.h .if ${MACHINE} == "pc98" |