iplink_can: add CAN XL support RFC based on Vincent cleanups
RFC PATCH 1/1 iplink_can: add CAN XL support RFC based on Vincent cleanups
Fixes from Oliver:
- remove newline before tdc information to increase readability
- fix copy/paste issue in CAN_CTRLMODE_XL_TDC_ definitions
Based on the iproute2 CAN XL preparations patch set at
https://lore.kernel.org/linux-can/173194923075.4109060.18408610499610779344.git-patchwork-notify@kernel.org/T/#t
which was already merged into iproute2-next tree:
https://git.kernel.org/pub/scm/network/iproute2/iproute2-next.git/commit/?id=7b4d64895f7c58a12c01d2f394f75b0d1938eb9c
Signed-off-by Oliver Hartkopp <[email protected]>
--- include/uapi/linux/can/netlink.h | 21 ++- ip/iplink_can.c | 223 ++++++++++++++++++++++++++++--- 2 files changed, 216 insertions(+), 28 deletions(-)
include/uapi/linux/can/netlink.h +14 -7
@@ -99,12 +99,15 @@ struct can_ctrlmode {#define CAN_CTRLMODE_BERR_REPORTING 0x10/* Bus-error reporting */ #define CAN_CTRLMODE_FD 0x20/* CAN FD mode */ #define CAN_CTRLMODE_PRESUME_ACK 0x40/* Ignore missing CAN ACKs */ #define CAN_CTRLMODE_FD_NON_ISO 0x80/* CAN FD in non-ISO mode */ #define CAN_CTRLMODE_CC_LEN8_DLC 0x100/* Classic CAN DLC option */ -#define CAN_CTRLMODE_TDC_AUTO 0x200/* CAN transiver automatically calculates TDCV */ -#define CAN_CTRLMODE_TDC_MANUAL 0x400/* TDCV is manually set up by user */ +#define CAN_CTRLMODE_TDC_AUTO 0x200/* FD transceiver automatically calculates TDCV */ +#define CAN_CTRLMODE_TDC_MANUAL 0x400/* FD TDCV is manually set up by user */ +#define CAN_CTRLMODE_XL 0x800/* CAN XL mode */ +#define CAN_CTRLMODE_XL_TDC_AUTO 0x1000/* XL transceiver automatically calculates TDCV */ +#define CAN_CTRLMODE_XL_TDC_MANUAL 0x2000/* XL TDCV is manually set up by user */ /* * CAN device statistics */ struct can_device_stats {
@@ -127,27 +130,31 @@ enum {IFLA_CAN_STATE ,IFLA_CAN_CTRLMODE ,IFLA_CAN_RESTART_MS ,IFLA_CAN_RESTART ,IFLA_CAN_BERR_COUNTER , -IFLA_CAN_DATA_BITTIMING , -IFLA_CAN_DATA_BITTIMING_CONST , +IFLA_CAN_DATA_BITTIMING ,/* FD */ +IFLA_CAN_DATA_BITTIMING_CONST ,/* FD */ IFLA_CAN_TERMINATION ,IFLA_CAN_TERMINATION_CONST ,IFLA_CAN_BITRATE_CONST , -IFLA_CAN_DATA_BITRATE_CONST , +IFLA_CAN_DATA_BITRATE_CONST ,/* FD */ IFLA_CAN_BITRATE_MAX , -IFLA_CAN_TDC , +IFLA_CAN_TDC ,/* FD */ IFLA_CAN_CTRLMODE_EXT , +IFLA_CAN_XL_DATA_BITTIMING , +IFLA_CAN_XL_DATA_BITTIMING_CONST , +IFLA_CAN_XL_DATA_BITRATE_CONST , +IFLA_CAN_XL_TDC ,/* add new constants above here */ __IFLA_CAN_MAX,IFLA_CAN_MAX = __IFLA_CAN_MAX -1 };/* -* CAN FD Transmitter Delay Compensation (TDC) +* CAN FD/XL Transmitter Delay Compensation (TDC) * * Please refer to struct can_tdc_const and can_tdc in * include/linux/can/bittiming.h for further details. */ enum {
ip/iplink_can.c +202 -21
395 lines not on this page · raw message
Signature · 1 line
2.45.2