summaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorRostislav Lisovy <lisovy@gmail.com>2012-07-04 05:32:03 +0200
committerMarc Kleine-Budde <mkl@pengutronix.de>2012-07-04 13:07:05 +0200
commitf057bbb6f9ed0fb61ea11105c9ef0ed5ac1a354d (patch)
treed1a3ce318ee81fec79aea757633e68612f04bbd9 /include/linux
parent30c1e672044d98e5c4cff5fcbdb34b55a2df0c0f (diff)
net: em_canid: Ematch rule to match CAN frames according to their identifiers
This ematch makes it possible to classify CAN frames (AF_CAN) according to their identifiers. This functionality can not be easily achieved with existing classifiers, such as u32, because CAN identifier is always stored in native endianness, whereas u32 expects Network byte order. Signed-off-by: Rostislav Lisovy <lisovy@gmail.com> Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/can.h3
-rw-r--r--include/linux/pkt_cls.h5
2 files changed, 6 insertions, 2 deletions
diff --git a/include/linux/can.h b/include/linux/can.h
index 1a66cf6112a..018055efc03 100644
--- a/include/linux/can.h
+++ b/include/linux/can.h
@@ -38,6 +38,9 @@
*/
typedef __u32 canid_t;
+#define CAN_SFF_ID_BITS 11
+#define CAN_EFF_ID_BITS 29
+
/*
* Controller Area Network Error Message Frame Mask structure
*
diff --git a/include/linux/pkt_cls.h b/include/linux/pkt_cls.h
index defbde203d0..38fbd4bc20a 100644
--- a/include/linux/pkt_cls.h
+++ b/include/linux/pkt_cls.h
@@ -451,8 +451,9 @@ enum {
#define TCF_EM_U32 3
#define TCF_EM_META 4
#define TCF_EM_TEXT 5
-#define TCF_EM_VLAN 6
-#define TCF_EM_MAX 6
+#define TCF_EM_VLAN 6
+#define TCF_EM_CANID 7
+#define TCF_EM_MAX 7
enum {
TCF_EM_PROG_TC