Interfaces for Virtual I/O (VIRTIO) devices.  
More...
|  | 
| file | virtio.h | 
|  | Main header file for Virtio driver API. 
 | 
|  | 
Interfaces for Virtual I/O (VIRTIO) devices. 
◆ virtio_enumerate_queues
#include <include/zephyr/drivers/virtio.h>
Callback used during virtqueue enumeration. 
- Parameters
- 
  
    | queue_idx | index of currently inspected queue |  | max_queue_size | maximum permitted size of currently inspected queue |  | opaque | pointer to user provided data |  
 
- Returns
- the size of currently inspected virtqueue we want to set 
 
 
◆ virtio_commit_feature_bits()
  
  | 
        
          | static int virtio_commit_feature_bits | ( | const struct device * | dev | ) |  |  | inlinestatic | 
 
#include <include/zephyr/drivers/virtio.h>
Commits feature bits. 
- Parameters
- 
  
    | dev | virtio device it operates on |  
 
- Returns
- 0 on success or negative error code on failure 
 
 
◆ virtio_finalize_init()
  
  | 
        
          | static void virtio_finalize_init | ( | const struct device * | dev | ) |  |  | inlinestatic | 
 
 
◆ virtio_get_device_specific_config()
  
  | 
        
          | static void * virtio_get_device_specific_config | ( | const struct device * | dev | ) |  |  | inlinestatic | 
 
#include <include/zephyr/drivers/virtio.h>
Returns device specific config. 
- Parameters
- 
  
    | dev | virtio device it operates on |  
 
- Returns
- pointer to the device specific config or NULL if its not present 
 
 
◆ virtio_get_virtqueue()
#include <include/zephyr/drivers/virtio.h>
Returns virtqueue at given idx. 
- Parameters
- 
  
    | dev | virtio device it operates on |  | queue_idx | index of virtqueue to get |  
 
- Returns
- pointer to virtqueue or NULL if not present 
 
 
◆ virtio_init_virtqueues()
#include <include/zephyr/drivers/virtio.h>
Initializes virtqueues. 
- Parameters
- 
  
    | 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 |  
 
- Returns
- 0 on success or negative error code on failure 
 
 
◆ virtio_notify_virtqueue()
  
  | 
        
          | static void virtio_notify_virtqueue | ( | const struct device * | dev, |  
          |  |  | uint16_t | queue_idx |  
          |  | ) |  |  |  | inlinestatic | 
 
#include <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
- Parameters
- 
  
    | dev | virtio device it operates on |  | queue_idx | virtqueue to be notified |  
 
 
 
◆ virtio_read_device_feature_bit()
  
  | 
        
          | static bool virtio_read_device_feature_bit | ( | const struct device * | dev, |  
          |  |  | int | bit |  
          |  | ) |  |  |  | inlinestatic | 
 
#include <include/zephyr/drivers/virtio.h>
Returns feature bit offered by virtio device. 
- Parameters
- 
  
    | dev | virtio device it operates on |  | bit | selected bit |  
 
- Returns
- value of the offered feature bit 
 
 
◆ virtio_write_driver_feature_bit()
  
  | 
        
          | static int virtio_write_driver_feature_bit | ( | const struct device * | dev, |  
          |  |  | int | bit, |  
          |  |  | bool | value |  
          |  | ) |  |  |  | inlinestatic | 
 
#include <include/zephyr/drivers/virtio.h>
Sets feature bit. 
- Parameters
- 
  
    | dev | virtio device it operates on |  | bit | selected bit |  | value | bit value to write |  
 
- Returns
- 0 on success or negative error code on failure