summaryrefslogtreecommitdiff
path: root/mainline/runtime/sdk/android/x86/include/bionic/libc/kernel/uapi/linux/can/gw.h
blob: 4b42ac807f543b868d66d77e2886e4fd0c91f79f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
/*
 * This file is auto-generated. Modifications will be lost.
 *
 * See https://android.googlesource.com/platform/bionic/+/master/libc/kernel/
 * for more information.
 */
#ifndef _UAPI_CAN_GW_H
#define _UAPI_CAN_GW_H
#include <linux/types.h>
#include <linux/can.h>
struct rtcanmsg {
  __u8 can_family;
  __u8 gwtype;
  __u16 flags;
};
enum {
  CGW_TYPE_UNSPEC,
  CGW_TYPE_CAN_CAN,
  __CGW_TYPE_MAX
};
#define CGW_TYPE_MAX (__CGW_TYPE_MAX - 1)
enum {
  CGW_UNSPEC,
  CGW_MOD_AND,
  CGW_MOD_OR,
  CGW_MOD_XOR,
  CGW_MOD_SET,
  CGW_CS_XOR,
  CGW_CS_CRC8,
  CGW_HANDLED,
  CGW_DROPPED,
  CGW_SRC_IF,
  CGW_DST_IF,
  CGW_FILTER,
  CGW_DELETED,
  CGW_LIM_HOPS,
  CGW_MOD_UID,
  CGW_FDMOD_AND,
  CGW_FDMOD_OR,
  CGW_FDMOD_XOR,
  CGW_FDMOD_SET,
  __CGW_MAX
};
#define CGW_MAX (__CGW_MAX - 1)
#define CGW_FLAGS_CAN_ECHO 0x01
#define CGW_FLAGS_CAN_SRC_TSTAMP 0x02
#define CGW_FLAGS_CAN_IIF_TX_OK 0x04
#define CGW_FLAGS_CAN_FD 0x08
#define CGW_MOD_FUNCS 4
#define CGW_MOD_ID 0x01
#define CGW_MOD_DLC 0x02
#define CGW_MOD_LEN CGW_MOD_DLC
#define CGW_MOD_DATA 0x04
#define CGW_MOD_FLAGS 0x08
#define CGW_FRAME_MODS 4
#define MAX_MODFUNCTIONS (CGW_MOD_FUNCS * CGW_FRAME_MODS)
struct cgw_frame_mod {
  struct can_frame cf;
  __u8 modtype;
} __attribute__((packed));
struct cgw_fdframe_mod {
  struct canfd_frame cf;
  __u8 modtype;
} __attribute__((packed));
#define CGW_MODATTR_LEN sizeof(struct cgw_frame_mod)
#define CGW_FDMODATTR_LEN sizeof(struct cgw_fdframe_mod)
struct cgw_csum_xor {
  __s8 from_idx;
  __s8 to_idx;
  __s8 result_idx;
  __u8 init_xor_val;
} __attribute__((packed));
struct cgw_csum_crc8 {
  __s8 from_idx;
  __s8 to_idx;
  __s8 result_idx;
  __u8 init_crc_val;
  __u8 final_xor_val;
  __u8 crctab[256];
  __u8 profile;
  __u8 profile_data[20];
} __attribute__((packed));
#define CGW_CS_XOR_LEN sizeof(struct cgw_csum_xor)
#define CGW_CS_CRC8_LEN sizeof(struct cgw_csum_crc8)
enum {
  CGW_CRC8PRF_UNSPEC,
  CGW_CRC8PRF_1U8,
  CGW_CRC8PRF_16U8,
  CGW_CRC8PRF_SFFID_XOR,
  __CGW_CRC8PRF_MAX
};
#define CGW_CRC8PRF_MAX (__CGW_CRC8PRF_MAX - 1)
#endif