Files
rockchip-kernel/include/uapi/linux
Vincent Mailhol 383f0993fc can: netlink: report the CAN controller mode supported flags
Currently, the CAN netlink interface provides no easy ways to check
the capabilities of a given controller. The only method from the
command line is to try each CAN_CTRLMODE_* individually to check
whether the netlink interface returns an -EOPNOTSUPP error or not
(alternatively, one may find it easier to directly check the source
code of the driver instead...)

This patch introduces a method for the user to check both the
supported and the static capabilities. The proposed method introduces
a new IFLA nest: IFLA_CAN_CTRLMODE_EXT which extends the current
IFLA_CAN_CTRLMODE. This is done to guaranty a full forward and
backward compatibility between the kernel and the user land
applications.

The IFLA_CAN_CTRLMODE_EXT nest contains one single entry:
IFLA_CAN_CTRLMODE_SUPPORTED. Because this entry is only used in one
direction: kernel to userland, no new struct nla_policy are
introduced.

Below table explains how IFLA_CAN_CTRLMODE_SUPPORTED (hereafter:
"supported") and can_ctrlmode::flags (hereafter: "flags") allow us to
identify both the supported and the static capabilities, when masked
with any of the CAN_CTRLMODE_* bit flags:

 supported &	flags &		Controller capabilities
 CAN_CTRLMODE_*	CAN_CTRLMODE_*
 -----------------------------------------------------------------------
 false		false		Feature not supported (always disabled)
 false		true		Static feature (always enabled)
 true		false		Feature supported but disabled
 true		true		Feature supported and enabled

Link: https://lore.kernel.org/all/20211213160226.56219-5-mailhol.vincent@wanadoo.fr
Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2022-01-05 12:09:06 +01:00
..
2021-09-14 08:46:08 +02:00
2021-11-01 13:36:08 +00:00
2021-08-23 13:19:09 +02:00
2021-10-29 12:38:43 +02:00
2021-08-10 13:32:40 -04:00
2021-10-28 10:20:31 +02:00
2021-10-07 13:51:11 +02:00
2021-10-06 12:05:51 +00:00
2021-11-15 07:53:10 -08:00
2021-06-03 15:31:34 -07:00
2021-12-02 12:07:04 +00:00
2021-11-30 12:15:58 +00:00
2021-05-21 15:03:50 +02:00
2021-10-26 14:58:45 +01:00
2021-10-14 23:06:28 +02:00
2021-07-06 10:37:46 -05:00
2021-10-18 17:20:50 +02:00
2021-09-16 14:36:26 +01:00
2021-06-12 13:16:45 -07:00
2021-09-15 13:41:36 +02:00