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_GW_H 20 #define _UAPI_CAN_GW_H 21 #include <linux/types.h> 22 #include <linux/can.h> 23 struct rtcanmsg { 24 __u8 can_family; 25 __u8 gwtype; 26 __u16 flags; 27 }; 28 enum { 29 CGW_TYPE_UNSPEC, 30 CGW_TYPE_CAN_CAN, 31 __CGW_TYPE_MAX 32 }; 33 #define CGW_TYPE_MAX (__CGW_TYPE_MAX - 1) 34 enum { 35 CGW_UNSPEC, 36 CGW_MOD_AND, 37 CGW_MOD_OR, 38 CGW_MOD_XOR, 39 CGW_MOD_SET, 40 CGW_CS_XOR, 41 CGW_CS_CRC8, 42 CGW_HANDLED, 43 CGW_DROPPED, 44 CGW_SRC_IF, 45 CGW_DST_IF, 46 CGW_FILTER, 47 CGW_DELETED, 48 CGW_LIM_HOPS, 49 CGW_MOD_UID, 50 CGW_FDMOD_AND, 51 CGW_FDMOD_OR, 52 CGW_FDMOD_XOR, 53 CGW_FDMOD_SET, 54 __CGW_MAX 55 }; 56 #define CGW_MAX (__CGW_MAX - 1) 57 #define CGW_FLAGS_CAN_ECHO 0x01 58 #define CGW_FLAGS_CAN_SRC_TSTAMP 0x02 59 #define CGW_FLAGS_CAN_IIF_TX_OK 0x04 60 #define CGW_FLAGS_CAN_FD 0x08 61 #define CGW_MOD_FUNCS 4 62 #define CGW_MOD_ID 0x01 63 #define CGW_MOD_DLC 0x02 64 #define CGW_MOD_LEN CGW_MOD_DLC 65 #define CGW_MOD_DATA 0x04 66 #define CGW_MOD_FLAGS 0x08 67 #define CGW_FRAME_MODS 4 68 #define MAX_MODFUNCTIONS (CGW_MOD_FUNCS * CGW_FRAME_MODS) 69 struct cgw_frame_mod { 70 struct can_frame cf; 71 __u8 modtype; 72 } __attribute__((packed)); 73 struct cgw_fdframe_mod { 74 struct canfd_frame cf; 75 __u8 modtype; 76 } __attribute__((packed)); 77 #define CGW_MODATTR_LEN sizeof(struct cgw_frame_mod) 78 #define CGW_FDMODATTR_LEN sizeof(struct cgw_fdframe_mod) 79 struct cgw_csum_xor { 80 __s8 from_idx; 81 __s8 to_idx; 82 __s8 result_idx; 83 __u8 init_xor_val; 84 } __attribute__((packed)); 85 struct cgw_csum_crc8 { 86 __s8 from_idx; 87 __s8 to_idx; 88 __s8 result_idx; 89 __u8 init_crc_val; 90 __u8 final_xor_val; 91 __u8 crctab[256]; 92 __u8 profile; 93 __u8 profile_data[20]; 94 } __attribute__((packed)); 95 #define CGW_CS_XOR_LEN sizeof(struct cgw_csum_xor) 96 #define CGW_CS_CRC8_LEN sizeof(struct cgw_csum_crc8) 97 enum { 98 CGW_CRC8PRF_UNSPEC, 99 CGW_CRC8PRF_1U8, 100 CGW_CRC8PRF_16U8, 101 CGW_CRC8PRF_SFFID_XOR, 102 __CGW_CRC8PRF_MAX 103 }; 104 #define CGW_CRC8PRF_MAX (__CGW_CRC8PRF_MAX - 1) 105 #endif 106