From: Oliver Hartkopp <socketcan@hartkopp.net>
To: linux-can@vger.kernel.org
Cc: Oliver Hartkopp <socketcan@hartkopp.net>
Subject: [canxl v7 00/17] can: netlink: add CAN XL support
Date: Tue, 25 Nov 2025 13:38:42 +0100 [thread overview]
Message-ID: <20251125123859.3924-1-socketcan@hartkopp.net> (raw)
Similarly to how CAN FD reuses the bittiming logic of Classical CAN,
CAN XL also reuses the entirety of CAN FD features, and, on top of
that, adds new features which are specific to CAN XL.
A so-called 'mixed-mode' is intended to have (XL-tolerant) CAN FD nodes
and CAN XL nodes on one CAN segment, where the FD-controllers can talk
CC/FD and the XL-controllers can talk CC/FD/XL. This mixed-mode
utilizes the known error-signalling (ES) for sending CC/FD/XL frames.
For CAN FD and CAN XL the tranceiver delay compensation (TDC) is
supported to use common CAN and CAN-SIG transceivers.
The CANXL-only mode disables the error-signalling in the CAN XL
controller. This mode does not allow CC/FD frames to be sent but
additionally offers a CAN XL transceiver mode switching (TMS) to send
CAN XL frames with up to 20Mbit/s data rate. The TMS utilizes a PWM
configuration which is added to the netlink interface.
Configured with CAN_CTRLMODE_FD and CAN_CTRLMODE_XL this leads to:
FD=0 XL=0 CC-only mode (ES=1)
FD=1 XL=0 FD/CC mixed-mode (ES=1)
FD=1 XL=1 XL/FD/CC mixed-mode (ES=1)
FD=0 XL=1 XL-only mode (ES=0, TMS optional)
Patch #1 print defined ctrlmode strings capitalized to increase the
readability and to be in line with the 'ip' tool (iproute2).
Patch #2 is a small clean-up which makes can_calc_bittiming() use
NL_SET_ERR_MSG() instead of netdev_err().
Patch #3 adds a check in can_dev_dropped_skb() to drop CAN FD frames
when CAN FD is turned off.
Patch #4 adds CAN_CTRLMODE_RESTRICTED. Note that contrary to the other
CAN_CTRL_MODE_XL_* that are introduced in the later patches, this
control mode is not specific to CAN XL. The nuance is that because
this restricted mode was only added in ISO 11898-1:2024, it is made
mandatory for CAN XL devices but optional for other protocols. This is
why this patch is added as a preparation before introducing the core
CAN XL logic.
Patch #5 adds all the CAN XL features which are inherited from CAN FD:
the nominal bittiming, the data bittiming and the TDC.
Patch #6 add a new CAN_CTRLMODE_XL_TMS control mode which is specific
to CAN XL to enable the transceiver mode switching (TMS) in XL-only mode.
Patch #7 adds a check in can_dev_dropped_skb() to drop CAN CC/FD frames
when the CAN XL controller is in CAN XL-only mode. The introduced
can_dev_in_xl_only_mode() function also determines the error-signalling
configuration for the CAN XL controllers.
Patch #8 to #11 add the PWM logic for the CAN XL TMS mode.
Patch #12 to #14 add different default sample-points for standard CAN and
CAN SIG transceivers (with TDC) and CAN XL transceivers using PWM in the
CAN XL TMS mode.
Patch #15 add a dummy_can driver for netlink testing and debugging.
Patch #16 check CAN frame type (CC/FD/XL) when writing those frames to the
CAN_RAW socket and reject them if it's not supported by the CAN interface.
Patch #17 increase the resolution when printing the bitrate error and
round-up the value to 0.01% in the case the resolution would still provide
values which would lead to 0.00%.
Oliver Hartkopp (4):
can: dev: can_get_ctrlmode_str: use capitalized ctrlmode strings
can: dev: can_dev_dropped_skb: drop CC/FD frames in CANXL-only mode
can: raw: instantly reject unsupported CAN frames
can: dev: print bitrate error with two decimal digits
Vincent Mailhol (13):
can: bittiming: apply NL_SET_ERR_MSG() to can_calc_bittiming()
can: dev: can_dev_dropped_skb: drop CAN FD skbs if FD is off
can: netlink: add CAN_CTRLMODE_RESTRICTED
can: netlink: add initial CAN XL support
can: netlink: add CAN_CTRLMODE_XL_TMS flag
can: bittiming: add PWM parameters
can: bittiming: add PWM validation
can: calc_bittiming: add PWM calculation
can: netlink: add PWM netlink interface
can: calc_bittiming: get rid of the incorrect "nominal" word
can: calc_bittiming: add can_calc_sample_point_nrz()
can: calc_bittiming: add can_calc_sample_point_pwm()
can: add dummy_can driver
drivers/net/can/Kconfig | 17 ++
drivers/net/can/Makefile | 1 +
drivers/net/can/dev/bittiming.c | 63 ++++++
drivers/net/can/dev/calc_bittiming.c | 118 +++++++---
drivers/net/can/dev/dev.c | 42 ++--
drivers/net/can/dev/netlink.c | 319 +++++++++++++++++++++++++--
drivers/net/can/dummy_can.c | 285 ++++++++++++++++++++++++
include/linux/can/bittiming.h | 81 ++++++-
include/linux/can/dev.h | 68 ++++--
include/uapi/linux/can/netlink.h | 34 +++
net/can/raw.c | 54 ++++-
11 files changed, 991 insertions(+), 91 deletions(-)
create mode 100644 drivers/net/can/dummy_can.c
--
2.47.3
next reply other threads:[~2025-11-25 12:39 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-25 12:38 Oliver Hartkopp [this message]
2025-11-25 12:38 ` [canxl v7 01/17] can: dev: can_get_ctrlmode_str: use capitalized ctrlmode strings Oliver Hartkopp
2025-11-25 12:38 ` [canxl v7 02/17] can: bittiming: apply NL_SET_ERR_MSG() to can_calc_bittiming() Oliver Hartkopp
2025-11-25 12:38 ` [canxl v7 03/17] can: dev: can_dev_dropped_skb: drop CAN FD skbs if FD is off Oliver Hartkopp
2025-11-25 12:38 ` [canxl v7 04/17] can: netlink: add CAN_CTRLMODE_RESTRICTED Oliver Hartkopp
2025-11-25 12:38 ` [canxl v7 05/17] can: netlink: add initial CAN XL support Oliver Hartkopp
2025-11-25 12:38 ` [canxl v7 06/17] can: netlink: add CAN_CTRLMODE_XL_TMS flag Oliver Hartkopp
2025-11-25 12:38 ` [canxl v7 07/17] can: dev: can_dev_dropped_skb: drop CC/FD frames in CANXL-only mode Oliver Hartkopp
2025-11-25 12:38 ` [canxl v7 08/17] can: bittiming: add PWM parameters Oliver Hartkopp
2025-11-25 12:38 ` [canxl v7 09/17] can: bittiming: add PWM validation Oliver Hartkopp
2025-11-25 12:38 ` [canxl v7 10/17] can: calc_bittiming: add PWM calculation Oliver Hartkopp
2025-11-25 12:38 ` [canxl v7 11/17] can: netlink: add PWM netlink interface Oliver Hartkopp
2025-11-25 12:38 ` [canxl v7 12/17] can: calc_bittiming: get rid of the incorrect "nominal" word Oliver Hartkopp
2025-11-26 10:14 ` Marc Kleine-Budde
2025-11-25 12:38 ` [canxl v7 13/17] can: calc_bittiming: add can_calc_sample_point_nrz() Oliver Hartkopp
2025-11-25 12:38 ` [canxl v7 14/17] can: calc_bittiming: add can_calc_sample_point_pwm() Oliver Hartkopp
2025-11-25 12:38 ` [canxl v7 15/17] can: add dummy_can driver Oliver Hartkopp
2025-11-25 12:38 ` [canxl v7 16/17] can: raw: instantly reject unsupported CAN frames Oliver Hartkopp
2025-11-25 12:38 ` [canxl v7 17/17] can: dev: print bitrate error with two decimal digits Oliver Hartkopp
2025-11-25 16:13 ` [canxl v7 00/17] can: netlink: add CAN XL support Rakuram Eswaran
2025-11-25 16:59 ` Oliver Hartkopp
2025-11-26 18:37 ` Rakuram Eswaran
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251125123859.3924-1-socketcan@hartkopp.net \
--to=socketcan@hartkopp.net \
--cc=linux-can@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox