00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef _CAN_DRVAPI_T_H
00011 #define _CAN_DRVAPI_T_H
00012
00013 #ifdef __KERNEL__
00014
00015 #include <linux/time.h>
00016 #include <linux/types.h>
00017 #include <linux/ioctl.h>
00018
00019 #else
00020
00021 #include <sys/time.h>
00022 #include <sys/types.h>
00023 #include <sys/ioctl.h>
00024
00025 #endif
00026
00027 #include "./canmsg.h"
00028
00029 #ifdef __cplusplus
00030 extern "C" {
00031 #endif
00032
00033
00034 #define CAN_IOC_MAGIC 'd'
00035
00036 typedef unsigned long bittiming_t;
00037 typedef unsigned short channel_t;
00038
00049 struct can_baudparams_t {
00050 long flags;
00051 long baudrate;
00052 long sjw;
00053 long sample_pt;
00054 };
00055
00056
00057 #define CAN_DRV_QUERY _IO(CAN_IOC_MAGIC, 0)
00058 #define CAN_DRV_QRY_BRANCH 0
00059 #define CAN_DRV_QRY_VERSION 1
00060 #define CAN_DRV_QRY_MSGFORMAT 2
00061
00062 #define CMD_START _IOW(CAN_IOC_MAGIC, 1, channel_t)
00063 #define CMD_STOP _IOW(CAN_IOC_MAGIC, 2, channel_t)
00064
00065
00066 #define CONF_BAUD _IOW(CAN_IOC_MAGIC, 4, bittiming_t)
00067
00068
00069
00070
00071 #define CONF_FILTER _IOW(CAN_IOC_MAGIC, 8, unsigned char)
00072
00073
00074
00075
00076 #define STAT _IO(CAN_IOC_MAGIC, 9)
00077 #define CANQUE_FILTER _IOW(CAN_IOC_MAGIC, 10, struct canfilt_t)
00078 #define CANQUE_FLUSH _IO(CAN_IOC_MAGIC, 11)
00079 #define CONF_BAUDPARAMS _IOW(CAN_IOC_MAGIC, 11, struct can_baudparams_t)
00080 #define CANRTR_READ _IOWR(CAN_IOC_MAGIC, 12, struct canmsg_t)
00081
00082 #ifdef __cplusplus
00083 }
00084 #endif
00085
00086 #endif