]> rtime.felk.cvut.cz Git - lincan.git/blob - lincan/include/can.h
Change to CAN_MSG_VERSION_2 and elimination of linux/*.h headers from user space...
[lincan.git] / lincan / include / can.h
1 #ifndef _CAN_DRVAPI_T_H
2 #define _CAN_DRVAPI_T_H
3
4 #ifdef __KERNEL__
5
6 #include <linux/time.h>
7 #include <linux/types.h>
8 #include <linux/ioctl.h>
9
10 #else /* __KERNEL__ */
11
12 #include <sys/time.h>
13 #include <sys/types.h>
14 #include <sys/ioctl.h>
15
16 #endif /* __KERNEL__ */
17
18 #include "./canmsg.h"
19
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23
24 /* CAN ioctl magic number */
25 #define CAN_IOC_MAGIC 'd'
26
27 typedef unsigned long bittiming_t;
28 typedef unsigned short channel_t;
29
30 /* CAN ioctl functions */
31 #define CMD_START _IOW(CAN_IOC_MAGIC, 1, channel_t)
32 #define CMD_STOP _IOW(CAN_IOC_MAGIC, 2, channel_t)
33 //#define CMD_RESET 3
34
35 #define CONF_BAUD _IOW(CAN_IOC_MAGIC, 4, bittiming_t)
36 //#define CONF_ACCM
37 //#define CONF_XTDACCM
38 //#define CONF_TIMING
39 //#define CONF_OMODE
40 #define CONF_FILTER _IOW(CAN_IOC_MAGIC, 8, unsigned char)
41
42 //#define CONF_FENABLE
43 //#define CONF_FDISABLE
44
45 #define STAT _IO(CAN_IOC_MAGIC, 9)
46 #define CANQUE_FILTER _IOW(CAN_IOC_MAGIC, 10, struct canfilt_t)
47 #define CANQUE_FLUSH  _IO(CAN_IOC_MAGIC, 11)
48
49 #ifdef __cplusplus
50 } /* extern "C"*/
51 #endif
52
53 #endif /*_CAN_DRVAPI_T_H*/