L4Re Operating System Framework
Interface and Usage Documentation
Loading...
Searching...
No Matches
L4virtio::Svr::Console::Port Struct Reference

Representation of a Virtio console port. More...

#include <virtio-console>

+ Inheritance diagram for L4virtio::Svr::Console::Port:
+ Collaboration diagram for L4virtio::Svr::Console::Port:

Public Types

enum  Port_status {
  Port_disabled = 0 , Port_added , Port_ready , Port_open ,
  Port_failed
}
 Possible states of a virtio console port. More...
 
enum  
 Size of control queues, also used as default size.
 

Public Member Functions

bool is_open () const
 Check that the port is open.
 
virtual void reset ()
 Reset the port to the initial state and disable its virtqueues.
 
bool queues_ready () const
 Check that both virtqueues are set up correctly.
 
bool rx_ready () const
 Check that device implementation may write to receive queues.
 
bool tx_ready () const
 Check that device implementation may read from transmit queues.
 

Data Fields

Virtqueue tx
 Receiveq of the port.
 
Virtqueue rx
 Transmitq of the port.
 
Port_status status
 State the port is in.
 
unsigned vq_max
 Maximum queue sizes for this port.
 

Detailed Description

Representation of a Virtio console port.

Each port consists of a pair of queues for sending and receiving.

A port may be added and removed at runtime when the multi-port feature is enabled. The states are as follows:

+----------+ port_remove()
| DISABLED |<----------------------- [all]
+----------+
|
| port_add()
v
+----------+ process_port_ready(0)
| ADDED + --------------+
+----------+ | +--------+
| +------------>| |
| process_port_ready(1) | |
v | FAILED |
+----------+ process_port_ready(0) | |
| READY |---------------------------->| |
+----------+<----------+ +--------+
| | ^
| port_open(true) | port_open(false) |
v | | process_port_ready(0)
+----------+ | |
| OPEN |-----------+ |
+----------+----------------------------------+

Definition at line 107 of file virtio-console.

Member Enumeration Documentation

◆ Port_status

Possible states of a virtio console port.

Enumerator
Port_disabled 

Reset state, waiting for port to be added.

Port_added 

Port has been added by device, waiting for ready message.

Port_ready 

Port is ready but still closed.

Port_open 

Port is in a working state.

Port_failed 

Device failure, port unusable.

Definition at line 112 of file virtio-console.


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