Skip to content

Commit 6d50eb0

Browse files
author
Jakub Klimczak
committed
drivers: serial: virtio_console: Make Kconfig more informative
Add descriptions to the Kconfig file and restructure it slightly. Signed-off-by: Jakub Klimczak <[email protected]>
1 parent 8fded46 commit 6d50eb0

File tree

2 files changed

+27
-8
lines changed

2 files changed

+27
-8
lines changed

drivers/serial/Kconfig.virtio_console

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,6 @@ config UART_VIRTIO_CONSOLE_TX_BUFSIZE
1717
int "VIRTIO console transmit buffer length"
1818
default 2
1919

20-
config UART_VIRTIO_CONSOLE_RX_CONTROL_BUFSIZE
21-
int "VIRTIO console receive buffer length (for control messages)"
22-
default 8
23-
24-
config UART_VIRTIO_CONSOLE_TX_CONTROL_BUFSIZE
25-
int "VIRTIO console transmit buffer length (for control messages)"
26-
default 8
27-
2820
config UART_VIRTIO_CONSOLE_F_MULTIPORT
2921
bool "Support multiple VIRTIO console ports"
3022
default n
@@ -33,8 +25,33 @@ config UART_VIRTIO_CONSOLE_F_MULTIPORT
3325
(up to 31 in the case of QEMU). Select to enable this feature. Otherwise
3426
only one will be used.
3527

28+
if UART_VIRTIO_CONSOLE_F_MULTIPORT
29+
30+
config UART_VIRTIO_CONSOLE_RX_CONTROL_BUFSIZE
31+
int "VIRTIO console receive buffer length (for control messages)"
32+
default 16
33+
help
34+
This will set the size of the control receive buffer and its corresponding
35+
virtqueue. Keep in mind that control messages are sent in quick succession
36+
and thus some may never be received if this value is too low. Try increasing
37+
this value if you're experiencing issues with the multiport feature.
38+
39+
config UART_VIRTIO_CONSOLE_TX_CONTROL_BUFSIZE
40+
int "VIRTIO console transmit buffer length (for control messages)"
41+
default 8
42+
help
43+
This will set the size of the control transmit buffer and its corresponding
44+
virtqueue. Keep in mind that control messages are sent in quick succession
45+
and this buffer may fill up fast if this value is too low. Try increasing
46+
this value if you're experiencing issues with the multiport feature.
47+
48+
endif
49+
3650
config UART_VIRTIO_CONSOLE_NAME_BUFSIZE
3751
int "VIRTIO console maximum port name length"
52+
default 0 if UART_LOG_LEVEL < 3
3853
default 16
54+
help
55+
Ports can be assigned human-readable names, which are then printed in logs.
3956

4057
endif

drivers/serial/uart_virtio_console.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,12 @@ struct virtconsole_data {
140140
static uint16_t virtconsole_enum_queues_cb(uint16_t q_index, uint16_t q_size_max, void *)
141141
{
142142
switch (q_index) {
143+
#ifdef CONFIG_UART_VIRTIO_CONSOLE_F_MULTIPORT
143144
case VIRTQ_CONTROL_RX:
144145
return CONFIG_UART_VIRTIO_CONSOLE_RX_CONTROL_BUFSIZE;
145146
case VIRTQ_CONTROL_TX:
146147
return CONFIG_UART_VIRTIO_CONSOLE_TX_CONTROL_BUFSIZE;
148+
#endif
147149
default:
148150
return 1;
149151
}

0 commit comments

Comments
 (0)