49#include <rtems/seterr.h>
50#include <rtems/thread.h>
51#include <sys/ioccom.h>
58#define CAN_IOC_MAGIC 'd'
78#define RTEMS_CHIP_FLAGS_CONFIGURED ( 1 << 0 )
83#define RTEMS_CHIP_FLAGS_RUNNING ( 1 << 1 )
88#define RTEMS_CHIP_FLAGS_FDCAPABLE ( 1 << 2 )
104#define RTEMS_CAN_CHIP_BITRATE ( 1 )
109#define RTEMS_CAN_CHIP_DBITRATE ( 2 )
114#define RTEMS_CAN_CHIP_NUSERS ( 3 )
120#define RTEMS_CAN_CHIP_FLAGS ( 4 )
125#define RTEMS_CAN_CHIP_MODE ( 5 )
130#define RTEMS_CAN_CHIP_MODE_SUPPORTED ( 6 )
145#define RTEMS_CAN_QUEUE_RX ( 1 << 0 )
150#define RTEMS_CAN_QUEUE_TX ( 1 << 1 )
166#define CAN_CTRLMODE_LOOPBACK ( 1 << 0 )
171#define CAN_CTRLMODE_LISTENONLY ( 1 << 1 )
176#define CAN_CTRLMODE_3_SAMPLES ( 1 << 2 )
181#define CAN_CTRLMODE_ONE_SHOT ( 1 << 3 )
186#define CAN_CTRLMODE_BERR_REPORTING ( 1 << 4 )
191#define CAN_CTRLMODE_FD ( 1 << 5 )
196#define CAN_CTRLMODE_PRESUME_ACK ( 1 << 6 )
201#define CAN_CTRLMODE_FD_NON_ISO ( 1 << 7 )
206#define CAN_CTRLMODE_CC_LEN8_DLC ( 1 << 8 )
211#define CAN_CTRLMODE_TDC_AUTO ( 1 << 9 )
216#define CAN_CTRLMODE_TDC_MANUAL ( 1 << 10 )
217#define CAN_CTRLMODE_MASK ( CAN_CTRLMODE_LOOPBACK | CAN_CTRLMODE_LISTENONLY | \
218 CAN_CTRLMODE_3_SAMPLES | CAN_CTRLMODE_ONE_SHOT | \
219 CAN_CTRLMODE_BERR_REPORTING | CAN_CTRLMODE_FD | \
220 CAN_CTRLMODE_PRESUME_ACK | CAN_CTRLMODE_FD_NON_ISO | \
221 CAN_CTRLMODE_CC_LEN8_DLC | CAN_CTRLMODE_TDC_AUTO | \
222 CAN_CTRLMODE_TDC_MANUAL)
245#define RTEMS_CAN_CHIP_START _IO( CAN_IOC_MAGIC, 1 )
250#define RTEMS_CAN_CHIP_STOP _IO( CAN_IOC_MAGIC, 2 )
255#define RTEMS_CAN_CLOSE_NONBLOCK _IO( CAN_IOC_MAGIC, 3 )
261#define RTEMS_CAN_DISCARD_QUEUES _IO( CAN_IOC_MAGIC, 4 )
267#define RTEMS_CAN_FLUSH_QUEUES _IO( CAN_IOC_MAGIC, 5 )
273#define RTEMS_CAN_CHIP_SET_MODE _IO( CAN_IOC_MAGIC, 6 )
278#define RTEMS_CAN_CHIP_GET_INFO _IO( CAN_IOC_MAGIC, 7 )
283#define RTEMS_CAN_WAIT_TX_DONE _IOW( CAN_IOC_MAGIC, 8, struct timespec )
288#define RTEMS_CAN_POLL_TX_READY _IOW( CAN_IOC_MAGIC, 9, struct timespec )
293#define RTEMS_CAN_POLL_RX_AVAIL _IOW( CAN_IOC_MAGIC, 10, struct timespec )
298#define RTEMS_CAN_CREATE_QUEUE _IOW( CAN_IOC_MAGIC, 11, struct can_queue_param )
303#define RTEMS_CAN_SET_BITRATE _IOW( CAN_IOC_MAGIC, 12, struct can_set_bittiming )
307#define RTEMS_CAN_CHIP_GET_TIMESTAMP _IOR( CAN_IOC_MAGIC, 13, uint64_t )
311#define RTEMS_CAN_CHIP_STATISTICS _IOR( CAN_IOC_MAGIC, 14, struct can_stats )
316#define RTEMS_CAN_GET_BITTIMING _IOWR( CAN_IOC_MAGIC, 15, struct can_get_bittiming )
This header file is part of CAN/CAN FD bus common support. It defines structures used for bit timing ...
This header file is part of CAN/CAN FD bus common support. It implements structure that represents fi...
This header file is part of CAN/CAN FD bus common support. It implements CAN frame structure and rela...
This header file is part of CAN/CAN FD bus common support. It implements controller's statistics.
This structure is used to represent CAN ID and flags in one unified structure.
Definition: can-filter.h:49
This structure represents parameters of FIFO queue. It is used to setup new queues via RTEMS_CAN_CREA...
Definition: can.h:324
uint8_t buffer_size
This member specifies queue's buffer size. Passing 0 applies default CAN_DEFAULT_FIFO_SIZE value.
Definition: can.h:346
uint8_t priority
This member specifies queue's priority. Maximum priority value is available from RTEMS_CAN_QUEUE_PRIO...
Definition: can.h:335
struct can_filter filter
This member holds a queue's filter. Refer to can_filter for more information.
Definition: can.h:351
uint8_t dlen_max
This member specifies queue's maximum data length. Passing 0 applies default value: CAN_FRAME_STANDAR...
Definition: can.h:341
uint8_t direction
This member specifies queue's direction. Use RTEMS_CAN_QUEUE_RX or RTEMS_CAN_QUEUE_TX.
Definition: can.h:329