Skip to content

Commit

Permalink
can: dev: add can_is_canfd_skb() API
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dong Aisheng authored and Marc Kleine-Budde committed Nov 18, 2014
1 parent 67b5909 commit 98e6901
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions include/linux/can/dev.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,12 @@ static inline int can_dropped_invalid_skb(struct net_device *dev,
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);

Expand Down

0 comments on commit 98e6901

Please sign in to comment.