From bdbd54e46d5bba56f2892143ae952e848dbc4988 Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Mon, 8 Jan 2001 01:59:15 +0000 Subject: [PATCH] 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. --- sys/conf/files | 1 + sys/dev/aic/aic_pccard.c | 49 +++++++++++++++++++++++++++++++++++----- sys/modules/aic/Makefile | 2 +- 3 files changed, 45 insertions(+), 7 deletions(-) diff --git a/sys/conf/files b/sys/conf/files index 076bbd3b082b..e4192311fe92 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 947afe7ad75b..104a86df30ee 100644 --- a/sys/dev/aic/aic_pccard.c +++ b/sys/dev/aic/aic_pccard.c @@ -37,6 +37,10 @@ #include #include +#include +#include + +#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 @@ -92,6 +110,19 @@ aic_pccard_release_resources(device_t dev) sc->sc_port = sc->sc_irq = 0; } +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) { @@ -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 e0fb1adcf1de..5a42be82cbe4 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"