Zephyr API Documentation 4.2.99
A Scalable Open Source RTOS
|
|
4.2.99 |
Virtio Interface. More...
Topics | |
Virtqueue Interface | |
Virtqueue Interface. |
Data Structures | |
struct | virtio_driver_api |
Virtio api structure. More... |
Typedefs | |
typedef uint16_t(* | virtio_enumerate_queues) (uint16_t queue_idx, uint16_t max_queue_size, void *opaque) |
Callback used during virtqueue enumeration. |
Functions | |
static struct virtq * | virtio_get_virtqueue (const struct device *dev, uint16_t queue_idx) |
Returns virtqueue at given idx. | |
static void | virtio_notify_virtqueue (const struct device *dev, uint16_t queue_idx) |
Notifies virtqueue. | |
static void * | virtio_get_device_specific_config (const struct device *dev) |
Returns device specific config. | |
static bool | virtio_read_device_feature_bit (const struct device *dev, int bit) |
Returns feature bit offered by virtio device. | |
static int | virtio_write_driver_feature_bit (const struct device *dev, int bit, bool value) |
Sets feature bit. | |
static int | virtio_commit_feature_bits (const struct device *dev) |
Commits feature bits. | |
static int | virtio_init_virtqueues (const struct device *dev, uint16_t num_queues, virtio_enumerate_queues cb, void *opaque) |
Initializes virtqueues. | |
static void | virtio_finalize_init (const struct device *dev) |
Finalizes initialization of the virtio device. |
Virtio Interface.
typedef uint16_t(* virtio_enumerate_queues) (uint16_t queue_idx, uint16_t max_queue_size, void *opaque) |
#include <zephyr/drivers/virtio.h>
Callback used during virtqueue enumeration.
queue_idx | index of currently inspected queue |
max_queue_size | maximum permitted size of currently inspected queue |
opaque | pointer to user provided data |
|
inlinestatic |
#include <zephyr/drivers/virtio.h>
Commits feature bits.
dev | virtio device it operates on |
|
inlinestatic |
#include <zephyr/drivers/virtio.h>
Finalizes initialization of the virtio device.
dev | virtio device it operates on |
|
inlinestatic |
#include <zephyr/drivers/virtio.h>
Returns device specific config.
dev | virtio device it operates on |
#include <zephyr/drivers/virtio.h>
Returns virtqueue at given idx.
dev | virtio device it operates on |
queue_idx | index of virtqueue to get |
|
inlinestatic |
#include <zephyr/drivers/virtio.h>
Initializes virtqueues.
dev | virtio device it operates on |
num_queues | number of queues to initialize |
cb | callback called for each available virtqueue |
opaque | pointer to user provided data that will be passed to the callback |
#include <zephyr/drivers/virtio.h>
Notifies virtqueue.
Note that according to spec 2.7.13.3 the device may access the buffers as soon as the avail->idx is increased, which is done by virtq_add_buffer_chain, so the device may access the buffers even without notifying it with virtio_notify_virtqueue
dev | virtio device it operates on |
queue_idx | virtqueue to be notified |
#include <zephyr/drivers/virtio.h>
Returns feature bit offered by virtio device.
dev | virtio device it operates on |
bit | selected bit |
#include <zephyr/drivers/virtio.h>
Sets feature bit.
dev | virtio device it operates on |
bit | selected bit |
value | bit value to write |