summaryrefslogtreecommitdiff
path: root/cethcan
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@diac24.net>2013-06-04 17:12:52 +0000
committerroot <root@beaglebone.local.sublab.org>2013-06-04 17:12:52 +0000
commit84de001e9568c8377f948d31bf4bc5d2e79528ec (patch)
treeafc599391cb2c18b8076bb06a31f41ec426954c1 /cethcan
parent9f8e491df58117e89fb498b1ea17e8e4b1fb2ac5 (diff)
cethcan/socketcan: pack some system headers
older versions of linux headers installed with the libc don't bring all the neccessary definitions, so let's ship some builtin here.
Diffstat (limited to 'cethcan')
-rw-r--r--cethcan/socketcan.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/cethcan/socketcan.c b/cethcan/socketcan.c
index 5aeaa2b..21b10fa 100644
--- a/cethcan/socketcan.c
+++ b/cethcan/socketcan.c
@@ -8,6 +8,21 @@
#include <linux/can.h>
#include <linux/can/raw.h>
+#ifndef CANFD_MAX_DLEN
+#define CANFD_MAX_DLEN 64
+#endif
+#ifndef CAN_RAW_FD_FRAMES
+#define CAN_RAW_FD_FRAMES 5
+struct canfd_frame {
+ canid_t can_id; /* 32 bit CAN_ID + EFF/RTR/ERR flags */
+ __u8 len; /* frame payload length in byte */
+ __u8 flags; /* additional flags for CAN FD */
+ __u8 __res0; /* reserved / padding */
+ __u8 __res1; /* reserved / padding */
+ __u8 data[CANFD_MAX_DLEN] __attribute__((aligned(8)));
+};
+#endif
+
struct socan {
struct can_user *u;
struct event *ev;