FreeBSD kernel kern code
|
#include <sys/cdefs.h>
#include "opt_bus.h"
#include "opt_ddb.h"
#include <sys/param.h>
#include <sys/conf.h>
#include <sys/domainset.h>
#include <sys/eventhandler.h>
#include <sys/filio.h>
#include <sys/lock.h>
#include <sys/kernel.h>
#include <sys/kobj.h>
#include <sys/limits.h>
#include <sys/malloc.h>
#include <sys/module.h>
#include <sys/mutex.h>
#include <sys/poll.h>
#include <sys/priv.h>
#include <sys/proc.h>
#include <sys/condvar.h>
#include <sys/queue.h>
#include <machine/bus.h>
#include <sys/random.h>
#include <sys/refcount.h>
#include <sys/rman.h>
#include <sys/sbuf.h>
#include <sys/selinfo.h>
#include <sys/signalvar.h>
#include <sys/smp.h>
#include <sys/sysctl.h>
#include <sys/systm.h>
#include <sys/uio.h>
#include <sys/bus.h>
#include <sys/cpuset.h>
#include <net/vnet.h>
#include <machine/cpu.h>
#include <machine/stdarg.h>
#include <vm/uma.h>
#include <vm/vm.h>
#include <ddb/ddb.h>
Go to the source code of this file.
Data Structures | |
struct | driverlink |
struct | _device |
Implementation of _device. More... | |
struct | dev_event_info |
struct | dev_softc |
struct | device_location_node |
Macros | |
#define | DL_DEFERRED_PROBE 1 /* Probe deferred on this */ |
#define | DC_HAS_CHILDREN 1 |
#define | DRIVERNAME(d) ((d)? d->name : "no driver") |
#define | DEVCLANAME(d) ((d)? d->name : "no devclass") |
#define | PDEBUG(a) /* nop */ |
#define | DEVICENAME(d) /* nop */ |
#define | print_device_short(d, i) /* nop */ |
#define | print_device(d, i) /* nop */ |
#define | print_device_tree_short(d, i) /* nop */ |
#define | print_device_tree(d, i) /* nop */ |
#define | print_driver_short(d, i) /* nop */ |
#define | print_driver(d, i) /* nop */ |
#define | print_driver_list(d, i) /* nop */ |
#define | print_devclass_short(d, i) /* nop */ |
#define | print_devclass(d, i) /* nop */ |
#define | print_devclass_list_short() /* nop */ |
#define | print_devclass_list() /* nop */ |
#define | DEVCTL_DEFAULT_QUEUE_LEN 1000 |
#define | DEVCTL_BUFFER (1024 - sizeof(void *)) |
Typedefs | |
typedef struct driverlink * | driverlink_t |
Enumerations | |
enum | { DEVCLASS_SYSCTL_PARENT } |
enum | { DEVICE_SYSCTL_DESC , DEVICE_SYSCTL_DRIVER , DEVICE_SYSCTL_LOCATION , DEVICE_SYSCTL_PNPINFO , DEVICE_SYSCTL_PARENT } |
Functions | |
__FBSDID ("$FreeBSD$") | |
SYSCTL_NODE (_hw, OID_AUTO, bus, CTLFLAG_RW|CTLFLAG_MPSAFE, NULL, NULL) | |
SYSCTL_ROOT_NODE (OID_AUTO, dev, CTLFLAG_RW|CTLFLAG_MPSAFE, NULL, NULL) | |
typedef | TAILQ_HEAD (devclass_list, devclass) |
static | MALLOC_DEFINE (M_BUS, "bus", "Bus data structures") |
static | MALLOC_DEFINE (M_BUS_SC, "bus-sc", "Bus data structures, softc") |
EVENTHANDLER_LIST_DEFINE (device_attach) | |
EVENTHANDLER_LIST_DEFINE (device_detach) | |
EVENTHANDLER_LIST_DEFINE (dev_lookup) | |
static void | devctl2_init (void) |
static int | devclass_sysctl_handler (SYSCTL_HANDLER_ARGS) |
static void | devclass_sysctl_init (devclass_t dc) |
static int | device_sysctl_handler (SYSCTL_HANDLER_ARGS) |
static void | device_sysctl_init (device_t dev) |
static void | device_sysctl_update (device_t dev) |
static void | device_sysctl_fini (device_t dev) |
static int | sysctl_devctl_queue (SYSCTL_HANDLER_ARGS) |
SYSCTL_PROC (_hw_bus, OID_AUTO, devctl_queue, CTLTYPE_INT|CTLFLAG_RWTUN|CTLFLAG_MPSAFE, NULL, 0, sysctl_devctl_queue, "I", "devctl queue length") | |
STAILQ_HEAD (devq, dev_event_info) | |
static void | filt_devctl_detach (struct knote *kn) |
static int | filt_devctl_read (struct knote *kn, long hint) |
static void | devinit (void) |
static int | devopen (struct cdev *dev, int oflags, int devtype, struct thread *td) |
static int | devclose (struct cdev *dev, int fflag, int devtype, struct thread *td) |
static int | devread (struct cdev *dev, struct uio *uio, int ioflag) |
static int | devioctl (struct cdev *dev, u_long cmd, caddr_t data, int fflag, struct thread *td) |
static int | devpoll (struct cdev *dev, int events, struct thread *td) |
static int | devkqfilter (struct cdev *dev, struct knote *kn) |
bool | devctl_process_running (void) |
Return whether the userland process is running. More... | |
static struct dev_event_info * | devctl_alloc_dei (void) |
static struct dev_event_info * | devctl_alloc_dei_sb (struct sbuf *sb) |
static void | devctl_free_dei (struct dev_event_info *dei) |
static void | devctl_queue (struct dev_event_info *dei) |
void | devctl_notify (const char *system, const char *subsystem, const char *type, const char *data) |
Send a 'notification' to userland, using standard ways. More... | |
static void | devaddq (const char *type, const char *what, device_t dev) |
static void | devadded (device_t dev) |
static void | devremoved (device_t dev) |
static void | devnomatch (device_t dev) |
void | devctl_safe_quote_sb (struct sbuf *sb, const char *src) |
safely quotes strings that might have double quotes in them. More... | |
DEFINE_CLASS (null, null_methods, 0) | |
void | bus_topo_assert () |
struct mtx * | bus_topo_mtx (void) |
void | bus_topo_lock (void) |
void | bus_topo_unlock (void) |
static void | driver_register_pass (struct driverlink *new) |
Register the pass level of a new driver attachment. More... | |
void | bus_set_pass (int pass) |
Raise the current bus pass. More... | |
static devclass_t | devclass_find_internal (const char *classname, const char *parentname, int create) |
Find or create a device class. More... | |
devclass_t | devclass_create (const char *classname) |
Create a device class. More... | |
devclass_t | devclass_find (const char *classname) |
Find a device class. More... | |
static void | devclass_driver_added (devclass_t dc, driver_t *driver) |
Register that a device driver has been added to a devclass. More... | |
int | devclass_add_driver (devclass_t dc, driver_t *driver, int pass, devclass_t *dcp) |
Add a device driver to a device class. More... | |
static int | devclass_driver_deleted (devclass_t busclass, devclass_t dc, driver_t *driver) |
Register that a device driver has been deleted from a devclass. More... | |
int | devclass_delete_driver (devclass_t busclass, driver_t *driver) |
Delete a device driver from a device class. More... | |
static int | devclass_quiesce_driver (devclass_t busclass, driver_t *driver) |
Quiesces a set of device drivers from a device class. More... | |
static driverlink_t | devclass_find_driver_internal (devclass_t dc, const char *classname) |
const char * | devclass_get_name (devclass_t dc) |
Return the name of the devclass. More... | |
device_t | devclass_get_device (devclass_t dc, int unit) |
Find a device given a unit number. More... | |
void * | devclass_get_softc (devclass_t dc, int unit) |
Find the softc field of a device given a unit number. More... | |
int | devclass_get_devices (devclass_t dc, device_t **devlistp, int *devcountp) |
Get a list of devices in the devclass. More... | |
int | devclass_get_drivers (devclass_t dc, driver_t ***listp, int *countp) |
Get a list of drivers in the devclass. More... | |
int | devclass_get_count (devclass_t dc) |
Get the number of devices in a devclass. More... | |
int | devclass_get_maxunit (devclass_t dc) |
Get the maximum unit number used in a devclass. More... | |
int | devclass_find_free_unit (devclass_t dc, int unit) |
Find a free unit number in a devclass. More... | |
void | devclass_set_parent (devclass_t dc, devclass_t pdc) |
Set the parent of a devclass. More... | |
devclass_t | devclass_get_parent (devclass_t dc) |
Get the parent of a devclass. More... | |
struct sysctl_ctx_list * | devclass_get_sysctl_ctx (devclass_t dc) |
struct sysctl_oid * | devclass_get_sysctl_tree (devclass_t dc) |
static int | devclass_alloc_unit (devclass_t dc, device_t dev, int *unitp) |
Allocate a unit number. More... | |
static int | devclass_add_device (devclass_t dc, device_t dev) |
Add a device to a devclass. More... | |
static int | devclass_delete_device (devclass_t dc, device_t dev) |
Delete a device from a devclass. More... | |
static device_t | make_device (device_t parent, const char *name, int unit) |
Make a new device and add it as a child of parent . More... | |
static int | device_print_child (device_t dev, device_t child) |
Print a description of a device. More... | |
device_t | device_add_child (device_t dev, const char *name, int unit) |
Create a new device. More... | |
device_t | device_add_child_ordered (device_t dev, u_int order, const char *name, int unit) |
Create a new device. More... | |
int | device_delete_child (device_t dev, device_t child) |
Delete a device. More... | |
int | device_delete_children (device_t dev) |
Delete all children devices of the given device, if any. More... | |
device_t | device_find_child (device_t dev, const char *classname, int unit) |
Find a device given a unit number. More... | |
static driverlink_t | first_matching_driver (devclass_t dc, device_t dev) |
static driverlink_t | next_matching_driver (devclass_t dc, device_t dev, driverlink_t last) |
int | device_probe_child (device_t dev, device_t child) |
device_t | device_get_parent (device_t dev) |
Return the parent of a device. More... | |
int | device_get_children (device_t dev, device_t **devlistp, int *devcountp) |
Get a list of children of a device. More... | |
driver_t * | device_get_driver (device_t dev) |
Return the current driver for the device or NULL if there is no driver currently attached. More... | |
devclass_t | device_get_devclass (device_t dev) |
Return the current devclass for the device or NULL if there is none. More... | |
const char * | device_get_name (device_t dev) |
Return the name of the device's devclass or NULL if there is none. More... | |
const char * | device_get_nameunit (device_t dev) |
Return a string containing the device's devclass name followed by an ascii representation of the device's unit number (e.g. "foo2" ). More... | |
int | device_get_unit (device_t dev) |
Return the device's unit number. More... | |
const char * | device_get_desc (device_t dev) |
Return the device's description string. More... | |
uint32_t | device_get_flags (device_t dev) |
Return the device's flags. More... | |
struct sysctl_ctx_list * | device_get_sysctl_ctx (device_t dev) |
struct sysctl_oid * | device_get_sysctl_tree (device_t dev) |
int | device_print_prettyname (device_t dev) |
Print the name of the device followed by a colon and a space. More... | |
int | device_printf (device_t dev, const char *fmt,...) |
Print the name of the device followed by a colon, a space and the result of calling vprintf() with the value of fmt and the following arguments. More... | |
int | device_log (device_t dev, int pri, const char *fmt,...) |
Print the name of the device followed by a colon, a space and the result of calling log() with the value of fmt and the following arguments. More... | |
static void | device_set_desc_internal (device_t dev, const char *desc, int copy) |
void | device_set_desc (device_t dev, const char *desc) |
Set the device's description. More... | |
void | device_set_desc_copy (device_t dev, const char *desc) |
Set the device's description. More... | |
void | device_set_flags (device_t dev, uint32_t flags) |
Set the device's flags. More... | |
void * | device_get_softc (device_t dev) |
Return the device's softc field. More... | |
void | device_set_softc (device_t dev, void *softc) |
Set the device's softc field. More... | |
void | device_free_softc (void *softc) |
Free claimed softc. More... | |
void | device_claim_softc (device_t dev) |
Claim softc. More... | |
void * | device_get_ivars (device_t dev) |
Get the device's ivars field. More... | |
void | device_set_ivars (device_t dev, void *ivars) |
Set the device's ivars field. More... | |
device_state_t | device_get_state (device_t dev) |
Return the device's state. More... | |
void | device_enable (device_t dev) |
Set the DF_ENABLED flag for the device. More... | |
void | device_disable (device_t dev) |
Clear the DF_ENABLED flag for the device. More... | |
void | device_busy (device_t dev) |
Increment the busy counter for the device. More... | |
void | device_unbusy (device_t dev) |
Decrement the busy counter for the device. More... | |
void | device_quiet (device_t dev) |
Set the DF_QUIET flag for the device. More... | |
void | device_quiet_children (device_t dev) |
Set the DF_QUIET_CHILDREN flag for the device. More... | |
void | device_verbose (device_t dev) |
Clear the DF_QUIET flag for the device. More... | |
ssize_t | device_get_property (device_t dev, const char *prop, void *val, size_t sz, device_property_type_t type) |
bool | device_has_property (device_t dev, const char *prop) |
int | device_has_quiet_children (device_t dev) |
Return non-zero if the DF_QUIET_CHIDLREN flag is set on the device. More... | |
int | device_is_quiet (device_t dev) |
Return non-zero if the DF_QUIET flag is set on the device. More... | |
int | device_is_enabled (device_t dev) |
Return non-zero if the DF_ENABLED flag is set on the device. More... | |
int | device_is_alive (device_t dev) |
Return non-zero if the device was successfully probed. More... | |
int | device_is_attached (device_t dev) |
Return non-zero if the device currently has a driver attached to it. More... | |
int | device_is_suspended (device_t dev) |
Return non-zero if the device is currently suspended. More... | |
int | device_set_devclass (device_t dev, const char *classname) |
Set the devclass of a device. More... | |
int | device_set_devclass_fixed (device_t dev, const char *classname) |
Set the devclass of a device and mark the devclass fixed. More... | |
bool | device_is_devclass_fixed (device_t dev) |
Query the device to determine if it's of a fixed devclass. More... | |
int | device_set_driver (device_t dev, driver_t *driver) |
Set the driver of a device. More... | |
int | device_probe (device_t dev) |
Probe a device, and return this status. More... | |
int | device_probe_and_attach (device_t dev) |
Probe a device and attach a driver if possible. More... | |
int | device_attach (device_t dev) |
Attach a device driver to a device. More... | |
int | device_detach (device_t dev) |
Detach a driver from a device. More... | |
int | device_quiesce (device_t dev) |
Tells a driver to quiesce itself. More... | |
int | device_shutdown (device_t dev) |
Notify a device of system shutdown. More... | |
int | device_set_unit (device_t dev, int unit) |
Set the unit number of a device. More... | |
void | resource_init_map_request_impl (struct resource_map_request *args, size_t sz) |
void | resource_list_init (struct resource_list *rl) |
Initialise a resource list. More... | |
void | resource_list_free (struct resource_list *rl) |
Reclaim memory used by a resource list. More... | |
int | resource_list_add_next (struct resource_list *rl, int type, rman_res_t start, rman_res_t end, rman_res_t count) |
Add a resource entry. More... | |
struct resource_list_entry * | resource_list_add (struct resource_list *rl, int type, int rid, rman_res_t start, rman_res_t end, rman_res_t count) |
Add or modify a resource entry. More... | |
int | resource_list_busy (struct resource_list *rl, int type, int rid) |
Determine if a resource entry is busy. More... | |
int | resource_list_reserved (struct resource_list *rl, int type, int rid) |
Determine if a resource entry is reserved. More... | |
struct resource_list_entry * | resource_list_find (struct resource_list *rl, int type, int rid) |
Find a resource entry by type and rid. More... | |
void | resource_list_delete (struct resource_list *rl, int type, int rid) |
Delete a resource entry. More... | |
struct resource * | resource_list_reserve (struct resource_list *rl, device_t bus, device_t child, int type, int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) |
Allocate a reserved resource. More... | |
struct resource * | resource_list_alloc (struct resource_list *rl, device_t bus, device_t child, int type, int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) |
Helper function for implementing BUS_ALLOC_RESOURCE() More... | |
int | resource_list_release (struct resource_list *rl, device_t bus, device_t child, int type, int rid, struct resource *res) |
Helper function for implementing BUS_RELEASE_RESOURCE() More... | |
int | resource_list_release_active (struct resource_list *rl, device_t bus, device_t child, int type) |
Release all active resources of a given type. More... | |
int | resource_list_unreserve (struct resource_list *rl, device_t bus, device_t child, int type, int rid) |
Fully release a reserved resource. More... | |
int | resource_list_print_type (struct resource_list *rl, const char *name, int type, const char *format) |
Print a description of resources in a resource list. More... | |
void | resource_list_purge (struct resource_list *rl) |
Releases all the resources in a list. More... | |
device_t | bus_generic_add_child (device_t dev, u_int order, const char *name, int unit) |
int | bus_generic_probe (device_t dev) |
Helper function for implementing DEVICE_PROBE() More... | |
int | bus_generic_attach (device_t dev) |
Helper function for implementing DEVICE_ATTACH() More... | |
int | bus_delayed_attach_children (device_t dev) |
Helper function for delaying attaching children. More... | |
int | bus_generic_detach (device_t dev) |
Helper function for implementing DEVICE_DETACH() More... | |
int | bus_generic_shutdown (device_t dev) |
Helper function for implementing DEVICE_SHUTDOWN() More... | |
int | bus_generic_suspend_child (device_t dev, device_t child) |
Default function for suspending a child device. More... | |
int | bus_generic_resume_child (device_t dev, device_t child) |
Default function for resuming a child device. More... | |
int | bus_generic_suspend (device_t dev) |
Helper function for implementing DEVICE_SUSPEND() More... | |
int | bus_generic_resume (device_t dev) |
Helper function for implementing DEVICE_RESUME() More... | |
int | bus_helper_reset_post (device_t dev, int flags) |
Helper function for implementing BUS_RESET_POST. More... | |
static void | bus_helper_reset_prepare_rollback (device_t dev, device_t child, int flags) |
int | bus_helper_reset_prepare (device_t dev, int flags) |
Helper function for implementing BUS_RESET_PREPARE. More... | |
int | bus_print_child_header (device_t dev, device_t child) |
Helper function for implementing BUS_PRINT_CHILD(). More... | |
int | bus_print_child_footer (device_t dev, device_t child) |
Helper function for implementing BUS_PRINT_CHILD(). More... | |
int | bus_print_child_domain (device_t dev, device_t child) |
Helper function for implementing BUS_PRINT_CHILD(). More... | |
int | bus_generic_print_child (device_t dev, device_t child) |
Helper function for implementing BUS_PRINT_CHILD(). More... | |
int | bus_generic_read_ivar (device_t dev, device_t child, int index, uintptr_t *result) |
Stub function for implementing BUS_READ_IVAR(). More... | |
int | bus_generic_write_ivar (device_t dev, device_t child, int index, uintptr_t value) |
Stub function for implementing BUS_WRITE_IVAR(). More... | |
ssize_t | bus_generic_get_property (device_t dev, device_t child, const char *propname, void *propvalue, size_t size, device_property_type_t type) |
Helper function for implementing BUS_GET_PROPERTY(). More... | |
struct resource_list * | bus_generic_get_resource_list (device_t dev, device_t child) |
Stub function for implementing BUS_GET_RESOURCE_LIST(). More... | |
void | bus_generic_driver_added (device_t dev, driver_t *driver) |
Helper function for implementing BUS_DRIVER_ADDED(). More... | |
void | bus_generic_new_pass (device_t dev) |
Helper function for implementing BUS_NEW_PASS(). More... | |
int | bus_generic_setup_intr (device_t dev, device_t child, struct resource *irq, int flags, driver_filter_t *filter, driver_intr_t *intr, void *arg, void **cookiep) |
Helper function for implementing BUS_SETUP_INTR(). More... | |
int | bus_generic_teardown_intr (device_t dev, device_t child, struct resource *irq, void *cookie) |
Helper function for implementing BUS_TEARDOWN_INTR(). More... | |
int | bus_generic_suspend_intr (device_t dev, device_t child, struct resource *irq) |
Helper function for implementing BUS_SUSPEND_INTR(). More... | |
int | bus_generic_resume_intr (device_t dev, device_t child, struct resource *irq) |
Helper function for implementing BUS_RESUME_INTR(). More... | |
int | bus_generic_adjust_resource (device_t dev, device_t child, int type, struct resource *r, rman_res_t start, rman_res_t end) |
Helper function for implementing BUS_ADJUST_RESOURCE(). More... | |
int | bus_generic_translate_resource (device_t dev, int type, rman_res_t start, rman_res_t *newstart) |
struct resource * | bus_generic_alloc_resource (device_t dev, device_t child, int type, int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) |
Helper function for implementing BUS_ALLOC_RESOURCE(). More... | |
int | bus_generic_release_resource (device_t dev, device_t child, int type, int rid, struct resource *r) |
Helper function for implementing BUS_RELEASE_RESOURCE(). More... | |
int | bus_generic_activate_resource (device_t dev, device_t child, int type, int rid, struct resource *r) |
Helper function for implementing BUS_ACTIVATE_RESOURCE(). More... | |
int | bus_generic_deactivate_resource (device_t dev, device_t child, int type, int rid, struct resource *r) |
Helper function for implementing BUS_DEACTIVATE_RESOURCE(). More... | |
int | bus_generic_map_resource (device_t dev, device_t child, int type, struct resource *r, struct resource_map_request *args, struct resource_map *map) |
Helper function for implementing BUS_MAP_RESOURCE(). More... | |
int | bus_generic_unmap_resource (device_t dev, device_t child, int type, struct resource *r, struct resource_map *map) |
Helper function for implementing BUS_UNMAP_RESOURCE(). More... | |
int | bus_generic_bind_intr (device_t dev, device_t child, struct resource *irq, int cpu) |
Helper function for implementing BUS_BIND_INTR(). More... | |
int | bus_generic_config_intr (device_t dev, int irq, enum intr_trigger trig, enum intr_polarity pol) |
Helper function for implementing BUS_CONFIG_INTR(). More... | |
int | bus_generic_describe_intr (device_t dev, device_t child, struct resource *irq, void *cookie, const char *descr) |
Helper function for implementing BUS_DESCRIBE_INTR(). More... | |
int | bus_generic_get_cpus (device_t dev, device_t child, enum cpu_sets op, size_t setsize, cpuset_t *cpuset) |
Helper function for implementing BUS_GET_CPUS(). More... | |
bus_dma_tag_t | bus_generic_get_dma_tag (device_t dev, device_t child) |
Helper function for implementing BUS_GET_DMA_TAG(). More... | |
bus_space_tag_t | bus_generic_get_bus_tag (device_t dev, device_t child) |
Helper function for implementing BUS_GET_BUS_TAG(). More... | |
int | bus_generic_rl_get_resource (device_t dev, device_t child, int type, int rid, rman_res_t *startp, rman_res_t *countp) |
Helper function for implementing BUS_GET_RESOURCE(). More... | |
int | bus_generic_rl_set_resource (device_t dev, device_t child, int type, int rid, rman_res_t start, rman_res_t count) |
Helper function for implementing BUS_SET_RESOURCE(). More... | |
void | bus_generic_rl_delete_resource (device_t dev, device_t child, int type, int rid) |
Helper function for implementing BUS_DELETE_RESOURCE(). More... | |
int | bus_generic_rl_release_resource (device_t dev, device_t child, int type, int rid, struct resource *r) |
Helper function for implementing BUS_RELEASE_RESOURCE(). More... | |
struct resource * | bus_generic_rl_alloc_resource (device_t dev, device_t child, int type, int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) |
Helper function for implementing BUS_ALLOC_RESOURCE(). More... | |
int | bus_generic_child_present (device_t dev, device_t child) |
Helper function for implementing BUS_CHILD_PRESENT(). More... | |
int | bus_generic_get_domain (device_t dev, device_t child, int *domain) |
int | bus_generic_get_device_path (device_t bus, device_t child, const char *locator, struct sbuf *sb) |
Helper function to implement normal BUS_GET_DEVICE_PATH() More... | |
int | bus_null_rescan (device_t dev) |
Helper function for implementing BUS_RESCAN(). More... | |
int | bus_alloc_resources (device_t dev, struct resource_spec *rs, struct resource **res) |
void | bus_release_resources (device_t dev, const struct resource_spec *rs, struct resource **res) |
struct resource * | bus_alloc_resource (device_t dev, int type, int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) |
Wrapper function for BUS_ALLOC_RESOURCE(). More... | |
int | bus_adjust_resource (device_t dev, int type, struct resource *r, rman_res_t start, rman_res_t end) |
Wrapper function for BUS_ADJUST_RESOURCE(). More... | |
int | bus_translate_resource (device_t dev, int type, rman_res_t start, rman_res_t *newstart) |
Wrapper function for BUS_TRANSLATE_RESOURCE(). More... | |
int | bus_activate_resource (device_t dev, int type, int rid, struct resource *r) |
Wrapper function for BUS_ACTIVATE_RESOURCE(). More... | |
int | bus_deactivate_resource (device_t dev, int type, int rid, struct resource *r) |
Wrapper function for BUS_DEACTIVATE_RESOURCE(). More... | |
int | bus_map_resource (device_t dev, int type, struct resource *r, struct resource_map_request *args, struct resource_map *map) |
Wrapper function for BUS_MAP_RESOURCE(). More... | |
int | bus_unmap_resource (device_t dev, int type, struct resource *r, struct resource_map *map) |
Wrapper function for BUS_UNMAP_RESOURCE(). More... | |
int | bus_release_resource (device_t dev, int type, int rid, struct resource *r) |
Wrapper function for BUS_RELEASE_RESOURCE(). More... | |
int | bus_setup_intr (device_t dev, struct resource *r, int flags, driver_filter_t filter, driver_intr_t handler, void *arg, void **cookiep) |
Wrapper function for BUS_SETUP_INTR(). More... | |
int | bus_teardown_intr (device_t dev, struct resource *r, void *cookie) |
Wrapper function for BUS_TEARDOWN_INTR(). More... | |
int | bus_suspend_intr (device_t dev, struct resource *r) |
Wrapper function for BUS_SUSPEND_INTR(). More... | |
int | bus_resume_intr (device_t dev, struct resource *r) |
Wrapper function for BUS_RESUME_INTR(). More... | |
int | bus_bind_intr (device_t dev, struct resource *r, int cpu) |
Wrapper function for BUS_BIND_INTR(). More... | |
int | bus_describe_intr (device_t dev, struct resource *irq, void *cookie, const char *fmt,...) |
Wrapper function for BUS_DESCRIBE_INTR(). More... | |
int | bus_set_resource (device_t dev, int type, int rid, rman_res_t start, rman_res_t count) |
Wrapper function for BUS_SET_RESOURCE(). More... | |
int | bus_get_resource (device_t dev, int type, int rid, rman_res_t *startp, rman_res_t *countp) |
Wrapper function for BUS_GET_RESOURCE(). More... | |
rman_res_t | bus_get_resource_start (device_t dev, int type, int rid) |
Wrapper function for BUS_GET_RESOURCE(). More... | |
rman_res_t | bus_get_resource_count (device_t dev, int type, int rid) |
Wrapper function for BUS_GET_RESOURCE(). More... | |
void | bus_delete_resource (device_t dev, int type, int rid) |
Wrapper function for BUS_DELETE_RESOURCE(). More... | |
int | bus_child_present (device_t child) |
Wrapper function for BUS_CHILD_PRESENT(). More... | |
int | bus_child_pnpinfo (device_t child, struct sbuf *sb) |
Wrapper function for BUS_CHILD_PNPINFO(). More... | |
int | bus_generic_child_pnpinfo (device_t dev, device_t child, struct sbuf *sb) |
Generic implementation that does nothing for bus_child_pnpinfo. More... | |
int | bus_child_location (device_t child, struct sbuf *sb) |
Wrapper function for BUS_CHILD_LOCATION(). More... | |
int | bus_generic_child_location (device_t dev, device_t child, struct sbuf *sb) |
Generic implementation that does nothing for bus_child_location. More... | |
int | bus_get_cpus (device_t dev, enum cpu_sets op, size_t setsize, cpuset_t *cpuset) |
Wrapper function for BUS_GET_CPUS(). More... | |
bus_dma_tag_t | bus_get_dma_tag (device_t dev) |
Wrapper function for BUS_GET_DMA_TAG(). More... | |
bus_space_tag_t | bus_get_bus_tag (device_t dev) |
Wrapper function for BUS_GET_BUS_TAG(). More... | |
int | bus_get_domain (device_t dev, int *domain) |
Wrapper function for BUS_GET_DOMAIN(). More... | |
static int | root_resume (device_t dev) |
static int | root_print_child (device_t dev, device_t child) |
static int | root_setup_intr (device_t dev, device_t child, struct resource *irq, int flags, driver_filter_t *filter, driver_intr_t *intr, void *arg, void **cookiep) |
static int | root_child_present (device_t dev, device_t child) |
static int | root_get_cpus (device_t dev, device_t child, enum cpu_sets op, size_t setsize, cpuset_t *cpuset) |
static int | root_bus_module_handler (module_t mod, int what, void *arg) |
DECLARE_MODULE (rootbus, root_bus_mod, SI_SUB_DRIVERS, SI_ORDER_FIRST) | |
void | root_bus_configure (void) |
Automatically configure devices. More... | |
int | driver_module_handler (module_t mod, int what, void *arg) |
Module handler for registering device drivers. More... | |
void | bus_enumerate_hinted_children (device_t bus) |
Enumerate all hinted devices for this bus. More... | |
static int | sysctl_bus_info (SYSCTL_HANDLER_ARGS) |
SYSCTL_PROC (_hw_bus, OID_AUTO, info, CTLTYPE_STRUCT|CTLFLAG_RD|CTLFLAG_MPSAFE, NULL, 0, sysctl_bus_info, "S,u_businfo", "bus-related data") | |
static int | sysctl_devices (SYSCTL_HANDLER_ARGS) |
SYSCTL_NODE (_hw_bus, OID_AUTO, devices, CTLFLAG_RD|CTLFLAG_NEEDGIANT, sysctl_devices, "system device tree") | |
int | bus_data_generation_check (int generation) |
void | bus_data_generation_update (void) |
int | bus_free_resource (device_t dev, int type, struct resource *r) |
device_t | device_lookup_by_name (const char *name) |
static int | find_device (struct devreq *req, device_t *devp) |
static bool | driver_exists (device_t bus, const char *driver) |
static void | device_gen_nomatch (device_t dev) |
static void | device_do_deferred_actions (void) |
static char * | device_get_path (device_t dev, const char *locator) |
static int | devctl2_ioctl (struct cdev *cdev, u_long cmd, caddr_t data, int fflag, struct thread *td) |
typedef | TAILQ_HEAD (device_location_list, device_location_node) |
device_location_cache_t * | dev_wired_cache_init (void) |
void | dev_wired_cache_fini (device_location_cache_t *dcp) |
static struct device_location_node * | dev_wired_cache_lookup (device_location_cache_t *dcp, const char *locator) |
static struct device_location_node * | dev_wired_cache_add (device_location_cache_t *dcp, const char *locator, const char *path) |
bool | dev_wired_cache_match (device_location_cache_t *dcp, device_t dev, const char *at) |
SYSCTL_INT (_debug, OID_AUTO, obsolete_panic, CTLFLAG_RWTUN, &obsolete_panic, 0, "Panic when obsolete features are used (0 = never, 1 = if obsolete, " "2 = if deprecated)") | |
static void | gone_panic (int major, int running, const char *msg) |
void | _gone_in (int major, const char *msg) |
void | _gone_in_dev (device_t dev, int major, const char *msg) |
Variables | |
static bool | device_frozen |
static int | devctl_queue_length = DEVCTL_DEFAULT_QUEUE_LEN |
static d_open_t | devopen |
static d_close_t | devclose |
static d_read_t | devread |
static d_ioctl_t | devioctl |
static d_poll_t | devpoll |
static d_kqfilter_t | devkqfilter |
static struct cdevsw | dev_cdevsw |
static struct dev_softc | devsoftc |
struct filterops | devctl_rfiltops |
static struct cdev * | devctl_dev |
static struct device_list | bus_data_devices |
static int | bus_data_generation = 1 |
static kobj_method_t | null_methods [] |
static driver_list_t | passes = TAILQ_HEAD_INITIALIZER(passes) |
int | bus_current_pass = BUS_PASS_ROOT |
static devclass_list_t | devclasses = TAILQ_HEAD_INITIALIZER(devclasses) |
static kobj_method_t | root_methods [] |
static driver_t | root_driver |
device_t | root_bus |
devclass_t | root_devclass |
static moduledata_t | root_bus_mod |
static struct cdevsw | devctl2_cdevsw |
static int | obsolete_panic = 0 |
#define DC_HAS_CHILDREN 1 |
#define DEVCLANAME | ( | d | ) | ((d)? d->name : "no devclass") |
Definition at line 167 of file subr_bus.c.
#define DEVCTL_BUFFER (1024 - sizeof(void *)) |
Definition at line 399 of file subr_bus.c.
#define DEVCTL_DEFAULT_QUEUE_LEN 1000 |
Definition at line 375 of file subr_bus.c.
#define DEVICENAME | ( | d | ) | /* nop */ |
Definition at line 198 of file subr_bus.c.
#define DL_DEFERRED_PROBE 1 /* Probe deferred on this */ |
#define DRIVERNAME | ( | d | ) | ((d)? d->name : "no driver") |
Definition at line 166 of file subr_bus.c.
#define PDEBUG | ( | a | ) | /* nop */ |
Definition at line 197 of file subr_bus.c.
#define print_devclass | ( | d, | |
i | |||
) | /* nop */ |
Definition at line 208 of file subr_bus.c.
#define print_devclass_list | ( | ) | /* nop */ |
Definition at line 210 of file subr_bus.c.
#define print_devclass_list_short | ( | ) | /* nop */ |
Definition at line 209 of file subr_bus.c.
#define print_devclass_short | ( | d, | |
i | |||
) | /* nop */ |
Definition at line 207 of file subr_bus.c.
#define print_device | ( | d, | |
i | |||
) | /* nop */ |
Definition at line 201 of file subr_bus.c.
#define print_device_short | ( | d, | |
i | |||
) | /* nop */ |
Definition at line 200 of file subr_bus.c.
#define print_device_tree | ( | d, | |
i | |||
) | /* nop */ |
Definition at line 203 of file subr_bus.c.
#define print_device_tree_short | ( | d, | |
i | |||
) | /* nop */ |
Definition at line 202 of file subr_bus.c.
#define print_driver | ( | d, | |
i | |||
) | /* nop */ |
Definition at line 205 of file subr_bus.c.
#define print_driver_list | ( | d, | |
i | |||
) | /* nop */ |
Definition at line 206 of file subr_bus.c.
#define print_driver_short | ( | d, | |
i | |||
) | /* nop */ |
Definition at line 204 of file subr_bus.c.
typedef struct driverlink* driverlink_t |
Definition at line 84 of file subr_bus.c.
anonymous enum |
Enumerator | |
---|---|
DEVCLASS_SYSCTL_PARENT |
Definition at line 217 of file subr_bus.c.
anonymous enum |
Enumerator | |
---|---|
DEVICE_SYSCTL_DESC | |
DEVICE_SYSCTL_DRIVER | |
DEVICE_SYSCTL_LOCATION | |
DEVICE_SYSCTL_PNPINFO | |
DEVICE_SYSCTL_PARENT |
Definition at line 253 of file subr_bus.c.
__FBSDID | ( | "$FreeBSD$" | ) |
void _gone_in | ( | int | major, |
const char * | msg | ||
) |
Definition at line 6259 of file subr_bus.c.
References gone_panic(), and printf().
void _gone_in_dev | ( | device_t | dev, |
int | major, | ||
const char * | msg | ||
) |
Definition at line 6270 of file subr_bus.c.
References device_printf(), and gone_panic().
int bus_activate_resource | ( | device_t | dev, |
int | type, | ||
int | rid, | ||
struct resource * | r | ||
) |
Wrapper function for BUS_ACTIVATE_RESOURCE().
This function simply calls the BUS_ACTIVATE_RESOURCE() method of the parent of dev
.
Definition at line 4818 of file subr_bus.c.
References type.
Referenced by resource_list_alloc().
int bus_adjust_resource | ( | device_t | dev, |
int | type, | ||
struct resource * | r, | ||
rman_res_t | start, | ||
rman_res_t | end | ||
) |
Wrapper function for BUS_ADJUST_RESOURCE().
This function simply calls the BUS_ADJUST_RESOURCE() method of the parent of dev
.
Definition at line 4788 of file subr_bus.c.
struct resource * bus_alloc_resource | ( | device_t | dev, |
int | type, | ||
int * | rid, | ||
rman_res_t | start, | ||
rman_res_t | end, | ||
rman_res_t | count, | ||
u_int | flags | ||
) |
int bus_alloc_resources | ( | device_t | dev, |
struct resource_spec * | rs, | ||
struct resource ** | res | ||
) |
Definition at line 4730 of file subr_bus.c.
References bus_release_resources(), flags, res, and type.
int bus_bind_intr | ( | device_t | dev, |
struct resource * | r, | ||
int | cpu | ||
) |
Wrapper function for BUS_BIND_INTR().
This function simply calls the BUS_BIND_INTR() method of the parent of dev
.
Definition at line 4958 of file subr_bus.c.
Referenced by taskqgroup_attach(), and taskqgroup_attach_cpu().
int bus_child_location | ( | device_t | child, |
struct sbuf * | sb | ||
) |
Wrapper function for BUS_CHILD_LOCATION().
This function simply calls the BUS_CHILD_LOCATION() method of the parent of dev
.
Definition at line 5115 of file subr_bus.c.
References child, device_get_parent(), and parent.
Referenced by devaddq(), device_sysctl_handler(), and sysctl_devices().
int bus_child_pnpinfo | ( | device_t | child, |
struct sbuf * | sb | ||
) |
Wrapper function for BUS_CHILD_PNPINFO().
This function simply calls the BUS_CHILD_PNPINFO() method of the parent of dev
.
Definition at line 5086 of file subr_bus.c.
References child, device_get_parent(), and parent.
Referenced by devaddq(), device_sysctl_handler(), and sysctl_devices().
int bus_child_present | ( | device_t | child | ) |
Wrapper function for BUS_CHILD_PRESENT().
This function simply calls the BUS_CHILD_PRESENT() method of the parent of dev
.
Definition at line 5074 of file subr_bus.c.
References child, and device_get_parent().
Referenced by devctl2_ioctl().
int bus_data_generation_check | ( | int | generation | ) |
Definition at line 5682 of file subr_bus.c.
References bus_data_generation.
Referenced by sysctl_devices(), and sysctl_rman().
void bus_data_generation_update | ( | void | ) |
Definition at line 5692 of file subr_bus.c.
References bus_data_generation.
Referenced by devclass_add_driver(), devclass_delete_driver(), devclass_find_internal(), device_add_child_ordered(), device_delete_child(), device_do_deferred_actions(), device_probe_child(), device_set_desc_internal(), device_set_devclass(), device_set_driver(), device_set_unit(), and make_device().
int bus_deactivate_resource | ( | device_t | dev, |
int | type, | ||
int | rid, | ||
struct resource * | r | ||
) |
Wrapper function for BUS_DEACTIVATE_RESOURCE().
This function simply calls the BUS_DEACTIVATE_RESOURCE() method of the parent of dev
.
Definition at line 4832 of file subr_bus.c.
References type.
Referenced by resource_list_release().
int bus_delayed_attach_children | ( | device_t | dev | ) |
Helper function for delaying attaching children.
Many buses can't run transactions on the bus which children need to probe and attach until after interrupts and/or timers are running. This function delays their attach until interrupts and timers are enabled.
Definition at line 3812 of file subr_bus.c.
References bus_generic_attach(), and config_intrhook_oneshot().
void bus_delete_resource | ( | device_t | dev, |
int | type, | ||
int | rid | ||
) |
Wrapper function for BUS_DELETE_RESOURCE().
This function simply calls the BUS_DELETE_RESOURCE() method of the parent of dev
.
Definition at line 5062 of file subr_bus.c.
References device_get_parent(), and type.
int bus_describe_intr | ( | device_t | dev, |
struct resource * | irq, | ||
void * | cookie, | ||
const char * | fmt, | ||
... | |||
) |
Wrapper function for BUS_DESCRIBE_INTR().
This function first formats the requested description into a temporary buffer and then calls the BUS_DESCRIBE_INTR() method of the parent of dev
.
Definition at line 4973 of file subr_bus.c.
References vsnprintf().
void bus_enumerate_hinted_children | ( | device_t | bus | ) |
Enumerate all hinted devices for this bus.
Walks through the hints for this bus and calls the bus_hinted_child routine for each one it fines. It searches first for the specific bus that's being probed for hinted children (eg isa0), and then for generic children (eg isa).
dev | bus device to enumerate |
Definition at line 5410 of file subr_bus.c.
References bus, device_get_name(), device_get_nameunit(), and resource_find_match().
int bus_free_resource | ( | device_t | dev, |
int | type, | ||
struct resource * | r | ||
) |
Definition at line 5698 of file subr_bus.c.
References bus_release_resource(), rman_get_rid(), and type.
int bus_generic_activate_resource | ( | device_t | dev, |
device_t | child, | ||
int | type, | ||
int | rid, | ||
struct resource * | r | ||
) |
Helper function for implementing BUS_ACTIVATE_RESOURCE().
This simple implementation of BUS_ACTIVATE_RESOURCE() simply calls the BUS_ACTIVATE_RESOURCE() method of the parent of dev
.
Definition at line 4362 of file subr_bus.c.
device_t bus_generic_add_child | ( | device_t | dev, |
u_int | order, | ||
const char * | name, | ||
int | unit | ||
) |
Definition at line 3748 of file subr_bus.c.
References device_add_child_ordered(), and name.
int bus_generic_adjust_resource | ( | device_t | dev, |
device_t | child, | ||
int | type, | ||
struct resource * | r, | ||
rman_res_t | start, | ||
rman_res_t | end | ||
) |
Helper function for implementing BUS_ADJUST_RESOURCE().
This simple implementation of BUS_ADJUST_RESOURCE() simply calls the BUS_ADJUST_RESOURCE() method of the parent of dev
.
Definition at line 4293 of file subr_bus.c.
struct resource * bus_generic_alloc_resource | ( | device_t | dev, |
device_t | child, | ||
int | type, | ||
int * | rid, | ||
rman_res_t | start, | ||
rman_res_t | end, | ||
rman_res_t | count, | ||
u_int | flags | ||
) |
int bus_generic_attach | ( | device_t | dev | ) |
Helper function for implementing DEVICE_ATTACH()
This function can be used to help implement the DEVICE_ATTACH() for a bus. It calls device_probe_and_attach() for each of the device's children.
Definition at line 3793 of file subr_bus.c.
References child, and device_probe_and_attach().
Referenced by bus_delayed_attach_children().
int bus_generic_bind_intr | ( | device_t | dev, |
device_t | child, | ||
struct resource * | irq, | ||
int | cpu | ||
) |
Helper function for implementing BUS_BIND_INTR().
This simple implementation of BUS_BIND_INTR() simply calls the BUS_BIND_INTR() method of the parent of dev
.
Definition at line 4430 of file subr_bus.c.
References child.
int bus_generic_child_location | ( | device_t | dev, |
device_t | child, | ||
struct sbuf * | sb | ||
) |
Generic implementation that does nothing for bus_child_location.
This function has the right signature and returns 0 since the sbuf is passed to us to append to.
Definition at line 5132 of file subr_bus.c.
int bus_generic_child_pnpinfo | ( | device_t | dev, |
device_t | child, | ||
struct sbuf * | sb | ||
) |
Generic implementation that does nothing for bus_child_pnpinfo.
This function has the right signature and returns 0 since the sbuf is passed to us to append to.
Definition at line 5103 of file subr_bus.c.
int bus_generic_child_present | ( | device_t | dev, |
device_t | child | ||
) |
Helper function for implementing BUS_CHILD_PRESENT().
This simple implementation of BUS_CHILD_PRESENT() simply calls the BUS_CHILD_PRESENT() method of the parent of dev
.
Definition at line 4650 of file subr_bus.c.
References device_get_parent().
int bus_generic_config_intr | ( | device_t | dev, |
int | irq, | ||
enum intr_trigger | trig, | ||
enum intr_polarity | pol | ||
) |
Helper function for implementing BUS_CONFIG_INTR().
This simple implementation of BUS_CONFIG_INTR() simply calls the BUS_CONFIG_INTR() method of the parent of dev
.
Definition at line 4446 of file subr_bus.c.
int bus_generic_deactivate_resource | ( | device_t | dev, |
device_t | child, | ||
int | type, | ||
int | rid, | ||
struct resource * | r | ||
) |
Helper function for implementing BUS_DEACTIVATE_RESOURCE().
This simple implementation of BUS_DEACTIVATE_RESOURCE() simply calls the BUS_DEACTIVATE_RESOURCE() method of the parent of dev
.
Definition at line 4379 of file subr_bus.c.
int bus_generic_describe_intr | ( | device_t | dev, |
device_t | child, | ||
struct resource * | irq, | ||
void * | cookie, | ||
const char * | descr | ||
) |
Helper function for implementing BUS_DESCRIBE_INTR().
This simple implementation of BUS_DESCRIBE_INTR() simply calls the BUS_DESCRIBE_INTR() method of the parent of dev
.
Definition at line 4462 of file subr_bus.c.
References child.
int bus_generic_detach | ( | device_t | dev | ) |
Helper function for implementing DEVICE_DETACH()
This function can be used to help implement the DEVICE_DETACH() for a bus. It calls device_detach() for each of the device's children.
Definition at line 3828 of file subr_bus.c.
References child, and device_detach().
void bus_generic_driver_added | ( | device_t | dev, |
driver_t * | driver | ||
) |
Helper function for implementing BUS_DRIVER_ADDED().
This implementation of BUS_DRIVER_ADDED() simply calls the driver's DEVICE_IDENTIFY() method to allow it to add new children to the bus and then calls device_probe_and_attach() for each unattached child.
Definition at line 4181 of file subr_bus.c.
References child, and device_probe_and_attach().
bus_space_tag_t bus_generic_get_bus_tag | ( | device_t | dev, |
device_t | child | ||
) |
Helper function for implementing BUS_GET_BUS_TAG().
This simple implementation of BUS_GET_BUS_TAG() simply calls the BUS_GET_BUS_TAG() method of the parent of dev
.
Definition at line 4510 of file subr_bus.c.
References child.
int bus_generic_get_cpus | ( | device_t | dev, |
device_t | child, | ||
enum cpu_sets | op, | ||
size_t | setsize, | ||
cpuset_t * | cpuset | ||
) |
Helper function for implementing BUS_GET_CPUS().
This simple implementation of BUS_GET_CPUS() simply calls the BUS_GET_CPUS() method of the parent of dev
.
Definition at line 4479 of file subr_bus.c.
References child.
int bus_generic_get_device_path | ( | device_t | bus, |
device_t | child, | ||
const char * | locator, | ||
struct sbuf * | sb | ||
) |
Helper function to implement normal BUS_GET_DEVICE_PATH()
This function knows how to (a) pass the request up the tree if there's a parent and (b) Knows how to supply a FreeBSD locator.
bus | bus in the walk up the tree |
child | leaf node to print information about |
locator | BUS_LOCATOR_xxx string for locator |
sb | Buffer to print information into |
Definition at line 4676 of file subr_bus.c.
References bus, child, device_get_nameunit(), device_get_parent(), parent, and sbuf_printf().
bus_dma_tag_t bus_generic_get_dma_tag | ( | device_t | dev, |
device_t | child | ||
) |
Helper function for implementing BUS_GET_DMA_TAG().
This simple implementation of BUS_GET_DMA_TAG() simply calls the BUS_GET_DMA_TAG() method of the parent of dev
.
Definition at line 4495 of file subr_bus.c.
References child.
int bus_generic_get_domain | ( | device_t | dev, |
device_t | child, | ||
int * | domain | ||
) |
Definition at line 4656 of file subr_bus.c.
References domain.
ssize_t bus_generic_get_property | ( | device_t | dev, |
device_t | child, | ||
const char * | propname, | ||
void * | propvalue, | ||
size_t | size, | ||
device_property_type_t | type | ||
) |
Helper function for implementing BUS_GET_PROPERTY().
This simply calls the BUS_GET_PROPERTY of the parent of dev, until a non-default implementation is found.
Definition at line 4152 of file subr_bus.c.
References child, device_get_parent(), and type.
struct resource_list * bus_generic_get_resource_list | ( | device_t | dev, |
device_t | child | ||
) |
Stub function for implementing BUS_GET_RESOURCE_LIST().
Definition at line 4168 of file subr_bus.c.
int bus_generic_map_resource | ( | device_t | dev, |
device_t | child, | ||
int | type, | ||
struct resource * | r, | ||
struct resource_map_request * | args, | ||
struct resource_map * | map | ||
) |
Helper function for implementing BUS_MAP_RESOURCE().
This simple implementation of BUS_MAP_RESOURCE() simply calls the BUS_MAP_RESOURCE() method of the parent of dev
.
Definition at line 4396 of file subr_bus.c.
void bus_generic_new_pass | ( | device_t | dev | ) |
Helper function for implementing BUS_NEW_PASS().
This implementing of BUS_NEW_PASS() first calls the identify routines for any drivers that probe at the current pass. Then it walks the list of devices for this bus. If a device is already attached, then it calls BUS_NEW_PASS() on that device. If the device is not already attached, it attempts to attach a driver to it.
Definition at line 4203 of file subr_bus.c.
References bus_current_pass, child, device_probe_and_attach(), and driverlink::driver.
int bus_generic_print_child | ( | device_t | dev, |
device_t | child | ||
) |
Helper function for implementing BUS_PRINT_CHILD().
This function simply calls bus_print_child_header() followed by bus_print_child_footer().
Definition at line 4110 of file subr_bus.c.
References bus_print_child_domain(), bus_print_child_footer(), bus_print_child_header(), and child.
int bus_generic_probe | ( | device_t | dev | ) |
Helper function for implementing DEVICE_PROBE()
This function can be used to help implement the DEVICE_PROBE() for a bus (i.e. a device which has other devices attached to it). It calls the DEVICE_IDENTIFY() method of each driver in the device's devclass.
Definition at line 3762 of file subr_bus.c.
References bus_current_pass, and driverlink::driver.
int bus_generic_read_ivar | ( | device_t | dev, |
device_t | child, | ||
int | index, | ||
uintptr_t * | result | ||
) |
Stub function for implementing BUS_READ_IVAR().
Definition at line 4127 of file subr_bus.c.
int bus_generic_release_resource | ( | device_t | dev, |
device_t | child, | ||
int | type, | ||
int | rid, | ||
struct resource * | r | ||
) |
Helper function for implementing BUS_RELEASE_RESOURCE().
This simple implementation of BUS_RELEASE_RESOURCE() simply calls the BUS_RELEASE_RESOURCE() method of the parent of dev
.
Definition at line 4345 of file subr_bus.c.
int bus_generic_resume | ( | device_t | dev | ) |
Helper function for implementing DEVICE_RESUME()
This function can be used to help implement the DEVICE_RESUME() for a bus. It calls DEVICE_RESUME() on each of the device's children.
Definition at line 3946 of file subr_bus.c.
References child.
Referenced by root_resume().
int bus_generic_resume_child | ( | device_t | dev, |
device_t | child | ||
) |
Default function for resuming a child device.
This function is to be used by a bus's DEVICE_RESUME_CHILD().
Definition at line 3895 of file subr_bus.c.
References child.
int bus_generic_resume_intr | ( | device_t | dev, |
device_t | child, | ||
struct resource * | irq | ||
) |
Helper function for implementing BUS_RESUME_INTR().
This simple implementation of BUS_RESUME_INTR() simply calls the BUS_RESUME_INTR() method of the parent of dev
.
Definition at line 4278 of file subr_bus.c.
References child.
struct resource * bus_generic_rl_alloc_resource | ( | device_t | dev, |
device_t | child, | ||
int | type, | ||
int * | rid, | ||
rman_res_t | start, | ||
rman_res_t | end, | ||
rman_res_t | count, | ||
u_int | flags | ||
) |
Helper function for implementing BUS_ALLOC_RESOURCE().
This implementation of BUS_ALLOC_RESOURCE() uses the resource_list_alloc() function to do most of the work. It calls BUS_GET_RESOURCE_LIST() to find a suitable resource list.
Definition at line 4626 of file subr_bus.c.
References child, count, device_get_parent(), flags, resource_list_alloc(), start, and type.
void bus_generic_rl_delete_resource | ( | device_t | dev, |
device_t | child, | ||
int | type, | ||
int | rid | ||
) |
Helper function for implementing BUS_DELETE_RESOURCE().
This implementation of BUS_DELETE_RESOURCE() uses the resource_list_delete() function to do most of the work. It calls BUS_GET_RESOURCE_LIST() to find a suitable resource list to edit.
Definition at line 4581 of file subr_bus.c.
References child, resource_list_delete(), and type.
int bus_generic_rl_get_resource | ( | device_t | dev, |
device_t | child, | ||
int | type, | ||
int | rid, | ||
rman_res_t * | startp, | ||
rman_res_t * | countp | ||
) |
Helper function for implementing BUS_GET_RESOURCE().
This implementation of BUS_GET_RESOURCE() uses the resource_list_find() function to do most of the work. It calls BUS_GET_RESOURCE_LIST() to find a suitable resource list to search.
Definition at line 4527 of file subr_bus.c.
References child, resource_list_find(), and type.
int bus_generic_rl_release_resource | ( | device_t | dev, |
device_t | child, | ||
int | type, | ||
int | rid, | ||
struct resource * | r | ||
) |
Helper function for implementing BUS_RELEASE_RESOURCE().
This implementation of BUS_RELEASE_RESOURCE() uses the resource_list_release() function to do most of the work. It calls BUS_GET_RESOURCE_LIST() to find a suitable resource list.
Definition at line 4602 of file subr_bus.c.
References child, device_get_parent(), resource_list_release(), and type.
int bus_generic_rl_set_resource | ( | device_t | dev, |
device_t | child, | ||
int | type, | ||
int | rid, | ||
rman_res_t | start, | ||
rman_res_t | count | ||
) |
Helper function for implementing BUS_SET_RESOURCE().
This implementation of BUS_SET_RESOURCE() uses the resource_list_add() function to do most of the work. It calls BUS_GET_RESOURCE_LIST() to find a suitable resource list to edit.
Definition at line 4558 of file subr_bus.c.
References child, count, resource_list_add(), start, and type.
int bus_generic_setup_intr | ( | device_t | dev, |
device_t | child, | ||
struct resource * | irq, | ||
int | flags, | ||
driver_filter_t * | filter, | ||
driver_intr_t * | intr, | ||
void * | arg, | ||
void ** | cookiep | ||
) |
Helper function for implementing BUS_SETUP_INTR().
This simple implementation of BUS_SETUP_INTR() simply calls the BUS_SETUP_INTR() method of the parent of dev
.
Definition at line 4229 of file subr_bus.c.
int bus_generic_shutdown | ( | device_t | dev | ) |
Helper function for implementing DEVICE_SHUTDOWN()
This function can be used to help implement the DEVICE_SHUTDOWN() for a bus. It calls device_shutdown() for each of the device's children.
Definition at line 3856 of file subr_bus.c.
References child, and device_shutdown().
int bus_generic_suspend | ( | device_t | dev | ) |
Helper function for implementing DEVICE_SUSPEND()
This function can be used to help implement the DEVICE_SUSPEND() for a bus. It calls DEVICE_SUSPEND() for each of the device's children. If any call to DEVICE_SUSPEND() fails, the suspend operation is aborted and any devices which were suspended are resumed immediately by calling their DEVICE_RESUME() methods.
Definition at line 3913 of file subr_bus.c.
References child.
int bus_generic_suspend_child | ( | device_t | dev, |
device_t | child | ||
) |
Default function for suspending a child device.
This function is to be used by a bus's DEVICE_SUSPEND_CHILD().
Definition at line 3877 of file subr_bus.c.
References child.
int bus_generic_suspend_intr | ( | device_t | dev, |
device_t | child, | ||
struct resource * | irq | ||
) |
Helper function for implementing BUS_SUSPEND_INTR().
This simple implementation of BUS_SUSPEND_INTR() simply calls the BUS_SUSPEND_INTR() method of the parent of dev
.
Definition at line 4263 of file subr_bus.c.
References child.
int bus_generic_teardown_intr | ( | device_t | dev, |
device_t | child, | ||
struct resource * | irq, | ||
void * | cookie | ||
) |
Helper function for implementing BUS_TEARDOWN_INTR().
This simple implementation of BUS_TEARDOWN_INTR() simply calls the BUS_TEARDOWN_INTR() method of the parent of dev
.
Definition at line 4247 of file subr_bus.c.
References child.
int bus_generic_translate_resource | ( | device_t | dev, |
int | type, | ||
rman_res_t | start, | ||
rman_res_t * | newstart | ||
) |
Definition at line 4311 of file subr_bus.c.
int bus_generic_unmap_resource | ( | device_t | dev, |
device_t | child, | ||
int | type, | ||
struct resource * | r, | ||
struct resource_map * | map | ||
) |
Helper function for implementing BUS_UNMAP_RESOURCE().
This simple implementation of BUS_UNMAP_RESOURCE() simply calls the BUS_UNMAP_RESOURCE() method of the parent of dev
.
Definition at line 4414 of file subr_bus.c.
int bus_generic_write_ivar | ( | device_t | dev, |
device_t | child, | ||
int | index, | ||
uintptr_t | value | ||
) |
Stub function for implementing BUS_WRITE_IVAR().
Definition at line 4139 of file subr_bus.c.
bus_space_tag_t bus_get_bus_tag | ( | device_t | dev | ) |
Wrapper function for BUS_GET_BUS_TAG().
This function simply calls the BUS_GET_BUS_TAG() method of the parent of dev
.
Definition at line 5178 of file subr_bus.c.
References device_get_parent(), and parent.
int bus_get_cpus | ( | device_t | dev, |
enum cpu_sets | op, | ||
size_t | setsize, | ||
cpuset_t * | cpuset | ||
) |
Wrapper function for BUS_GET_CPUS().
This function simply calls the BUS_GET_CPUS() method of the parent of dev
.
Definition at line 5144 of file subr_bus.c.
References device_get_parent(), and parent.
bus_dma_tag_t bus_get_dma_tag | ( | device_t | dev | ) |
Wrapper function for BUS_GET_DMA_TAG().
This function simply calls the BUS_GET_DMA_TAG() method of the parent of dev
.
Definition at line 5161 of file subr_bus.c.
References device_get_parent(), and parent.
int bus_get_domain | ( | device_t | dev, |
int * | domain | ||
) |
Wrapper function for BUS_GET_DOMAIN().
This function simply calls the BUS_GET_DOMAIN() method of the parent of dev
.
Definition at line 5195 of file subr_bus.c.
References device_get_parent(), and domain.
Referenced by device_set_driver(), and device_sysctl_init().
int bus_get_resource | ( | device_t | dev, |
int | type, | ||
int | rid, | ||
rman_res_t * | startp, | ||
rman_res_t * | countp | ||
) |
Wrapper function for BUS_GET_RESOURCE().
This function simply calls the BUS_GET_RESOURCE() method of the parent of dev
.
Definition at line 5008 of file subr_bus.c.
References device_get_parent(), and type.
rman_res_t bus_get_resource_count | ( | device_t | dev, |
int | type, | ||
int | rid | ||
) |
Wrapper function for BUS_GET_RESOURCE().
This function simply calls the BUS_GET_RESOURCE() method of the parent of dev
and returns the count value.
Definition at line 5042 of file subr_bus.c.
References count, device_get_parent(), start, and type.
rman_res_t bus_get_resource_start | ( | device_t | dev, |
int | type, | ||
int | rid | ||
) |
Wrapper function for BUS_GET_RESOURCE().
This function simply calls the BUS_GET_RESOURCE() method of the parent of dev
and returns the start value.
Definition at line 5022 of file subr_bus.c.
References count, device_get_parent(), start, and type.
int bus_helper_reset_post | ( | device_t | dev, |
int | flags | ||
) |
Helper function for implementing BUS_RESET_POST.
Bus can use this function to implement common operations of re-attaching or resuming the children after the bus itself was reset, and after restoring bus-unique state of children.
dev | The bus #param flags DEVF_RESET_* |
Definition at line 3968 of file subr_bus.c.
References child, device_probe_and_attach(), and flags.
int bus_helper_reset_prepare | ( | device_t | dev, |
int | flags | ||
) |
Helper function for implementing BUS_RESET_PREPARE.
Bus can use this function to implement common operations of detaching or suspending the children before the bus itself is reset, and then save bus-unique state of children that must persists around reset.
dev | The bus #param flags DEVF_RESET_* |
Definition at line 4012 of file subr_bus.c.
References bus_helper_reset_prepare_rollback(), child, device_detach(), device_get_state(), device_probe_and_attach(), and flags.
|
static |
Definition at line 3986 of file subr_bus.c.
References child, device_probe_and_attach(), and flags.
Referenced by bus_helper_reset_prepare().
int bus_map_resource | ( | device_t | dev, |
int | type, | ||
struct resource * | r, | ||
struct resource_map_request * | args, | ||
struct resource_map * | map | ||
) |
Wrapper function for BUS_MAP_RESOURCE().
This function simply calls the BUS_MAP_RESOURCE() method of the parent of dev
.
Definition at line 4846 of file subr_bus.c.
References type.
int bus_null_rescan | ( | device_t | dev | ) |
Helper function for implementing BUS_RESCAN().
This null implementation of BUS_RESCAN() always fails to indicate the bus does not support rescanning.
Definition at line 4716 of file subr_bus.c.
int bus_print_child_domain | ( | device_t | dev, |
device_t | child | ||
) |
Helper function for implementing BUS_PRINT_CHILD().
This function prints out the VM domain for the given device.
Definition at line 4090 of file subr_bus.c.
References child, domain, and printf().
Referenced by bus_generic_print_child().
int bus_print_child_footer | ( | device_t | dev, |
device_t | child | ||
) |
Helper function for implementing BUS_PRINT_CHILD().
This function prints the last part of the ascii representation of child
, which consists of the string " on "
followed by the name and unit of the dev
.
Definition at line 4077 of file subr_bus.c.
References device_get_nameunit(), and printf().
Referenced by bus_generic_print_child().
int bus_print_child_header | ( | device_t | dev, |
device_t | child | ||
) |
Helper function for implementing BUS_PRINT_CHILD().
This function prints the first part of the ascii representation of child
, including its name, unit and description (if any - see device_set_desc()).
Definition at line 4054 of file subr_bus.c.
References child, device_get_desc(), device_get_nameunit(), device_printf(), and printf().
Referenced by bus_generic_print_child(), and root_print_child().
int bus_release_resource | ( | device_t | dev, |
int | type, | ||
int | rid, | ||
struct resource * | r | ||
) |
Wrapper function for BUS_RELEASE_RESOURCE().
This function simply calls the BUS_RELEASE_RESOURCE() method of the parent of dev
.
Definition at line 4876 of file subr_bus.c.
References type.
Referenced by bus_free_resource(), bus_release_resources(), and resource_list_purge().
void bus_release_resources | ( | device_t | dev, |
const struct resource_spec * | rs, | ||
struct resource ** | res | ||
) |
Definition at line 4749 of file subr_bus.c.
References bus_release_resource(), res, and type.
Referenced by bus_alloc_resources().
int bus_resume_intr | ( | device_t | dev, |
struct resource * | r | ||
) |
Wrapper function for BUS_RESUME_INTR().
This function simply calls the BUS_RESUME_INTR() method of the parent of dev
.
Definition at line 4944 of file subr_bus.c.
void bus_set_pass | ( | int | pass | ) |
Raise the current bus pass.
Raise the current bus pass level to pass
. Call the BUS_NEW_PASS() method on the root bus to kick off a new device tree scan for each new pass level that has at least one driver.
Definition at line 948 of file subr_bus.c.
References bus_current_pass, panic(), passes, and root_bus.
Referenced by root_bus_configure().
int bus_set_resource | ( | device_t | dev, |
int | type, | ||
int | rid, | ||
rman_res_t | start, | ||
rman_res_t | count | ||
) |
Wrapper function for BUS_SET_RESOURCE().
This function simply calls the BUS_SET_RESOURCE() method of the parent of dev
.
Definition at line 4994 of file subr_bus.c.
References count, device_get_parent(), start, and type.
int bus_setup_intr | ( | device_t | dev, |
struct resource * | r, | ||
int | flags, | ||
driver_filter_t | filter, | ||
driver_intr_t | handler, | ||
void * | arg, | ||
void ** | cookiep | ||
) |
Wrapper function for BUS_SETUP_INTR().
This function simply calls the BUS_SETUP_INTR() method of the parent of dev
.
Definition at line 4893 of file subr_bus.c.
References device_printf(), and flags.
int bus_suspend_intr | ( | device_t | dev, |
struct resource * | r | ||
) |
Wrapper function for BUS_SUSPEND_INTR().
This function simply calls the BUS_SUSPEND_INTR() method of the parent of dev
.
Definition at line 4930 of file subr_bus.c.
int bus_teardown_intr | ( | device_t | dev, |
struct resource * | r, | ||
void * | cookie | ||
) |
Wrapper function for BUS_TEARDOWN_INTR().
This function simply calls the BUS_TEARDOWN_INTR() method of the parent of dev
.
Definition at line 4916 of file subr_bus.c.
void bus_topo_assert | ( | ) |
Definition at line 871 of file subr_bus.c.
Referenced by device_detach(), device_probe(), device_probe_and_attach(), and device_probe_child().
void bus_topo_lock | ( | void | ) |
Definition at line 885 of file subr_bus.c.
References bus_topo_mtx().
Referenced by devctl2_ioctl(), and device_sysctl_handler().
struct mtx * bus_topo_mtx | ( | void | ) |
Definition at line 878 of file subr_bus.c.
References Giant.
Referenced by bus_topo_lock(), and bus_topo_unlock().
void bus_topo_unlock | ( | void | ) |
Definition at line 892 of file subr_bus.c.
References bus_topo_mtx().
Referenced by devctl2_ioctl(), and device_sysctl_handler().
int bus_translate_resource | ( | device_t | dev, |
int | type, | ||
rman_res_t | start, | ||
rman_res_t * | newstart | ||
) |
Wrapper function for BUS_TRANSLATE_RESOURCE().
This function simply calls the BUS_TRANSLATE_RESOURCE() method of the parent of dev
.
Definition at line 4803 of file subr_bus.c.
int bus_unmap_resource | ( | device_t | dev, |
int | type, | ||
struct resource * | r, | ||
struct resource_map * | map | ||
) |
Wrapper function for BUS_UNMAP_RESOURCE().
This function simply calls the BUS_UNMAP_RESOURCE() method of the parent of dev
.
Definition at line 4861 of file subr_bus.c.
References type.
DECLARE_MODULE | ( | rootbus | , |
root_bus_mod | , | ||
SI_SUB_DRIVERS | , | ||
SI_ORDER_FIRST | |||
) |
DEFINE_CLASS | ( | null | , |
null_methods | , | ||
0 | |||
) |
|
static |
Definition at line 6190 of file subr_bus.c.
References device_location_node::dln_locator, device_location_node::dln_path, malloc(), and path.
Referenced by dev_wired_cache_match().
void dev_wired_cache_fini | ( | device_location_cache_t * | dcp | ) |
Definition at line 6164 of file subr_bus.c.
References device_location_node::dln_path, and free().
device_location_cache_t * dev_wired_cache_init | ( | void | ) |
Definition at line 6153 of file subr_bus.c.
References malloc().
|
static |
Definition at line 6177 of file subr_bus.c.
References device_location_node::dln_locator.
Referenced by dev_wired_cache_match().
bool dev_wired_cache_match | ( | device_location_cache_t * | dcp, |
device_t | dev, | ||
const char * | at | ||
) |
Definition at line 6205 of file subr_bus.c.
References dev_wired_cache_add(), dev_wired_cache_lookup(), device_get_path(), path, and res.
|
static |
Definition at line 771 of file subr_bus.c.
References devaddq(), and device_get_nameunit().
Referenced by device_attach().
|
static |
Definition at line 727 of file subr_bus.c.
References bus_child_location(), bus_child_pnpinfo(), devctl_alloc_dei_sb(), devctl_free_dei(), devctl_queue(), device_get_nameunit(), device_get_parent(), sbuf_cat(), sbuf_cpy(), sbuf_finish(), sbuf_putc(), and type.
Referenced by devadded(), devnomatch(), and devremoved().
|
static |
Add a device to a devclass.
A unit number is allocated for the device (using the device's preferred unit number if any) and the device is registered in the devclass. This allows the device to be looked up by its unit number, e.g. by decoding a dev_t minor number.
dc | the devclass to add to |
dev | the device to add |
0 | success |
EEXIST | the requested unit number is already allocated |
ENOMEM | memory allocation failure |
Definition at line 1733 of file subr_bus.c.
References DEVCLANAME, devclass_alloc_unit(), DEVICENAME, free(), malloc(), PDEBUG, and snprintf().
Referenced by devctl2_ioctl(), device_set_devclass(), device_set_unit(), and make_device().
int devclass_add_driver | ( | devclass_t | dc, |
driver_t * | driver, | ||
int | pass, | ||
devclass_t * | dcp | ||
) |
Add a device driver to a device class.
Add a device driver to a devclass. This is normally called automatically by DRIVER_MODULE(). The BUS_DRIVER_ADDED() method of all devices in the devclass will be called to allow them to attempt to re-probe any unmatched children.
dc | the devclass to edit |
driver | the driver to register |
Definition at line 1140 of file subr_bus.c.
References bus_data_generation_update(), devclass_driver_added(), devclass_find_internal(), device_frozen, DL_DEFERRED_PROBE, driverlink::driver, driver_register_pass(), DRIVERNAME, kobj_class_compile(), malloc(), and PDEBUG.
Referenced by driver_module_handler().
|
static |
Allocate a unit number.
On entry, *unitp
is the desired unit number (or -1
if any will do). The allocated unit number is returned in *unitp
.
dc | the devclass to allocate from |
unitp | points at the location for the allocated unit number |
0 | success |
EEXIST | the requested unit number is already allocated |
ENOMEM | memory allocation failure |
Definition at line 1647 of file subr_bus.c.
References bootverbose, DEVCLANAME, device_get_parent(), free(), malloc(), PDEBUG, printf(), and resource_string_value().
Referenced by devclass_add_device().
devclass_t devclass_create | ( | const char * | classname | ) |
Create a device class.
If a device class with the name classname
exists, return it, otherwise create and return a new device class.
classname | the devclass name to find or create |
Definition at line 1062 of file subr_bus.c.
References devclass_find_internal().
Referenced by devctl2_ioctl().
|
static |
Delete a device from a devclass.
The device is removed from the devclass's device list and its unit number is freed.
dc | the devclass to delete from |
dev | the device to delete |
0 | success |
Definition at line 1771 of file subr_bus.c.
References DEVCLANAME, DEVICENAME, free(), panic(), and PDEBUG.
Referenced by devctl2_ioctl(), device_attach(), device_delete_child(), device_detach(), device_set_devclass(), and device_set_unit().
int devclass_delete_driver | ( | devclass_t | busclass, |
driver_t * | driver | ||
) |
Delete a device driver from a device class.
Delete a device driver from a devclass. This is normally called automatically by DRIVER_MODULE().
If the driver is currently attached to any devices, devclass_delete_driver() will first attempt to detach from each device. If one of the detach calls fails, the driver will not be deleted.
dc | the devclass to edit |
driver | the driver to unregister |
Definition at line 1285 of file subr_bus.c.
References bus_data_generation_update(), DEVCLANAME, devclass_driver_deleted(), devclass_find(), driverlink::driver, free(), kobj_class_free(), and PDEBUG.
Referenced by driver_module_handler().
|
static |
Register that a device driver has been added to a devclass.
Register that a device driver has been added to a devclass. This is called by devclass_add_driver to accomplish the recursive notification of all the children classes of dc, as well as dc. Each layer will have BUS_DRIVER_ADDED() called for all instances of the devclass.
We do a full search here of the devclass list at each iteration level to save storing children-lists in the devclass structure. If we ever move beyond a few dozen devices doing this, we may need to reevaluate...
dc | the devclass to edit |
driver | the driver that was just added |
Definition at line 1099 of file subr_bus.c.
References DC_HAS_CHILDREN, devclass_driver_added(), devclasses, device_is_attached(), driverlink::driver, and parent.
Referenced by devclass_add_driver(), devclass_driver_added(), and device_do_deferred_actions().
|
static |
Register that a device driver has been deleted from a devclass.
Register that a device driver has been removed from a devclass. This is called by devclass_delete_driver to accomplish the recursive notification of all the children classes of busclass, as well as busclass. Each layer will attempt to detach the driver from any devices that are children of the bus's devclass. The function will return an error if a device fails to detach.
We do a full search here of the devclass list at each iteration level to save storing children-lists in the devclass structure. If we ever move beyond a few dozen devices doing this, we may need to reevaluate...
busclass | the devclass of the parent bus |
dc | the devclass of the driver being deleted |
driver | the driver being deleted |
Definition at line 1211 of file subr_bus.c.
References DC_HAS_CHILDREN, devclass_driver_deleted(), devclasses, device_detach(), device_frozen, devnomatch(), driverlink::driver, and parent.
Referenced by devclass_delete_driver(), and devclass_driver_deleted().
devclass_t devclass_find | ( | const char * | classname | ) |
Find a device class.
If a device class with the name classname
exists, return it, otherwise return NULL
.
classname | the devclass name to find |
Definition at line 1076 of file subr_bus.c.
References devclass_find_internal().
Referenced by devclass_delete_driver(), devclass_quiesce_driver(), and device_find_child().
|
static |
Definition at line 1395 of file subr_bus.c.
References DEVCLANAME, driverlink::driver, and PDEBUG.
Referenced by driver_exists(), and first_matching_driver().
int devclass_find_free_unit | ( | devclass_t | dc, |
int | unit | ||
) |
Find a free unit number in a devclass.
This function searches for the first unused unit number greater that or equal to unit
.
dc | the devclass to examine |
unit | the first unit number to check |
Definition at line 1584 of file subr_bus.c.
|
static |
Find or create a device class.
If a device class with the name classname
exists, return it, otherwise if create
is non-zero create and return a new device class.
If parentname
is non-NULL, the parent of the devclass is set to the devclass of that name.
classname | the devclass name to find or create |
parentname | the parent devclass name or NULL |
create | non-zero to create a devclass |
Definition at line 1007 of file subr_bus.c.
References bus_data_generation_update(), DC_HAS_CHILDREN, devclass_find_internal(), devclasses, malloc(), and PDEBUG.
Referenced by devclass_add_driver(), devclass_create(), devclass_find(), devclass_find_internal(), device_set_devclass(), driver_module_handler(), make_device(), and root_bus_module_handler().
int devclass_get_count | ( | devclass_t | dc | ) |
Get the number of devices in a devclass.
dc | the devclass to examine |
Definition at line 1546 of file subr_bus.c.
References count.
Referenced by devclass_get_devices().
device_t devclass_get_device | ( | devclass_t | dc, |
int | unit | ||
) |
Find a device given a unit number.
dc | the devclass to search |
unit | the unit number to search for |
NULL
if there is no such device Definition at line 1429 of file subr_bus.c.
Referenced by devclass_get_softc(), and device_find_child().
int devclass_get_devices | ( | devclass_t | dc, |
device_t ** | devlistp, | ||
int * | devcountp | ||
) |
Get a list of devices in the devclass.
An array containing a list of all the devices in the given devclass is allocated and returned in *devlistp
. The number of devices in the array is returned in *devcountp
. The caller should free the array using free(p, M_TEMP)
, even if *devcountp
is 0.
dc | the devclass to examine |
devlistp | points at location for array pointer return value |
devcountp | points at location for array size return value |
0 | success |
ENOMEM | the array allocation failed |
Definition at line 1475 of file subr_bus.c.
References count, devclass_get_count(), and malloc().
Referenced by cpufreq_curr_sysctl().
int devclass_get_drivers | ( | devclass_t | dc, |
driver_t *** | listp, | ||
int * | countp | ||
) |
Get a list of drivers in the devclass.
An array containing a list of pointers to all the drivers in the given devclass is allocated and returned in *listp
. The number of drivers in the array is returned in *countp
. The caller should free the array using free(p, M_TEMP)
.
dc | the devclass to examine |
listp | gives location for array pointer return value |
countp | gives location for number of array elements return value |
0 | success |
ENOMEM | the array allocation failed |
Definition at line 1516 of file subr_bus.c.
References count, driverlink::driver, and malloc().
int devclass_get_maxunit | ( | devclass_t | dc | ) |
Get the maximum unit number used in a devclass.
Note that this is one greater than the highest currently-allocated unit. If a null devclass_t is passed in, -1 is returned to indicate that not even the devclass has been allocated yet.
dc | the devclass to examine |
Definition at line 1567 of file subr_bus.c.
Referenced by device_find_child().
const char * devclass_get_name | ( | devclass_t | dc | ) |
Return the name of the devclass.
Definition at line 1414 of file subr_bus.c.
Referenced by device_get_name().
devclass_t devclass_get_parent | ( | devclass_t | dc | ) |
Get the parent of a devclass.
dc | the devclass to examine |
Definition at line 1614 of file subr_bus.c.
void * devclass_get_softc | ( | devclass_t | dc, |
int | unit | ||
) |
Find the softc field of a device given a unit number.
dc | the devclass to search |
unit | the unit number to search for |
NULL
if there is no such device Definition at line 1447 of file subr_bus.c.
References devclass_get_device(), and device_get_softc().
struct sysctl_ctx_list * devclass_get_sysctl_ctx | ( | devclass_t | dc | ) |
Definition at line 1620 of file subr_bus.c.
struct sysctl_oid * devclass_get_sysctl_tree | ( | devclass_t | dc | ) |
Definition at line 1626 of file subr_bus.c.
|
static |
Quiesces a set of device drivers from a device class.
Quiesce a device driver from a devclass. This is normally called automatically by DRIVER_MODULE().
If the driver is currently attached to any devices, devclass_quiesece_driver() will first attempt to quiesce each device.
dc | the devclass to edit |
driver | the driver to unregister |
Definition at line 1340 of file subr_bus.c.
References DEVCLANAME, devclass_find(), device_quiesce(), driverlink::driver, and PDEBUG.
Referenced by driver_module_handler().
void devclass_set_parent | ( | devclass_t | dc, |
devclass_t | pdc | ||
) |
Set the parent of a devclass.
The parent class is normally initialised automatically by DRIVER_MODULE().
dc | the devclass to edit |
pdc | the new parent devclass |
Definition at line 1603 of file subr_bus.c.
|
static |
Definition at line 222 of file subr_bus.c.
References DEVCLASS_SYSCTL_PARENT, and value.
Referenced by devclass_sysctl_init().
|
static |
Definition at line 238 of file subr_bus.c.
References devclass_sysctl_handler(), DEVCLASS_SYSCTL_PARENT, and sysctl_ctx_init().
Referenced by device_sysctl_init().
|
static |
Definition at line 478 of file subr_bus.c.
References dev_softc::async, dev_softc::cv, devsoftc, funsetown(), dev_softc::inuse, dev_softc::mtx, dev_softc::nonblock, and dev_softc::sigio.
|
static |
Definition at line 6128 of file subr_bus.c.
References devctl2_cdevsw, and make_dev_credf().
Referenced by devinit().
|
static |
Definition at line 5835 of file subr_bus.c.
References bus_child_present(), bus_topo_lock(), bus_topo_unlock(), data, devclass_add_device(), devclass_create(), devclass_delete_device(), device_attach(), device_delete_child(), device_detach(), device_disable(), device_do_deferred_actions(), device_enable(), device_frozen, device_get_parent(), device_get_path(), device_is_alive(), device_is_attached(), device_is_enabled(), device_is_suspended(), device_probe_and_attach(), device_quiesce(), driver_exists(), find_device(), free(), parent, path, priv_check(), resource_disabled(), and resource_unset_value().
|
static |
Definition at line 614 of file subr_bus.c.
References devctl_queue_length, dev_softc::devq, devsoftc, dev_softc::mtx, dev_softc::queued, and dev_softc::zone.
Referenced by devctl_alloc_dei_sb().
|
static |
Definition at line 647 of file subr_bus.c.
References devctl_alloc_dei(), and sbuf_new().
Referenced by devaddq(), and devctl_notify().
|
static |
Definition at line 658 of file subr_bus.c.
References devsoftc, and dev_softc::zone.
Referenced by devaddq(), and devctl_notify().
void devctl_notify | ( | const char * | system, |
const char * | subsystem, | ||
const char * | type, | ||
const char * | data | ||
) |
Send a 'notification' to userland, using standard ways.
Definition at line 681 of file subr_bus.c.
References data, devctl_alloc_dei_sb(), devctl_free_dei(), devctl_queue(), sbuf_cat(), sbuf_cpy(), sbuf_finish(), sbuf_putc(), and type.
Referenced by coredump(), mount_devctl_event(), notify(), and root_resume().
bool devctl_process_running | ( | void | ) |
Return whether the userland process is running.
Definition at line 608 of file subr_bus.c.
References devsoftc, and dev_softc::inuse.
|
static |
Definition at line 664 of file subr_bus.c.
References dev_softc::async, dev_softc::cv, dev_softc::devq, devsoftc, dev_softc::mtx, pgsigio(), dev_softc::queued, dev_softc::sel, selwakeup(), and dev_softc::sigio.
Referenced by devaddq(), and devctl_notify().
void devctl_safe_quote_sb | ( | struct sbuf * | sb, |
const char * | src | ||
) |
safely quotes strings that might have double quotes in them.
The devctl protocol relies on quoted strings having matching quotes. This routine quotes any internal quotes so the resulting string is safe to pass to snprintf to construct, for example pnp info strings.
sb | sbuf to place the characters into |
src | Original buffer. |
Definition at line 850 of file subr_bus.c.
References sbuf_putc(), and src.
Referenced by coredump(), and mount_devctl_event().
device_t device_add_child | ( | device_t | dev, |
const char * | name, | ||
int | unit | ||
) |
Create a new device.
This creates a new device and adds it as a child of an existing parent device. The new device will be added after the last existing child with order zero.
dev | the device which will be the parent of the new child device |
name | devclass name for new device or NULL if not specified |
unit | unit number for new device or -1 if not specified |
Definition at line 1893 of file subr_bus.c.
References device_add_child_ordered(), and name.
device_t device_add_child_ordered | ( | device_t | dev, |
u_int | order, | ||
const char * | name, | ||
int | unit | ||
) |
Create a new device.
This creates a new device and adds it as a child of an existing parent device. The new device will be added after the last existing child with the same order.
dev | the device which will be the parent of the new child device |
order | a value which is used to partially sort the children of dev - devices created using lower values of order appear first in dev's list of children |
name | devclass name for new device or NULL if not specified |
unit | unit number for new device or -1 if not specified |
Definition at line 1919 of file subr_bus.c.
References bus_data_generation_update(), child, DEVICENAME, make_device(), name, and PDEBUG.
Referenced by bus_generic_add_child(), and device_add_child().
int device_attach | ( | device_t | dev | ) |
Attach a device driver to a device.
This function is a wrapper around the DEVICE_ATTACH() driver method. In addition to calling DEVICE_ATTACH(), it initialises the device's sysctl tree, optionally prints a description of the device and queues a notification event for user-based device management services.
Normally this function is only called internally from device_probe_and_attach().
dev | the device to initialise |
0 | success |
ENXIO | no driver was found |
ENOMEM | memory allocation failure |
non-zero | some other unix error code |
Definition at line 3015 of file subr_bus.c.
References bootverbose, devadded(), devclass_delete_device(), device_attach(), device_disable(), device_is_quiet(), device_print_child(), device_printf(), device_set_driver(), device_sysctl_fini(), device_sysctl_init(), device_sysctl_update(), printf(), and resource_disabled().
Referenced by devctl2_ioctl(), device_attach(), and device_probe_and_attach().
void device_busy | ( | device_t | dev | ) |
Increment the busy counter for the device.
Definition at line 2667 of file subr_bus.c.
References device_busy().
Referenced by device_busy().
void device_claim_softc | ( | device_t | dev | ) |
Claim softc.
This function can be used to let the driver free the automatically allocated softc using "device_free_softc()". This function is useful when the driver is refcounting the softc and the softc cannot be freed when the "device_detach" method is called.
Definition at line 2604 of file subr_bus.c.
int device_delete_child | ( | device_t | dev, |
device_t | child | ||
) |
Delete a device.
This function deletes a device along with all of its children. If the device currently has a driver attached to it, the device is detached first using device_detach().
dev | the parent device |
child | the device to delete |
0 | success |
non-zero | a unit error code describing the error |
Definition at line 1971 of file subr_bus.c.
References bus_data_devices, bus_data_generation_update(), child, devclass_delete_device(), device_delete_child(), device_detach(), DEVICENAME, kobj_delete(), and PDEBUG.
Referenced by cpufreq_unregister(), devctl2_ioctl(), device_delete_child(), and device_delete_children().
int device_delete_children | ( | device_t | dev | ) |
Delete all children devices of the given device, if any.
This function deletes all children devices of the given device, if any, using the device_delete_child() function for each device it finds. If a child device cannot be deleted, this function will return an error code.
dev | the parent device |
0 | success |
non-zero | a device would not detach |
Definition at line 2015 of file subr_bus.c.
References child, device_delete_child(), DEVICENAME, and PDEBUG.
int device_detach | ( | device_t | dev | ) |
Detach a driver from a device.
This function is a wrapper around the DEVICE_DETACH() driver method. If the call to DEVICE_DETACH() succeeds, it calls BUS_CHILD_DETACHED() for the parent of dev
, queues a notification event for user-based device management services and cleans up the device's sysctl tree.
dev | the device to un-initialise |
0 | success |
ENXIO | no driver was found |
ENOMEM | memory allocation failure |
non-zero | some other unix error code |
Definition at line 3075 of file subr_bus.c.
References bus_topo_assert(), devclass_delete_device(), device_detach(), device_is_quiet(), device_printf(), device_set_driver(), device_sysctl_fini(), device_verbose(), DEVICENAME, devremoved(), and PDEBUG.
Referenced by bus_generic_detach(), bus_helper_reset_prepare(), devclass_driver_deleted(), devctl2_ioctl(), device_delete_child(), and device_detach().
void device_disable | ( | device_t | dev | ) |
Clear the DF_ENABLED flag for the device.
Definition at line 2658 of file subr_bus.c.
Referenced by devctl2_ioctl(), and device_attach().
|
static |
Definition at line 5782 of file subr_bus.c.
References bus_data_generation_update(), devclass_driver_added(), devclasses, device_gen_nomatch(), DL_DEFERRED_PROBE, driverlink::driver, and root_bus.
Referenced by devctl2_ioctl().
void device_enable | ( | device_t | dev | ) |
Set the DF_ENABLED flag for the device.
Definition at line 2649 of file subr_bus.c.
Referenced by devctl2_ioctl().
device_t device_find_child | ( | device_t | dev, |
const char * | classname, | ||
int | unit | ||
) |
Find a device given a unit number.
This is similar to devclass_get_devices() but only searches for devices which have dev
as a parent.
dev | the parent device to search |
unit | the unit number to search for. If the unit is -1, return the first child of dev which has name classname (that is, the one with the lowest unit.) |
NULL
if there is no such device Definition at line 2049 of file subr_bus.c.
References child, devclass_find(), devclass_get_device(), and devclass_get_maxunit().
Referenced by cpufreq_register(), and cpufreq_unregister().
void device_free_softc | ( | void * | softc | ) |
Free claimed softc.
Most drivers do not need to use this since the softc is freed automatically when the driver is detached.
Definition at line 2590 of file subr_bus.c.
References free().
|
static |
Definition at line 5765 of file subr_bus.c.
References child, device_gen_nomatch(), and devnomatch().
Referenced by device_do_deferred_actions(), and device_gen_nomatch().
int device_get_children | ( | device_t | dev, |
device_t ** | devlistp, | ||
int * | devcountp | ||
) |
Get a list of children of a device.
An array containing a list of all the children of the given device is allocated and returned in *devlistp
. The number of devices in the array is returned in *devcountp
. The caller should free the array using free(p, M_TEMP)
.
dev | the device to examine |
devlistp | points at location for array pointer return value |
devcountp | points at location for array size return value |
0 | success |
ENOMEM | the array allocation failed |
Definition at line 2285 of file subr_bus.c.
References child, count, and malloc().
const char * device_get_desc | ( | device_t | dev | ) |
Return the device's description string.
Definition at line 2373 of file subr_bus.c.
Referenced by bus_print_child_header().
devclass_t device_get_devclass | ( | device_t | dev | ) |
Return the current devclass for the device or NULL
if there is none.
Definition at line 2332 of file subr_bus.c.
Referenced by device_set_unit().
driver_t * device_get_driver | ( | device_t | dev | ) |
Return the current driver for the device or NULL
if there is no driver currently attached.
Definition at line 2322 of file subr_bus.c.
uint32_t device_get_flags | ( | device_t | dev | ) |
Return the device's flags.
Definition at line 2382 of file subr_bus.c.
void * device_get_ivars | ( | device_t | dev | ) |
Get the device's ivars field.
The ivars field is used by the parent device to store per-device state (e.g. the physical location of the device or a list of resources).
Definition at line 2620 of file subr_bus.c.
const char * device_get_name | ( | device_t | dev | ) |
Return the name of the device's devclass or NULL
if there is none.
Definition at line 2342 of file subr_bus.c.
References devclass_get_name().
Referenced by bus_enumerate_hinted_children(), device_log(), device_print_prettyname(), device_printf(), device_probe(), device_probe_child(), intr_alloc_msi(), intr_alloc_msix(), intr_map_msi(), intr_pic_claim_root(), intr_release_msi(), intr_release_msix(), intr_resolve_irq(), and sysctl_rman().
const char * device_get_nameunit | ( | device_t | dev | ) |
Return a string containing the device's devclass name followed by an ascii representation of the device's unit number (e.g. "foo2"
).
Definition at line 2355 of file subr_bus.c.
Referenced by bus_enumerate_hinted_children(), bus_generic_get_device_path(), bus_print_child_footer(), bus_print_child_header(), cf_get_method(), cf_set_method(), cpufreq_add_freq_driver_sysctl(), cpufreq_add_levels(), cpufreq_attach(), cpufreq_detach(), cpufreq_dup_set(), devadded(), devaddq(), devremoved(), intr_msi_register(), intr_pic_claim_root(), intr_pic_register(), intr_setup_irq(), resource_list_alloc(), and rman_reserve_resource_bound().
device_t device_get_parent | ( | device_t | dev | ) |
Return the parent of a device.
Definition at line 2263 of file subr_bus.c.
Referenced by bus_child_location(), bus_child_pnpinfo(), bus_child_present(), bus_delete_resource(), bus_generic_child_present(), bus_generic_get_device_path(), bus_generic_get_property(), bus_generic_rl_alloc_resource(), bus_generic_rl_release_resource(), bus_get_bus_tag(), bus_get_cpus(), bus_get_dma_tag(), bus_get_domain(), bus_get_resource(), bus_get_resource_count(), bus_get_resource_start(), bus_set_resource(), cpufreq_attach(), cpufreq_register(), cpufreq_settings_changed(), cpufreq_unregister(), devaddq(), devclass_alloc_unit(), devctl2_ioctl(), device_get_path(), device_get_property(), resource_list_alloc(), resource_list_release(), resource_list_reserve(), and resource_list_unreserve().
|
static |
Definition at line 5812 of file subr_bus.c.
References device_get_parent(), malloc(), sbuf_data(), sbuf_delete(), sbuf_finish(), sbuf_len(), and sbuf_new().
Referenced by dev_wired_cache_match(), and devctl2_ioctl().
ssize_t device_get_property | ( | device_t | dev, |
const char * | prop, | ||
void * | val, | ||
size_t | sz, | ||
device_property_type_t | type | ||
) |
Definition at line 2720 of file subr_bus.c.
References bus, device_get_parent(), and type.
Referenced by device_has_property().
void * device_get_softc | ( | device_t | dev | ) |
Return the device's softc field.
The softc is allocated and zeroed when a driver is attached, based on the size field of the driver.
Definition at line 2560 of file subr_bus.c.
Referenced by cf_get_method(), cf_levels_method(), cf_set_method(), cpufreq_add_freq_driver_sysctl(), cpufreq_add_levels(), cpufreq_attach(), cpufreq_detach(), cpufreq_register(), cpufreq_unregister(), and devclass_get_softc().
device_state_t device_get_state | ( | device_t | dev | ) |
Return the device's state.
Definition at line 2640 of file subr_bus.c.
Referenced by bus_helper_reset_prepare().
struct sysctl_ctx_list * device_get_sysctl_ctx | ( | device_t | dev | ) |
Definition at line 2388 of file subr_bus.c.
Referenced by cpufreq_register().
struct sysctl_oid * device_get_sysctl_tree | ( | device_t | dev | ) |
Definition at line 2394 of file subr_bus.c.
Referenced by cpufreq_add_freq_driver_sysctl(), cpufreq_attach(), and cpufreq_register().
int device_get_unit | ( | device_t | dev | ) |
Return the device's unit number.
Definition at line 2364 of file subr_bus.c.
Referenced by cpufreq_register(), cpufreq_settings_changed(), device_log(), device_print_prettyname(), device_printf(), and sysctl_rman().
bool device_has_property | ( | device_t | dev, |
const char * | prop | ||
) |
Definition at line 2745 of file subr_bus.c.
References device_get_property().
int device_has_quiet_children | ( | device_t | dev | ) |
Return non-zero if the DF_QUIET_CHIDLREN flag is set on the device.
Definition at line 2754 of file subr_bus.c.
Referenced by make_device().
int device_is_alive | ( | device_t | dev | ) |
Return non-zero if the device was successfully probed.
Definition at line 2781 of file subr_bus.c.
Referenced by devctl2_ioctl(), and device_print_child().
int device_is_attached | ( | device_t | dev | ) |
Return non-zero if the device currently has a driver attached to it.
Definition at line 2791 of file subr_bus.c.
Referenced by cf_set_method(), cpufreq_add_levels(), devclass_driver_added(), and devctl2_ioctl().
bool device_is_devclass_fixed | ( | device_t | dev | ) |
Query the device to determine if it's of a fixed devclass.
Definition at line 2860 of file subr_bus.c.
int device_is_enabled | ( | device_t | dev | ) |
Return non-zero if the DF_ENABLED flag is set on the device.
Definition at line 2772 of file subr_bus.c.
Referenced by devctl2_ioctl().
int device_is_quiet | ( | device_t | dev | ) |
Return non-zero if the DF_QUIET flag is set on the device.
Definition at line 2763 of file subr_bus.c.
Referenced by device_attach(), and device_detach().
int device_is_suspended | ( | device_t | dev | ) |
Return non-zero if the device is currently suspended.
Definition at line 2800 of file subr_bus.c.
Referenced by devctl2_ioctl().
int device_log | ( | device_t | dev, |
int | pri, | ||
const char * | fmt, | ||
... | |||
) |
Print the name of the device followed by a colon, a space and the result of calling log() with the value of fmt
and the following arguments.
Definition at line 2460 of file subr_bus.c.
References buf, device_get_name(), device_get_unit(), log(), name, sbuf_cat(), sbuf_data(), sbuf_delete(), sbuf_finish(), sbuf_len(), sbuf_new(), sbuf_printf(), and sbuf_vprintf().
device_t device_lookup_by_name | ( | const char * | name | ) |
Definition at line 5706 of file subr_bus.c.
References bus_data_devices, and name.
Referenced by find_device().
|
static |
Print a description of a device.
Definition at line 1864 of file subr_bus.c.
References child, device_is_alive(), and device_printf().
Referenced by device_attach().
int device_print_prettyname | ( | device_t | dev | ) |
Print the name of the device followed by a colon and a space.
Definition at line 2405 of file subr_bus.c.
References device_get_name(), device_get_unit(), name, and printf().
Referenced by device_probe().
int device_printf | ( | device_t | dev, |
const char * | fmt, | ||
... | |||
) |
Print the name of the device followed by a colon, a space and the result of calling vprintf() with the value of fmt
and the following arguments.
Definition at line 2422 of file subr_bus.c.
References buf, device_get_name(), device_get_unit(), name, sbuf_cat(), sbuf_delete(), sbuf_finish(), sbuf_new(), sbuf_printf(), sbuf_printf_drain(), sbuf_set_drain(), and sbuf_vprintf().
Referenced by _gone_in_dev(), bus_print_child_header(), bus_setup_intr(), cf_set_method(), clock_dbgprint_hdr(), clock_register_flags(), cpufreq_unregister(), device_attach(), device_detach(), device_print_child(), intr_pic_claim_root(), read_clocks(), resource_list_alloc(), resource_list_release_active(), and settime_task_func().
int device_probe | ( | device_t | dev | ) |
Probe a device, and return this status.
This function is the core of the device autoconfiguration system. Its purpose is to select a suitable driver for a device and then call that driver to initialise the hardware appropriately. The driver is selected by calling the DEVICE_PROBE() method of a set of candidate drivers and then choosing the driver which returned the best value. This driver is then attached to the device using device_attach().
The set of suitable drivers is taken from the list of drivers in the parent device's devclass. If the device was originally created with a specific class name (see device_add_child()), only drivers with that name are probed, otherwise all drivers in the devclass are probed. If no drivers return successful probe values in the parent devclass, the search continues in the parent of that devclass (see devclass_get_parent()) if any.
dev | the device to initialise |
0 | success |
ENXIO | no driver was found |
ENOMEM | memory allocation failure |
non-zero | some other unix error code |
-1 | Device already attached |
Definition at line 2943 of file subr_bus.c.
References bootverbose, bus_current_pass, bus_topo_assert(), device_get_name(), device_print_prettyname(), device_probe_child(), devnomatch(), and printf().
Referenced by device_probe_and_attach().
int device_probe_and_attach | ( | device_t | dev | ) |
Probe a device and attach a driver if possible.
calls device_probe() and attaches if that was successful.
Definition at line 2977 of file subr_bus.c.
References bus_topo_assert(), device_attach(), and device_probe().
Referenced by bus_generic_attach(), bus_generic_driver_added(), bus_generic_new_pass(), bus_helper_reset_post(), bus_helper_reset_prepare(), bus_helper_reset_prepare_rollback(), cpufreq_register(), and devctl2_ioctl().
int device_probe_child | ( | device_t | dev, |
device_t | child | ||
) |
Definition at line 2103 of file subr_bus.c.
References bus_current_pass, bus_data_generation_update(), bus_topo_assert(), child, device_get_name(), device_set_devclass(), device_set_driver(), device_verbose(), driverlink::driver, DRIVERNAME, first_matching_driver(), next_matching_driver(), panic(), PDEBUG, printf(), resource_int_value(), and result.
Referenced by device_probe().
int device_quiesce | ( | device_t | dev | ) |
Tells a driver to quiesce itself.
This function is a wrapper around the DEVICE_QUIESCE() driver method. If the call to DEVICE_QUIESCE() succeeds.
dev | the device to quiesce |
0 | success |
ENXIO | no driver was found |
ENOMEM | memory allocation failure |
non-zero | some other unix error code |
Definition at line 3131 of file subr_bus.c.
References DEVICENAME, and PDEBUG.
Referenced by devclass_quiesce_driver(), and devctl2_ioctl().
void device_quiet | ( | device_t | dev | ) |
Set the DF_QUIET flag for the device.
Definition at line 2696 of file subr_bus.c.
Referenced by cpufreq_register().
void device_quiet_children | ( | device_t | dev | ) |
Set the DF_QUIET_CHILDREN flag for the device.
Definition at line 2705 of file subr_bus.c.
void device_set_desc | ( | device_t | dev, |
const char * | desc | ||
) |
Set the device's description.
The value of desc
should be a string constant that will not change (at least until the description is changed in a subsequent call to device_set_desc() or device_set_desc_copy()).
Definition at line 2527 of file subr_bus.c.
References device_set_desc_internal().
Referenced by device_set_driver().
void device_set_desc_copy | ( | device_t | dev, |
const char * | desc | ||
) |
Set the device's description.
The string pointed to by desc
is copied. Use this function if the device description is generated, (e.g. with sprintf()).
Definition at line 2539 of file subr_bus.c.
References device_set_desc_internal().
|
static |
Definition at line 2497 of file subr_bus.c.
References bus_data_generation_update(), free(), and malloc().
Referenced by device_set_desc(), and device_set_desc_copy().
int device_set_devclass | ( | device_t | dev, |
const char * | classname | ||
) |
Set the devclass of a device.
Definition at line 2810 of file subr_bus.c.
References bus_data_generation_update(), devclass_add_device(), devclass_delete_device(), devclass_find_internal(), and printf().
Referenced by device_probe_child(), and device_set_devclass_fixed().
int device_set_devclass_fixed | ( | device_t | dev, |
const char * | classname | ||
) |
Set the devclass of a device and mark the devclass fixed.
Definition at line 2841 of file subr_bus.c.
References device_set_devclass().
int device_set_driver | ( | device_t | dev, |
driver_t * | driver | ||
) |
Set the driver of a device.
0 | success |
EBUSY | the device already has a driver attached |
ENOMEM | a memory allocation failure occurred |
Definition at line 2873 of file subr_bus.c.
References bus_data_generation_update(), bus_get_domain(), device_set_desc(), domain, free(), kobj_delete(), kobj_init(), and malloc_domainset().
Referenced by device_attach(), device_detach(), and device_probe_child().
void device_set_flags | ( | device_t | dev, |
uint32_t | flags | ||
) |
void device_set_ivars | ( | device_t | dev, |
void * | ivars | ||
) |
Set the device's ivars field.
Definition at line 2630 of file subr_bus.c.
void device_set_softc | ( | device_t | dev, |
void * | softc | ||
) |
Set the device's softc field.
Most drivers do not need to use this since the softc is allocated automatically when the driver is attached.
Definition at line 2572 of file subr_bus.c.
References free().
int device_set_unit | ( | device_t | dev, |
int | unit | ||
) |
Set the unit number of a device.
This function can be used to override the unit number used for a device (e.g. to wire a device to a pre-configured unit number).
Definition at line 3165 of file subr_bus.c.
References bus_data_generation_update(), devclass_add_device(), devclass_delete_device(), and device_get_devclass().
int device_shutdown | ( | device_t | dev | ) |
Notify a device of system shutdown.
This function calls the DEVICE_SHUTDOWN() driver method if the device currently has an attached driver.
Definition at line 3151 of file subr_bus.c.
Referenced by bus_generic_shutdown(), and root_bus_module_handler().
|
static |
Definition at line 353 of file subr_bus.c.
References sysctl_ctx_free().
Referenced by device_attach(), and device_detach().
|
static |
Definition at line 262 of file subr_bus.c.
References bus_child_location(), bus_child_pnpinfo(), bus_topo_lock(), bus_topo_unlock(), DEVICE_SYSCTL_DESC, DEVICE_SYSCTL_DRIVER, DEVICE_SYSCTL_LOCATION, DEVICE_SYSCTL_PARENT, DEVICE_SYSCTL_PNPINFO, sbuf_cat(), sbuf_clear_flags(), sbuf_delete(), sbuf_finish(), and sbuf_new_for_sysctl().
Referenced by device_sysctl_init().
|
static |
Definition at line 299 of file subr_bus.c.
References bus_get_domain(), devclass_sysctl_init(), DEVICE_SYSCTL_DESC, DEVICE_SYSCTL_DRIVER, device_sysctl_handler(), DEVICE_SYSCTL_LOCATION, DEVICE_SYSCTL_PARENT, DEVICE_SYSCTL_PNPINFO, domain, and sysctl_ctx_init().
Referenced by device_attach().
|
static |
Definition at line 343 of file subr_bus.c.
References sysctl_rename_oid().
Referenced by device_attach().
void device_unbusy | ( | device_t | dev | ) |
Decrement the busy counter for the device.
Definition at line 2682 of file subr_bus.c.
References device_unbusy().
Referenced by device_unbusy().
void device_verbose | ( | device_t | dev | ) |
Clear the DF_QUIET flag for the device.
Definition at line 2714 of file subr_bus.c.
Referenced by device_detach(), and device_probe_child().
|
static |
Definition at line 432 of file subr_bus.c.
References dev_softc::cv, cv_init(), dev_cdevsw, devctl2_init(), devctl_dev, devctl_queue_length, dev_softc::devq, devsoftc, knlist_init_mtx(), make_dev_credf(), dev_softc::mtx, dev_softc::sel, and dev_softc::zone.
Referenced by root_bus_module_handler().
|
static |
Definition at line 529 of file subr_bus.c.
References dev_softc::async, data, devsoftc, fgetown(), fsetown(), dev_softc::nonblock, and dev_softc::sigio.
|
static |
Definition at line 578 of file subr_bus.c.
References devctl_rfiltops, devsoftc, knlist_add(), and dev_softc::sel.
|
static |
Definition at line 794 of file subr_bus.c.
References devaddq().
Referenced by devclass_driver_deleted(), device_gen_nomatch(), and device_probe().
|
static |
Definition at line 464 of file subr_bus.c.
References devsoftc, dev_softc::inuse, and dev_softc::mtx.
|
static |
Definition at line 561 of file subr_bus.c.
References dev_softc::devq, devsoftc, dev_softc::mtx, dev_softc::sel, and selrecord().
|
static |
Definition at line 499 of file subr_bus.c.
References dev_softc::cv, dev_softc::devq, devsoftc, dev_softc::mtx, dev_softc::nonblock, dev_softc::queued, uiomove(), and dev_softc::zone.
|
static |
Definition at line 781 of file subr_bus.c.
References devaddq(), and device_get_nameunit().
Referenced by device_detach().
|
static |
Definition at line 5753 of file subr_bus.c.
References bus, and devclass_find_driver_internal().
Referenced by devctl2_ioctl().
int driver_module_handler | ( | module_t | mod, |
int | what, | ||
void * | arg | ||
) |
Module handler for registering device drivers.
This module handler is used to automatically register device drivers when modules are loaded. If what
is MOD_LOAD, it calls devclass_add_driver() for the driver described by the driver_module_data structure pointed to by arg
Definition at line 5347 of file subr_bus.c.
References devclass_add_driver(), devclass_delete_driver(), devclass_find_internal(), devclass_quiesce_driver(), DRIVERNAME, and PDEBUG.
|
static |
Register the pass level of a new driver attachment.
Register a new driver attachment's pass level. If no driver attachment with the same pass level has been added, then new
will be added to the global passes list.
new | the new driver attachment |
Definition at line 916 of file subr_bus.c.
References bus_current_pass, and passes.
Referenced by devclass_add_driver().
EVENTHANDLER_LIST_DEFINE | ( | dev_lookup | ) |
EVENTHANDLER_LIST_DEFINE | ( | device_attach | ) |
EVENTHANDLER_LIST_DEFINE | ( | device_detach | ) |
|
static |
Definition at line 592 of file subr_bus.c.
References devsoftc, knlist_remove(), and dev_softc::sel.
|
static |
Definition at line 598 of file subr_bus.c.
References devsoftc, and dev_softc::queued.
|
static |
Definition at line 5723 of file subr_bus.c.
References device_lookup_by_name().
Referenced by devctl2_ioctl().
|
static |
Definition at line 2076 of file subr_bus.c.
References devclass_find_driver_internal().
Referenced by device_probe_child().
|
static |
Definition at line 6243 of file subr_bus.c.
References obsolete_panic, and panic().
Referenced by _gone_in(), and _gone_in_dev().
|
static |
Make a new device and add it as a child of parent
.
parent | the parent of the new device |
name | the devclass name of the new device or NULL to leave the devclass unspecified @parem unit the unit number of the new device of -1 to leave the unit number unspecified |
Definition at line 1803 of file subr_bus.c.
References bus_data_devices, bus_data_generation_update(), devclass_add_device(), devclass_find_internal(), device_has_quiet_children(), DEVICENAME, kobj_delete(), kobj_init(), malloc(), name, parent, PDEBUG, and printf().
Referenced by device_add_child_ordered(), and root_bus_module_handler().
|
static |
|
static |
|
static |
Definition at line 2087 of file subr_bus.c.
References driverlink::driver.
Referenced by device_probe_child().
void resource_init_map_request_impl | ( | struct resource_map_request * | args, |
size_t | sz | ||
) |
Definition at line 3193 of file subr_bus.c.
struct resource_list_entry * resource_list_add | ( | struct resource_list * | rl, |
int | type, | ||
int | rid, | ||
rman_res_t | start, | ||
rman_res_t | end, | ||
rman_res_t | count | ||
) |
Add or modify a resource entry.
If an existing entry exists with the same type and rid, it will be modified using the given values of start
, end
and count
. If no entry exists, a new one will be created using the given values. The resource list entry that matches is then returned.
rl | the resource list to edit |
type | the resource entry type (e.g. SYS_RES_MEMORY) |
rid | the resource identifier |
start | the start address of the resource |
end | the end address of the resource |
count | XXX end-start+1 |
Definition at line 3274 of file subr_bus.c.
References count, malloc(), panic(), resource_list_find(), start, and type.
Referenced by bus_generic_rl_set_resource(), and resource_list_add_next().
int resource_list_add_next | ( | struct resource_list * | rl, |
int | type, | ||
rman_res_t | start, | ||
rman_res_t | end, | ||
rman_res_t | count | ||
) |
Add a resource entry.
This function adds a resource entry using the given type
, start
, end
and count
values. A rid value is chosen by searching sequentially for the first unused rid starting at zero.
rl | the resource list to edit |
type | the resource entry type (e.g. SYS_RES_MEMORY) |
start | the start address of the resource |
end | the end address of the resource |
count | XXX end-start+1 |
Definition at line 3246 of file subr_bus.c.
References count, resource_list_add(), resource_list_find(), start, and type.
struct resource * resource_list_alloc | ( | struct resource_list * | rl, |
device_t | bus, | ||
device_t | child, | ||
int | type, | ||
int * | rid, | ||
rman_res_t | start, | ||
rman_res_t | end, | ||
rman_res_t | count, | ||
u_int | flags | ||
) |
Helper function for implementing BUS_ALLOC_RESOURCE()
Implement BUS_ALLOC_RESOURCE() by looking up a resource from the list and passing the allocation up to the parent of bus
. This assumes that the first entry of device_get_ivars(child)
is a struct resource_list. This also handles 'passthrough' allocations where a child is a remote descendant of bus by passing the allocation up to the parent of bus.
Typically, a bus driver would store a list of child resources somewhere in the child device's ivars (see device_get_ivars()) and its implementation of BUS_ALLOC_RESOURCE() would find that list and then call resource_list_alloc() to perform the allocation.
rl | the resource list to allocate from |
bus | the parent device of child |
child | the device which is requesting an allocation |
type | the type of resource to allocate |
rid | a pointer to the resource identifier |
start | hint at the start of the resource range - pass 0 for any start address |
end | hint at the end of the resource range - pass ~0 for any end address |
count | hint at the size of range required - pass 1 for any size |
flags | any extra flags to control the resource allocation - see RF_XXX flags in <sys/rman.h> for details |
NULL
if no resource could be allocated Definition at line 3489 of file subr_bus.c.
References bus, bus_activate_resource(), child, count, device_get_nameunit(), device_get_parent(), device_printf(), flags, resource_list_find(), rman_get_end(), rman_get_start(), start, and type.
Referenced by bus_generic_rl_alloc_resource(), and resource_list_reserve().
int resource_list_busy | ( | struct resource_list * | rl, |
int | type, | ||
int | rid | ||
) |
Determine if a resource entry is busy.
Returns true if a resource entry is busy meaning that it has an associated resource that is not an unallocated "reserved" resource.
rl | the resource list to search |
type | the resource entry type (e.g. SYS_RES_MEMORY) |
rid | the resource identifier |
Definition at line 3314 of file subr_bus.c.
References resource_list_find(), rman_get_flags(), and type.
void resource_list_delete | ( | struct resource_list * | rl, |
int | type, | ||
int | rid | ||
) |
Delete a resource entry.
rl | the resource list to edit |
type | the resource entry type (e.g. SYS_RES_MEMORY) |
rid | the resource identifier |
Definition at line 3383 of file subr_bus.c.
References free(), panic(), resource_list_find(), and type.
Referenced by bus_generic_rl_delete_resource().
struct resource_list_entry * resource_list_find | ( | struct resource_list * | rl, |
int | type, | ||
int | rid | ||
) |
Find a resource entry by type and rid.
rl | the resource list to search |
type | the resource entry type (e.g. SYS_RES_MEMORY) |
rid | the resource identifier |
Definition at line 3364 of file subr_bus.c.
References type.
Referenced by bus_generic_rl_get_resource(), resource_list_add(), resource_list_add_next(), resource_list_alloc(), resource_list_busy(), resource_list_delete(), resource_list_release(), resource_list_reserve(), resource_list_reserved(), and resource_list_unreserve().
void resource_list_free | ( | struct resource_list * | rl | ) |
Reclaim memory used by a resource list.
This function frees the memory for all resource entries on the list (if any).
rl | the resource list to free |
Definition at line 3220 of file subr_bus.c.
References free(), and panic().
void resource_list_init | ( | struct resource_list * | rl | ) |
Initialise a resource list.
rl | the resource list to initialise |
Definition at line 3206 of file subr_bus.c.
int resource_list_print_type | ( | struct resource_list * | rl, |
const char * | name, | ||
int | type, | ||
const char * | format | ||
) |
Print a description of resources in a resource list.
Print all resources of a specified type, for use in BUS_PRINT_CHILD(). The name is printed if at least one resource of the given type is available. The format is used to print resource start and end.
rl | the resource list to print |
name | the name of type , e.g. "memory" |
type | type type of resource entry to print |
format | printf(9) format string to print resource start and end values |
Definition at line 3699 of file subr_bus.c.
References name, printf(), and type.
void resource_list_purge | ( | struct resource_list * | rl | ) |
Releases all the resources in a list.
rl | The resource list to purge. |
Definition at line 3734 of file subr_bus.c.
References bus_release_resource(), free(), and rman_get_device().
int resource_list_release | ( | struct resource_list * | rl, |
device_t | bus, | ||
device_t | child, | ||
int | type, | ||
int | rid, | ||
struct resource * | res | ||
) |
Helper function for implementing BUS_RELEASE_RESOURCE()
Implement BUS_RELEASE_RESOURCE() using a resource list. Normally used with resource_list_alloc().
rl | the resource list which was allocated from |
bus | the parent device of child |
child | the device which is requesting a release |
type | the type of resource to release |
rid | the resource identifier |
res | the resource to release |
0 | success |
non-zero | a standard unix error code indicating what error condition prevented the operation |
Definition at line 3562 of file subr_bus.c.
References bus, bus_deactivate_resource(), child, device_get_parent(), panic(), res, resource_list_find(), rman_get_flags(), and type.
Referenced by bus_generic_rl_release_resource(), resource_list_release_active(), and resource_list_unreserve().
int resource_list_release_active | ( | struct resource_list * | rl, |
device_t | bus, | ||
device_t | child, | ||
int | type | ||
) |
Release all active resources of a given type.
Release all active resources of a specified type. This is intended to be used to cleanup resources leaked by a driver after detach or a failed attach.
rl | the resource list which was allocated from |
bus | the parent device of child |
child | the device whose active resources are being released |
type | the type of resources to release |
0 | success |
EBUSY | at least one resource was active |
Definition at line 3619 of file subr_bus.c.
References bus, child, device_printf(), resource_list_release(), rman_get_rid(), and type.
struct resource * resource_list_reserve | ( | struct resource_list * | rl, |
device_t | bus, | ||
device_t | child, | ||
int | type, | ||
int * | rid, | ||
rman_res_t | start, | ||
rman_res_t | end, | ||
rman_res_t | count, | ||
u_int | flags | ||
) |
Allocate a reserved resource.
This can be used by buses to force the allocation of resources that are always active in the system even if they are not allocated by a driver (e.g. PCI BARs). This function is usually called when adding a new child to the bus. The resource is allocated from the parent bus when it is reserved. The resource list entry is marked with RLE_RESERVED to note that it is a reserved resource.
Subsequent attempts to allocate the resource with resource_list_alloc() will succeed the first time and will set RLE_ALLOCATED to note that it has been allocated. When a reserved resource that has been allocated is released with resource_list_release() the resource RLE_ALLOCATED is cleared, but the actual resource remains allocated. The resource can be released to the parent bus by calling resource_list_unreserve().
rl | the resource list to allocate from |
bus | the parent device of child |
child | the device for which the resource is being reserved |
type | the type of resource to allocate |
rid | a pointer to the resource identifier |
start | hint at the start of the resource range - pass 0 for any start address |
end | hint at the end of the resource range - pass ~0 for any end address |
count | hint at the size of range required - pass 1 for any size |
flags | any extra flags to control the resource allocation - see RF_XXX flags in <sys/rman.h> for details |
NULL
if no resource could be allocated Definition at line 3432 of file subr_bus.c.
References bus, child, count, device_get_parent(), flags, panic(), resource_list_alloc(), resource_list_find(), start, and type.
int resource_list_reserved | ( | struct resource_list * | rl, |
int | type, | ||
int | rid | ||
) |
Determine if a resource entry is reserved.
Returns true if a resource entry is reserved meaning that it has an associated "reserved" resource. The resource can either be allocated or unallocated.
rl | the resource list to search |
type | the resource entry type (e.g. SYS_RES_MEMORY) |
rid | the resource identifier |
Definition at line 3343 of file subr_bus.c.
References resource_list_find(), and type.
int resource_list_unreserve | ( | struct resource_list * | rl, |
device_t | bus, | ||
device_t | child, | ||
int | type, | ||
int | rid | ||
) |
Fully release a reserved resource.
Fully releases a resource reserved via resource_list_reserve().
rl | the resource list which was allocated from |
bus | the parent device of child |
child | the device whose reserved resource is being released |
type | the type of resource to release |
rid | the resource identifier |
res | the resource to release |
0 | success |
non-zero | a standard unix error code indicating what error condition prevented the operation |
Definition at line 3661 of file subr_bus.c.
References bus, child, device_get_parent(), panic(), resource_list_find(), resource_list_release(), and type.
void root_bus_configure | ( | void | ) |
Automatically configure devices.
This function begins the autoconfiguration process by calling device_probe_and_attach() for each child of the root0
device.
Definition at line 5330 of file subr_bus.c.
References bus_set_pass(), and PDEBUG.
|
static |
Definition at line 5291 of file subr_bus.c.
References bus_data_devices, devclass_find_internal(), device_shutdown(), devinit(), kobj_class_compile(), kobj_init(), make_device(), root_bus, root_devclass, and root_driver.
|
static |
Definition at line 5243 of file subr_bus.c.
|
static |
Definition at line 5249 of file subr_bus.c.
References all_cpus.
|
static |
Definition at line 5215 of file subr_bus.c.
References bus_print_child_header(), child, and printf().
|
static |
Definition at line 5202 of file subr_bus.c.
References bus_generic_resume(), and devctl_notify().
|
static |
Definition at line 5226 of file subr_bus.c.
References panic().
STAILQ_HEAD | ( | devq | , |
dev_event_info | |||
) |
|
static |
Definition at line 5602 of file subr_bus.c.
References bus_data_generation.
|
static |
Definition at line 800 of file subr_bus.c.
References devctl_queue_length, devsoftc, dev_softc::mtx, sysctl_handle_int(), and dev_softc::zone.
|
static |
Definition at line 5616 of file subr_bus.c.
References bus_child_location(), bus_child_pnpinfo(), bus_data_devices, bus_data_generation_check(), free(), malloc(), name, sbuf_cat(), sbuf_delete(), sbuf_finish(), sbuf_new(), and sbuf_putc().
SYSCTL_INT | ( | _debug | , |
OID_AUTO | , | ||
obsolete_panic | , | ||
CTLFLAG_RWTUN | , | ||
& | obsolete_panic, | ||
0 | , | ||
"Panic when obsolete features are used (0 = never, 1 = if obsolete, " "2 = if deprecated)" | |||
) |
SYSCTL_NODE | ( | _hw | , |
OID_AUTO | , | ||
bus | , | ||
CTLFLAG_RW| | CTLFLAG_MPSAFE, | ||
NULL | , | ||
NULL | |||
) |
SYSCTL_NODE | ( | _hw_bus | , |
OID_AUTO | , | ||
devices | , | ||
CTLFLAG_RD| | CTLFLAG_NEEDGIANT, | ||
sysctl_devices | , | ||
"system device tree" | |||
) |
SYSCTL_PROC | ( | _hw_bus | , |
OID_AUTO | , | ||
devctl_queue | , | ||
CTLTYPE_INT|CTLFLAG_RWTUN| | CTLFLAG_MPSAFE, | ||
NULL | , | ||
0 | , | ||
sysctl_devctl_queue | , | ||
"I" | , | ||
"devctl queue length" | |||
) |
SYSCTL_PROC | ( | _hw_bus | , |
OID_AUTO | , | ||
info | , | ||
CTLTYPE_STRUCT|CTLFLAG_RD| | CTLFLAG_MPSAFE, | ||
NULL | , | ||
0 | , | ||
sysctl_bus_info | , | ||
" | S, | ||
u_businfo" | , | ||
"bus-related data" | |||
) |
SYSCTL_ROOT_NODE | ( | OID_AUTO | , |
dev | , | ||
CTLFLAG_RW| | CTLFLAG_MPSAFE, | ||
NULL | , | ||
NULL | |||
) |
typedef TAILQ_HEAD | ( | devclass_list | , |
devclass | |||
) |
Definition at line 97 of file subr_bus.c.
typedef TAILQ_HEAD | ( | device_location_list | , |
device_location_node | |||
) |
Definition at line 6142 of file subr_bus.c.
int bus_current_pass = BUS_PASS_ROOT |
Definition at line 903 of file subr_bus.c.
Referenced by bus_generic_new_pass(), bus_generic_probe(), bus_set_pass(), device_probe(), device_probe_child(), and driver_register_pass().
|
static |
Definition at line 861 of file subr_bus.c.
Referenced by device_delete_child(), device_lookup_by_name(), make_device(), root_bus_module_handler(), and sysctl_devices().
|
static |
Definition at line 862 of file subr_bus.c.
Referenced by bus_data_generation_check(), bus_data_generation_update(), and sysctl_bus_info().
|
static |
Definition at line 388 of file subr_bus.c.
Referenced by devinit().
|
static |
Definition at line 989 of file subr_bus.c.
Referenced by devclass_driver_added(), devclass_driver_deleted(), devclass_find_internal(), and device_do_deferred_actions().
|
static |
Definition at line 382 of file subr_bus.c.
|
static |
Definition at line 6121 of file subr_bus.c.
Referenced by devctl2_init().
|
static |
Definition at line 429 of file subr_bus.c.
Referenced by devinit().
|
static |
Definition at line 377 of file subr_bus.c.
Referenced by devctl_alloc_dei(), devinit(), and sysctl_devctl_queue().
struct filterops devctl_rfiltops |
Definition at line 423 of file subr_bus.c.
Referenced by devkqfilter().
|
static |
Definition at line 164 of file subr_bus.c.
Referenced by devclass_add_driver(), devclass_driver_deleted(), and devctl2_ioctl().
|
static |
Definition at line 384 of file subr_bus.c.
|
static |
Definition at line 386 of file subr_bus.c.
|
static |
Definition at line 381 of file subr_bus.c.
|
static |
Definition at line 385 of file subr_bus.c.
|
static |
Definition at line 383 of file subr_bus.c.
|
static |
|
static |
Definition at line 864 of file subr_bus.c.
|
static |
Definition at line 6237 of file subr_bus.c.
Referenced by gone_panic().
|
static |
Definition at line 902 of file subr_bus.c.
Referenced by bus_set_pass(), clockcalib(), and driver_register_pass().
device_t root_bus |
Definition at line 5287 of file subr_bus.c.
Referenced by bus_set_pass(), device_do_deferred_actions(), and root_bus_module_handler().
|
static |
Definition at line 5316 of file subr_bus.c.
devclass_t root_devclass |
Definition at line 5288 of file subr_bus.c.
Referenced by root_bus_module_handler().
|
static |
Definition at line 5281 of file subr_bus.c.
Referenced by root_bus_module_handler().
|
static |
Definition at line 5264 of file subr_bus.c.