Loading...
Searching...
No Matches
virtio-console
// vi:ft=cpp
/* SPDX-License-Identifier: MIT */
/*
* Copyright (C) 2019-2024 Kernkonzept GmbH.
* Author(s): Sarah Hoffmann <sarah.hoffmann@kernkonzept.com>
* Phillip Raffeck <phillip.raffeck@kernkonzept.com>
* Steffen Liebergeld <steffen.liebergeld@kernkonzept.com>
* Jan Klötzke <jan.kloetzke@kernkonzept.com>
*/
#pragma once
#include <l4/l4virtio/server/l4virtio>
#include <l4/re/error_helper>
namespace L4virtio { namespace Svr { namespace Console {
struct Features : Dev_config::Features
{
Features() = default;
explicit Features(l4_uint32_t raw) : Dev_config::Features(raw) {}
CXX_BITFIELD_MEMBER(0, 0, console_size, raw);
CXX_BITFIELD_MEMBER(1, 1, console_multiport, raw);
CXX_BITFIELD_MEMBER(2, 2, emerg_write, raw);
};
struct Control_message
{
enum Events
{
Device_ready = 0,
Device_add = 1,
Device_remove = 2,
Port_ready = 3,
Console_port = 4,
Resize = 5,
Port_open = 6,
Port_name = 7,
};
l4_uint32_t id;
l4_uint16_t event;
l4_uint16_t value;
Control_message() {}
Control_message(l4_uint32_t i, l4_uint16_t e, l4_uint16_t v)
: id(i), event(e), value(v)
{}
};
struct Control_request
{
Control_message *msg;
l4_uint32_t len;
Driver_mem_region *mem;
};
struct Port
{
enum Port_status
{
Port_disabled = 0,
Port_added,
Port_ready,
Port_open,
Port_failed,
Port_num_states,
};
enum { Control_queue_size = 0x10 };
Virtqueue tx;
Virtqueue rx;
Port_status status;
Port_status reported_status;
unsigned vq_max;
Port() : status(Port_disabled), vq_max(Control_queue_size) {}
Port(Port const &) = delete;
Port &operator = (Port const &) = delete;
virtual ~Port() = default;
bool is_open() const
{ return status == Port_open; }
virtual void reset()
{
status = Port_disabled;
reported_status = Port_disabled;
}
bool queues_ready() const
{ return tx.ready() && rx.ready(); }
bool rx_ready() const
{ return is_open() && rx.ready(); }
bool tx_ready() const
{ return is_open() && tx.ready(); }
struct Transition {
l4_int16_t event;
l4_uint16_t value;
Port_status next;
};
static constexpr Transition
state_transitions[Port_num_states][Port_num_states] =
{
/* reported current */
/* Port_disabled */ /* Port_disabled */ {{ -1, 0, Port_disabled },
/* Port_added */ { Control_message::Device_add, 0,
Port_added },
/* Port_ready */ { Control_message::Device_add, 0,
Port_ready },
/* Port_open */ { Control_message::Device_add, 0,
Port_ready },
/* Port_failed */ { Control_message::Device_add, 0,
Port_failed }},
/* Port_added */ /* Port_disabled */ {{ Control_message::Device_remove,
0, Port_disabled },
/* Port_added */ { -1, 0, Port_added },
/* Port_ready */ { -1, 0, Port_ready },
/* Port_open */ { Control_message::Port_open, 1,
Port_open },
/* Port_failed */ { -1, 0, Port_failed }},
/* Port_ready */ /* Port_disabled */ {{ Control_message::Device_remove,
0, Port_disabled },
/* Port_added */ { -1, 0, Port_added },
/* Port_ready */ { -1, 0, Port_ready },
/* Port_open */ { Control_message::Port_open, 1,
Port_open },
/* Port_failed */ { -1, 0, Port_failed }},
/* Port_open */ /* Port_disabled */ {{ Control_message::Port_open, 0,
Port_ready },
/* Port_added */ { Control_message::Port_open, 0,
Port_added },
/* Port_ready */ { Control_message::Port_open, 0,
Port_ready },
/* Port_open */ { -1, 0, Port_open },
/* Port_failed */ { Control_message::Port_open, 0,
Port_ready }},
/* Port_failed */ /* Port_disabled */ {{ Control_message::Device_remove,
0, Port_disabled },
/* Port_added */ { -1, 0, Port_added },
/* Port_ready */ { -1, 0, Port_ready },
/* Port_open */ { Control_message::Port_open, 1,
Port_open },
/* Port_failed */ { -1, 0, Port_failed }},
};
};
class Virtio_con : public L4virtio::Svr::Device
{
enum Virtqueue_names
{
Ctrl_rx = 2,
Ctrl_tx = 3,
};
struct Serial_config_space
{
l4_uint16_t cols;
l4_uint16_t rows;
l4_uint32_t max_nr_ports;
l4_uint32_t emerg_wr;
} __attribute__((packed));
public:
explicit Virtio_con(unsigned max_ports, bool enable_multiport)
: L4virtio::Svr::Device(&_dev_config),
_num_ports(enable_multiport ? max_ports : 1),
_dev_config(L4VIRTIO_VENDOR_KK, L4VIRTIO_ID_CONSOLE,
enable_multiport ? max_ports * 2 + 2 : 2)
{
if (_num_ports < 1)
L4Re::chksys(-L4_EINVAL, "At least one port is required.");
Features hf(0);
hf.console_multiport() = enable_multiport;
_dev_config.host_features(0) = hf.raw;
if (enable_multiport)
_dev_config.priv_config()->max_nr_ports = _num_ports;
_dev_config.reset_hdr();
}
void reset_queue_configs()
{
for (unsigned q = 0; q < _dev_config.num_queues(); ++q)
reset_queue_config(q, max_queue_size(q));
}
int reconfig_queue(unsigned index) override
{
if (index >= _dev_config.num_queues())
return -L4_ERANGE;
if (setup_queue(get_queue(index), index, max_queue_size(index)))
return 0;
return -L4_EINVAL;
}
bool multiport_enabled() const
{
return _negotiated_features.console_multiport()
&& _dev_config.num_queues() > Ctrl_rx;
}
bool ctrl_queue_ready() const
{ return _ctrl_port.is_open(); }
bool check_features(void) override
{
_negotiated_features = Features(_dev_config.negotiated_features(0));
return true;
}
bool check_queues() override
{
// NOTE
// The VIRTIO specification states:
// "The port 0 receive and transmit queues always exist"
// The linux driver however does not setup port 0 if the multiport feature
// is negotiated.
// We just go along with the linux driver and do not expect port 0 to be up,
// if the multiport feature is negotiated.
if (multiport_enabled())
// If MULTIPORT was negotiated, ctrl queues should be set up.
return _ctrl_port.queues_ready();
// If MULTIPORT was not negotiated, port 0 should be set up.
port(0)->status = Port::Port_open;
return port(0)->queues_ready();
}
int port_add(unsigned idx)
{
Port *p = port(idx);
if (p->status != Port::Port_disabled)
return -L4_EPERM;
p->status = Port::Port_added;
port_report_status(idx);
return L4_EOK;
}
int port_remove(unsigned idx)
{
Port *p = port(idx);
if (p->status == Port::Port_disabled)
return -L4_EPERM;
p->status = Port::Port_disabled;
port_report_status(idx);
return L4_EOK;
}
int port_open(unsigned idx, bool open)
{
Port *p = port(idx);
if ((open && p->status != Port::Port_ready)
|| (!open && p->status != Port::Port_open))
return -L4_EPERM;
p->status = open ? Port::Port_open : Port::Port_ready;
port_report_status(idx);
return L4_EOK;
}
int port_name(unsigned idx, char const *name)
{
Port *p = port(idx);
if (p->status == Port::Port_disabled)
return -L4_EPERM;
return send_control_message(idx, Control_message::Port_name, 0, name);
}
int send_control_message(l4_uint32_t idx, l4_uint16_t event,
l4_uint16_t value = 0, const char *name = 0)
{
if (!ctrl_queue_ready())
return -L4_ENODEV;
Virtqueue *q = &_ctrl_port.rx;
if (!q->ready())
return -L4_ENODEV;
Virtqueue::Request r = q->next_avail();
if (!r)
return -L4_EBUSY;
Request_processor rp;
Control_request req;
rp.start(this, r, &req);
if (req.len < sizeof(Control_message))
return -L4_ENOMEM;
Control_message msg(idx, event, value);
memcpy(req.msg, &msg, sizeof(msg));
if (event == Control_message::Port_name && name)
{
size_t name_len = cxx::min(req.len - sizeof(msg), strlen(name));
memcpy(reinterpret_cast<char*>(req.msg) + sizeof(msg), name, name_len);
q->finish(r, this, sizeof(msg) + name_len);
}
else
q->finish(r, this, sizeof(msg));
return L4_EOK;
}
int handle_control_message()
{
// Report port state transitions if that failed in the past...
if (_report_port_state)
{
_report_port_state = false;
for (unsigned i = 0; i < _num_ports; ++i)
if (!port_report_status(i))
_report_port_state = true;
}
Virtqueue *q = &_ctrl_port.tx;
if (!q->ready())
return -L4_ENODEV;
int ret = L4_EOK;
Virtqueue::Request r;
while ((r = q->next_avail()))
{
Request_processor rp;
Control_request req;
rp.start(this, r, &req);
Control_message msg;
if (req.len < sizeof(msg))
{
// Just ignore malformed input.
q->finish(r, this);
ret = -L4_EINVAL;
continue;
}
memcpy(&msg, req.msg, sizeof(msg));
q->finish(r, this);
if (_ctrl_port.status == Port::Port_disabled)
{
// When the control queue is disabled, only device ready is accepted.
if (msg.event == Control_message::Device_ready)
{
if (msg.value)
_ctrl_port.status = Port::Port_open;
}
process_device_ready(msg.value);
continue;
}
if (!ctrl_queue_ready())
continue;
// Ignore invalid port ids
if (msg.id >= max_ports())
break;
switch (msg.event)
{
case Control_message::Port_ready:
process_port_ready(msg.id, msg.value);
break;
case Control_message::Port_open:
process_port_open(msg.id, msg.value);
break;
default:
ret = -L4_EINVAL;
break;
}
}
return ret;
}
void load_desc(L4virtio::Virtqueue::Desc const &desc,
Request_processor const *proc,
L4virtio::Virtqueue::Desc const **table)
{
this->_mem_info.load_desc(desc, proc, table);
}
void load_desc(L4virtio::Virtqueue::Desc const &desc,
Request_processor const *proc,
Control_request *data)
{
auto *region = this->_mem_info.find(desc.addr.get(), desc.len);
if (L4_UNLIKELY(!region))
throw Bad_descriptor(proc, Bad_descriptor::Bad_address);
data->msg = reinterpret_cast<Control_message *>(region->local(desc.addr));
data->len = desc.len;
data->mem = region;
}
void reset() override
{
for (unsigned p = 0; p < _num_ports; ++p)
port(p)->reset();
_ctrl_port.reset();
reset_queue_configs();
_dev_config.reset_hdr();
_negotiated_features = Features(0);
_report_port_state = false;
reset_device();
}
virtual void reset_device() {}
virtual void notify_queue(Virtqueue *queue) = 0;
virtual Port *port(unsigned port) = 0;
virtual Port const *port(unsigned port) const = 0;
virtual void process_device_ready(l4_uint16_t value) = 0;
virtual void process_port_ready(l4_uint32_t id, l4_uint16_t value)
{
Port *p = port(id);
switch (p->status)
{
case Port::Port_added:
case Port::Port_ready:
p->status = value ? Port::Port_ready : Port::Port_failed;
break;
case Port::Port_open:
if (!value)
p->status = Port::Port_failed;
break;
default:
// invalid state for PORT_READY message
break;
}
}
virtual void process_port_open(l4_uint32_t id, l4_uint16_t value) = 0;
unsigned max_ports() const
{ return _num_ports; }
private:
bool is_control_queue(unsigned q) const
{ return q == Ctrl_rx || q == Ctrl_tx; }
unsigned queue_to_port(unsigned q) const
{ return (q == 0 || q == 1) ? 0 : (q / 2) - 1; }
unsigned max_queue_size(unsigned q) const
{
if (is_control_queue(q))
return _ctrl_port.vq_max;
return port(queue_to_port(q))->vq_max;
}
Virtqueue *get_queue(unsigned q)
{
Port *p;
if (is_control_queue(q))
p = &_ctrl_port;
else
p = port(queue_to_port(q));
if (q & 1)
return &p->tx;
else
return &p->rx;
}
bool port_report_status(unsigned idx)
{
Port *p = port(idx);
while (p->status != p->reported_status)
{
auto const &trans
= Port::state_transitions[p->reported_status][p->status];
if (trans.event >= 0
&& send_control_message(idx, trans.event, trans.value) < 0)
{
_report_port_state = true;
return false;
}
p->reported_status = trans.next;
}
return true;
}
unsigned _num_ports;
bool _report_port_state = false;
protected:
Dev_config_t<Serial_config_space> _dev_config;
Port _ctrl_port;
Features _negotiated_features{0};
};
}}} // name space
L4virtio::Ptr::get
l4_uint64_t get() const
Definition virtqueue:62
L4virtio::Svr::Console::Device
Base class implementing a virtio console device with L4Re-based notification handling.
Definition virtio-console-device:120
L4virtio::Svr::Console::Virtio_con::process_port_open
virtual void process_port_open(l4_uint32_t id, l4_uint16_t value)=0
Callback called on PORT_OPEN event.
L4virtio::Svr::Console::Virtio_con::check_queues
bool check_queues() override
callback for checking if the queues at DRIVER_OK transition
Definition virtio-console:349
L4virtio::Svr::Console::Virtio_con::reset_device
virtual void reset_device()
Reset the state of the actual console device.
Definition virtio-console:652
L4virtio::Svr::Console::Virtio_con::multiport_enabled
bool multiport_enabled() const
Return true if the multiport feature is enabled and control queues are available.
Definition virtio-console:334
L4virtio::Svr::Console::Virtio_con::check_features
bool check_features(void) override
callback for checking the subset of accepted features
Definition virtio-console:343
L4virtio::Svr::Console::Virtio_con::notify_queue
virtual void notify_queue(Virtqueue *queue)=0
Notify queue of available data.
L4virtio::Svr::Console::Virtio_con::reset
void reset() override
reset callback, called for doing a device reset
Definition virtio-console:632
L4virtio::Svr::Console::Virtio_con::port_open
int port_open(unsigned idx, bool open)
Send a PORT_OPEN message and update the internal state.
Definition virtio-console:428
L4virtio::Svr::Console::Virtio_con::port_name
int port_name(unsigned idx, char const *name)
Send a PORT_NAME message to announce the port name.
Definition virtio-console:455
L4virtio::Svr::Console::Virtio_con::process_port_ready
virtual void process_port_ready(l4_uint32_t id, l4_uint16_t value)
Callback called on PORT_READY event.
Definition virtio-console:698
L4virtio::Svr::Console::Virtio_con::port_remove
int port_remove(unsigned idx)
Send a DEVICE_REMOVE message and update the internal state.
Definition virtio-console:403
L4virtio::Svr::Console::Virtio_con::process_device_ready
virtual void process_device_ready(l4_uint16_t value)=0
Callback called on DEVICE_READY event.
L4virtio::Svr::Console::Virtio_con::port_add
int port_add(unsigned idx)
Send a DEVICE_ADD message and update the internal state.
Definition virtio-console:379
L4virtio::Svr::Console::Virtio_con::reconfig_queue
int reconfig_queue(unsigned index) override
callback for client queue-config request
Definition virtio-console:319
L4virtio::Svr::Console::Virtio_con::Virtio_con
Virtio_con(unsigned max_ports, bool enable_multiport)
Create a new multiport console device.
Definition virtio-console:293
L4virtio::Svr::Console::Virtio_con::port
virtual Port * port(unsigned port)=0
Return the specified port.
L4virtio::Svr::Console::Virtio_con::handle_control_message
int handle_control_message()
Handle control message received from the driver.
Definition virtio-console:536
L4virtio::Svr::Console::Virtio_con::send_control_message
int send_control_message(l4_uint32_t idx, l4_uint16_t event, l4_uint16_t value=0, const char *name=0)
Send control message to driver.
Definition virtio-console:487
L4virtio::Svr::Dev_config::num_queues
l4_uint32_t num_queues() const
Return the number of queues currently usable.
Definition l4virtio:184
L4virtio::Svr::Device_t< No_custom_data >::_mem_info
Mem_list _mem_info
Definition l4virtio:807
L4virtio::Svr::Device_t< No_custom_data >::setup_queue
bool setup_queue(Virtqueue *q, unsigned qn, unsigned num_max)
Definition l4virtio:1047
L4virtio::Svr::Device_t< No_custom_data >::reset_queue_config
void reset_queue_config(unsigned idx, unsigned num_max, bool inc_generation=false)
Definition l4virtio:1002
L4virtio::Svr::Driver_mem_list_t::find
Mem_region * find(l4_uint64_t base, l4_umword_t size) const
Find memory region containing the given driver address region.
Definition l4virtio:703
L4virtio::Svr::Driver_mem_list_t::load_desc
void load_desc(Virtqueue::Desc const &desc, Request_processor const *p, Virtqueue::Desc const **table) const
Default implementation for loading an indirect descriptor.
Definition l4virtio:717
L4virtio::Svr::Request_processor
Encapsulate the state for processing a VIRTIO request.
Definition virtio:473
L4virtio::Svr::Request_processor::start
void start(DESC_MAN *dm, Virtqueue *ring, Virtqueue::Head_desc const &request, ARGS... args)
Start processing a new request.
Definition virtio:501
L4virtio::Svr::Virtqueue
Virtqueue implementation for the device.
Definition virtio:88
L4virtio::Svr::Virtqueue::next_avail
Request next_avail()
Get the next available descriptor from the available ring.
Definition virtio:136
L4virtio::Svr::Virtqueue::finish
void finish(Head_desc &d, QUEUE_OBSERVER *o, l4_uint32_t len=0)
Add a descriptor to the used ring, and notify an observer.
Definition virtio:240
L4virtio::Virtqueue::Desc
Descriptor in the descriptor table.
Definition virtqueue:87
L4virtio::Virtqueue::Desc::len
l4_uint32_t len
Length of described buffer.
Definition virtqueue:109
L4virtio::Virtqueue::Desc::addr
Ptr< void > addr
Address stored in descriptor.
Definition virtqueue:108
L4virtio::Virtqueue::ready
bool ready() const
Test if this queue is in working state.
Definition virtqueue:400
error_helper
Error helper.
l4_int16_t
signed short int l4_int16_t
Signed 16bit value.
Definition l4int.h:26
l4_uint32_t
unsigned int l4_uint32_t
Unsigned 32bit value.
Definition l4int.h:29
l4_uint16_t
unsigned short int l4_uint16_t
Unsigned 16bit value.
Definition l4int.h:27
L4_ERANGE
@ L4_ERANGE
Range error.
Definition err.h:48
L4_EINVAL
@ L4_EINVAL
Invalid argument.
Definition err.h:46
L4_EBUSY
@ L4_EBUSY
Object currently busy, try later.
Definition err.h:42
L4_ENODEV
@ L4_ENODEV
No such thing.
Definition err.h:44
L4_EOK
@ L4_EOK
Ok.
Definition err.h:32
L4_EPERM
@ L4_EPERM
No permission.
Definition err.h:33
L4_ENOMEM
@ L4_ENOMEM
No memory.
Definition err.h:39
L4_UNLIKELY
#define L4_UNLIKELY(x)
Expression is unlikely to execute.
Definition compiler.h:284
L4VIRTIO_ID_CONSOLE
@ L4VIRTIO_ID_CONSOLE
Simple device for data IO via ports.
Definition virtio.h:66
L4Re::chksys
long chksys(long err, char const *extra="", long ret=0)
Generate C++ exception on error.
Definition error_helper:72
L4virtio
L4-VIRTIO Transport C++ API.
Definition l4virtio:26
L4virtio::Svr::Bad_descriptor
Exception used by Queue to indicate descriptor errors.
Definition virtio:398
L4virtio::Svr::Bad_descriptor::Bad_address
@ Bad_address
Address cannot be translated.
Definition virtio:402
L4virtio::Svr::Console::Control_message
Virtio console control message.
Definition virtio-console:32
L4virtio::Svr::Console::Control_message::Events
Events
Possible control events.
Definition virtio-console:35
L4virtio::Svr::Console::Control_message::Device_ready
@ Device_ready
Sent by driver at initialization.
Definition virtio-console:37
L4virtio::Svr::Console::Control_message::Console_port
@ Console_port
Sent by device to nominate port as console port.
Definition virtio-console:45
L4virtio::Svr::Console::Control_message::Port_open
@ Port_open
Sent by device and driver to indicate whether a port is open.
Definition virtio-console:49
L4virtio::Svr::Console::Control_message::Port_name
@ Port_name
Sent by device to tag a port.
Definition virtio-console:51
L4virtio::Svr::Console::Control_message::Device_remove
@ Device_remove
Sent by device to remove added ports.
Definition virtio-console:41
L4virtio::Svr::Console::Control_message::Device_add
@ Device_add
Sent by device to create new ports.
Definition virtio-console:39
L4virtio::Svr::Console::Control_message::Port_ready
@ Port_ready
Sent by driver as response to Device_add.
Definition virtio-console:43
L4virtio::Svr::Console::Control_message::Resize
@ Resize
Sent by device to indicate a console size change.
Definition virtio-console:47
L4virtio::Svr::Console::Control_message::value
l4_uint16_t value
Extra information.
Definition virtio-console:56
L4virtio::Svr::Console::Control_message::id
l4_uint32_t id
Port number.
Definition virtio-console:54
L4virtio::Svr::Console::Control_message::event
l4_uint16_t event
Control event, see Events.
Definition virtio-console:55
L4virtio::Svr::Console::Control_request
Specialised Virtqueue::Request providing access to control message payload.
Definition virtio-console:66
L4virtio::Svr::Console::Control_request::msg
Control_message * msg
Virtual address of the data block (in device space).
Definition virtio-console:68
L4virtio::Svr::Console::Control_request::len
l4_uint32_t len
Length of datablock in bytes.
Definition virtio-console:70
L4virtio::Svr::Console::Control_request::mem
Driver_mem_region * mem
Pointer to driver memory region.
Definition virtio-console:72
L4virtio::Svr::Console::Features
Virtio console specific feature bits.
Definition virtio-console:19
L4virtio::Svr::Console::Features::emerg_write
constexpr emerg_write_bfm_t::Val emerg_write() const
Get the emerg_write bits (2 to 2) of raw.
Definition virtio-console:27
L4virtio::Svr::Console::Features::console_multiport
constexpr console_multiport_bfm_t::Val console_multiport() const
Get the console_multiport bits (1 to 1) of raw.
Definition virtio-console:25
L4virtio::Svr::Console::Features::console_size
constexpr console_size_bfm_t::Val console_size() const
Get the console_size bits (0 to 0) of raw.
Definition virtio-console:23
L4virtio::Svr::Console::Port::Transition
State transition from last report state to current state.
Definition virtio-console:169
L4virtio::Svr::Console::Port::Transition::value
l4_uint16_t value
Extra information.
Definition virtio-console:171
L4virtio::Svr::Console::Port::Transition::next
Port_status next
Next Port_status state.
Definition virtio-console:172
L4virtio::Svr::Console::Port::Transition::event
l4_int16_t event
Control_message::Events or <0 if no event is sent.
Definition virtio-console:170
L4virtio::Svr::Console::Port
Representation of a Virtio console port.
Definition virtio-console:110
L4virtio::Svr::Console::Port::status
Port_status status
State the port is in.
Definition virtio-console:135
L4virtio::Svr::Console::Port::rx
Virtqueue rx
Transmitq of the port.
Definition virtio-console:134
L4virtio::Svr::Console::Port::state_transitions
static constexpr Transition state_transitions[Port_num_states][Port_num_states]
State transition table from last report state to current state.
Definition virtio-console:195
L4virtio::Svr::Console::Port::vq_max
unsigned vq_max
Maximum queue sizes for this port.
Definition virtio-console:137
L4virtio::Svr::Console::Port::reset
virtual void reset()
Reset the port to the initial state and disable its virtqueues.
Definition virtio-console:150
L4virtio::Svr::Console::Port::tx
Virtqueue tx
Receiveq of the port.
Definition virtio-console:133
L4virtio::Svr::Console::Port::is_open
bool is_open() const
Check that the port is open.
Definition virtio-console:146
L4virtio::Svr::Console::Port::rx_ready
bool rx_ready() const
Check that device implementation may write to receive queues.
Definition virtio-console:161
L4virtio::Svr::Console::Port::tx_ready
bool tx_ready() const
Check that device implementation may read from transmit queues.
Definition virtio-console:165
L4virtio::Svr::Console::Port::Port_status
Port_status
Possible states of a virtio console port.
Definition virtio-console:115
L4virtio::Svr::Console::Port::Port_added
@ Port_added
Port has been added by device, waiting for ready message.
Definition virtio-console:119
L4virtio::Svr::Console::Port::Port_ready
@ Port_ready
Port is ready but still closed.
Definition virtio-console:121
L4virtio::Svr::Console::Port::Port_num_states
@ Port_num_states
Number of port states. Must be last.
Definition virtio-console:127
L4virtio::Svr::Console::Port::Port_open
@ Port_open
Port is in a working state.
Definition virtio-console:123
L4virtio::Svr::Console::Port::Port_disabled
@ Port_disabled
Reset state, waiting for port to be added.
Definition virtio-console:117
L4virtio::Svr::Console::Port::Port_failed
@ Port_failed
Device failure, port unusable.
Definition virtio-console:125
L4virtio::Svr::Console::Port::queues_ready
bool queues_ready() const
Check that both virtqueues are set up correctly.
Definition virtio-console:157
L4virtio::Svr::Console::Port::reported_status
Port_status reported_status
State the port was last reported.
Definition virtio-console:136
L4virtio::Svr::Dev_features::raw
l4_uint32_t raw
The raw value of the features bitmap.
Definition virtio:68