diff options
author | Oliver Hartkopp <socketcan@hartkopp.net> | 2022-09-12 20:07:24 +0300 |
---|---|---|
committer | Marc Kleine-Budde <mkl@pengutronix.de> | 2022-09-15 10:08:09 +0300 |
commit | ebf87fc728502244550eaf8819fc785e2014b2ad (patch) | |
tree | d4336c9933ea1856ec06126c09e33d749414308d /include/linux/can | |
parent | fb08cba12b52cba4366e858932307649dc5304e2 (diff) | |
download | linux-ebf87fc728502244550eaf8819fc785e2014b2ad.tar.xz |
can: dev: add CAN XL support to virtual CAN
Make use of new can_skb_get_data_len() helper.
Add support for variable CANXL MTU using the new can_is_canxl_dev_mtu().
Acked-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Link: https://lore.kernel.org/all/20220912170725.120748-7-socketcan@hartkopp.net
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'include/linux/can')
-rw-r--r-- | include/linux/can/dev.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/can/dev.h b/include/linux/can/dev.h index c3e50e537e39..58f5431a5559 100644 --- a/include/linux/can/dev.h +++ b/include/linux/can/dev.h @@ -147,6 +147,11 @@ static inline u32 can_get_static_ctrlmode(struct can_priv *priv) return priv->ctrlmode & ~priv->ctrlmode_supported; } +static inline bool can_is_canxl_dev_mtu(unsigned int mtu) +{ + return (mtu >= CANXL_MIN_MTU && mtu <= CANXL_MAX_MTU); +} + void can_setup(struct net_device *dev); struct net_device *alloc_candev_mqs(int sizeof_priv, unsigned int echo_skb_max, |