OpenAMP Library  353
virtqueue Struct Reference

Local virtio queue to manage a virtio ring for sending or receiving. More...

#include <virtqueue.h>

Data Fields

struct virtio_devicevq_dev
 Associated virtio device. More...
 
const char * vq_name
 Name of the virtio queue. More...
 
uint16_t vq_queue_index
 Index of the virtio queue. More...
 
uint16_t vq_nentries
 Max number of buffers in the virtio queue. More...
 
void(* callback )(struct virtqueue *vq)
 Function to invoke, when message is available on the virtio queue. More...
 
void * priv
 Private data associated to the virtio queue. More...
 
void(* notify )(struct virtqueue *vq)
 Function to invoke, to inform the other side about an update in the virtio queue. More...
 
struct vring vq_ring
 Associated virtio ring. More...
 
uint16_t vq_free_cnt
 Number of free descriptor in the virtio ring. More...
 
uint16_t vq_queued_cnt
 Number of queued buffer in the virtio ring. More...
 
struct metal_io_region * shm_io
 Metal I/O region of the buffers. More...
 
uint16_t vq_desc_head_idx
 Head of the free chain in the descriptor table. More...
 
uint16_t vq_used_cons_idx
 Last consumed descriptor in the used table, trails vq_ring.used->idx. More...
 
uint16_t vq_available_idx
 Last consumed descriptor in the available table, used by the consumer side. More...
 
struct vq_desc_extra vq_descx [0]
 Used by the host side during callback. More...
 

Detailed Description

Local virtio queue to manage a virtio ring for sending or receiving.

Field Documentation

◆ callback

void(* virtqueue::callback) (struct virtqueue *vq)

Function to invoke, when message is available on the virtio queue.

◆ notify

void(* virtqueue::notify) (struct virtqueue *vq)

Function to invoke, to inform the other side about an update in the virtio queue.

◆ priv

void* virtqueue::priv

Private data associated to the virtio queue.

◆ shm_io

struct metal_io_region* virtqueue::shm_io

Metal I/O region of the buffers.

This structure is used for conversion between virtual and physical addresses.

◆ vq_available_idx

uint16_t virtqueue::vq_available_idx

Last consumed descriptor in the available table, used by the consumer side.

◆ vq_desc_head_idx

uint16_t virtqueue::vq_desc_head_idx

Head of the free chain in the descriptor table.

If there are no free descriptors, this will be set to VQ_RING_DESC_CHAIN_END.

◆ vq_descx

struct vq_desc_extra virtqueue::vq_descx[0]

Used by the host side during callback.

Cookie holds the address of buffer received from other side. Other fields in this structure are not used currently.

◆ vq_dev

struct virtio_device* virtqueue::vq_dev

Associated virtio device.

◆ vq_free_cnt

uint16_t virtqueue::vq_free_cnt

Number of free descriptor in the virtio ring.

◆ vq_name

const char* virtqueue::vq_name

Name of the virtio queue.

◆ vq_nentries

uint16_t virtqueue::vq_nentries

Max number of buffers in the virtio queue.

◆ vq_queue_index

uint16_t virtqueue::vq_queue_index

Index of the virtio queue.

◆ vq_queued_cnt

uint16_t virtqueue::vq_queued_cnt

Number of queued buffer in the virtio ring.

◆ vq_ring

struct vring virtqueue::vq_ring

Associated virtio ring.

◆ vq_used_cons_idx

uint16_t virtqueue::vq_used_cons_idx

Last consumed descriptor in the used table, trails vq_ring.used->idx.


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