From 3e4be4cbf1e9abadf7dc564d43b70e37fb05ec8a Mon Sep 17 00:00:00 2001 From: Noriaki Mitsunaga Date: Thu, 28 Nov 2002 01:15:01 +0000 Subject: o Changes to support NEWCARD. o Add needed headers. o Add stg_products[] product data and stg_match() function. o Change stg_pccard_method[] to support both OLDCARD and NEWCARD. Approved by: re --- sys/dev/stg/tmc18c30_pccard.c | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) (limited to 'sys/dev') diff --git a/sys/dev/stg/tmc18c30_pccard.c b/sys/dev/stg/tmc18c30_pccard.c index 51fbd13d42c56..4b98b1f232755 100644 --- a/sys/dev/stg/tmc18c30_pccard.c +++ b/sys/dev/stg/tmc18c30_pccard.c @@ -50,6 +50,9 @@ #include +#include +#include + #include #include @@ -71,6 +74,15 @@ static int stgattach(DEVPORT_PDEVICE devi); static void stg_card_unload (DEVPORT_PDEVICE); +static const struct pccard_product stg_products[] = { + PCMCIA_CARD(FUTUREDOMAIN, SCSI2GO, 0), + PCMCIA_CARD(IBM, SCSICARD, 0), + PCMCIA_CARD(RATOC, REX5536, 0), + PCMCIA_CARD(RATOC, REX5536AM, 0), + PCMCIA_CARD(RATOC, REX5536M, 0), + { NULL } +}; + /* * Additional code for FreeBSD new-bus PCCard frontend */ @@ -155,6 +167,18 @@ stg_alloc_resource(DEVPORT_PDEVICE dev) return(0); } +static int stg_pccard_match(device_t dev) +{ + const struct pccard_product *pp; + + if ((pp = pccard_product_lookup(dev, stg_products, + sizeof(stg_products[0]), NULL)) != NULL) { + device_set_desc(dev, pp->pp_name); + return(0); + } + return(EIO); +} + static int stg_pccard_probe(DEVPORT_PDEVICE dev) { @@ -213,10 +237,15 @@ stg_pccard_detach(DEVPORT_PDEVICE dev) static device_method_t stg_pccard_methods[] = { /* Device interface */ - DEVMETHOD(device_probe, stg_pccard_probe), - DEVMETHOD(device_attach, stg_pccard_attach), + DEVMETHOD(device_probe, pccard_compat_probe), + DEVMETHOD(device_attach, pccard_compat_attach), DEVMETHOD(device_detach, stg_pccard_detach), + /* Card interface */ + DEVMETHOD(card_compat_match, stg_pccard_match), + DEVMETHOD(card_compat_probe, stg_pccard_probe), + DEVMETHOD(card_compat_attach, stg_pccard_attach), + { 0, 0 } }; -- cgit v1.3