![]() |
L4Re Operating System Framework
Interface and Usage Documentation
|
Representation of a Virtio console port. More...
#include <virtio-console>
Data Structures | |
struct | Transition |
State transition from last report state to current state. More... | |
Public Types | |
enum | Port_status { Port_disabled = 0 , Port_added , Port_ready , Port_open , Port_failed , Port_num_states } |
Possible states of a virtio console port. More... | |
enum | |
Size of control queues, also used as default size. | |
Data Fields | |
Virtqueue | tx |
Receiveq of the port. | |
Virtqueue | rx |
Transmitq of the port. | |
Port_status | status |
State the port is in. | |
Port_status | reported_status |
State the port was last reported. | |
unsigned | vq_max |
Maximum queue sizes for this port. | |
Static Public Attributes | |
static constexpr Transition | state_transitions [Port_num_states][Port_num_states] |
State transition table from last report state to current state. | |
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:
Definition at line 109 of file virtio-console.
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. |
Port_num_states | Number of port states. Must be last. |
Definition at line 114 of file virtio-console.
|
staticconstexpr |
State transition table from last report state to current state.
Not all transitions can be made directly. For example, if the last reported state was Port_disabled
and the current state is Port_open
, the device has to send two messages: Control_message::Device_add
and Control_message::Port_open
. This is expressed by going through an intermediate state (Port_ready
) on the reporting side.
For the purpose of the driver there are only three coarse states:
The state transition table with Port_added, Port_ready and Port_failed as current state are thus identical.
Definition at line 195 of file virtio-console.