1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-10-19 02:29:40 +00:00

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
This commit is contained in:
Noriaki Mitsunaga 2002-11-28 01:15:01 +00:00
parent 4a42958a2b
commit 3e4be4cbf1
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=107363

View File

@ -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 }
};