13#include <l4/vbus/vbus_pm.h>
19#include <l4/re/inhibitor>
55 DEC
const *self()
const {
return static_cast<DEC
const *
>(
this); }
56 DEC *self() {
return static_cast<DEC *
>(
this); }
151 int depth = L4VBUS_MAX_DEPTH,
363 flags &= ~L4VBUS_DMAD_KERNEL_DMA_SPACE;
388 flags &= ~L4VBUS_DMAD_L4RE_DMA_SPACE;
Flags flags() const noexcept
Get flags of the dataspace.
l4_cap_idx_t cap() const noexcept
Return capability selector.
C++ interface for capabilities.
Device on a L4vbus::Vbus.
int device(l4vbus_device_t *devinfo) const
Obtain detailed information about a Vbus device.
L4::Cap< Vbus > bus_cap() const
Access the Vbus capability of the underlying virtual bus.
int get_resource(unsigned res_idx, l4vbus_resource_t *res) const
Obtain the resource description of an individual device resource.
Device(L4::Cap< Vbus > bus, l4vbus_device_handle_t dev)
Construct a new vbus device using a device handle.
Device()
Construct a new vbus device using the NULL device L4VBUS_NULL.
int device_by_hid(Device *child, char const *hid, int depth=L4VBUS_MAX_DEPTH, l4vbus_device_t *devinfo=0) const
Find a device by the hardware interface identifier (HID).
l4vbus_device_handle_t dev_handle() const
Access the device handle of this device.
bool operator==(Device const &o) const
Test if two devices are the same Vbus device.
bool operator!=(Device const &o) const
Test if two Vbus devices are not the same.
int next_device(Device *child, int depth=L4VBUS_MAX_DEPTH, l4vbus_device_t *devinfo=0) const
Find next child following child.
l4vbus_device_handle_t _dev
The device handle for this device.
L4::Cap< Vbus > _bus
The Vbus capability where this device is located on.
int is_compatible(char const *cid) const
Check if the given device has a compatibility ID (CID) or HID that matches cid.
Vbus Interrupt controller API.
Src_types
Flags that can be used with the ICU on a vbus device.
@ Src_dev_handle
Flag to denote that the value should be interpreted as a device handle.
int vicu(L4::Cap< L4::Icu > icu) const
Request an L4::Icu capability for this Vbus's virtual ICU.
Power-management API mixin.
int pm_suspend() const
Suspend the device.
int pm_resume() const
Resume the device.
The virtual bus (Vbus) interface.
int assign_dma_domain(unsigned domain_id, unsigned flags, L4::Cap< L4Re::Dma_space > dma_space) const
Bind or unbind an L4Re::Dma_space to a DMA domain.
Device root() const
Get the root device of the device tree of this bus.
int request_ioport(l4vbus_resource_t *res) const
Request the given IO port resource from the bus.
int assign_dma_domain(unsigned domain_id, unsigned flags, L4::Cap< L4::Task > dma_space) const
Bind or unbind a kernel DMA space to a DMA domain.
int release_ioport(l4vbus_resource_t *res) const
Release the given IO port resource from the bus.
int l4vbus_get_next_device(l4_cap_idx_t vbus, l4vbus_device_handle_t parent, l4vbus_device_handle_t *child, int depth, l4vbus_device_t *devinfo)
Find next child following child.
int l4vbus_assign_dma_domain(l4_cap_idx_t vbus, unsigned domain_id, unsigned flags, l4_cap_idx_t dma_space)
Bind or unbind a kernel DMA space or a L4Re::Dma_space to a DMA domain.
int l4vbus_get_device(l4_cap_idx_t vbus, l4vbus_device_handle_t dev, l4vbus_device_t *devinfo)
Obtain detailed information about a Vbus device.
int l4vbus_get_resource(l4_cap_idx_t vbus, l4vbus_device_handle_t dev, unsigned res_idx, l4vbus_resource_t *res)
Obtain the resource description of an individual device resource.
int l4vbus_request_ioport(l4_cap_idx_t vbus, l4vbus_resource_t const *res)
Request an IO port resource.
int l4vbus_get_device_by_hid(l4_cap_idx_t vbus, l4vbus_device_handle_t parent, l4vbus_device_handle_t *child, char const *hid, int depth, l4vbus_device_t *devinfo)
Find a device by the hardware interface identifier (HID).
int l4vbus_is_compatible(l4_cap_idx_t vbus, l4vbus_device_handle_t dev, char const *cid)
Check if the given device has a compatibility ID (CID) or HID that matches cid.
int l4vbus_vicu_get_cap(l4_cap_idx_t vbus, l4vbus_device_handle_t icu, l4_cap_idx_t cap)
Get capability of ICU.
int l4vbus_release_ioport(l4_cap_idx_t vbus, l4vbus_resource_t const *res)
Release a previously requested IO port resource.
@ L4VBUS_DMAD_L4RE_DMA_SPACE
The given DMA space is an L4Re::Dma_space.
@ L4VBUS_DMAD_KERNEL_DMA_SPACE
The given DMA space is a kernel DMA space (L4::Task)
int l4vbus_pm_resume(l4_cap_idx_t vbus, l4vbus_device_handle_t handle)
Resume the device.
int l4vbus_pm_suspend(l4_cap_idx_t vbus, l4vbus_device_handle_t handle)
Suspend the device.
C++ interface of the Vbus API.
Helper class to create an L4Re interface class that is derived from three base classes (see L4::Kobje...
RPCs list for passing raw incoming IPC to the server object.
Detailed information about a vbus device.
Description of a single vbus resource.
Description of the vbus C API.
@ L4VBUS_ICU_SRC_DEV_HANDLE
Flag to denote that the value should be interpreted as a device handle.
@ L4VBUS_NULL
NULL device.
@ L4VBUS_ROOT_BUS
Root device on the vbus.
l4_mword_t l4vbus_device_handle_t
Device handle for a device on the vbus.