summaryrefslogtreecommitdiffstats
path: root/sys/pccard
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>1999-09-06 06:34:44 +0000
committerimp <imp@FreeBSD.org>1999-09-06 06:34:44 +0000
commit807a894190420ad4941c156eafc7668184d007a6 (patch)
treea56fbeba00cca0ef2a99c56b0b848a20724c1064 /sys/pccard
parent918093dd5066208fb1b176a2202effe2eddc7981 (diff)
downloadFreeBSD-src-807a894190420ad4941c156eafc7668184d007a6.zip
FreeBSD-src-807a894190420ad4941c156eafc7668184d007a6.tar.gz
Kludge together support for the old pccard system with newbus. This
will allow newbus based drivers to have pccard attachments. Also start printing out probe messages for pccards stating the resources used and regularize many of the pccard printfs. Reviewed by: Peter Wemm.
Diffstat (limited to 'sys/pccard')
-rw-r--r--sys/pccard/pccard.c72
-rw-r--r--sys/pccard/pccard_nbk.c274
-rw-r--r--sys/pccard/pccard_nbk.h38
-rw-r--r--sys/pccard/pcic.c2
-rw-r--r--sys/pccard/slot.h21
5 files changed, 388 insertions, 19 deletions
diff --git a/sys/pccard/pccard.c b/sys/pccard/pccard.c
index 6497ce4..8f10b99 100644
--- a/sys/pccard/pccard.c
+++ b/sys/pccard/pccard.c
@@ -41,9 +41,14 @@
#include <sys/select.h>
#include <sys/sysctl.h>
#include <sys/conf.h>
+#include <sys/module.h>
#include <sys/uio.h>
#include <sys/poll.h>
#include <sys/interrupt.h>
+#include <sys/bus.h>
+#include <machine/bus.h>
+#include <sys/rman.h>
+#include <machine/resource.h>
#include <i386/isa/isa_device.h>
#include <i386/isa/icu.h>
@@ -58,6 +63,7 @@
#include <pccard/driver.h>
#include <pccard/pcic.h>
#include <pccard/slot.h>
+#include <pccard/pccard_nbk.h>
#include <machine/md_var.h>
@@ -178,9 +184,11 @@ pccard_configure(dummy)
struct pccard_device *drv;
/* This isn't strictly correct, but works because of initialize order */
- printf("Initializing PC-card drivers:");
- for (drv = drivers; drv != NULL; drv = drv->next)
+ printf("pccard: initalizing drivers:");
+ for (drv = drivers; drv != NULL; drv = drv->next) {
+ pccnbk_wrap_old_driver(drv);
printf(" %s", drv->name);
+ }
cdevsw_add(&crd_cdevsw);
printf("\n");
}
@@ -214,7 +222,7 @@ pccard_add_driver(struct pccard_device *drv)
* If already loaded, then reject the driver.
*/
if (find_driver(drv->name)) {
- printf("Driver %s already loaded\n", drv->name);
+ printf("pccard: driver %s already loaded\n", drv->name);
return;
}
drv->next = drivers;
@@ -350,7 +358,6 @@ unregister_device_interrupt(struct pccard_devinfo *devi)
devi->drv->disable(devi);
devi->running = 0;
if (devi->isahd.id_irq && --slt->irqref <= 0) {
- printf("Return IRQ=%d\n",slt->irq);
slt->ctrl->mapirq(slt, 0);
INTRDIS(1<<slt->irq);
unregister_pcic_intr(slt->irq, slot_irq_handler);
@@ -372,8 +379,10 @@ unregister_device_interrupt(struct pccard_devinfo *devi)
static void
disable_slot(struct slot *slt)
{
+ device_t pccarddev;
struct pccard_devinfo *devi;
int i;
+
/*
* Unload all the drivers on this slot. Note we can't
* remove the device structures themselves, because this
@@ -385,8 +394,15 @@ disable_slot(struct slot *slt)
* driver is accessing the device and it is removed, then
* all bets are off...
*/
- for (devi = slt->devices; devi; devi = devi->next)
+ pccarddev = devclass_get_device(pccard_devclass, 0);
+ for (devi = slt->devices; devi; devi = devi->next) {
unregister_device_interrupt(devi);
+ if (devi->isahd.id_device != 0) {
+ pccnbk_release_resources(devi->isahd.id_device);
+ device_delete_child(pccarddev, devi->isahd.id_device);
+ devi->isahd.id_device = 0;
+ }
+ }
/* Power off the slot 1/2 second after removal of the card */
slt->poff_ch = timeout(power_off_slot, (caddr_t)slt, hz / 2);
@@ -421,7 +437,7 @@ slot_suspend(void *arg)
slt->laststate = filled;
slt->state = suspend;
splx(s);
- printf("Card disabled, slot %d\n", slt->slotnum);
+ printf("pccard: card disabled, slot %d\n", slt->slotnum);
}
/*
* Disable any pending timeouts for this slot since we're
@@ -494,7 +510,7 @@ pccard_alloc_slot(struct slot_ctrl *ctrl)
ctrl->maxmem = NUM_MEM_WINDOWS;
if (ctrl->maxio > NUM_IO_WINDOWS)
ctrl->maxio = NUM_IO_WINDOWS;
- printf("PC-Card %s (%d mem & %d I/O windows)\n",
+ printf("pcic: pccard bridge %s (%d mem & %d I/O windows)\n",
ctrl->name, ctrl->maxmem, ctrl->maxio);
}
callout_handle_init(&slt->insert_ch);
@@ -561,8 +577,12 @@ allocate_driver(struct slot *slt, struct dev_desc *desc)
{
struct pccard_devinfo *devi;
struct pccard_device *drv;
+ device_t pccarddev;
+ char devnam[128];
int err, irq = 0, s;
+ pccarddev = devclass_get_device(pccard_devclass, 0);
+ snprintf(devnam, sizeof(devnam), "pccard-%s", desc->name);
drv = find_driver(desc->name);
if (drv == 0)
return(ENXIO);
@@ -574,7 +594,7 @@ allocate_driver(struct slot *slt, struct dev_desc *desc)
for (devi = slt->devices; devi; devi = devi->next) {
if (devi->drv == drv && devi->isahd.id_unit == desc->unit) {
if (devi->running) {
- printf("pccard %s%d: still running\n",
+ printf("pccard: %s%d still running\n",
devi->drv->name, desc->unit);
return(EBUSY);
}
@@ -612,7 +632,7 @@ allocate_driver(struct slot *slt, struct dev_desc *desc)
slot_irq_handler, (int)slt,
drv->imask, slt->ctrl->imask);
if (irq < 0) {
- printf("pccard_alloc_intr failed for irq %d\n",
+ printf("pccard: alloc intr failed irq %d\n",
irq);
return(EINVAL);
}
@@ -633,6 +653,7 @@ allocate_driver(struct slot *slt, struct dev_desc *desc)
devi->isahd.id_unit = desc->unit;
devi->isahd.id_msize = desc->memsize;
devi->isahd.id_iobase = desc->iobase;
+ devi->isahd.id_iosize = desc->iosize;
bcopy(desc->misc, devi->misc, sizeof(desc->misc));
if (irq)
devi->isahd.id_irq = 1 << irq;
@@ -641,11 +662,27 @@ allocate_driver(struct slot *slt, struct dev_desc *desc)
* Convert the memory to kernel space.
*/
if (desc->mem)
- devi->isahd.id_maddr =
- (caddr_t)(void *)(uintptr_t)
+ devi->isahd.id_maddr = (caddr_t)(void *)(uintptr_t)
(desc->mem + atdevbase - IOM_BEGIN);
else
devi->isahd.id_maddr = 0;
+ /*
+ * XXX I think the following should be done in an attach
+ * routine, but can't seem to slip the knot to get it working
+ * right. This is one reason I call this a kludge
+ */
+ devi->isahd.id_device = device_add_child(pccarddev, devnam,
+ devi->isahd.id_unit, devi);
+ if ((err = pccnbk_alloc_resources(devi->isahd.id_device)) != 0) {
+ device_delete_child(pccarddev, devi->isahd.id_device);
+ devi->isahd.id_device = 0;
+ free(devi, M_DEVBUF);
+ return(err);
+ }
+ snprintf(devnam, sizeof(devnam), "compat %s", desc->name);
+ device_set_desc(devi->isahd.id_device, devnam);
+ BUS_PRINT_CHILD(pccarddev, devi->isahd.id_device);
+
devi->next = slt->devices;
slt->devices = devi;
s = splhigh();
@@ -659,7 +696,7 @@ allocate_driver(struct slot *slt, struct dev_desc *desc)
* it will also set 'running' to off.
*/
if (err) {
- printf("pccard %s%d: Enable failed %d\n", devi->drv->name,
+ printf("pccard: %s%d Enable failed %d\n", devi->drv->name,
devi->isahd.id_unit, err);
remove_device(devi);
}
@@ -677,6 +714,10 @@ remove_device(struct pccard_devinfo *devi)
* then unregister it if no-one else is using it.
*/
unregister_device_interrupt(devi);
+ if (devi->isahd.id_device)
+ pccnbk_release_resources(devi->isahd.id_device);
+ devi->isahd.id_device = NULL;
+
/*
* Remove from device list on this slot.
*/
@@ -718,7 +759,7 @@ inserted(void *arg)
power_off_slot(slt);
slt->ctrl->power(slt);
- printf("Card inserted, slot %d\n", slt->slotnum);
+ printf("pccard: card inserted, slot %d\n", slt->slotnum);
/*
* Now start resetting the card.
*/
@@ -748,7 +789,7 @@ pccard_event(struct slot *slt, enum card_event event)
disable_slot(slt);
slt->state = empty;
splx(s);
- printf("Card removed, slot %d\n", slt->slotnum);
+ printf("pccard: card removed, slot %d\n", slt->slotnum);
pccard_remove_beep();
selwakeup(&slt->selp);
}
@@ -783,7 +824,8 @@ slot_irq_handler(void *arg)
* XXX - Should 'debounce' these for drivers that have recently
* been removed.
*/
- printf("Slot %d, unfielded interrupt (%d)\n", slt->slotnum, slt->irq);
+ printf("pccard: slot %d, unfielded interrupt (%d)\n", slt->slotnum,
+ slt->irq);
}
/*
diff --git a/sys/pccard/pccard_nbk.c b/sys/pccard/pccard_nbk.c
new file mode 100644
index 0000000..282c092
--- /dev/null
+++ b/sys/pccard/pccard_nbk.c
@@ -0,0 +1,274 @@
+/*
+ * Copyright (c) 1999, M. Warner Losh.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $Id:$
+ */
+
+/*
+ * This file contains various kludges to allow the legacy pccard system to
+ * work in the newbus system until the pccard system can be converted
+ * wholesale to newbus. As that is a while off, I'm providing this glue to
+ * allow newbus drivers to have pccard attachments.
+ *
+ * We do *NOT* implement ISA ivars at all. We are not an isa bus, and drivers
+ * that abuse isa_{set,get}_* must be fixed in order to work with pccard.
+ * We use ivars for something else anyway, so it becomes fairly awkward
+ * to do so.
+ *
+ * Here's a summary of the glue that we do to make things work.
+ *
+ * First, we have pccard node in the device and driver trees. The pccard
+ * device lives in the instance tree attached to the nexus. The pccard
+ * attachments will be attached to that node. This allows one to pass things
+ * up the tree that terminates at the nexus, like other buses. The pccard
+ * code will create a device instance for each of the drivers that are to
+ * be attached.
+ *
+ * These compatibility nodes are called pccnbk. PCCard New Bus Kludge.
+ */
+
+#include "opt_bus.h"
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/malloc.h>
+#include <sys/module.h>
+#include <sys/fcntl.h>
+#include <sys/conf.h>
+#include <sys/kernel.h>
+#include <sys/queue.h>
+#include <sys/select.h>
+#include <sys/types.h>
+
+#include <sys/bus.h>
+#include <machine/bus.h>
+#include <sys/rman.h>
+#include <machine/resource.h>
+
+#include <i386/isa/isa_device.h>
+#include <pccard/cardinfo.h>
+#include <pccard/driver.h>
+#include <pccard/pcic.h>
+#include <pccard/slot.h>
+#include <pccard/pccard_nbk.h>
+
+devclass_t pccard_devclass;
+
+static int
+pccard_add_children(device_t dev, int busno)
+{
+ device_add_child(dev, NULL, -1, NULL);
+ return 0;
+}
+
+static int
+pccard_probe(device_t dev)
+{
+ device_set_desc(dev, "PC Card bus -- KLUDGE version");
+ return pccard_add_children(dev, device_get_unit(dev));
+}
+
+static int
+pccard_print_child(device_t dev, device_t child)
+{
+ struct pccard_devinfo *devi = device_get_ivars(child);
+ int retval = 0;
+
+ retval += bus_print_child_header(dev, child);
+ retval += printf(" at");
+
+ if (devi) {
+ if (devi->iorv) {
+ retval += printf(" port 0x%lx",
+ rman_get_start(devi->iorv));
+ if (rman_get_start(devi->iorv) !=
+ rman_get_end(devi->iorv))
+ retval += printf("-0x%lx",
+ rman_get_end(devi->iorv));
+ }
+ if (devi->irqrv) {
+ retval += printf(" irq %ld",
+ rman_get_start(devi->irqrv));
+ }
+ retval += printf(" slot %d", devi->slt->slotnum);
+ }
+
+ retval += bus_print_child_footer(dev, child);
+
+ return (retval);
+}
+
+
+
+static device_method_t pccard_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_probe, pccard_probe),
+ DEVMETHOD(device_attach, bus_generic_attach),
+ DEVMETHOD(device_shutdown, bus_generic_shutdown),
+ DEVMETHOD(device_suspend, bus_generic_suspend),
+ DEVMETHOD(device_resume, bus_generic_resume),
+
+ /* Bus interface */
+ DEVMETHOD(bus_print_child, pccard_print_child),
+/* DEVMETHOD(bus_probe_nomatch, pccard_probe_nomatch),*/
+ DEVMETHOD(bus_driver_added, bus_generic_driver_added),
+ DEVMETHOD(bus_alloc_resource, bus_generic_alloc_resource),
+ DEVMETHOD(bus_release_resource, bus_generic_release_resource),
+ DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
+ DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
+ DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
+ DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
+
+ { 0, 0 }
+};
+
+static driver_t pccard_driver = {
+ "pccard",
+ pccard_methods,
+ 1, /* no softc */
+};
+
+
+DRIVER_MODULE(pccard, nexus, pccard_driver, pccard_devclass, 0, 0);
+
+/* ============================================================ */
+
+static devclass_t pccnbk_devclass;
+
+static int
+pccnbk_probe(device_t dev)
+{
+ return ENXIO;
+}
+
+/*
+ * Allocate resources for this device in the rman system.
+ */
+int
+pccnbk_alloc_resources(device_t dev)
+{
+ struct pccard_devinfo *devi = device_get_ivars(dev);
+ int rid;
+ u_long start;
+ u_long end;
+ u_long count;
+
+ start = devi->isahd.id_iobase;
+ count = devi->isahd.id_iosize;
+ end = start + count - 1;
+
+ rid = 0;
+ devi->iorv = BUS_ALLOC_RESOURCE(device_get_parent(dev), dev,
+ SYS_RES_IOPORT, &rid, start, end, count, RF_ACTIVE);
+ if (!devi->iorv) {
+ printf("Cannot allocate ports 0x%x-0x%x\n", start, end);
+ return (ENOMEM);
+ }
+ rid = 0;
+ start = end = ffs(devi->isahd.id_irq) - 1;
+ count = 1;
+ devi->irqrv = BUS_ALLOC_RESOURCE(device_get_parent(dev), dev,
+ SYS_RES_IRQ, &rid, start, end, count, RF_ACTIVE);
+ if (!devi->irqrv) {
+ return (ENOMEM);
+ }
+ return(0);
+}
+
+void
+pccnbk_release_resources(device_t dev)
+{
+ struct pccard_devinfo *devi = device_get_ivars(dev);
+ u_long start;
+ u_long end;
+ u_long count;
+
+ start = devi->isahd.id_iobase;
+ count = devi->isahd.id_iosize;
+ end = start + count - 1;
+
+ if (devi->iorv) {
+ BUS_RELEASE_RESOURCE(device_get_parent(dev), dev,
+ SYS_RES_IOPORT, 0, devi->iorv);
+ devi->iorv = NULL;
+ }
+ if (devi->irqrv) {
+ BUS_RELEASE_RESOURCE(device_get_parent(dev), dev, SYS_RES_IRQ,
+ 0, devi->irqrv);
+ devi->irqrv = NULL;
+ }
+}
+
+static device_method_t pccnbk_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_probe, pccnbk_probe),
+ DEVMETHOD(device_attach, bus_generic_attach),
+ DEVMETHOD(device_shutdown, bus_generic_shutdown),
+ DEVMETHOD(device_suspend, bus_generic_suspend),
+ DEVMETHOD(device_resume, bus_generic_resume),
+
+ /* Bus interface */
+ DEVMETHOD(bus_print_child, bus_generic_print_child),
+ DEVMETHOD(bus_driver_added, bus_generic_driver_added),
+ DEVMETHOD(bus_alloc_resource, bus_generic_alloc_resource),
+ DEVMETHOD(bus_release_resource, bus_generic_release_resource),
+ DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
+ DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
+ DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
+ DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
+
+ { 0, 0 }
+};
+
+void
+pccnbk_wrap_old_driver(struct pccard_device *drv)
+{
+ char devnam[128];
+ char *nm;
+ driver_t *driver;
+
+ snprintf(devnam, sizeof(devnam), "pccard-%s", drv->name);
+ driver = malloc(sizeof(driver_t), M_DEVBUF, M_NOWAIT);
+ if (!driver)
+ return;
+ bzero(driver, sizeof(driver_t));
+ /* XXX May create a memory leak :-( XXX */
+ nm = malloc(strlen(devnam) + 1, M_DEVBUF, M_NOWAIT);
+ strcpy(nm, devnam);
+ driver->name = nm;
+ driver->methods = pccnbk_methods;
+ driver->softc = sizeof(struct pccard_device);
+ driver->priv = drv;
+ devclass_add_driver(pccard_devclass, driver);
+ drv->driver = driver;
+}
+
+static driver_t pccnbk_driver = {
+ "pccnbk",
+ pccnbk_methods,
+ 1, /* no softc */
+};
+
+DRIVER_MODULE(pccnbk, pccard, pccnbk_driver, pccnbk_devclass, 0, 0);
diff --git a/sys/pccard/pccard_nbk.h b/sys/pccard/pccard_nbk.h
new file mode 100644
index 0000000..f0737d9
--- /dev/null
+++ b/sys/pccard/pccard_nbk.h
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 1999, M. Warner Losh.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $Id:$
+ */
+
+#ifndef PCCARD_PCCARD_NBK_H
+#define PCCARD_PCCARD_NBK_H
+
+struct pccard_device;
+extern devclass_t pccard_devclass;
+extern int pccnbk_alloc_resources(device_t);
+extern void pccnbk_release_resources(device_t);
+extern void pccnbk_wrap_old_driver(struct pccard_device *);
+
+#endif /* ! PCCARD_PCCARD_NBK_H */
diff --git a/sys/pccard/pcic.c b/sys/pccard/pcic.c
index 5a637ab..35a3305 100644
--- a/sys/pccard/pcic.c
+++ b/sys/pccard/pcic.c
@@ -704,7 +704,7 @@ pcic_probe(void)
}
switch(sp->controller) {
case PCIC_I82365:
- cinfo.name = "Intel 82365";
+ cinfo.name = "i82365";
break;
case PCIC_IBM:
cinfo.name = "IBM PCIC";
diff --git a/sys/pccard/slot.h b/sys/pccard/slot.h
index 619d6f5..86dd76b 100644
--- a/sys/pccard/slot.h
+++ b/sys/pccard/slot.h
@@ -33,6 +33,19 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#ifndef _PCCARD_SLOT_H
+#define _PCCARD_SLOT_H
+
+/*
+ * Normally we shouldn't include stuff here, but we're trying to be
+ * compatible with the long, dark hand of the past.
+ */
+#include <sys/bus.h>
+#include <machine/bus.h>
+#include <sys/rman.h>
+#include <machine/resource.h>
+#include <i386/isa/isa_device.h>
+
/*
* Controller data - Specific to each slot controller.
*/
@@ -82,6 +95,7 @@ struct pccard_device {
int (*handler)(struct pccard_devinfo *); /* interrupt handler */
int attr; /* driver attributes */
unsigned int *imask; /* Interrupt mask ptr */
+ driver_t *driver; /* Driver */
struct pccard_device *next;
};
@@ -114,13 +128,12 @@ DECLARE_MODULE(name, name ## _mod, SI_SUB_DRIVERS, SI_ORDER_MIDDLE)
struct pccard_devinfo {
struct pccard_device *drv;
struct isa_device isahd; /* Device details */
-#if 0
- void *arg; /* Device argument */
-#endif
int running; /* Current state of driver */
u_char misc[128]; /* For any random info */
struct slot *slt; /* Back pointer to slot */
+ struct resource *iorv; /* Kludge: keep track of io resource */
+ struct resource *irqrv; /* Kludge: keep track of irq */
struct pccard_devinfo *next; /* List of drivers */
};
@@ -157,3 +170,5 @@ enum card_event { card_removed, card_inserted };
struct slot *pccard_alloc_slot(struct slot_ctrl *);
void pccard_event(struct slot *, enum card_event);
void pccard_remove_controller(struct slot_ctrl *);
+
+#endif /* !_PCCARD_SLOT_H */
OpenPOWER on IntegriCloud