11 /* maximum buffer len to store whole LIN message*/
12 #define SLLIN_DATA_MAX 8
13 #define SLLIN_BUFF_LEN (1 /*break*/ + 1 /*sync*/ + 1 /*ID*/ + \
14 SLLIN_DATA_MAX + 1 /*checksum*/)
15 #define SLLIN_BUFF_BREAK 0
16 #define SLLIN_BUFF_SYNC 1
17 #define SLLIN_BUFF_ID 2
18 #define SLLIN_BUFF_DATA 3
20 extern const unsigned char sllin_id_parity_table[64];
26 struct sllin_tty *tty; /* ptr to TTY structure */
28 /* LIN message buffer and actual processed data counts */
29 unsigned char rx_buff[SLLIN_BUFF_LEN]; /* LIN Rx buffer */
30 unsigned char tx_buff[SLLIN_BUFF_LEN]; /* LIN Tx buffer */
31 int rx_expect; /* expected number of Rx chars */
32 int rx_lim; /* maximum Rx chars for ID */
33 int rx_cnt; /* message buffer Rx fill level */
34 int tx_lim; /* actual limit of bytes to Tx */
35 int tx_cnt; /* number of already Tx bytes */
36 char lin_master; /* node is a master node */
37 int lin_baud; /* LIN baudrate */
38 int lin_break_baud; /* Baudrate used for break send */
39 int lin_state; /* state */
40 int id_to_send; /* there is ID to be sent */
42 unsigned long flags; /* Flag values/ mode etc */
43 #define SLF_INUSE 0 /* Channel in use */
44 #define SLF_ERROR 1 /* Parity, etc. error */
45 #define SLF_RXEVENT 2 /* Rx wake event */
46 #define SLF_TXEVENT 3 /* Tx wake event */
47 #define SLF_MSGEVENT 4 /* CAN message to sent */
50 int sllin_setup_msg(struct sllin *sl, int mode, int id,
51 unsigned char *data, int len);
59 #endif /*_LIN_COMMON_H*/