Zephyr Project API 4.1.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
virtq Struct Reference

virtqueue More...

#include <virtqueue.h>

Data Fields

struct k_spinlock lock
 lock used to synchronize operations on virtqueue
 
uint16_t num
 size of virtqueue
 
struct virtq_descdesc
 array with descriptors
 
struct virtq_availavail
 available ring
 
struct virtq_usedused
 used ring
 
uint16_t last_used_idx
 last seen idx in used ring, used to determine first descriptor to process after receiving virtqueue interrupt
 
struct k_stack free_desc_stack
 Stack containing indexes of free descriptors.
 
uint16_t free_desc_n
 amount of free descriptors in the free_desc_stack
 
struct virtq_receive_callback_entryrecv_cbs
 array with callbacks invoked after receiving buffers back from the device
 

Detailed Description

virtqueue

contains structures required for virtqueue operation

Field Documentation

◆ avail

struct virtq_avail* virtq::avail

available ring

◆ desc

struct virtq_desc* virtq::desc

array with descriptors

◆ free_desc_n

uint16_t virtq::free_desc_n

amount of free descriptors in the free_desc_stack

◆ free_desc_stack

struct k_stack virtq::free_desc_stack

Stack containing indexes of free descriptors.

Because virtio devices are not required to use received descriptors in order (see 2.7.9) unless VIRTIO_F_IN_ORDER was offered, we can't use array with descriptors as another ring buffer, always taking next descriptor. This is an auxilary structure to easily determine next free descriptor

◆ last_used_idx

uint16_t virtq::last_used_idx

last seen idx in used ring, used to determine first descriptor to process after receiving virtqueue interrupt

◆ lock

struct k_spinlock virtq::lock

lock used to synchronize operations on virtqueue

◆ num

uint16_t virtq::num

size of virtqueue

◆ recv_cbs

struct virtq_receive_callback_entry* virtq::recv_cbs

array with callbacks invoked after receiving buffers back from the device

◆ used

struct virtq_used* virtq::used

used ring


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