add newcard support to ex
This commit is contained in:
parent
4b6b090588
commit
ffb788f3a2
@ -49,17 +49,29 @@ __FBSDID("$FreeBSD$");
|
||||
#include <dev/ex/if_exvar.h>
|
||||
|
||||
#include <dev/pccard/pccardvar.h>
|
||||
#include <dev/pccard/pccarddevs.h>
|
||||
|
||||
static const struct pccard_product ex_pccard_products[] = {
|
||||
PCMCIA_CARD(OLICOM, OC2220, 0),
|
||||
{ NULL }
|
||||
};
|
||||
|
||||
/* Bus Front End Functions */
|
||||
static int ex_pccard_match (device_t);
|
||||
static int ex_pccard_probe (device_t);
|
||||
static int ex_pccard_attach (device_t);
|
||||
|
||||
static device_method_t ex_pccard_methods[] = {
|
||||
/* Device interface */
|
||||
DEVMETHOD(device_probe, ex_pccard_probe),
|
||||
DEVMETHOD(device_attach, ex_pccard_attach),
|
||||
DEVMETHOD(device_probe, pccard_compat_probe),
|
||||
DEVMETHOD(device_attach, pccard_compat_attach),
|
||||
DEVMETHOD(device_detach, ex_detach),
|
||||
|
||||
/* Card interface */
|
||||
DEVMETHOD(card_compat_match, ex_pccard_match),
|
||||
DEVMETHOD(card_compat_probe, ex_pccard_probe),
|
||||
DEVMETHOD(card_compat_attach, ex_pccard_attach),
|
||||
|
||||
{ 0, 0 }
|
||||
};
|
||||
|
||||
@ -71,6 +83,20 @@ static driver_t ex_pccard_driver = {
|
||||
|
||||
DRIVER_MODULE(ex, pccard, ex_pccard_driver, ex_devclass, 0, 0);
|
||||
|
||||
static int
|
||||
ex_pccard_match(device_t dev)
|
||||
{
|
||||
const struct pccard_product *pp;
|
||||
|
||||
if ((pp = pccard_product_lookup(dev, ex_pccard_products,
|
||||
sizeof(ex_pccard_products[0]), NULL)) != NULL) {
|
||||
if (pp->pp_name != NULL)
|
||||
device_set_desc(dev, pp->pp_name);
|
||||
return 0;
|
||||
}
|
||||
return EIO;
|
||||
}
|
||||
|
||||
static int
|
||||
ex_pccard_probe(device_t dev)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user