summaryrefslogtreecommitdiffstats
path: root/sys/dev/stg
diff options
context:
space:
mode:
authornon <non@FreeBSD.org>2002-11-28 01:15:01 +0000
committernon <non@FreeBSD.org>2002-11-28 01:15:01 +0000
commitca5ddd8b39105e0a1a48515b109cebb4c7b735a6 (patch)
tree3102e8e623f8d7eefd60b46a9dd5126ed954a276 /sys/dev/stg
parent3768f72e83c73cee8f2773fea1c23be1e0b370d7 (diff)
downloadFreeBSD-src-ca5ddd8b39105e0a1a48515b109cebb4c7b735a6.zip
FreeBSD-src-ca5ddd8b39105e0a1a48515b109cebb4c7b735a6.tar.gz
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
Diffstat (limited to 'sys/dev/stg')
-rw-r--r--sys/dev/stg/tmc18c30_pccard.c33
1 files changed, 31 insertions, 2 deletions
diff --git a/sys/dev/stg/tmc18c30_pccard.c b/sys/dev/stg/tmc18c30_pccard.c
index 51fbd13..4b98b1f 100644
--- a/sys/dev/stg/tmc18c30_pccard.c
+++ b/sys/dev/stg/tmc18c30_pccard.c
@@ -50,6 +50,9 @@
#include <sys/device_port.h>
+#include <dev/pccard/pccarddevs.h>
+#include <dev/pccard/pccardvar.h>
+
#include <cam/scsi/scsi_low.h>
#include <cam/scsi/scsi_low_pisa.h>
@@ -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 }
};
OpenPOWER on IntegriCloud