mirror-linux/include/linux/can
Vincent Mailhol 7de54546ff can: dev: add can_get_ctrlmode_str()
In an effort to give more human readable messages when errors occur
because of conflicting options, it can be useful to convert the CAN
control mode flags into text.

Add a function which converts the first set CAN control mode into a
human readable string. The reason to only convert the first one is to
simplify edge cases: imagine that there are several invalid control
modes, we would just return the first invalid one to the user, thus
not having to handle complex string concatenation. The user can then
solve the first problem, call the netlink interface again and see the
next issue.

People who wish to enumerate all the control modes can still do so by,
for example, using this new function in a for_each_set_bit() loop.

Signed-off-by: Vincent Mailhol <mailhol@kernel.org>
Link: https://patch.msgid.link/20250923-canxl-netlink-prep-v4-19-e720d28f66fe@kernel.org
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2025-09-24 17:09:47 +02:00
..
dev can: peak: Modification of references to email accounts being deleted 2025-09-13 19:04:57 +02:00
platform can: sja1000: fix size of OCR_MODE_MASK define 2022-11-24 16:01:04 +01:00
bittiming.h can: calc_bittiming: make can_calc_tdco() FD agnostic 2025-09-24 17:09:46 +02:00
can-ml.h
core.h
dev.h can: dev: add can_get_ctrlmode_str() 2025-09-24 17:09:47 +02:00
length.h can: length: refactor frame lengths definition to add size in bits 2023-06-22 09:43:40 +02:00
rx-offload.h can: rx-offload: add can_rx_offload_get_echo_skb_queue_tail() 2023-07-28 09:45:25 +02:00
skb.h can: canxl: update CAN infrastructure for CAN XL frames 2022-09-15 09:08:09 +02:00