nico@215: nico@215:
nico@215:00001 /* can.h nico@215: 00002 * Header file for the Linux CAN-bus driver. nico@215: 00003 * Written by Arnaud Westenberg email:arnaud@wanadoo.nl nico@215: 00004 * Rewritten for new CAN queues by Pavel Pisa - OCERA team member nico@215: 00005 * email:pisa@cmp.felk.cvut.cz nico@215: 00006 * This software is released under the GPL-License. nico@215: 00007 * Version lincan-0.3 17 Jun 2004 nico@215: 00008 */ nico@215: 00009 nico@215: 00010 #ifndef _CAN_DRVAPI_T_H nico@215: 00011 #define _CAN_DRVAPI_T_H nico@215: 00012 nico@215: 00013 #ifdef __KERNEL__ nico@215: 00014 nico@215: 00015 #include <linux/time.h> nico@215: 00016 #include <linux/types.h> nico@215: 00017 #include <linux/ioctl.h> nico@215: 00018 nico@215: 00019 #else /* __KERNEL__ */ nico@215: 00020 nico@215: 00021 #include <sys/time.h> nico@215: 00022 #include <sys/types.h> nico@215: 00023 #include <sys/ioctl.h> nico@215: 00024 nico@215: 00025 #endif /* __KERNEL__ */ nico@215: 00026 nico@215: 00027 #include "./canmsg.h" nico@215: 00028 nico@215: 00029 #ifdef __cplusplus nico@215: 00030 extern "C" { nico@215: 00031 #endif nico@215: 00032 nico@215: 00033 /* CAN ioctl magic number */ etisserant@240: 00034 #define CAN_IOC_MAGIC 'd' nico@215: 00035 etisserant@240: 00036 typedef unsigned long bittiming_t; etisserant@240: 00037 typedef unsigned short channel_t; nico@215: 00038 nico@215: 00049 struct can_baudparams_t { etisserant@240: 00050 long flags; etisserant@240: 00051 long baudrate; etisserant@240: 00052 long sjw; etisserant@240: 00053 long sample_pt; nico@215: 00054 }; nico@215: 00055 nico@215: 00056 /* CAN ioctl functions */ etisserant@240: 00057 #define CAN_DRV_QUERY _IO(CAN_IOC_MAGIC, 0) etisserant@240: 00058 #define CAN_DRV_QRY_BRANCH 0 /* returns driver branch value - "LINC" for LinCAN driver */ etisserant@240: 00059 #define CAN_DRV_QRY_VERSION 1 /* returns driver version as (major<<16) | (minor<<8) | patch */ etisserant@240: 00060 #define CAN_DRV_QRY_MSGFORMAT 2 /* format of canmsg_t structure */ nico@215: 00061 etisserant@240: 00062 #define CMD_START _IOW(CAN_IOC_MAGIC, 1, channel_t) etisserant@240: 00063 #define CMD_STOP _IOW(CAN_IOC_MAGIC, 2, channel_t) nico@215: 00064 //#define CMD_RESET 3 nico@215: 00065 etisserant@240: 00066 #define CONF_BAUD _IOW(CAN_IOC_MAGIC, 4, bittiming_t) nico@215: 00067 //#define CONF_ACCM nico@215: 00068 //#define CONF_XTDACCM nico@215: 00069 //#define CONF_TIMING nico@215: 00070 //#define CONF_OMODE etisserant@240: 00071 #define CONF_FILTER _IOW(CAN_IOC_MAGIC, 8, unsigned char) nico@215: 00072 nico@215: 00073 //#define CONF_FENABLE nico@215: 00074 //#define CONF_FDISABLE nico@215: 00075 etisserant@240: 00076 #define STAT _IO(CAN_IOC_MAGIC, 9) etisserant@240: 00077 #define CANQUE_FILTER _IOW(CAN_IOC_MAGIC, 10, struct canfilt_t) etisserant@240: 00078 #define CANQUE_FLUSH _IO(CAN_IOC_MAGIC, 11) etisserant@240: 00079 #define CONF_BAUDPARAMS _IOW(CAN_IOC_MAGIC, 11, struct can_baudparams_t) etisserant@240: 00080 #define CANRTR_READ _IOWR(CAN_IOC_MAGIC, 12, struct canmsg_t) nico@215: 00081 nico@215: 00082 #ifdef __cplusplus nico@215: 00083 } /* extern "C"*/ nico@215: 00084 #endif nico@215: 00085 nico@215: 00086 #endif /*_CAN_DRVAPI_T_H*/ etisserant@240: