aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/can
diff options
context:
space:
mode:
authorOliver Hartkopp <socketcan@hartkopp.net>2022-09-12 19:07:24 +0200
committerMarc Kleine-Budde <mkl@pengutronix.de>2022-09-15 09:08:09 +0200
commitebf87fc728502244550eaf8819fc785e2014b2ad (patch)
treed4336c9933ea1856ec06126c09e33d749414308d /include/linux/can
parentcan: canxl: update CAN infrastructure for CAN XL frames (diff)
downloadlinux-dev-ebf87fc728502244550eaf8819fc785e2014b2ad.tar.xz
linux-dev-ebf87fc728502244550eaf8819fc785e2014b2ad.zip
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.h5
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,