From: Dong Aisheng Date: Fri, 7 Nov 2014 08:45:12 +0000 (+0800) Subject: can: dev: add can_is_canfd_skb() API X-Git-Tag: submit/tizen/20160607.132125~3522^2~11^2~14 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=98e69016a11b2b9398bea668442193b3b362cd43;p=sdk%2Femulator%2Femulator-kernel.git 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 Signed-off-by: Dong Aisheng Signed-off-by: Marc Kleine-Budde --- diff --git a/include/linux/can/dev.h b/include/linux/can/dev.h index 6992afc..b37ea95 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);