Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/bhnd/bhndb/bhndb.c
Show All 39 Lines | |||||
* Provides generic support for bridging from a parent bus (such as PCI) to | * Provides generic support for bridging from a parent bus (such as PCI) to | ||||
* a BHND-compatible bus (e.g. bcma or siba). | * a BHND-compatible bus (e.g. bcma or siba). | ||||
*/ | */ | ||||
#include <sys/param.h> | #include <sys/param.h> | ||||
#include <sys/kernel.h> | #include <sys/kernel.h> | ||||
#include <sys/bus.h> | #include <sys/bus.h> | ||||
#include <sys/module.h> | #include <sys/module.h> | ||||
#include <sys/sbuf.h> | |||||
#include <sys/systm.h> | #include <sys/systm.h> | ||||
#include <machine/bus.h> | #include <machine/bus.h> | ||||
#include <sys/rman.h> | #include <sys/rman.h> | ||||
#include <machine/resource.h> | #include <machine/resource.h> | ||||
#include <dev/bhnd/bhndvar.h> | #include <dev/bhnd/bhndvar.h> | ||||
#include <dev/bhnd/bhndreg.h> | #include <dev/bhnd/bhndreg.h> | ||||
▲ Show 20 Lines • Show All 107 Lines • ▼ Show 20 Lines | bhndb_print_child(device_t dev, device_t child) | ||||
retval += bus_print_child_domain(dev, child); | retval += bus_print_child_domain(dev, child); | ||||
retval += bus_print_child_footer(dev, child); | retval += bus_print_child_footer(dev, child); | ||||
return (retval); | return (retval); | ||||
} | } | ||||
static int | static int | ||||
bhndb_child_pnpinfo_str(device_t bus, device_t child, char *buf, | bhndb_child_location(device_t dev, device_t child, struct sbuf *sb) | ||||
size_t buflen) | |||||
{ | { | ||||
*buf = '\0'; | |||||
return (0); | |||||
} | |||||
static int | |||||
bhndb_child_location_str(device_t dev, device_t child, char *buf, | |||||
size_t buflen) | |||||
{ | |||||
struct bhndb_softc *sc; | struct bhndb_softc *sc; | ||||
sc = device_get_softc(dev); | sc = device_get_softc(dev); | ||||
snprintf(buf, buflen, "base=0x%llx", | sbuf_printf(sb, "base=0x%llx", | ||||
(unsigned long long) sc->chipid.enum_addr); | (unsigned long long) sc->chipid.enum_addr); | ||||
return (0); | return (0); | ||||
} | } | ||||
/** | /** | ||||
* Return true if @p cores matches the @p hw specification. | * Return true if @p cores matches the @p hw specification. | ||||
* | * | ||||
* @param sc BHNDB device state. | * @param sc BHNDB device state. | ||||
▲ Show 20 Lines • Show All 2,015 Lines • ▼ Show 20 Lines | static device_method_t bhndb_methods[] = { | ||||
DEVMETHOD(device_detach, bhndb_generic_detach), | DEVMETHOD(device_detach, bhndb_generic_detach), | ||||
DEVMETHOD(device_shutdown, bus_generic_shutdown), | DEVMETHOD(device_shutdown, bus_generic_shutdown), | ||||
DEVMETHOD(device_suspend, bhndb_generic_suspend), | DEVMETHOD(device_suspend, bhndb_generic_suspend), | ||||
DEVMETHOD(device_resume, bhndb_generic_resume), | DEVMETHOD(device_resume, bhndb_generic_resume), | ||||
/* Bus interface */ | /* Bus interface */ | ||||
DEVMETHOD(bus_probe_nomatch, bhndb_probe_nomatch), | DEVMETHOD(bus_probe_nomatch, bhndb_probe_nomatch), | ||||
DEVMETHOD(bus_print_child, bhndb_print_child), | DEVMETHOD(bus_print_child, bhndb_print_child), | ||||
DEVMETHOD(bus_child_pnpinfo_str, bhndb_child_pnpinfo_str), | DEVMETHOD(bus_child_location, bhndb_child_location), | ||||
DEVMETHOD(bus_child_location_str, bhndb_child_location_str), | |||||
DEVMETHOD(bus_add_child, bhndb_add_child), | DEVMETHOD(bus_add_child, bhndb_add_child), | ||||
DEVMETHOD(bus_child_deleted, bhndb_child_deleted), | DEVMETHOD(bus_child_deleted, bhndb_child_deleted), | ||||
DEVMETHOD(bus_alloc_resource, bhndb_alloc_resource), | DEVMETHOD(bus_alloc_resource, bhndb_alloc_resource), | ||||
DEVMETHOD(bus_release_resource, bhndb_release_resource), | DEVMETHOD(bus_release_resource, bhndb_release_resource), | ||||
DEVMETHOD(bus_activate_resource, bhndb_activate_resource), | DEVMETHOD(bus_activate_resource, bhndb_activate_resource), | ||||
DEVMETHOD(bus_deactivate_resource, bhndb_deactivate_resource), | DEVMETHOD(bus_deactivate_resource, bhndb_deactivate_resource), | ||||
▲ Show 20 Lines • Show All 100 Lines • Show Last 20 Lines |