L4Re - L4 Runtime Environment
L4virtio::Svr::Device_t< DATA > Class Template Referenceabstract

Server-side L4-VIRTIO device stub. More...

+ Inheritance diagram for L4virtio::Svr::Device_t< DATA >:
+ Collaboration diagram for L4virtio::Svr::Device_t< DATA >:

Public Member Functions

virtual void reset ()=0
 reset callback, called for doing a device reset
 
virtual bool check_queues ()=0
 callback for checking if the queues at DRIVER_OK transition
 
virtual int reconfig_queue (unsigned idx)=0
 callback for client queue-config request
 
virtual void register_single_driver_irq ()=0
 callback for registering a singe guest IRQ for all queues
 
virtual L4::Cap< L4::Irqdevice_notify_irq () const =0
 callback to gather the device notification IRQ
 
 Device_t (Dev_config *dev_config)
 Make a device for the given config.
 
Mem_list const * mem_info () const
 Get the memory region list used for this device.
 
void reset_queue_config (unsigned idx, unsigned num_max, bool inc_generation=false)
 Trigger reset for the configuration space for queue idx. More...
 
void init_mem_info (unsigned num)
 Initialize the memory region list to the given maximum. More...
 
void device_error ()
 Transition device into failed state. More...
 
bool setup_queue (Virtqueue *q, unsigned qn, unsigned num_max)
 Enable/disable the specified queue. More...
 
bool handle_mem_cmd_write ()
 Check for a value in the cmd register and handle a write. More...
 

Protected Attributes

Mem_list _mem_info
 Memory region list.
 

Detailed Description

template<typename DATA>
class L4virtio::Svr::Device_t< DATA >

Server-side L4-VIRTIO device stub.

Definition at line 652 of file l4virtio.

Member Function Documentation

◆ device_error()

template<typename DATA>
void L4virtio::Svr::Device_t< DATA >::device_error ( )
inline

Transition device into failed state.

Note
Callers should trigger a guest config IRQ after calling this function.

This function does a full reset, (calls reset()) and sets the failed bit in the device status register.

Definition at line 777 of file l4virtio.

◆ handle_mem_cmd_write()

template<typename DATA>
bool L4virtio::Svr::Device_t< DATA >::handle_mem_cmd_write ( )
inline

Check for a value in the cmd register and handle a write.

This function checks for a value in the cmd register and executes the command if there is any, or returns false if there was no command.

Execution of the command is signaled by a zero in the cmd register.

Definition at line 897 of file l4virtio.

◆ init_mem_info()

template<typename DATA>
void L4virtio::Svr::Device_t< DATA >::init_mem_info ( unsigned  num)
inline

Initialize the memory region list to the given maximum.

Parameters
numMaximum number of memory regions that can be managed.

Definition at line 764 of file l4virtio.

◆ reset_queue_config()

template<typename DATA>
void L4virtio::Svr::Device_t< DATA >::reset_queue_config ( unsigned  idx,
unsigned  num_max,
bool  inc_generation = false 
)
inline

Trigger reset for the configuration space for queue idx.

Parameters
idxThe queue index to reset.
num_maxMaximum number of entries in this queue.
inc_generationThe config generation will be incremented when this is true.

This function resets the driver-readable configuration space for the queue with the given index. The queue configuration is reset to all 0, name num_max to the given value.

Definition at line 754 of file l4virtio.

◆ setup_queue()

template<typename DATA>
bool L4virtio::Svr::Device_t< DATA >::setup_queue ( Virtqueue q,
unsigned  qn,
unsigned  num_max 
)
inline

Enable/disable the specified queue.

Parameters
qPointer to the ring that represents the virtqueue internally.
qnIndex of the queue.
num_maxMaximum number of supported entries in this queue.
Returns
true for success.
  • This function calculates the parameters of the virtqueue from the clients configuration space values, checks the accessibility of the queue data structures and initializes q to ready state when all checks succeeded.

Definition at line 796 of file l4virtio.


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