aboutsummaryrefslogtreecommitdiffstats
path: root/include/uapi/linux/can/gw.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/uapi/linux/can/gw.h')
-rw-r--r--include/uapi/linux/can/gw.h17
1 files changed, 15 insertions, 2 deletions
diff --git a/include/uapi/linux/can/gw.h b/include/uapi/linux/can/gw.h
index 7bee7a0b9800..3aea5388c8e4 100644
--- a/include/uapi/linux/can/gw.h
+++ b/include/uapi/linux/can/gw.h
@@ -80,6 +80,10 @@ enum {
80 CGW_DELETED, /* number of deleted CAN frames (see max_hops param) */ 80 CGW_DELETED, /* number of deleted CAN frames (see max_hops param) */
81 CGW_LIM_HOPS, /* limit the number of hops of this specific rule */ 81 CGW_LIM_HOPS, /* limit the number of hops of this specific rule */
82 CGW_MOD_UID, /* user defined identifier for modification updates */ 82 CGW_MOD_UID, /* user defined identifier for modification updates */
83 CGW_FDMOD_AND, /* CAN FD frame modification binary AND */
84 CGW_FDMOD_OR, /* CAN FD frame modification binary OR */
85 CGW_FDMOD_XOR, /* CAN FD frame modification binary XOR */
86 CGW_FDMOD_SET, /* CAN FD frame modification set alternate values */
83 __CGW_MAX 87 __CGW_MAX
84}; 88};
85 89
@@ -88,15 +92,18 @@ enum {
88#define CGW_FLAGS_CAN_ECHO 0x01 92#define CGW_FLAGS_CAN_ECHO 0x01
89#define CGW_FLAGS_CAN_SRC_TSTAMP 0x02 93#define CGW_FLAGS_CAN_SRC_TSTAMP 0x02
90#define CGW_FLAGS_CAN_IIF_TX_OK 0x04 94#define CGW_FLAGS_CAN_IIF_TX_OK 0x04
95#define CGW_FLAGS_CAN_FD 0x08
91 96
92#define CGW_MOD_FUNCS 4 /* AND OR XOR SET */ 97#define CGW_MOD_FUNCS 4 /* AND OR XOR SET */
93 98
94/* CAN frame elements that are affected by curr. 3 CAN frame modifications */ 99/* CAN frame elements that are affected by curr. 3 CAN frame modifications */
95#define CGW_MOD_ID 0x01 100#define CGW_MOD_ID 0x01
96#define CGW_MOD_DLC 0x02 101#define CGW_MOD_DLC 0x02 /* contains the data length in bytes */
102#define CGW_MOD_LEN CGW_MOD_DLC /* CAN FD length representation */
97#define CGW_MOD_DATA 0x04 103#define CGW_MOD_DATA 0x04
104#define CGW_MOD_FLAGS 0x08 /* CAN FD flags */
98 105
99#define CGW_FRAME_MODS 3 /* ID DLC DATA */ 106#define CGW_FRAME_MODS 4 /* ID DLC/LEN DATA FLAGS */
100 107
101#define MAX_MODFUNCTIONS (CGW_MOD_FUNCS * CGW_FRAME_MODS) 108#define MAX_MODFUNCTIONS (CGW_MOD_FUNCS * CGW_FRAME_MODS)
102 109
@@ -105,7 +112,13 @@ struct cgw_frame_mod {
105 __u8 modtype; 112 __u8 modtype;
106} __attribute__((packed)); 113} __attribute__((packed));
107 114
115struct cgw_fdframe_mod {
116 struct canfd_frame cf;
117 __u8 modtype;
118} __attribute__((packed));
119
108#define CGW_MODATTR_LEN sizeof(struct cgw_frame_mod) 120#define CGW_MODATTR_LEN sizeof(struct cgw_frame_mod)
121#define CGW_FDMODATTR_LEN sizeof(struct cgw_fdframe_mod)
109 122
110struct cgw_csum_xor { 123struct cgw_csum_xor {
111 __s8 from_idx; 124 __s8 from_idx;