diff options
author | nate <nate@FreeBSD.org> | 1997-10-26 04:54:16 +0000 |
---|---|---|
committer | nate <nate@FreeBSD.org> | 1997-10-26 04:54:16 +0000 |
commit | 2f55d3018bb2f9d1790a2085125effcbad72ad2e (patch) | |
tree | 5bde5383c575d64c76fda2c3aa76c95a74f212e8 /sys/isa | |
parent | c68183d0b8cb8cb595c0fac05b6d989132543595 (diff) | |
download | FreeBSD-src-2f55d3018bb2f9d1790a2085125effcbad72ad2e.zip FreeBSD-src-2f55d3018bb2f9d1790a2085125effcbad72ad2e.tar.gz |
- Functional changes to PCCARD support.
* Kill individual drivers 'suspend' routines, since there's no simple/safe
way to suspend/resume a card w/out going through the complete probe
at initialization time.
* Default to using the apm_pccard_resume sysctl code, which basically
pretends the card was removed, and then re-inserted. Suspend/resume
is now 'emulated' with a fake insert/removal. (Hence we no longer
need the driver-specific suspend routines.)
Diffstat (limited to 'sys/isa')
-rw-r--r-- | sys/isa/sio.c | 56 |
1 files changed, 15 insertions, 41 deletions
diff --git a/sys/isa/sio.c b/sys/isa/sio.c index 9697556..93d147d 100644 --- a/sys/isa/sio.c +++ b/sys/isa/sio.c @@ -474,17 +474,15 @@ SYSCTL_PROC(_machdep, OID_AUTO, conspeed, CTLTYPE_INT | CTLFLAG_RW, /* * PC-Card (PCMCIA) specific code. */ -static int sioinit(struct pccard_devinfo *, int); /* init device */ +static int sioinit(struct pccard_devinfo *); /* init device */ static void siounload(struct pccard_devinfo *); /* Disable driver */ static int card_intr(struct pccard_devinfo *); /* Interrupt handler */ -static void siosuspend(struct pccard_devinfo *); /* Suspend driver */ static struct pccard_device sio_info = { driver_name, sioinit, siounload, card_intr, - siosuspend, 0, /* Attributes - presently unused */ &tty_imask /* Interrupt mask for device */ /* XXX - Should this also include net_imask? */ @@ -492,37 +490,26 @@ static struct pccard_device sio_info = { /* * Initialize the device - called from Slot manager. - * - * If first is set, then check for the device's existence - * before initializing it. Once initialized, the device table may - * be set up. */ int -sioinit(struct pccard_devinfo *devi, int first) +sioinit(struct pccard_devinfo *devi) { + /* validate unit number. */ - if (first) { - if (devi->isahd.id_unit >= (NSIOTOT)) - return(ENODEV); - /* Make sure it isn't already probed. */ - if (com_addr(devi->isahd.id_unit)) - return(EBUSY); - /* - * Probe the device. If a value is returned, the - * device was found at the location. - */ - if (sioprobe(&devi->isahd) == 0) - return(ENXIO); - if (sioattach(&devi->isahd) == 0) - return(ENXIO); - } + if (devi->isahd.id_unit >= (NSIOTOT)) + return(ENODEV); + /* Make sure it isn't already probed. */ + if (com_addr(devi->isahd.id_unit)) + return(EBUSY); /* - * XXX TODO: - * If it was initialized before, the device structure - * should also be initialized. We should - * reset (and possibly restart) the hardware, but - * I am not sure of the best way to do this... + * Probe the device. If a value is returned, the + * device was found at the location. */ + if (sioprobe(&devi->isahd) == 0) + return(ENXIO); + if (sioattach(&devi->isahd) == 0) + return(ENXIO); + return(0); } @@ -575,19 +562,6 @@ card_intr(struct pccard_devinfo *devi) COM_UNLOCK(); return(1); } - -/* - * Called when a power down is requested. Shuts down the - * device and configures the device as unavailable (but - * still loaded...). A resume is done by calling - * sioinit with first=0. This is called when the user suspends - * the system, or the APM code suspends the system. - */ -static void -siosuspend(struct pccard_devinfo *devi) -{ - printf("sio%d: suspending\n", devi->isahd.id_unit); -} #endif /* NCARD > 0 */ static int |