1 /****************************************************************************
2  ****************************************************************************
3  ***
4  ***   This header was automatically generated from a Linux kernel header
5  ***   of the same name, to make information necessary for userspace to
6  ***   call into the kernel available to libc.  It contains only constants,
7  ***   structures, and macros generated from the original header, and thus,
8  ***   contains no copyrightable information.
9  ***
10  ***   To edit the content of this header, modify the corresponding
11  ***   source file (e.g. under external/kernel-headers/original/) then
12  ***   run bionic/libc/kernel/tools/update_all.py
13  ***
14  ***   Any manual change here will be lost the next time this script will
15  ***   be run. You've been warned!
16  ***
17  ****************************************************************************
18  ****************************************************************************/
19 #ifndef _UAPI_CAN_NETLINK_H
20 #define _UAPI_CAN_NETLINK_H
21 #include <linux/types.h>
22 struct can_bittiming {
23   __u32 bitrate;
24   __u32 sample_point;
25   __u32 tq;
26   __u32 prop_seg;
27   __u32 phase_seg1;
28   __u32 phase_seg2;
29   __u32 sjw;
30   __u32 brp;
31 };
32 struct can_bittiming_const {
33   char name[16];
34   __u32 tseg1_min;
35   __u32 tseg1_max;
36   __u32 tseg2_min;
37   __u32 tseg2_max;
38   __u32 sjw_max;
39   __u32 brp_min;
40   __u32 brp_max;
41   __u32 brp_inc;
42 };
43 struct can_clock {
44   __u32 freq;
45 };
46 enum can_state {
47   CAN_STATE_ERROR_ACTIVE = 0,
48   CAN_STATE_ERROR_WARNING,
49   CAN_STATE_ERROR_PASSIVE,
50   CAN_STATE_BUS_OFF,
51   CAN_STATE_STOPPED,
52   CAN_STATE_SLEEPING,
53   CAN_STATE_MAX
54 };
55 struct can_berr_counter {
56   __u16 txerr;
57   __u16 rxerr;
58 };
59 struct can_ctrlmode {
60   __u32 mask;
61   __u32 flags;
62 };
63 #define CAN_CTRLMODE_LOOPBACK 0x01
64 #define CAN_CTRLMODE_LISTENONLY 0x02
65 #define CAN_CTRLMODE_3_SAMPLES 0x04
66 #define CAN_CTRLMODE_ONE_SHOT 0x08
67 #define CAN_CTRLMODE_BERR_REPORTING 0x10
68 #define CAN_CTRLMODE_FD 0x20
69 #define CAN_CTRLMODE_PRESUME_ACK 0x40
70 #define CAN_CTRLMODE_FD_NON_ISO 0x80
71 #define CAN_CTRLMODE_CC_LEN8_DLC 0x100
72 struct can_device_stats {
73   __u32 bus_error;
74   __u32 error_warning;
75   __u32 error_passive;
76   __u32 bus_off;
77   __u32 arbitration_lost;
78   __u32 restarts;
79 };
80 enum {
81   IFLA_CAN_UNSPEC,
82   IFLA_CAN_BITTIMING,
83   IFLA_CAN_BITTIMING_CONST,
84   IFLA_CAN_CLOCK,
85   IFLA_CAN_STATE,
86   IFLA_CAN_CTRLMODE,
87   IFLA_CAN_RESTART_MS,
88   IFLA_CAN_RESTART,
89   IFLA_CAN_BERR_COUNTER,
90   IFLA_CAN_DATA_BITTIMING,
91   IFLA_CAN_DATA_BITTIMING_CONST,
92   IFLA_CAN_TERMINATION,
93   IFLA_CAN_TERMINATION_CONST,
94   IFLA_CAN_BITRATE_CONST,
95   IFLA_CAN_DATA_BITRATE_CONST,
96   IFLA_CAN_BITRATE_MAX,
97   __IFLA_CAN_MAX
98 };
99 #define IFLA_CAN_MAX (__IFLA_CAN_MAX - 1)
100 #define CAN_TERMINATION_DISABLED 0
101 #endif
102