]> rtime.felk.cvut.cz Git - linux-lin.git/blob - sllin/linux/lin_bus.h
sllin: General purpose LIN-related flags and masks moved into separate header file.
[linux-lin.git] / sllin / linux / lin_bus.h
1 #ifndef _LIN_BUS_H_
2 #define _LIN_BUS_H_
3
4 #define SLLIN_ID_MASK           0x3f
5 #define SLLIN_ID_MAX            SLLIN_ID_MASK
6 #define SLLIN_CTRL_FRAME        CAN_EFF_FLAG
7
8 #define SLLIN_CANFR_FLAGS_OFFS  6 /* Lower 6 bits in can_id correspond to LIN ID */
9 /* Save configuration for particular LIN ID */
10 #define SLLIN_LIN_ID_CONF       (1 <<  SLLIN_CANFR_FLAGS_OFFS)
11 /* Publisher of particular LIN response is SLLIN Master */
12 #define SLLIN_SRC_MASTER        (1 << (SLLIN_CANFR_FLAGS_OFFS + 1))
13 #define SLLIN_SRC_SLAVE         (1 << (SLLIN_CANFR_FLAGS_OFFS + 2))
14 #define SLLIN_SLAVE_LOCAL       (1 << (SLLIN_CANFR_FLAGS_OFFS + 3))
15 #define SLLIN_SLAVE_REMOTE      (1 << (SLLIN_CANFR_FLAGS_OFFS + 4))
16 #define SLLIN_LOC_SLAVE_CACHE   (1 << (SLLIN_CANFR_FLAGS_OFFS + 5))
17 #define SLLIN_CHECKSUM_EXTENDED (1 << (SLLIN_CANFR_FLAGS_OFFS + 6))
18
19 #define SLLIN_ERR_RX_TIMEOUT    (1 << (SLLIN_CANFR_FLAGS_OFFS + 7))
20 #define SLLIN_ERR_CHECKSUM      (1 << (SLLIN_CANFR_FLAGS_OFFS + 8))
21 //#define SLLIN_ERR_FRAMING     (1 << (SLLIN_CANFR_FLAGS_OFFS + 9))
22
23 #endif /* _LIN_BUS_H_ */