13 #include <l4/vbus/vbus_pm.h> 18 #include <l4/re/event> 19 #include <l4/re/inhibitor> 46 template<
typename DEC>
50 DEC
const *
self()
const {
return static_cast<DEC
const *
>(
this); }
51 DEC *
self() {
return static_cast<DEC *
>(
this); }
57 {
return l4vbus_pm_suspend(
self()->bus_cap().cap(),
self()->dev_handle()); }
63 {
return l4vbus_pm_resume(
self()->bus_cap().cap(),
self()->dev_handle()); }
77 : _bus(bus), _dev(dev) {}
92 l4vbus_device_handle_t
dev_handle()
const {
return _dev; }
125 int depth = L4VBUS_MAX_DEPTH,
207 return _bus == o.
_bus && _dev == o.
_dev;
216 return _bus != o.
_bus || _dev != o.
_dev;
Device root() const
Get the root device of the device tree of this bus.
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 human interface identifier (HID).
Helper class to create an L4Re interface class that is derived from three base classes (see L4::Kobje...
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 (L4::Task) or a L4Re::Dma_space to a DMA domain.
Power-management API mixin.
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 human interface identifier (HID).
int next_device(Device *child, int depth=L4VBUS_MAX_DEPTH, l4vbus_device_t *devinfo=0) const
Find next child following child.
int assign_dma_domain(unsigned domain_id, unsigned flags, L4::Cap< L4Re::Dma_space > dma_space) const
Assign an L4Re::Dma_space to a DMA domain.
int assign_dma_domain(unsigned domain_id, unsigned flags, L4::Cap< L4::Task > dma_space) const
Assign a kernel DMA space to a DMA domain.
RPCs list for passing raw incoming IPC to the server object.
int device(l4vbus_device_t *devinfo) const
Obtain detailed information about a Vbus device.
Description of the vbus C API.
int is_compatible(char const *cid) const
Check if the given device has a compatibility ID (CID) or HID that matches cid.
Description of a single vbus resource.
l4vbus_device_handle_t dev_handle() const
Access the device handle of this device.
int l4vbus_get_resource(l4_cap_idx_t vbus, l4vbus_device_handle_t dev, int res_idx, l4vbus_resource_t *res)
Obtain the resource description of an individual device resource.
Device on a L4vbus::Vbus.
int pm_suspend() const
Suspend the module.
int get_resource(int res_idx, l4vbus_resource_t *res) const
Obtain the resource description of an individual device resource.
int l4vbus_vicu_get_cap(l4_cap_idx_t vbus, l4vbus_device_handle_t icu, l4_cap_idx_t cap)
Get capability of ICU.
l4_cap_idx_t cap() const
Return capability selector.
Detailed information about a vbus device.
int l4vbus_request_resource(l4_cap_idx_t vbus, l4vbus_resource_t const *res, int flags)
Request a resource of a specific type.
l4vbus_device_handle_t _dev
The device handle for this device.
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_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_release_resource(l4_cap_idx_t vbus, l4vbus_resource_t const *res)
Release a previously requested resource.
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 release_resource(l4vbus_resource_t *res) const
Release the given resource from the bus.
Vbus Interrupt controller API.
The given DMA space is an L4Re::Dma_space.
C++ interface for capabilities.
The virtual bus (Vbus) interface.
int request_resource(l4vbus_resource_t *res, int flags=0) const
Request the given resource from the bus.
L4::Cap< Vbus > bus_cap() const
Access the Vbus capability of the underlying virtual bus.
The given DMA space is a kernel DMA space (L4::Task)
int pm_resume() const
Resume the module.
int vicu(L4::Cap< L4::Icu > icu) const
Request the L4::Icu capability for this Vbus ICU.