class Device

Defined at line 27 of file ../../src/devices/bus/lib/virtio/include/lib/virtio/device.h

Protected Members

bti bti_
unique_ptr backend_
thrd_t irq_thread_
mutex lock_
atomic irq_thread_should_exit_

Public Methods

void Device (zx::bti bti, std::unique_ptr<Backend> backend)

Defined at line 26 of file ../../src/devices/bus/lib/virtio/device.cc

void ~Device ()

Defined at line 29 of file ../../src/devices/bus/lib/virtio/device.cc

zx_status_t Init ()
void Release ()

Defined at line 31 of file ../../src/devices/bus/lib/virtio/device.cc

fuchsia_hardware_pci::InterruptMode InterruptMode ()

interrupt cases that devices may override

Defined at line 37 of file ../../src/devices/bus/lib/virtio/include/lib/virtio/device.h

void StartIrqThread ()

Defined at line 105 of file ../../src/devices/bus/lib/virtio/device.cc

void IrqRingUpdate ()
void IrqConfigChange ()
const char * tag ()

It is expected that each derived device will implement tag().

uint16_t GetRingSize (uint16_t index)

Get the Ring size for the particular device / backend.

This has to be proxied to a backend method because we can't

simply do config reads to determine the information.

Defined at line 44 of file ../../src/devices/bus/lib/virtio/include/lib/virtio/device.h

zx_status_t SetRing (uint16_t index, uint16_t count, zx_paddr_t pa_desc, zx_paddr_t pa_avail, zx_paddr_t pa_used)

Set up ring descriptors with the backend.

Defined at line 46 of file ../../src/devices/bus/lib/virtio/include/lib/virtio/device.h

void RingKick (uint16_t ring_index)

Another method that has to be proxied to the backend due to differences

in how Legacy vs Modern systems are laid out.

Defined at line 53 of file ../../src/devices/bus/lib/virtio/include/lib/virtio/device.h

const zx::bti & bti ()

Accessor for bti so that Rings can map IO buffers

Defined at line 59 of file ../../src/devices/bus/lib/virtio/include/lib/virtio/device.h

zx_status_t GetSharedMemoryVmo (zx::vmo * vmo_out)

Defined at line 61 of file ../../src/devices/bus/lib/virtio/include/lib/virtio/device.h

Protected Methods

void CopyDeviceConfig (void * _buf, size_t len)

Device config management

Defined at line 111 of file ../../src/devices/bus/lib/virtio/device.cc

int IrqThreadEntry (void * arg)

Defined at line 99 of file ../../src/devices/bus/lib/virtio/device.cc

void IrqWorker ()

Defined at line 38 of file ../../src/devices/bus/lib/virtio/device.cc

uint64_t DeviceFeaturesSupported ()

Methods for checking / acknowledging features

Defined at line 65 of file ../../src/devices/bus/lib/virtio/include/lib/virtio/device.h

void DriverFeaturesAck (uint64_t feature_bitmap)

Defined at line 66 of file ../../src/devices/bus/lib/virtio/include/lib/virtio/device.h

bool DeviceStatusFeaturesOk ()

Defined at line 67 of file ../../src/devices/bus/lib/virtio/include/lib/virtio/device.h

void DeviceReset ()

Device lifecycle methods

Defined at line 70 of file ../../src/devices/bus/lib/virtio/include/lib/virtio/device.h

void WaitForDeviceReset ()

Defined at line 71 of file ../../src/devices/bus/lib/virtio/include/lib/virtio/device.h

void DriverStatusAck ()

Defined at line 72 of file ../../src/devices/bus/lib/virtio/include/lib/virtio/device.h

void DriverStatusOk ()

Defined at line 73 of file ../../src/devices/bus/lib/virtio/include/lib/virtio/device.h

uint32_t IsrStatus ()

Defined at line 74 of file ../../src/devices/bus/lib/virtio/include/lib/virtio/device.h

template <typename T>
void ReadDeviceConfig (uint16_t offset, T * val)

Defined at line 79 of file ../../src/devices/bus/lib/virtio/include/lib/virtio/device.h

template <typename T>
void WriteDeviceConfig (uint16_t offset, T val)

Defined at line 83 of file ../../src/devices/bus/lib/virtio/include/lib/virtio/device.h