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
This commit is contained in:
Warner Losh 2004-06-09 16:08:20 +00:00
parent da3003f09a
commit 6732641e0a
4 changed files with 39 additions and 14 deletions

View File

@ -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

View File

@ -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 \

View File

@ -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 }
};

View File

@ -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_ */