This is a minimal patch to introduce the new CAN_CTRLMODE_FD_COMMON_BRP in the user API that requests or forces the use of a common BRP value for both the nominal and data bit rate for CAN FD. This patch should be integrated in the patch series to introduce the changed bit rate calculation in the common CAN tree. Signed-off-by: Stefan Mätje <stefan.maetje@xxxxxx> --- drivers/net/can/dev/netlink.c | 4 ++-- include/uapi/linux/can/netlink.h | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net/can/dev/netlink.c b/drivers/net/can/dev/netlink.c index 01aacdcda260..79328d70759a 100644 --- a/drivers/net/can/dev/netlink.c +++ b/drivers/net/can/dev/netlink.c @@ -211,9 +211,9 @@ static int can_changelink(struct net_device *dev, struct nlattr *tb[], if (maskedflags & ~(priv->ctrlmode_supported | ctrlstatic)) return -EOPNOTSUPP; - /* do not check for static fd-non-iso if 'fd' is disabled */ + /* do not check for static fd specialties if 'fd' is disabled */ if (!(maskedflags & CAN_CTRLMODE_FD)) - ctrlstatic &= ~CAN_CTRLMODE_FD_NON_ISO; + ctrlstatic &= ~(CAN_CTRLMODE_FD_NON_ISO | CAN_CTRLMODE_FD_COMMON_BRP); /* make sure static options are provided by configuration */ if ((maskedflags & ctrlstatic) != ctrlstatic) diff --git a/include/uapi/linux/can/netlink.h b/include/uapi/linux/can/netlink.h index 02ec32d69474..cfcb4205e7bf 100644 --- a/include/uapi/linux/can/netlink.h +++ b/include/uapi/linux/can/netlink.h @@ -101,8 +101,9 @@ struct can_ctrlmode { #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_AUTO 0x200 /* CAN controller automatically calculates TDCV */ #define CAN_CTRLMODE_TDC_MANUAL 0x400 /* TDCV is manually set up by user */ +#define CAN_CTRLMODE_FD_COMMON_BRP 0x800 /* CAN FD common BRP for nom and data bitrates */ /* * CAN device statistics -- 2.34.1