Device on a L4vbus::Vbus.
More...
#include <vbus>
Device on a L4vbus::Vbus.
Definition at line 85 of file vbus.
◆ Device()
Construct a new vbus device using a device handle.
Specifying the special root bus device handle L4VBUS_ROOT_BUS forms the root device of the corresponding vbus, see Vbus::root.
- Parameters
-
bus | The vbus capability where this device is assigned. |
dev | The device handle of the device. |
Definition at line 102 of file vbus.
◆ bus_cap()
◆ dev_handle()
Access the device handle of this device.
- Returns
- the device handle for this device.
The device handle is used to directly address the device on its virtual bus.
Definition at line 118 of file vbus.
References _dev.
◆ device()
Obtain detailed information about a Vbus device.
- Parameters
-
[out] | devinfo | Information structure which contains details about the device. The pointer might be NULL. |
- Return values
-
0 | Success. |
-L4_ENODEV | No device with the given device handle dev could be found. |
Definition at line 191 of file vbus.
References _bus, _dev, and l4vbus_get_device().
◆ device_by_hid()
int L4vbus::Device::device_by_hid |
( |
Device * |
child, |
|
|
char const * |
hid, |
|
|
int |
depth = L4VBUS_MAX_DEPTH , |
|
|
l4vbus_device_t * |
devinfo = 0 |
|
) |
| const |
|
inline |
Find a device by the hardware interface identifier (HID).
This function searches the vbus for a device with the given HID and returns a handle to the first matching device. The HID usually conforms to an ACPI HID or a Linux device tree compatible identifier.
It is possible to have multiple devices with the same HID on a vbus. In order to find all matching devices this function has to be called repeatedly with child
pointing to the device found in the previous iteration. The iteration starts at child
that might be any device node in the tree.
- Parameters
-
[in,out] | child | Handle of the device from where in the device tree the search should start. To start searching from the beginning child must be initialized using the default (L4VBUS_NULL). If a matching device is found, its handle is returned through this parameter. |
| hid | HID of the device |
| depth | Maximum depth for the recursive lookup |
[out] | devinfo | Device information structure (might be NULL) |
- Return values
-
>=0 | A device with the given HID was found. |
-L4_ENOENT | No device with the given HID could be found on the vbus. |
-L4_EINVAL | Invalid or no HID provided. |
-L4_ENODEV | Function called on a non-existing device. |
Definition at line 150 of file vbus.
References _bus, _dev, and l4vbus_get_device_by_hid().
◆ get_resource()
Obtain the resource description of an individual device resource.
- Parameters
-
This function returns the resource descriptor of an individual device resource selected by the res_idx
parameter.
- Return values
-
0 | Success. |
-L4_ENOENT | Invalid resource index res_idx . |
Definition at line 211 of file vbus.
References _bus, _dev, and l4vbus_get_resource().
◆ is_compatible()
int L4vbus::Device::is_compatible |
( |
char const * |
cid | ) |
const |
|
inline |
Check if the given device has a compatibility ID (CID) or HID that matches cid.
- Parameters
-
cid | the compatibility ID to test |
- Returns
- 1 when the given ID (cid) matches this device, 0 when the given ID does not match, <0 on error.
Definition at line 225 of file vbus.
References _bus, _dev, and l4vbus_is_compatible().
◆ next_device()
int L4vbus::Device::next_device |
( |
Device * |
child, |
|
|
int |
depth = L4VBUS_MAX_DEPTH , |
|
|
l4vbus_device_t * |
devinfo = 0 |
|
) |
| const |
|
inline |
Find next child following child
.
- Parameters
-
[in,out] | child | Handle of the device that precedes the device that shall be returned. To start from the beginning, child must be initialized with L4VBUS_NULL (Device::Device). If a device is found, its handle is returned through this parameter. |
| depth | Depth to look for |
[out] | devinfo | Device information (might be NULL) |
- Returns
- 0 on success, else failure
Definition at line 173 of file vbus.
References _bus, _dev, and l4vbus_get_next_device().
◆ operator!=()
bool L4vbus::Device::operator!= |
( |
Device const & |
o | ) |
const |
|
inline |
Test if two Vbus devices are not the same.
- Returns
- true if the two devices are different, false else.
Definition at line 241 of file vbus.
References _bus, and _dev.
◆ operator==()
bool L4vbus::Device::operator== |
( |
Device const & |
o | ) |
const |
|
inline |
Test if two devices are the same Vbus device.
- Returns
- true if the two devices are the same, false else.
Definition at line 232 of file vbus.
References _bus, and _dev.
The documentation for this class was generated from the following file: