Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/atkbdc/atkbdc_isa.c
Show First 20 Lines • Show All 44 Lines • ▼ Show 20 Lines | |||||
#include <isa/isareg.h> | #include <isa/isareg.h> | ||||
#include <isa/isavar.h> | #include <isa/isavar.h> | ||||
static int atkbdc_isa_probe(device_t dev); | static int atkbdc_isa_probe(device_t dev); | ||||
static int atkbdc_isa_attach(device_t dev); | static int atkbdc_isa_attach(device_t dev); | ||||
static device_t atkbdc_isa_add_child(device_t bus, u_int order, const char *name, | static device_t atkbdc_isa_add_child(device_t bus, u_int order, const char *name, | ||||
int unit); | int unit); | ||||
static struct resource *atkbdc_isa_alloc_resource(device_t dev, device_t child, | static struct resource *atkbdc_isa_alloc_resource(device_t dev, device_t child, | ||||
int type, int *rid, u_long start, u_long end, | int type, int *rid, rman_res_t start, rman_res_t end, | ||||
u_long count, u_int flags); | rman_res_t count, u_int flags); | ||||
static int atkbdc_isa_release_resource(device_t dev, device_t child, | static int atkbdc_isa_release_resource(device_t dev, device_t child, | ||||
int type, int rid, struct resource *r); | int type, int rid, struct resource *r); | ||||
static device_method_t atkbdc_isa_methods[] = { | static device_method_t atkbdc_isa_methods[] = { | ||||
DEVMETHOD(device_probe, atkbdc_isa_probe), | DEVMETHOD(device_probe, atkbdc_isa_probe), | ||||
DEVMETHOD(device_attach, atkbdc_isa_attach), | DEVMETHOD(device_attach, atkbdc_isa_attach), | ||||
DEVMETHOD(device_suspend, bus_generic_suspend), | DEVMETHOD(device_suspend, bus_generic_suspend), | ||||
DEVMETHOD(device_resume, bus_generic_resume), | DEVMETHOD(device_resume, bus_generic_resume), | ||||
Show All 29 Lines | static struct isa_pnp_id atkbdc_ids[] = { | ||||
{ 0 } | { 0 } | ||||
}; | }; | ||||
static int | static int | ||||
atkbdc_isa_probe(device_t dev) | atkbdc_isa_probe(device_t dev) | ||||
{ | { | ||||
struct resource *port0; | struct resource *port0; | ||||
struct resource *port1; | struct resource *port1; | ||||
u_long start; | rman_res_t start; | ||||
u_long count; | rman_res_t count; | ||||
int error; | int error; | ||||
int rid; | int rid; | ||||
#if defined(__i386__) || defined(__amd64__) | #if defined(__i386__) || defined(__amd64__) | ||||
bus_space_tag_t tag; | bus_space_tag_t tag; | ||||
bus_space_handle_t ioh1; | bus_space_handle_t ioh1; | ||||
volatile int i; | volatile int i; | ||||
register_t flags; | register_t flags; | ||||
#endif | #endif | ||||
▲ Show 20 Lines • Show All 180 Lines • ▼ Show 20 Lines | atkbdc_isa_add_child(device_t bus, u_int order, const char *name, int unit) | ||||
device_set_ivars(child, ivar); | device_set_ivars(child, ivar); | ||||
return child; | return child; | ||||
} | } | ||||
struct resource * | struct resource * | ||||
atkbdc_isa_alloc_resource(device_t dev, device_t child, int type, int *rid, | atkbdc_isa_alloc_resource(device_t dev, device_t child, int type, int *rid, | ||||
u_long start, u_long end, u_long count, u_int flags) | rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) | ||||
{ | { | ||||
atkbdc_softc_t *sc; | atkbdc_softc_t *sc; | ||||
sc = *(atkbdc_softc_t **)device_get_softc(dev); | sc = *(atkbdc_softc_t **)device_get_softc(dev); | ||||
if (type == SYS_RES_IRQ && *rid == KBDC_RID_KBD && sc->irq != NULL) | if (type == SYS_RES_IRQ && *rid == KBDC_RID_KBD && sc->irq != NULL) | ||||
return (sc->irq); | return (sc->irq); | ||||
return (bus_generic_rl_alloc_resource(dev, child, type, rid, start, | return (bus_generic_rl_alloc_resource(dev, child, type, rid, start, | ||||
end, count, flags)); | end, count, flags)); | ||||
Show All 16 Lines |