From ac2c52e9f869897b6f4c0a54cf07da380ef2b8d6 Mon Sep 17 00:00:00 2001 From: Christian Fontanez Date: Mon, 18 May 2026 21:33:20 -0400 Subject: virtio: add missing kernel-doc for map and vmap members Commit bee8c7c24b73 ("virtio: introduce map ops in virtio core") and commit b16060c5c7d5 ("virtio: introduce virtio_map container union") added 'map' and 'vmap' members to struct virtio_device but did not update the kernel-doc comment block. This caused 'make htmldocs' to emit warnings: ./include/linux/virtio.h:188 struct member 'map' not described in 'virtio_device' ./include/linux/virtio.h:188 struct member 'vmap' not described in 'virtio_device' Add the missing entries in struct-declaration order to match the existing convention in the file. After this patch, 'make htmldocs' no longer emits these warnings. Fixes: bee8c7c24b73 ("virtio: introduce map ops in virtio core") Fixes: b16060c5c7d5 ("virtio: introduce virtio_map container union") Reported-by: Luis Felipe Hernandez Signed-off-by: Christian Fontanez Signed-off-by: Michael S. Tsirkin Message-ID: <20260519013321.32511-1-christfontanez@gmail.com> --- include/linux/virtio.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/linux/virtio.h b/include/linux/virtio.h index 3bbc4cb6a672..bf089e51970e 100644 --- a/include/linux/virtio.h +++ b/include/linux/virtio.h @@ -157,11 +157,13 @@ struct virtio_admin_cmd { * @id: the device type identification (used to match it with a driver). * @config: the configuration ops for this device. * @vringh_config: configuration ops for host vrings. + * @map: the map operations for mapping virtio device memory. * @vqs: the list of virtqueues for this device. * @features: the 64 lower features supported by both driver and device. * @features_array: the full features space supported by both driver and * device. * @priv: private pointer for the driver's use. + * @vmap: the map container with transport- or device-specific metadata. * @debugfs_dir: debugfs directory entry. * @debugfs_filter_features: features to be filtered set by debugfs. */ -- cgit v1.2.3 From 02687282c751a77b774e4a16d5e937c3ecd1731d Mon Sep 17 00:00:00 2001 From: Ethan Carter Edwards Date: Sat, 18 Apr 2026 20:49:48 -0400 Subject: virtio_console: Fix spelling mistake "colums" -> "columns" There is a spelling mistake in a struct description. Fix it. Signed-off-by: Ethan Carter Edwards Signed-off-by: Michael S. Tsirkin Message-ID: <20260418-virtio-typo-v1-1-0df6f943a79d@ethancedwards.com> --- include/uapi/linux/virtio_console.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/uapi/linux/virtio_console.h b/include/uapi/linux/virtio_console.h index 7e6ec2ff0560..0506539e6553 100644 --- a/include/uapi/linux/virtio_console.h +++ b/include/uapi/linux/virtio_console.h @@ -44,7 +44,7 @@ #define VIRTIO_CONSOLE_BAD_ID (~(__u32)0) struct virtio_console_config { - /* colums of the screens */ + /* columns of the screens */ __virtio16 cols; /* rows of the screens */ __virtio16 rows; -- cgit v1.2.3 From 083082a4e6d8311c91ac7e1d59426514c5e1c04b Mon Sep 17 00:00:00 2001 From: Matias Ezequiel Vara Larsen Date: Tue, 26 May 2026 18:42:23 +0200 Subject: can: virtio: Add virtio CAN driver Add virtio CAN driver based on Virtio 1.4 specification (see https://github.com/oasis-tcs/virtio-spec/tree/virtio-1.4). The driver implements a complete CAN bus interface over Virtio transport, supporting both CAN Classic and CAN-FD Ids. In term of frames, it supports classic and CAN FD. RTR frames are only supported with classic CAN. Usage: - "ip link set up can0" - start controller - "ip link set down can0" - stop controller - "candump can0" - receive frames - "cansend can0 123#DEADBEEF" - send frames Signed-off-by: Harald Mommer Co-developed-by: Harald Mommer Signed-off-by: Mikhail Golubev-Ciuchea Co-developed-by: Marc Kleine-Budde Signed-off-by: Marc Kleine-Budde Cc: Damir Shaikhutdinov Reviewed-by: Francesco Valla Tested-by: Francesco Valla Signed-off-by: Matias Ezequiel Vara Larsen Signed-off-by: Michael S. Tsirkin Message-ID: --- include/uapi/linux/virtio_can.h | 78 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 include/uapi/linux/virtio_can.h (limited to 'include') diff --git a/include/uapi/linux/virtio_can.h b/include/uapi/linux/virtio_can.h new file mode 100644 index 000000000000..08d7e3e78776 --- /dev/null +++ b/include/uapi/linux/virtio_can.h @@ -0,0 +1,78 @@ +/* SPDX-License-Identifier: BSD-3-Clause */ +/* + * Copyright (C) 2021-2023 OpenSynergy GmbH + * Copyright Red Hat, Inc. 2025 + */ +#ifndef _LINUX_VIRTIO_VIRTIO_CAN_H +#define _LINUX_VIRTIO_VIRTIO_CAN_H + +#include +#include +#include +#include + +/* Feature bit numbers */ +#define VIRTIO_CAN_F_CAN_CLASSIC 0 +#define VIRTIO_CAN_F_CAN_FD 1 +#define VIRTIO_CAN_F_RTR_FRAMES 2 +#define VIRTIO_CAN_F_LATE_TX_ACK 3 + +/* CAN Result Types */ +#define VIRTIO_CAN_RESULT_OK 0 +#define VIRTIO_CAN_RESULT_NOT_OK 1 + +/* CAN flags to determine type of CAN Id */ +#define VIRTIO_CAN_FLAGS_EXTENDED 0x8000 +#define VIRTIO_CAN_FLAGS_FD 0x4000 +#define VIRTIO_CAN_FLAGS_RTR 0x2000 + +#define VIRTIO_CAN_MAX_DLEN 64 // this is like CANFD_MAX_DLEN + +struct virtio_can_config { +#define VIRTIO_CAN_S_CTRL_BUSOFF (1u << 0) /* Controller BusOff */ + /* CAN controller status */ + __le16 status; +}; + +/* TX queue message types */ +struct virtio_can_tx_out { +#define VIRTIO_CAN_TX 0x0001 + __le16 msg_type; + __le16 length; /* 0..8 CC, 0..64 CAN-FD, 0..2048 CAN-XL, 12 bits */ + __u8 reserved_classic_dlc; /* If CAN classic length = 8 then DLC can be 8..15 */ + __u8 padding; + __le16 reserved_xl_priority; /* May be needed for CAN XL priority */ + __le32 flags; + __le32 can_id; + __u8 sdu[] __counted_by_le(length); +}; + +struct virtio_can_tx_in { + __u8 result; +}; + +/* RX queue message types */ +struct virtio_can_rx { +#define VIRTIO_CAN_RX 0x0101 + __le16 msg_type; + __le16 length; /* 0..8 CC, 0..64 CAN-FD, 0..2048 CAN-XL, 12 bits */ + __u8 reserved_classic_dlc; /* If CAN classic length = 8 then DLC can be 8..15 */ + __u8 padding; + __le16 reserved_xl_priority; /* May be needed for CAN XL priority */ + __le32 flags; + __le32 can_id; + __u8 sdu[] __counted_by_le(length); +}; + +/* Control queue message types */ +struct virtio_can_control_out { +#define VIRTIO_CAN_SET_CTRL_MODE_START 0x0201 +#define VIRTIO_CAN_SET_CTRL_MODE_STOP 0x0202 + __le16 msg_type; +}; + +struct virtio_can_control_in { + __u8 result; +}; + +#endif /* #ifndef _LINUX_VIRTIO_VIRTIO_CAN_H */ -- cgit v1.2.3 From 8cb2c9285e4ce9154f45fb15633ebd45dfd8d9cf Mon Sep 17 00:00:00 2001 From: Nathan Chancellor Date: Thu, 4 Jun 2026 15:57:15 -0700 Subject: can: virtio: Fix comment in UAPI header When compile testing the UAPI headers with clang, there is an warning turned error for using a C++ style ('//') comment, which is explicitly forbidden for UAPI headers. In file included from :1: ./usr/include/linux/virtio_can.h:29:35: error: // comments are not allowed in this language [-Werror,-Wcomment] 29 | #define VIRTIO_CAN_MAX_DLEN 64 // this is like CANFD_MAX_DLEN | ^ 1 error generated. Switch to a standard C style comment. Fixes: 2b6b4bb7d96f ("can: virtio: Add virtio CAN driver") Signed-off-by: Nathan Chancellor Signed-off-by: Michael S. Tsirkin Message-ID: <20260604-virtio_can-fix-uapi-comment-v1-1-199fa96ec5f0@kernel.org> --- include/uapi/linux/virtio_can.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/uapi/linux/virtio_can.h b/include/uapi/linux/virtio_can.h index 08d7e3e78776..e054d5099241 100644 --- a/include/uapi/linux/virtio_can.h +++ b/include/uapi/linux/virtio_can.h @@ -26,7 +26,7 @@ #define VIRTIO_CAN_FLAGS_FD 0x4000 #define VIRTIO_CAN_FLAGS_RTR 0x2000 -#define VIRTIO_CAN_MAX_DLEN 64 // this is like CANFD_MAX_DLEN +#define VIRTIO_CAN_MAX_DLEN 64 /* this is like CANFD_MAX_DLEN */ struct virtio_can_config { #define VIRTIO_CAN_S_CTRL_BUSOFF (1u << 0) /* Controller BusOff */ -- cgit v1.2.3