diff options
author | imp <imp@FreeBSD.org> | 2004-06-09 16:08:20 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2004-06-09 16:08:20 +0000 |
commit | af37537fe396a9fba47ccb8fd90b1e1c4a7eb1d5 (patch) | |
tree | e6f921e6e95c4b23e88498664b4aa739fb602613 /sys | |
parent | 0307fa34d7fc48a54789626544488fc902a7bca7 (diff) | |
download | FreeBSD-src-af37537fe396a9fba47ccb8fd90b1e1c4a7eb1d5.zip FreeBSD-src-af37537fe396a9fba47ccb8fd90b1e1c4a7eb1d5.tar.gz |
Step 1 in moving EISA devices to kobj/newbus. Use kobj methods for
all of the interface between the driver and the bus. This will enable
us to stop special casing eisa bus attachments in modules and treat them
like we treat all other busses.
In the longer run, we need to eliminate much (all?) of these interfaces
and switch to using the standard bus_alloc_resource(), but that's not
done right now.
# I've not updated the modules to include eisa, etc, just yet
Tested on: Compaq Proliant 3000/333 purchased for eisa work
Diffstat (limited to 'sys')
-rw-r--r-- | sys/conf/files | 1 | ||||
-rw-r--r-- | sys/conf/kmod.mk | 2 | ||||
-rw-r--r-- | sys/dev/eisa/eisaconf.c | 19 | ||||
-rw-r--r-- | sys/dev/eisa/eisaconf.h | 31 |
4 files changed, 39 insertions, 14 deletions
diff --git a/sys/conf/files b/sys/conf/files index da48f48..9f30294 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -417,6 +417,7 @@ dev/ed/if_ed.c optional ed dev/ed/if_ed_pccard.c optional ed card dev/ed/if_ed_pccard.c optional ed pccard dev/ed/if_ed_pci.c optional ed pci +dev/eisa/eisa_if.m standard dev/eisa/eisaconf.c optional eisa dev/em/if_em.c optional em dev/em/if_em_hw.c optional em diff --git a/sys/conf/kmod.mk b/sys/conf/kmod.mk index fd58f13..de4461b 100644 --- a/sys/conf/kmod.mk +++ b/sys/conf/kmod.mk @@ -289,7 +289,7 @@ ${_src}: MFILES?= kern/bus_if.m kern/device_if.m dev/iicbus/iicbb_if.m \ dev/iicbus/iicbus_if.m isa/isa_if.m \ libkern/iconv_converter_if.m \ - dev/mii/miibus_if.m \ + dev/eisa/eisa_if.m dev/mii/miibus_if.m \ dev/pccard/card_if.m dev/pccard/power_if.m dev/pci/pci_if.m \ dev/pci/pcib_if.m dev/ppbus/ppbus_if.m dev/smbus/smbus_if.m \ dev/usb/usb_if.m dev/sound/pcm/ac97_if.m dev/sound/pcm/channel_if.m \ diff --git a/sys/dev/eisa/eisaconf.c b/sys/dev/eisa/eisaconf.c index 66ca860..de5f4ff 100644 --- a/sys/dev/eisa/eisaconf.c +++ b/sys/dev/eisa/eisaconf.c @@ -508,8 +508,8 @@ eisa_release_resource(device_t dev, device_t child, int type, int rid, return rv; } -int -eisa_add_intr(device_t dev, int irq, int trigger) +static int +eisa_add_intr_m(device_t eisa, device_t dev, int irq, int trigger) { struct eisa_device *e_dev = device_get_ivars(dev); struct irq_node *irq_info; @@ -575,8 +575,9 @@ eisa_add_resvaddr(struct eisa_device *e_dev, struct resvlist *head, u_long base, return (0); } -int -eisa_add_mspace(device_t dev, u_long mbase, u_long msize, int flags) +static int +eisa_add_mspace_m(device_t eisa, device_t dev, u_long mbase, u_long msize, + int flags) { struct eisa_device *e_dev = device_get_ivars(dev); @@ -584,8 +585,9 @@ eisa_add_mspace(device_t dev, u_long mbase, u_long msize, int flags) flags); } -int -eisa_add_iospace(device_t dev, u_long iobase, u_long iosize, int flags) +static int +eisa_add_iospace_m(device_t eisa, device_t dev, u_long iobase, u_long iosize, + int flags) { struct eisa_device *e_dev = device_get_ivars(dev); @@ -614,6 +616,11 @@ static device_method_t eisa_methods[] = { DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), + /* EISA interface */ + DEVMETHOD(eisa_add_intr, eisa_add_intr_m), + DEVMETHOD(eisa_add_iospace, eisa_add_iospace_m), + DEVMETHOD(eisa_add_mspace, eisa_add_mspace_m), + { 0, 0 } }; diff --git a/sys/dev/eisa/eisaconf.h b/sys/dev/eisa/eisaconf.h index 434a6a4..ebdee5a 100644 --- a/sys/dev/eisa/eisaconf.h +++ b/sys/dev/eisa/eisaconf.h @@ -31,9 +31,10 @@ * $FreeBSD$ */ -#ifndef _I386_EISA_EISACONF_H_ -#define _I386_EISA_EISACONF_H_ 1 +#ifndef _DEV_EISA_EISACONF_H_ +#define _DEV_EISA_EISACONF_H_ 1 +#include "eisa_if.h" #define EISA_SLOT_SIZE 0x1000 #define EISA_MFCTR_CHAR0(ID) (char)(((ID>>26) & 0x1F) | '@') /* Bits 26-30 */ @@ -68,14 +69,30 @@ EISA_ACCESSOR(irq, IRQ, eisa_id_t) #undef EISA_ACCESSOR -int eisa_add_intr(device_t, int, int); - #define RESVADDR_NONE 0x00 #define RESVADDR_BITMASK 0x01 /* size is a mask of reserved * bits at addr */ #define RESVADDR_RELOCATABLE 0x02 -int eisa_add_iospace(device_t, u_long, u_long, int); -int eisa_add_mspace(device_t, u_long, u_long, int); -#endif /* _I386_EISA_EISACONF_H_ */ +static __inline int +eisa_add_intr(device_t dev, int irq, int trigger) +{ + return (EISA_ADD_INTR(device_get_parent(dev), dev, irq, trigger)); +} + +static __inline int +eisa_add_iospace(device_t dev, u_long iobase, u_long iosize, int flags) +{ + return (EISA_ADD_IOSPACE(device_get_parent(dev), dev, iobase, iosize, + flags)); +} + +static __inline int +eisa_add_mspace(device_t dev, u_long mbase, u_long msize, int flags) +{ + return (EISA_ADD_MSPACE(device_get_parent(dev), dev, mbase, msize, + flags)); +} + +#endif /* _DEV_EISA_EISACONF_H_ */ |