L4Re - L4 Runtime Environment
L4vbus::Pci_dev Class Reference

A PCI device. More...

+ Inheritance diagram for L4vbus::Pci_dev:
+ Collaboration diagram for L4vbus::Pci_dev:

Public Member Functions

int cfg_read (l4_uint32_t reg, l4_uint32_t *value, l4_uint32_t width) const
 Read from the device's vPCI configuration space. More...
 
int cfg_write (l4_uint32_t reg, l4_uint32_t value, l4_uint32_t width) const
 Write to the device's vPCI configuration space. More...
 
int irq_enable (unsigned char *trigger, unsigned char *polarity) const
 Enable the device's PCI interrupt. More...
 
- Public Member Functions inherited from L4vbus::Device
L4::Cap< Vbusbus_cap () const
 Access the V-BUS capability of the underlying virtual bus. More...
 
l4vbus_device_handle_t dev_handle () const
 Access the device handle of this device. More...
 
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 HID. More...
 
int next_device (Device *child, int depth=L4VBUS_MAX_DEPTH, l4vbus_device_t *devinfo=0) const
 Find next child following child. More...
 
int device (l4vbus_device_t *devinfo) const
 Obtain detailed information about a vbus device. More...
 
int get_resource (int res_idx, l4vbus_resource_t *res) const
 Obtain the resource description of an individual device resource. More...
 
int is_compatible (char const *cid) const
 Check if the given device has a compatibility ID (CID) or HID that matches cid. More...
 
bool operator== (Device const &o) const
 Test if two devices are the same V-BUS device. More...
 
bool operator!= (Device const &o) const
 Test if two devices are not the same. More...
 
- Public Member Functions inherited from L4vbus::Pm< Device >
int pm_suspend () const
 Suspend the module.
 
int pm_resume () const
 Resume the module.
 

Additional Inherited Members

- Protected Attributes inherited from L4vbus::Device
L4::Cap< Vbus_bus
 
l4vbus_device_handle_t _dev
 The device handle for this device.
 

Detailed Description

A PCI device.

Definition at line 87 of file vbus_pci.

Member Function Documentation

◆ cfg_read()

int L4vbus::Pci_dev::cfg_read ( l4_uint32_t  reg,
l4_uint32_t value,
l4_uint32_t  width 
) const
inline

Read from the device's vPCI configuration space.

Parameters
regRegister in configuration space to read
[out]valueValue that has been read
widthWidth to read in bits (e.g. 8, 16, 32)
Returns
0 on success, else failure

Definition at line 99 of file vbus_pci.

◆ cfg_write()

int L4vbus::Pci_dev::cfg_write ( l4_uint32_t  reg,
l4_uint32_t  value,
l4_uint32_t  width 
) const
inline

Write to the device's vPCI configuration space.

Parameters
regRegister in configuration space to write
valueValue to write
widthWidth to write in bits (e.g. 8, 16, 32)
Returns
0 on success, else failure

Definition at line 115 of file vbus_pci.

◆ irq_enable()

int L4vbus::Pci_dev::irq_enable ( unsigned char *  trigger,
unsigned char *  polarity 
) const
inline

Enable the device's PCI interrupt.

Parameters
[out]triggerFalse if interrupt is level-triggered
[out]polarityTrue if interrupt is of low polarity
Returns
On success: Interrupt line to be used, else failure

Definition at line 131 of file vbus_pci.


The documentation for this class was generated from the following file: