diff --git a/sys/conf/files b/sys/conf/files index da48f485ffc3..9f302941a32c 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 fd58f1347867..de4461b97219 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 66ca860f801f..de5f4ff726cf 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 434a6a4f5b9f..ebdee5a6cdd6 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_ */