13 #define IOC_MAGIC _DCMD_MISC
20 #include <sys/ioctl.h>
26 #define PACKED __attribute__((packed))
32 #include <sys/endian.h>
40 #if !defined(HICO_LE) && !defined(HICO_BE) && !defined(__KERNEL__)
42 #if __BYTE_ORDER == __LITTLE_ENDIAN
44 #elif __BYTE_ORDER == __BIG_ENDIAN
48 #error -- could not detect endianess!
52 #if defined(HICO_LE) && defined(HICO_BE)
53 #error -- You cannot have both!
59 #define IOC_RESET_BOARD _IO (IOC_MAGIC, 1)
65 #define IOC_START _IO (IOC_MAGIC, 5)
71 #define IOC_START_PASSIVE _IO (IOC_MAGIC, 10)
78 #define IOC_START_BAUDSCAN _IO (IOC_MAGIC, 15)
88 #define IOC_STOP _IO (IOC_MAGIC, 20)
94 #define IOC_GET_MODE _IOR(IOC_MAGIC, 25, uint32_t)
113 #define IOC_SET_BITRATE _IOW (IOC_MAGIC, 30, uint32_t)
118 #define BITRATE_10k 0
119 #define BITRATE_20k 1
120 #define BITRATE_50k 2
121 #define BITRATE_100k 3
122 #define BITRATE_125k 4
123 #define BITRATE_250k 5
124 #define BITRATE_500k 6
125 #define BITRATE_800k 7
126 #define BITRATE_1000k 8
129 #define IOC_SET_SJW_INCREMENT _IOW (IOC_MAGIC, 31, uint32_t)
139 #define IOC_GET_BITRATE _IOR (IOC_MAGIC, 35, uint32_t)
147 #define IOC_GET_CAN_STATUS _IOR (IOC_MAGIC, 40, uint32_t)
153 #define CS_ERROR_PASSIVE (1<<6)
157 #define CS_ERROR_BUS_OFF (1<<7)
161 #define CS_GET_RXERRCNT(status) ((status>>16)&0xff)
162 #define CS_GET_TXERRCNT(status) ((status>>24)&0xff)
168 #define IOC_GET_BOARD_STATUS _IOR (IOC_MAGIC, 45, uint32_t)
173 #define BS_RUNNING_OK 0xf2f20000
177 #define IOC_SET_FILTER _IOW (IOC_MAGIC, 50, struct can_filter)
184 #define IOC_CLEAR_FILTERS _IO (IOC_MAGIC, 55)
191 #define IOC_MSGS_IN_RXBUF _IOR (IOC_MAGIC, 60, int)
197 #define IOC_MSGS_IN_TXBUF _IOR (IOC_MAGIC, 61, int)
203 #define IOC_GET_TXBUF_SIZE _IOR (IOC_MAGIC, 62, int)
207 #define IOC_GET_RXBUF_SIZE _IOR (IOC_MAGIC, 63, int)
212 #define IOC_RESET_TIMESTAMP _IO (IOC_MAGIC, 65)
218 #define IOC_GET_HW_ID _IOR (IOC_MAGIC, 70, uint32_t)
223 #define HW_HICOCAN_MPCI 0x10
225 #define HW_HICOCAN_PCI104 0x13
227 #define HW_HICOCAN_UNKNOWN 0xff
230 #define IOC_GET_FW2_VERSION _IOR (IOC_MAGIC, 71, uint32_t)
236 #define IOC_GET_DRIVER_VERSION _IOR (IOC_MAGIC, 72, uint32_t)
241 #define IOC_GET_CAN_TYPE _IOR (IOC_MAGIC, 73, uint32_t)
245 #define CAN_TYPE_EMPTY 0
246 #define CAN_TYPE_HS 1
247 #define CAN_TYPE_FT 2
250 #define IOC_GET_PCI104_POS _IOR (IOC_MAGIC, 75, uint32_t)
257 #define IOC_GET_IOPIN_STATUS _IOR (IOC_MAGIC, 80, uint32_t)
265 #define IOC_GET_ERR_STAT _IOR (IOC_MAGIC, 81, struct err_stat)
268 uint32_t values[0x3f];
271 #define IOC_CLEAR_ERR_STAT _IO (IOC_MAGIC, 82)
277 #define IOC_PRODUCTION_OK _IO (IOC_MAGIC, 101)
284 #define IOC_GET_LPCBC_REV _IOR (IOC_MAGIC, 102, uint32_t)
291 #define IOC_SET_MODE _IOW (IOC_MAGIC, 65, uint32_t)
302 #define MSG_DLC(msg) (((msg)->fi&0xf)>>0)
303 #define MSG_RTR(msg) (((msg)->fi&(1<<4))>>4)
304 #define MSG_FF(msg) (((msg)->fi&(1<<5))>>5)
305 #define MSG_DOS(msg) (((msg)->fi&(1<<6))>>6)
306 #define MSG_IOPIN(msg)(((msg)->fi&(1<<7))>>7)
307 #define MSG_NODE(msg) (((msg)->fi&(3<<8))>>8)
334 #elif defined(HICO_BE)
358 #define FF_EXTENDED 1
371 #define FTYPE_AMASK 1
372 #define FTYPE_RANGE 2
Definition: hico_api.h:360
Definition: hico_api.h:309
Definition: hico_api.h:267