blob: ddf90589d7dc70968cda94faeb3f5f924d5124a9 [file] [log] [blame]
Ben Cheng655a7c02013-10-16 16:09:24 -07001/****************************************************************************
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 ****************************************************************************/
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070019#ifndef _UAPI_CAN_NETLINK_H
20#define _UAPI_CAN_NETLINK_H
Ben Cheng655a7c02013-10-16 16:09:24 -070021#include <linux/types.h>
22struct can_bittiming {
Tao Baod7db5942015-01-28 10:07:51 -080023 __u32 bitrate;
24 __u32 sample_point;
25 __u32 tq;
26 __u32 prop_seg;
Tao Baod7db5942015-01-28 10:07:51 -080027 __u32 phase_seg1;
28 __u32 phase_seg2;
29 __u32 sjw;
30 __u32 brp;
Ben Cheng655a7c02013-10-16 16:09:24 -070031};
32struct can_bittiming_const {
Tao Baod7db5942015-01-28 10:07:51 -080033 char name[16];
34 __u32 tseg1_min;
Tao Baod7db5942015-01-28 10:07:51 -080035 __u32 tseg1_max;
36 __u32 tseg2_min;
37 __u32 tseg2_max;
38 __u32 sjw_max;
Tao Baod7db5942015-01-28 10:07:51 -080039 __u32 brp_min;
40 __u32 brp_max;
41 __u32 brp_inc;
Ben Cheng655a7c02013-10-16 16:09:24 -070042};
Ben Cheng655a7c02013-10-16 16:09:24 -070043struct can_clock {
Tao Baod7db5942015-01-28 10:07:51 -080044 __u32 freq;
Ben Cheng655a7c02013-10-16 16:09:24 -070045};
46enum can_state {
Tao Baod7db5942015-01-28 10:07:51 -080047 CAN_STATE_ERROR_ACTIVE = 0,
48 CAN_STATE_ERROR_WARNING,
49 CAN_STATE_ERROR_PASSIVE,
50 CAN_STATE_BUS_OFF,
Tao Baod7db5942015-01-28 10:07:51 -080051 CAN_STATE_STOPPED,
52 CAN_STATE_SLEEPING,
53 CAN_STATE_MAX
Ben Cheng655a7c02013-10-16 16:09:24 -070054};
Ben Cheng655a7c02013-10-16 16:09:24 -070055struct can_berr_counter {
Tao Baod7db5942015-01-28 10:07:51 -080056 __u16 txerr;
57 __u16 rxerr;
Ben Cheng655a7c02013-10-16 16:09:24 -070058};
Ben Cheng655a7c02013-10-16 16:09:24 -070059struct can_ctrlmode {
Tao Baod7db5942015-01-28 10:07:51 -080060 __u32 mask;
61 __u32 flags;
Ben Cheng655a7c02013-10-16 16:09:24 -070062};
Ben Cheng655a7c02013-10-16 16:09:24 -070063#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
Ben Cheng655a7c02013-10-16 16:09:24 -070067#define CAN_CTRLMODE_BERR_REPORTING 0x10
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070068#define CAN_CTRLMODE_FD 0x20
Christopher Ferris82d75042015-01-26 10:57:07 -080069#define CAN_CTRLMODE_PRESUME_ACK 0x40
Christopher Ferrise01d32f2015-03-31 14:57:48 -070070#define CAN_CTRLMODE_FD_NON_ISO 0x80
Christopher Ferrise01d32f2015-03-31 14:57:48 -070071struct can_device_stats {
Tao Baod7db5942015-01-28 10:07:51 -080072 __u32 bus_error;
73 __u32 error_warning;
74 __u32 error_passive;
Christopher Ferrise01d32f2015-03-31 14:57:48 -070075 __u32 bus_off;
Tao Baod7db5942015-01-28 10:07:51 -080076 __u32 arbitration_lost;
77 __u32 restarts;
Ben Cheng655a7c02013-10-16 16:09:24 -070078};
Christopher Ferrise01d32f2015-03-31 14:57:48 -070079enum {
Tao Baod7db5942015-01-28 10:07:51 -080080 IFLA_CAN_UNSPEC,
81 IFLA_CAN_BITTIMING,
82 IFLA_CAN_BITTIMING_CONST,
Christopher Ferrise01d32f2015-03-31 14:57:48 -070083 IFLA_CAN_CLOCK,
Tao Baod7db5942015-01-28 10:07:51 -080084 IFLA_CAN_STATE,
85 IFLA_CAN_CTRLMODE,
86 IFLA_CAN_RESTART_MS,
Christopher Ferrise01d32f2015-03-31 14:57:48 -070087 IFLA_CAN_RESTART,
Tao Baod7db5942015-01-28 10:07:51 -080088 IFLA_CAN_BERR_COUNTER,
89 IFLA_CAN_DATA_BITTIMING,
90 IFLA_CAN_DATA_BITTIMING_CONST,
Christopher Ferris525ce912017-07-26 13:12:53 -070091 IFLA_CAN_TERMINATION,
92 IFLA_CAN_TERMINATION_CONST,
93 IFLA_CAN_BITRATE_CONST,
94 IFLA_CAN_DATA_BITRATE_CONST,
Christopher Ferris76a1d452018-06-27 14:12:29 -070095 IFLA_CAN_BITRATE_MAX,
Christopher Ferrise01d32f2015-03-31 14:57:48 -070096 __IFLA_CAN_MAX
Christopher Ferris82d75042015-01-26 10:57:07 -080097};
Ben Cheng655a7c02013-10-16 16:09:24 -070098#define IFLA_CAN_MAX (__IFLA_CAN_MAX - 1)
Christopher Ferris525ce912017-07-26 13:12:53 -070099#define CAN_TERMINATION_DISABLED 0
Ben Cheng655a7c02013-10-16 16:09:24 -0700100#endif