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_J1939_H_
20 #define _UAPI_CAN_J1939_H_
21 #include <linux/types.h>
22 #include <linux/socket.h>
23 #include <linux/can.h>
24 #define J1939_MAX_UNICAST_ADDR 0xfd
25 #define J1939_IDLE_ADDR 0xfe
26 #define J1939_NO_ADDR 0xff
27 #define J1939_NO_NAME 0
28 #define J1939_PGN_REQUEST 0x0ea00
29 #define J1939_PGN_ADDRESS_CLAIMED 0x0ee00
30 #define J1939_PGN_ADDRESS_COMMANDED 0x0fed8
31 #define J1939_PGN_PDU1_MAX 0x3ff00
32 #define J1939_PGN_MAX 0x3ffff
33 #define J1939_NO_PGN 0x40000
34 typedef __u32 pgn_t;
35 typedef __u8 priority_t;
36 typedef __u64 name_t;
37 #define SOL_CAN_J1939 (SOL_CAN_BASE + CAN_J1939)
38 enum {
39   SO_J1939_FILTER = 1,
40   SO_J1939_PROMISC = 2,
41   SO_J1939_SEND_PRIO = 3,
42   SO_J1939_ERRQUEUE = 4,
43 };
44 enum {
45   SCM_J1939_DEST_ADDR = 1,
46   SCM_J1939_DEST_NAME = 2,
47   SCM_J1939_PRIO = 3,
48   SCM_J1939_ERRQUEUE = 4,
49 };
50 enum {
51   J1939_NLA_PAD,
52   J1939_NLA_BYTES_ACKED,
53 };
54 enum {
55   J1939_EE_INFO_NONE,
56   J1939_EE_INFO_TX_ABORT,
57 };
58 struct j1939_filter {
59   name_t name;
60   name_t name_mask;
61   pgn_t pgn;
62   pgn_t pgn_mask;
63   __u8 addr;
64   __u8 addr_mask;
65 };
66 #define J1939_FILTER_MAX 512
67 #endif
68