]> rtime.felk.cvut.cz Git - linux-lin.git/blob - lin_config/src/lin_config.h
lin_config: Run as daemon when configuring sllin tty line discipline
[linux-lin.git] / lin_config / src / lin_config.h
1 #ifndef _LIN_CONFIG_H_
2 #define _LIN_CONFIG_H_
3
4 #define LIN_EXIT_OK                             1
5
6 /* Flags passed to configuration functions */
7 #define FLASH_CONF_fl                           (1 << 0)
8 #define RESET_DEVICE_fl                         (1 << 1)
9 #define SLLIN_ATTACH_fl                         (1 << 2)
10 #define SLLIN_DETACH_fl                         (1 << 3)
11
12 #define MAX_LIN_ID                              0x3F
13 #define PCL_DEFAULT_CONFIG                      "config.pclin"
14
15 struct linc_scheduler_entry {
16         int lin_id;
17         int interval_ms;
18 };
19
20 /* Index in this array = LIN ID */
21 struct linc_frame_entry {
22         int status; /* 1 = active; 0 = unactive */
23         int data_len;
24         char data[8];
25 };
26
27 struct linc_lin_state {
28         int is_active;          /* Is LIN device active */
29         int baudrate;           /* LIN baudrate */
30         int master_status;      /* LIN node type -- Master or Slave */
31         int bus_termination;    /* LIN bus termination in device -- Master or Slave */
32
33         /* Subscriber/publisher table entries */
34         struct linc_frame_entry frame_entry[MAX_LIN_ID + 1];
35         /* Scheduler table entries */
36         // FIXME max value
37         struct linc_scheduler_entry scheduler_entry[100];
38         int scheduler_entries_cnt; /* No. of configured scheduler entries */
39
40         char *dev;              /* Path to LIN device to be configured */
41         int flags;              /* Flags passed to configuration function
42                                 of particular device */
43 };
44
45 #endif /* _LIN_CONFIG_H_ */