Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 98e69016 authored by Dong Aisheng's avatar Dong Aisheng Committed by Marc Kleine-Budde
Browse files

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: default avatarOliver Hartkopp <socketcan@hartkopp.net>
Signed-off-by: default avatarDong Aisheng <b29396@freescale.com>
Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
parent 67b5909e
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -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);