linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V4 1/3] can: add can_is_canfd_skb() API
@ 2014-11-07  8:45 Dong Aisheng
  2014-11-07  8:45 ` [PATCH V4 2/3] can: m_can: update to support CAN FD features Dong Aisheng
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Dong Aisheng @ 2014-11-07  8:45 UTC (permalink / raw)
  To: linux-arm-kernel

The CAN device drivers can use it 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>
---
ChangesLog:
 * v3->v4: add comments and change prototype a bit
 * v1->v2: change to skb->len == CANFD_MTU;
---
 include/linux/can/dev.h | 6 ++++++
 1 file changed, 6 insertions(+)

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);
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2014-11-18 11:22 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-07  8:45 [PATCH V4 1/3] can: add can_is_canfd_skb() API Dong Aisheng
2014-11-07  8:45 ` [PATCH V4 2/3] can: m_can: update to support CAN FD features Dong Aisheng
2014-11-13 10:10   ` Marc Kleine-Budde
2014-11-13 16:56     ` Oliver Hartkopp
2014-11-14  9:24       ` Marc Kleine-Budde
2014-11-18 11:22         ` Dong Aisheng
2014-11-07  8:45 ` [PATCH V4 3/3] can: m_can: add missing message RAM initialization Dong Aisheng
2014-11-07 10:30   ` Marc Kleine-Budde
2014-11-07 10:21     ` Dong Aisheng
2014-11-07 11:53   ` Oliver Hartkopp
2014-11-13 10:04 ` [PATCH V4 1/3] can: add can_is_canfd_skb() API Marc Kleine-Budde

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).