1 /* 2 * This header was generated from the Linux kernel headers by update_headers.py, 3 * to provide necessary information from kernel to userspace, such as constants, 4 * structures, and macros, and thus, contains no copyrightable information. 5 */ 6 #ifndef _UAPI_CAN_GW_H 7 #define _UAPI_CAN_GW_H 8 #include <linux/types.h> 9 #include <linux/can.h> 10 struct rtcanmsg { 11 __u8 can_family; 12 __u8 gwtype; 13 __u16 flags; 14 }; 15 enum { 16 CGW_TYPE_UNSPEC, 17 CGW_TYPE_CAN_CAN, 18 __CGW_TYPE_MAX 19 }; 20 #define CGW_TYPE_MAX (__CGW_TYPE_MAX - 1) 21 enum { 22 CGW_UNSPEC, 23 CGW_MOD_AND, 24 CGW_MOD_OR, 25 CGW_MOD_XOR, 26 CGW_MOD_SET, 27 CGW_CS_XOR, 28 CGW_CS_CRC8, 29 CGW_HANDLED, 30 CGW_DROPPED, 31 CGW_SRC_IF, 32 CGW_DST_IF, 33 CGW_FILTER, 34 CGW_DELETED, 35 CGW_LIM_HOPS, 36 CGW_MOD_UID, 37 __CGW_MAX 38 }; 39 #define CGW_MAX (__CGW_MAX - 1) 40 #define CGW_FLAGS_CAN_ECHO 0x01 41 #define CGW_FLAGS_CAN_SRC_TSTAMP 0x02 42 #define CGW_FLAGS_CAN_IIF_TX_OK 0x04 43 #define CGW_MOD_FUNCS 4 44 #define CGW_MOD_ID 0x01 45 #define CGW_MOD_DLC 0x02 46 #define CGW_MOD_DATA 0x04 47 #define CGW_FRAME_MODS 3 48 #define MAX_MODFUNCTIONS (CGW_MOD_FUNCS * CGW_FRAME_MODS) 49 struct cgw_frame_mod { 50 struct can_frame cf; 51 __u8 modtype; 52 } __attribute__((packed)); 53 #define CGW_MODATTR_LEN sizeof(struct cgw_frame_mod) 54 struct cgw_csum_xor { 55 __s8 from_idx; 56 __s8 to_idx; 57 __s8 result_idx; 58 __u8 init_xor_val; 59 } __attribute__((packed)); 60 struct cgw_csum_crc8 { 61 __s8 from_idx; 62 __s8 to_idx; 63 __s8 result_idx; 64 __u8 init_crc_val; 65 __u8 final_xor_val; 66 __u8 crctab[256]; 67 __u8 profile; 68 __u8 profile_data[20]; 69 } __attribute__((packed)); 70 #define CGW_CS_XOR_LEN sizeof(struct cgw_csum_xor) 71 #define CGW_CS_CRC8_LEN sizeof(struct cgw_csum_crc8) 72 enum { 73 CGW_CRC8PRF_UNSPEC, 74 CGW_CRC8PRF_1U8, 75 CGW_CRC8PRF_16U8, 76 CGW_CRC8PRF_SFFID_XOR, 77 __CGW_CRC8PRF_MAX 78 }; 79 #define CGW_CRC8PRF_MAX (__CGW_CRC8PRF_MAX - 1) 80 #endif 81