summaryrefslogtreecommitdiffstats
path: root/sys/pccard/slot.h
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>1999-10-25 02:41:58 +0000
committerimp <imp@FreeBSD.org>1999-10-25 02:41:58 +0000
commitb3ebae016a5c532ef50c367a058d394d04b05029 (patch)
treef08c2d0c060a6858fd722931d6a11acad72b8933 /sys/pccard/slot.h
parent5c654c474375626efab60ddf5d5bf9098b8f7337 (diff)
downloadFreeBSD-src-b3ebae016a5c532ef50c367a058d394d04b05029.zip
FreeBSD-src-b3ebae016a5c532ef50c367a058d394d04b05029.tar.gz
Massive rewrite of pccard to convert it to newbus.
o Gut the compatibility interface, you now must attach with newbus. o Unit numbers from pccardd are now ignored. This may change the units assigned to a card. It now uses the first available unit. o kill old skeleton code that is now obsolete. o Use newbus attachment code. o cleanup interfile dependencies some. o kill list of devices per slot. we use the device tree for what we need. o Remove now obsolete code. o The ep driver (and maybe ed) may need some config file tweaks to allow it to attach. See config files that were committed for examples on how to do this. Drivers to be commited shortly. This is an interrum fix until the new pccard. ed, ep and sio will be supported by me with this release, although others are welcome to try to support other devices before new pccard is working. I plan on doing minimal further work on this code base. Be careful when upgrading, since this code is known to work on my laptop and those of a couple others as well, but your milage may vary. BUGS TO BE FIXED: o system memory isn't allocated yet, it will be soon. o No devices actually have a pccard newbus attach in the tree. BUGS THAT MIGHT BE FIXED: o card removal, including suspend, usually hangs the system. Many thanks to Peter Wemm and Doug Rabson for helping me to fill in the missing bits of New Bus understanding at FreeBSD Con '99.
Diffstat (limited to 'sys/pccard/slot.h')
-rw-r--r--sys/pccard/slot.h57
1 files changed, 13 insertions, 44 deletions
diff --git a/sys/pccard/slot.h b/sys/pccard/slot.h
index 07e4d0d..18ffc62 100644
--- a/sys/pccard/slot.h
+++ b/sys/pccard/slot.h
@@ -72,8 +72,6 @@ struct slot_ctrl {
int extra; /* Controller specific size */
int maxmem; /* Number of allowed memory windows */
int maxio; /* Number of allowed I/O windows */
- int irqs; /* IRQ's that are allowed */
- u_int *imask; /* IRQ mask for the PCIC controller */
/*
* The rest is maintained by the mainline PC-CARD code.
@@ -83,43 +81,6 @@ struct slot_ctrl {
};
/*
- * Driver structure - each driver registers itself
- * with the mainline PC-CARD code. These drivers are
- * then available for linking to the devices.
- */
-struct pccard_devinfo;
-
-struct pccard_device {
- char *name; /* Driver name */
- int (*enable)(struct pccard_devinfo *); /* init/enable driver */
- void (*disable)(struct pccard_devinfo *); /* disable driver */
- 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;
-};
-
-int pccard_module_handler __P((module_t mod, int what, void *arg));
-
-#define PCCARD_MODULE(name, enable, disable, handler, attr, imask) \
-static struct pccard_device name ## _info = { \
- #name, \
- enable, \
- disable, \
- handler, \
- attr, \
- &imask \
-}; \
-static moduledata_t name ## _mod = { \
- "pccard_" #name, \
- pccard_module_handler, \
- &name ## _info \
-}; \
-DECLARE_MODULE(name, name ## _mod, SI_SUB_DRIVERS, SI_ORDER_MIDDLE)
-
-/*
* Device structure for cards. Each card may have one
* or more pccard drivers attached to it; each driver is assumed
* to require at most one interrupt handler, one I/O block
@@ -127,14 +88,13 @@ DECLARE_MODULE(name, name ## _mod, SI_SUB_DRIVERS, SI_ORDER_MIDDLE)
* devices together.
*/
struct pccard_devinfo {
- struct pccard_device *drv;
- struct isa_device isahd; /* Device details */
+ u_char name[128];
+ struct isa_device isahd;
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 resource_list resources;
struct pccard_devinfo *next; /* List of drivers */
};
@@ -170,6 +130,15 @@ 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 *);
+
+static __inline__ const char *
+pccard_get_name(device_t dev)
+{
+ struct pccard_devinfo *devi = (struct pccard_devinfo *)
+ device_get_ivars(dev);
+ if (!devi)
+ return ("anonymous");
+ return (devi->name);
+}
#endif /* !_PCCARD_SLOT_H */
OpenPOWER on IntegriCloud