blob: 9be6107292ff02fc1dd541af2ab3cba49457628f [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_GW_H
20#define _UAPI_CAN_GW_H
Ben Cheng655a7c02013-10-16 16:09:24 -070021#include <linux/types.h>
22#include <linux/can.h>
Ben Cheng655a7c02013-10-16 16:09:24 -070023struct rtcanmsg {
Tao Baod7db5942015-01-28 10:07:51 -080024 __u8 can_family;
25 __u8 gwtype;
26 __u16 flags;
Ben Cheng655a7c02013-10-16 16:09:24 -070027};
28enum {
Tao Baod7db5942015-01-28 10:07:51 -080029 CGW_TYPE_UNSPEC,
30 CGW_TYPE_CAN_CAN,
Tao Baod7db5942015-01-28 10:07:51 -080031 __CGW_TYPE_MAX
Ben Cheng655a7c02013-10-16 16:09:24 -070032};
33#define CGW_TYPE_MAX (__CGW_TYPE_MAX - 1)
34enum {
Tao Baod7db5942015-01-28 10:07:51 -080035 CGW_UNSPEC,
36 CGW_MOD_AND,
37 CGW_MOD_OR,
38 CGW_MOD_XOR,
Tao Baod7db5942015-01-28 10:07:51 -080039 CGW_MOD_SET,
40 CGW_CS_XOR,
41 CGW_CS_CRC8,
42 CGW_HANDLED,
Tao Baod7db5942015-01-28 10:07:51 -080043 CGW_DROPPED,
44 CGW_SRC_IF,
45 CGW_DST_IF,
46 CGW_FILTER,
Tao Baod7db5942015-01-28 10:07:51 -080047 CGW_DELETED,
48 CGW_LIM_HOPS,
Christopher Ferris05d08e92016-02-04 13:16:38 -080049 CGW_MOD_UID,
Tao Baod7db5942015-01-28 10:07:51 -080050 __CGW_MAX
Christopher Ferris05d08e92016-02-04 13:16:38 -080051};
Christopher Ferris38062f92014-07-09 15:33:25 -070052#define CGW_MAX (__CGW_MAX - 1)
Ben Cheng655a7c02013-10-16 16:09:24 -070053#define CGW_FLAGS_CAN_ECHO 0x01
54#define CGW_FLAGS_CAN_SRC_TSTAMP 0x02
Christopher Ferris05d08e92016-02-04 13:16:38 -080055#define CGW_FLAGS_CAN_IIF_TX_OK 0x04
Christopher Ferris38062f92014-07-09 15:33:25 -070056#define CGW_MOD_FUNCS 4
Ben Cheng655a7c02013-10-16 16:09:24 -070057#define CGW_MOD_ID 0x01
58#define CGW_MOD_DLC 0x02
Christopher Ferris05d08e92016-02-04 13:16:38 -080059#define CGW_MOD_DATA 0x04
Christopher Ferris38062f92014-07-09 15:33:25 -070060#define CGW_FRAME_MODS 3
Ben Cheng655a7c02013-10-16 16:09:24 -070061#define MAX_MODFUNCTIONS (CGW_MOD_FUNCS * CGW_FRAME_MODS)
62struct cgw_frame_mod {
Christopher Ferris05d08e92016-02-04 13:16:38 -080063 struct can_frame cf;
Tao Baod7db5942015-01-28 10:07:51 -080064 __u8 modtype;
Ben Cheng655a7c02013-10-16 16:09:24 -070065} __attribute__((packed));
66#define CGW_MODATTR_LEN sizeof(struct cgw_frame_mod)
Christopher Ferris05d08e92016-02-04 13:16:38 -080067struct cgw_csum_xor {
Tao Baod7db5942015-01-28 10:07:51 -080068 __s8 from_idx;
69 __s8 to_idx;
70 __s8 result_idx;
Christopher Ferris05d08e92016-02-04 13:16:38 -080071 __u8 init_xor_val;
Christopher Ferris38062f92014-07-09 15:33:25 -070072} __attribute__((packed));
Ben Cheng655a7c02013-10-16 16:09:24 -070073struct cgw_csum_crc8 {
Tao Baod7db5942015-01-28 10:07:51 -080074 __s8 from_idx;
Christopher Ferris05d08e92016-02-04 13:16:38 -080075 __s8 to_idx;
Tao Baod7db5942015-01-28 10:07:51 -080076 __s8 result_idx;
77 __u8 init_crc_val;
78 __u8 final_xor_val;
Christopher Ferris05d08e92016-02-04 13:16:38 -080079 __u8 crctab[256];
Tao Baod7db5942015-01-28 10:07:51 -080080 __u8 profile;
81 __u8 profile_data[20];
Ben Cheng655a7c02013-10-16 16:09:24 -070082} __attribute__((packed));
Christopher Ferris05d08e92016-02-04 13:16:38 -080083#define CGW_CS_XOR_LEN sizeof(struct cgw_csum_xor)
Christopher Ferris38062f92014-07-09 15:33:25 -070084#define CGW_CS_CRC8_LEN sizeof(struct cgw_csum_crc8)
Ben Cheng655a7c02013-10-16 16:09:24 -070085enum {
Tao Baod7db5942015-01-28 10:07:51 -080086 CGW_CRC8PRF_UNSPEC,
Christopher Ferris05d08e92016-02-04 13:16:38 -080087 CGW_CRC8PRF_1U8,
Tao Baod7db5942015-01-28 10:07:51 -080088 CGW_CRC8PRF_16U8,
89 CGW_CRC8PRF_SFFID_XOR,
90 __CGW_CRC8PRF_MAX
Christopher Ferris05d08e92016-02-04 13:16:38 -080091};
Christopher Ferris38062f92014-07-09 15:33:25 -070092#define CGW_CRC8PRF_MAX (__CGW_CRC8PRF_MAX - 1)
Ben Cheng655a7c02013-10-16 16:09:24 -070093#endif