4 #include <linux/types.h>
5 #include <linux/ioctl.h>
8 #define PACKED __attribute__((packed))
11 #define CAN_MSG_LENGTH 8
14 * struct canmsg_t - structure representing CAN message
15 * @flags: message flags, %MSG_RTR .. message is Remote Transmission Request,
16 * %MSG_EXT .. message with extended ID, %MSG_OVR indication of queue
18 * @cob: communication object number (not used)
19 * @id: ID of CAN message
20 * @timestamp: not used
21 * @length: length of used data
22 * @data: data bytes buffer
30 unsigned long timestamp;
32 unsigned char data[CAN_MSG_LENGTH];
42 /* Definitions to use for canmsg_t flags */
43 #define MSG_RTR (1<<0)
44 #define MSG_OVR (1<<1)
45 #define MSG_EXT (1<<2)
47 /* CAN ioctl magic number */
48 #define CAN_IOC_MAGIC 'd'
50 typedef unsigned long bittiming_t;
51 typedef unsigned short channel_t;
53 /* CAN ioctl functions */
54 #define CMD_START _IOW(CAN_IOC_MAGIC, 1, channel_t)
55 #define CMD_STOP _IOW(CAN_IOC_MAGIC, 2, channel_t)
58 #define CONF_BAUD _IOW(CAN_IOC_MAGIC, 4, bittiming_t)
60 //#define CONF_XTDACCM
63 #define CONF_FILTER _IOW(CAN_IOC_MAGIC, 8, unsigned char)
65 //#define CONF_FENABLE
66 //#define CONF_FDISABLE
68 #define STAT _IO(CAN_IOC_MAGIC, 9)
69 #define CONF_FILTER_QUE0 _IOW(CAN_IOC_MAGIC, 10, struct canfilt_t)
71 #endif /*_CANMSG_T_H*/