30 #define CAN4LINUXVERSION 0x0403
38 # define CAN_MSG_LENGTH 64
40 # define CAN_MSG_LENGTH 8
45 #define MSG_ACTIVE (0)
47 #define MSG_RTR (1<<0)
48 #define MSG_OVR (1<<1)
49 #define MSG_EXT (1<<2)
50 #define MSG_SELF (1<<3)
51 #define MSG_PASSIVE (1<<4)
52 #define MSG_BUSOFF (1<<5)
53 #define MSG_WARNING (1<<6)
54 #define MSG_BOVR (1<<7)
56 #define MSG_CANFD (1<<8)
57 #define MSG_RESI (1<<9)
61 #define MSG_ERR_MASK (MSG_OVR+MSG_PASSIVE+MSG_BUSOFF+MSG_BOVR+MSG_WARNING)
65 #define CAN_SFF_MASK 0x000007FFU
66 #define CAN_EFF_MASK 0x1FFFFFFFU
67 #define CANDRIVERERROR 0xFFFFFFFFul
84 struct timeval timestamp;
86 unsigned char data[CAN_MSG_LENGTH];
96 #define CAN4L_IOC_MAGIC 'c'
98 #define CAN_IOCTL_COMMAND 0
99 #define CAN_IOCTL_CONFIG 1
100 #define CAN_IOCTL_SEND 2
101 #define CAN_IOCTL_CONFIGURERTR 4
102 #define CAN_IOCTL_STATUS 5
144 #define CAN_TYPE_UNSPEC 0
145 #define CAN_TYPE_SJA1000 1
146 #define CAN_TYPE_FlexCAN 2
147 #define CAN_TYPE_TouCAN 3
148 #define CAN_TYPE_82527 4
149 #define CAN_TYPE_TwinCAN 5
150 #define CAN_TYPE_BlackFinCAN 6
151 #define CAN_TYPE_AT91SAM9263 7
152 #define CAN_TYPE_MCP2515 8
153 #define CAN_TYPE_XCANPS 9
154 #define CAN_TYPE_DCAN 10
155 #define CAN_TYPE_IFI_CAN_FD 11
156 #define CAN_TYPE_VIRTUAL 100
190 # define CMD_CLEARBUFFERS 4
191 # define CMD_CTRL_LED 5
192 # define CMD_CTRL_TERM 6
206 enum can_termination_state {
218 # define CONF_TIMING 3
219 # define CONF_OMODE 4
220 # define CONF_FILTER 5
221 # define CONF_FENABLE 6
222 # define CONF_FDISABLE 7
223 # define CONF_LISTEN_ONLY_MODE 8
224 # define CONF_SELF_RECEPTION 9
227 # define CONF_TIMESTAMP 11
228 # define CONF_WAKEUP 12
229 # define CONF_SPEEDFACTOR 13
231 # define CONF_ACC1 100
232 # define CONF_ACC2 101
233 # define CONF_ACC3 102
234 # define CONF_ACC4 103
235 # define CONF_ACC5 104
236 # define CONF_ACC6 105
237 # define CONF_ACC7 106
unsigned int type
CAN controller / driver type.
Definition: can4linux.h:139
unsigned long retval
return value
Definition: can4linux.h:164
unsigned int rx_buffer_size
size of rx buffer
Definition: can4linux.h:134
unsigned int status
CAN controller status register.
Definition: can4linux.h:129
unsigned long retval
return value
Definition: can4linux.h:172
unsigned long val2
Definition: can4linux.h:111
unsigned int tx_errors
content of TX error counter
Definition: can4linux.h:132
unsigned int rx_buffer_used
number of messages
Definition: can4linux.h:135
unsigned int tx_buffer_used
number of messages
Definition: can4linux.h:137
canmsg_t * tx
CAN message struct.
Definition: can4linux.h:162
unsigned long retval
return value
Definition: can4linux.h:113
unsigned int error_warning_limit
the error warning limit
Definition: can4linux.h:130
unsigned long retval
return value
Definition: can4linux.h:138
int cob
CAN object number, used in Full CAN.
Definition: can4linux.h:79
IOCTL Receive request parameter structure.
Definition: can4linux.h:169
int error
return value for errno
Definition: can4linux.h:163
unsigned long id
CAN message ID, 4 bytes if in receive mode an id 0xFFFF.FFFF is received...
Definition: can4linux.h:80
IOCTL Command request parameter structure.
Definition: can4linux.h:107
int cmd
special driver command
Definition: can4linux.h:108
short int length
number of bytes in the CAN message
Definition: can4linux.h:85
IOCTL generic CAN controller status request parameter structure.
Definition: can4linux.h:127
unsigned int rx_errors
content of RX error counter
Definition: can4linux.h:131
unsigned long val1
Definition: can4linux.h:110
unsigned int tx_buffer_size
size of tx buffer
Definition: can4linux.h:136
int error
return value
Definition: can4linux.h:112
unsigned int error_code
content of error code register
Definition: can4linux.h:133
int error
return value for errno
Definition: can4linux.h:171
int target
special configuration target
Definition: can4linux.h:109
canmsg_t * rx
CAN message struct.
Definition: can4linux.h:170
unsigned int baud
actual bit rate
Definition: can4linux.h:128
IOCTL Send request parameter structure.
Definition: can4linux.h:161
int flags
flags, indicating or controlling special message properties
Definition: can4linux.h:78
The CAN message structure.
Definition: can4linux.h:76