diff options
author | Dong Aisheng <b29396@freescale.com> | 2014-11-07 16:45:12 +0800 |
---|---|---|
committer | Marc Kleine-Budde <mkl@pengutronix.de> | 2014-11-18 13:23:31 +0100 |
commit | 98e69016a11b2b9398bea668442193b3b362cd43 (patch) | |
tree | c37f796c64213c3b024c39298663d4281e0fb61e /include/linux/can/dev.h | |
parent | 67b5909edccfe3ea3b85b1d96284d2c53e3fd47c (diff) | |
download | blackbird-obmc-linux-98e69016a11b2b9398bea668442193b3b362cd43.tar.gz blackbird-obmc-linux-98e69016a11b2b9398bea668442193b3b362cd43.zip |
can: dev: add can_is_canfd_skb() API
The CAN device drivers can use can_is_canfd_skb() to check if the frame to send
is on CAN FD mode or normal CAN mode.
Acked-by: Oliver Hartkopp <socketcan@hartkopp.net>
Signed-off-by: Dong Aisheng <b29396@freescale.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'include/linux/can/dev.h')
-rw-r--r-- | include/linux/can/dev.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/can/dev.h b/include/linux/can/dev.h index 6992afc6ba7f..b37ea95bc348 100644 --- a/include/linux/can/dev.h +++ b/include/linux/can/dev.h @@ -99,6 +99,12 @@ inval_skb: return 1; } +static inline bool can_is_canfd_skb(const struct sk_buff *skb) +{ + /* the CAN specific type of skb is identified by its data length */ + return skb->len == CANFD_MTU; +} + /* get data length from can_dlc with sanitized can_dlc */ u8 can_dlc2len(u8 can_dlc); |