Device Structure
include/device.h View source View on GitHubStructs
Section titled “Structs”device_physical_location
Section titled “device_physical_location” struct device_physical_location (5 fields) source
§
enum device_physical_location_panel panel §
enum device_physical_location_vertical_position vertical_position §
enum device_physical_location_horizontal_position horizontal_position §
bool dock §
bool lid device_driver
Section titled “device_driver” struct device_driver (6 fields) source
device_resource
Section titled “device_resource” struct device_resource (4 fields) source
§
enum device_resource_type type §
uint64_t start §
uint64_t size length in bytes / count for IRQ,DMA
§
uint32_t flags device_ops
Section titled “device_ops”device
Section titled “device” struct device (23 fields) source
§
const char *name §
uint32_t id unique device-model ID
§
enum device_type type §
enum device_bus_type bus §
struct device_ops *ops §
struct device_driver *driver §
void *driver_data opaque, owned by the driver
§
enum device_state state §
enum device_power_state power §
enum device_flags flags §
refcount_t refcount §
struct device_resource resources[DEVICE_MAX_RESOURCES] §
uint8_t resource_count §
numa_node_t numa_node §
struct device_physical_location location §
struct iommu_domain *iommu_domain §
void *private device_physical_location_panel
Section titled “device_physical_location_panel” enum device_physical_location_panel (7 variants) source
device_physical_location_vertical_position
Section titled “device_physical_location_vertical_position” enum device_physical_location_vertical_position (3 variants) source
device_physical_location_horizontal_position
Section titled “device_physical_location_horizontal_position” enum device_physical_location_horizontal_position (3 variants) source
device_bus_type
Section titled “device_bus_type” enum device_bus_type (7 variants) source
device_type
Section titled “device_type” enum device_type (11 variants) source
device_power_state
Section titled “device_power_state” enum device_power_state (6 variants) source
device_state
Section titled “device_state” enum device_state (7 variants) source
§
DEVICE_STATE_UNBOUND in the tree but no driver attached
§
DEVICE_STATE_PROBING driver probe() in progress
§
DEVICE_STATE_BOUND driver matched and probe() succeeded
§
DEVICE_STATE_SUSPENDED low-power, context saved
§
DEVICE_STATE_REMOVING being torn down
§
DEVICE_STATE_REMOVED gone, awaiting final release
§
DEVICE_STATE_ERROR unrecoverable fault
device_flags
Section titled “device_flags” enum device_flags (8 variants) source
§
DEVICE_FLAG_HOTPLUG = (1u << 0) supports hot-plug/remove
§
DEVICE_FLAG_DMA = (1u << 1) DMA-capable
§
DEVICE_FLAG_MMIO = (1u << 2) memory-mapped I/O
§
DEVICE_FLAG_PIO = (1u << 3) port I/O
§
DEVICE_FLAG_MSI = (1u << 4) MSI / MSI-X capable
§
DEVICE_FLAG_VIRTUAL = (1u << 5) software-only / emulated
§
DEVICE_FLAG_REMOVABLE = (1u << 6) user-removable
§
DEVICE_FLAG_WAKEUP = (1u << 7) can wake system from sleep
device_resource_type
Section titled “device_resource_type” enum device_resource_type (4 variants) source
Functions
Section titled “Functions”device_init
Section titled “device_init”Macros
Section titled “Macros”DEVICE_MAX_RESOURCES
Section titled “DEVICE_MAX_RESOURCES”#define DEVICE_MAX_RESOURCES 8 source