Remove OLDCARD shims

This commit is contained in:
Warner Losh 2005-09-21 22:45:14 +00:00
parent 209161a4f6
commit 7132e1b9ae
3 changed files with 22 additions and 67 deletions

View File

@ -22,6 +22,7 @@ __FBSDID("$FreeBSD$");
/*
* CardBus front-end for the Ralink RT2500 driver.
* XXX this is actually a PC Card front end. Maybe?
*/
#include <sys/param.h>
@ -68,22 +69,16 @@ static const struct pccard_product ral_pccard_products[] = {
{ NULL }
};
static int ral_pccard_match(device_t);
static int ral_pccard_probe(device_t);
static int ral_pccard_attach(device_t);
static device_method_t ral_pccard_methods[] = {
/* Device interface */
DEVMETHOD(device_probe, pccard_compat_probe),
DEVMETHOD(device_attach, pccard_compat_attach),
DEVMETHOD(device_probe, ral_pccard_probe),
DEVMETHOD(device_attach, ral_pccard_attach),
DEVMETHOD(device_detach, ral_detach),
DEVMETHOD(device_shutdown, ral_shutdown),
/* Card interface */
DEVMETHOD(card_compat_match, ral_pccard_match),
DEVMETHOD(card_compat_probe, ral_pccard_probe),
DEVMETHOD(card_compat_attach, ral_pccard_attach),
{ 0, 0 }
};
@ -96,7 +91,7 @@ static driver_t ral_pccard_driver = {
DRIVER_MODULE(ral, pccard, ral_pccard_driver, ral_devclass, 0, 0);
static int
ral_pccard_match(device_t dev)
ral_pccard_probe(device_t dev)
{
const struct pccard_product *pp;
@ -109,20 +104,6 @@ ral_pccard_match(device_t dev)
return ENXIO;
}
static int
ral_pccard_probe(device_t dev)
{
int error;
error = ral_alloc(dev, 0);
if (error != 0)
return error;
ral_free(dev);
return 0;
}
static int
ral_pccard_attach(device_t dev)
{

View File

@ -74,10 +74,10 @@ static const struct pccard_product stg_products[] = {
};
/*
* Additional code for FreeBSD new-bus PCCard frontend
* Additional code for FreeBSD new-bus PC Card frontend
*/
static int stg_pccard_match(device_t dev)
static int
stg_pccard_probe(device_t dev)
{
const struct pccard_product *pp;
@ -91,7 +91,7 @@ static int stg_pccard_match(device_t dev)
}
static int
stg_pccard_probe(DEVPORT_PDEVICE dev)
stg_pccard_attach(device_t dev)
{
struct stg_softc *sc = device_get_softc(dev);
int error;
@ -107,25 +107,6 @@ stg_pccard_probe(DEVPORT_PDEVICE dev)
stg_release_resource(dev);
return(ENXIO);
}
stg_release_resource(dev);
return(0);
}
static int
stg_pccard_attach(DEVPORT_PDEVICE dev)
{
struct stg_softc *sc = device_get_softc(dev);
int error;
sc->port_rid = 0;
sc->irq_rid = 0;
error = stg_alloc_resource(dev);
if (error) {
return(error);
}
error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_CAM | INTR_ENTROPY,
stg_intr, (void *)sc, &sc->stg_intrhand);
if (error) {
@ -143,15 +124,9 @@ stg_pccard_attach(DEVPORT_PDEVICE dev)
static device_method_t stg_pccard_methods[] = {
/* Device interface */
DEVMETHOD(device_probe, pccard_compat_probe),
DEVMETHOD(device_attach, pccard_compat_attach),
DEVMETHOD(device_probe, stg_pccard_probe),
DEVMETHOD(device_attach, stg_pccard_attach),
DEVMETHOD(device_detach, stg_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 }
};

View File

@ -43,20 +43,15 @@ __FBSDID("$FreeBSD$");
#include "pccarddevs.h"
static int uart_pccard_match(device_t self);
static int uart_pccard_probe(device_t dev);
static int uart_pccard_attach(device_t dev);
static device_method_t uart_pccard_methods[] = {
/* Device interface */
DEVMETHOD(device_probe, pccard_compat_probe),
DEVMETHOD(device_attach, pccard_compat_attach),
DEVMETHOD(device_probe, uart_pccard_probe),
DEVMETHOD(device_attach, uart_pccard_attach),
DEVMETHOD(device_detach, uart_bus_detach),
/* Card interface */
DEVMETHOD(card_compat_match, uart_pccard_match),
DEVMETHOD(card_compat_probe, uart_pccard_probe),
DEVMETHOD(card_compat_attach, uart_bus_attach),
{ 0, 0 }
};
@ -67,7 +62,7 @@ static driver_t uart_pccard_driver = {
};
static int
uart_pccard_match(device_t dev)
uart_pccard_probe(device_t dev)
{
int error = 0;
u_int32_t fcn = PCCARD_FUNCTION_UNSPEC;
@ -83,20 +78,24 @@ uart_pccard_match(device_t dev)
if (fcn == PCCARD_FUNCTION_SERIAL)
return (-100);
return(ENXIO);
return (ENXIO);
}
static int
uart_pccard_probe(dev)
device_t dev;
uart_pccard_attach(device_t dev)
{
struct uart_softc *sc;
int err;
sc = device_get_softc(dev);
sc->sc_class = &uart_ns8250_class;
/* Do not probe IRQ - pccard doesn't turn on the interrupt line */
/* until bus_setup_intr but how can I do so?*/
return (uart_bus_probe(dev, 0, 0, 0, 0));
err = uart_bus_probe(dev, 0, 0, 0, 0);
if (err)
return (err);
return (uart_bus_attach(dev));
}
DRIVER_MODULE(uart, pccard, uart_pccard_driver, uart_devclass, 0, 0);