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#ifndef __TCP_COMMON__
34#define __TCP_COMMON__
35
36
37
38
39
40#define TCP_INVALID_TIMEOUT_VAL -1
41
42
43struct ooo_opaque {
44 __le32 cid;
45 u8 drop_isle;
46 u8 drop_size;
47 u8 ooo_opcode;
48 u8 ooo_isle;
49};
50
51
52enum tcp_connect_mode {
53 TCP_CONNECT_ACTIVE,
54 TCP_CONNECT_PASSIVE,
55 MAX_TCP_CONNECT_MODE
56};
57
58
59struct tcp_init_params {
60 __le32 two_msl_timer;
61 __le16 tx_sws_timer;
62 u8 max_fin_rt;
63 u8 reserved[9];
64};
65
66
67enum tcp_ip_version {
68 TCP_IPV4,
69 TCP_IPV6,
70 MAX_TCP_IP_VERSION
71};
72
73
74struct tcp_offload_params {
75 __le16 local_mac_addr_lo;
76 __le16 local_mac_addr_mid;
77 __le16 local_mac_addr_hi;
78 __le16 remote_mac_addr_lo;
79 __le16 remote_mac_addr_mid;
80 __le16 remote_mac_addr_hi;
81 __le16 vlan_id;
82 __le16 flags;
83#define TCP_OFFLOAD_PARAMS_TS_EN_MASK 0x1
84#define TCP_OFFLOAD_PARAMS_TS_EN_SHIFT 0
85#define TCP_OFFLOAD_PARAMS_DA_EN_MASK 0x1
86#define TCP_OFFLOAD_PARAMS_DA_EN_SHIFT 1
87#define TCP_OFFLOAD_PARAMS_KA_EN_MASK 0x1
88#define TCP_OFFLOAD_PARAMS_KA_EN_SHIFT 2
89#define TCP_OFFLOAD_PARAMS_ECN_SENDER_EN_MASK 0x1
90#define TCP_OFFLOAD_PARAMS_ECN_SENDER_EN_SHIFT 3
91#define TCP_OFFLOAD_PARAMS_ECN_RECEIVER_EN_MASK 0x1
92#define TCP_OFFLOAD_PARAMS_ECN_RECEIVER_EN_SHIFT 4
93#define TCP_OFFLOAD_PARAMS_NAGLE_EN_MASK 0x1
94#define TCP_OFFLOAD_PARAMS_NAGLE_EN_SHIFT 5
95#define TCP_OFFLOAD_PARAMS_DA_CNT_EN_MASK 0x1
96#define TCP_OFFLOAD_PARAMS_DA_CNT_EN_SHIFT 6
97#define TCP_OFFLOAD_PARAMS_FIN_SENT_MASK 0x1
98#define TCP_OFFLOAD_PARAMS_FIN_SENT_SHIFT 7
99#define TCP_OFFLOAD_PARAMS_FIN_RECEIVED_MASK 0x1
100#define TCP_OFFLOAD_PARAMS_FIN_RECEIVED_SHIFT 8
101#define TCP_OFFLOAD_PARAMS_RESERVED_MASK 0x7F
102#define TCP_OFFLOAD_PARAMS_RESERVED_SHIFT 9
103 u8 ip_version;
104 u8 reserved0[3];
105 __le32 remote_ip[4];
106 __le32 local_ip[4];
107 __le32 flow_label;
108 u8 ttl;
109 u8 tos_or_tc;
110 __le16 remote_port;
111 __le16 local_port;
112 __le16 mss;
113 u8 rcv_wnd_scale;
114 u8 connect_mode;
115 __le16 srtt;
116 __le32 ss_thresh;
117 __le32 rcv_wnd;
118 __le32 cwnd;
119 u8 ka_max_probe_cnt;
120 u8 dup_ack_theshold;
121 __le16 reserved1;
122 __le32 ka_timeout;
123 __le32 ka_interval;
124 __le32 max_rt_time;
125 __le32 initial_rcv_wnd;
126 __le32 rcv_next;
127 __le32 snd_una;
128 __le32 snd_next;
129 __le32 snd_max;
130 __le32 snd_wnd;
131 __le32 snd_wl1;
132 __le32 ts_recent;
133 __le32 ts_recent_age;
134 __le32 total_rt;
135 __le32 ka_timeout_delta;
136 __le32 rt_timeout_delta;
137 u8 dup_ack_cnt;
138 u8 snd_wnd_probe_cnt;
139 u8 ka_probe_cnt;
140 u8 rt_cnt;
141 __le16 rtt_var;
142 __le16 fw_internal;
143 u8 snd_wnd_scale;
144 u8 ack_frequency;
145 __le16 da_timeout_value;
146 __le32 reserved3;
147};
148
149
150struct tcp_offload_params_opt2 {
151 __le16 local_mac_addr_lo;
152 __le16 local_mac_addr_mid;
153 __le16 local_mac_addr_hi;
154 __le16 remote_mac_addr_lo;
155 __le16 remote_mac_addr_mid;
156 __le16 remote_mac_addr_hi;
157 __le16 vlan_id;
158 __le16 flags;
159#define TCP_OFFLOAD_PARAMS_OPT2_TS_EN_MASK 0x1
160#define TCP_OFFLOAD_PARAMS_OPT2_TS_EN_SHIFT 0
161#define TCP_OFFLOAD_PARAMS_OPT2_DA_EN_MASK 0x1
162#define TCP_OFFLOAD_PARAMS_OPT2_DA_EN_SHIFT 1
163#define TCP_OFFLOAD_PARAMS_OPT2_KA_EN_MASK 0x1
164#define TCP_OFFLOAD_PARAMS_OPT2_KA_EN_SHIFT 2
165#define TCP_OFFLOAD_PARAMS_OPT2_ECN_EN_MASK 0x1
166#define TCP_OFFLOAD_PARAMS_OPT2_ECN_EN_SHIFT 3
167#define TCP_OFFLOAD_PARAMS_OPT2_RESERVED0_MASK 0xFFF
168#define TCP_OFFLOAD_PARAMS_OPT2_RESERVED0_SHIFT 4
169 u8 ip_version;
170 u8 reserved1[3];
171 __le32 remote_ip[4];
172 __le32 local_ip[4];
173 __le32 flow_label;
174 u8 ttl;
175 u8 tos_or_tc;
176 __le16 remote_port;
177 __le16 local_port;
178 __le16 mss;
179 u8 rcv_wnd_scale;
180 u8 connect_mode;
181 __le16 syn_ip_payload_length;
182 __le32 syn_phy_addr_lo;
183 __le32 syn_phy_addr_hi;
184 __le32 cwnd;
185 u8 ka_max_probe_cnt;
186 u8 reserved2[3];
187 __le32 ka_timeout;
188 __le32 ka_interval;
189 __le32 max_rt_time;
190 __le32 reserved3[16];
191};
192
193
194enum tcp_seg_placement_event {
195 TCP_EVENT_ADD_PEN,
196 TCP_EVENT_ADD_NEW_ISLE,
197 TCP_EVENT_ADD_ISLE_RIGHT,
198 TCP_EVENT_ADD_ISLE_LEFT,
199 TCP_EVENT_JOIN,
200 TCP_EVENT_DELETE_ISLES,
201 TCP_EVENT_NOP,
202 MAX_TCP_SEG_PLACEMENT_EVENT
203};
204
205
206struct tcp_update_params {
207 __le16 flags;
208#define TCP_UPDATE_PARAMS_REMOTE_MAC_ADDR_CHANGED_MASK 0x1
209#define TCP_UPDATE_PARAMS_REMOTE_MAC_ADDR_CHANGED_SHIFT 0
210#define TCP_UPDATE_PARAMS_MSS_CHANGED_MASK 0x1
211#define TCP_UPDATE_PARAMS_MSS_CHANGED_SHIFT 1
212#define TCP_UPDATE_PARAMS_TTL_CHANGED_MASK 0x1
213#define TCP_UPDATE_PARAMS_TTL_CHANGED_SHIFT 2
214#define TCP_UPDATE_PARAMS_TOS_OR_TC_CHANGED_MASK 0x1
215#define TCP_UPDATE_PARAMS_TOS_OR_TC_CHANGED_SHIFT 3
216#define TCP_UPDATE_PARAMS_KA_TIMEOUT_CHANGED_MASK 0x1
217#define TCP_UPDATE_PARAMS_KA_TIMEOUT_CHANGED_SHIFT 4
218#define TCP_UPDATE_PARAMS_KA_INTERVAL_CHANGED_MASK 0x1
219#define TCP_UPDATE_PARAMS_KA_INTERVAL_CHANGED_SHIFT 5
220#define TCP_UPDATE_PARAMS_MAX_RT_TIME_CHANGED_MASK 0x1
221#define TCP_UPDATE_PARAMS_MAX_RT_TIME_CHANGED_SHIFT 6
222#define TCP_UPDATE_PARAMS_FLOW_LABEL_CHANGED_MASK 0x1
223#define TCP_UPDATE_PARAMS_FLOW_LABEL_CHANGED_SHIFT 7
224#define TCP_UPDATE_PARAMS_INITIAL_RCV_WND_CHANGED_MASK 0x1
225#define TCP_UPDATE_PARAMS_INITIAL_RCV_WND_CHANGED_SHIFT 8
226#define TCP_UPDATE_PARAMS_KA_MAX_PROBE_CNT_CHANGED_MASK 0x1
227#define TCP_UPDATE_PARAMS_KA_MAX_PROBE_CNT_CHANGED_SHIFT 9
228#define TCP_UPDATE_PARAMS_KA_EN_CHANGED_MASK 0x1
229#define TCP_UPDATE_PARAMS_KA_EN_CHANGED_SHIFT 10
230#define TCP_UPDATE_PARAMS_NAGLE_EN_CHANGED_MASK 0x1
231#define TCP_UPDATE_PARAMS_NAGLE_EN_CHANGED_SHIFT 11
232#define TCP_UPDATE_PARAMS_KA_EN_MASK 0x1
233#define TCP_UPDATE_PARAMS_KA_EN_SHIFT 12
234#define TCP_UPDATE_PARAMS_NAGLE_EN_MASK 0x1
235#define TCP_UPDATE_PARAMS_NAGLE_EN_SHIFT 13
236#define TCP_UPDATE_PARAMS_KA_RESTART_MASK 0x1
237#define TCP_UPDATE_PARAMS_KA_RESTART_SHIFT 14
238#define TCP_UPDATE_PARAMS_RETRANSMIT_RESTART_MASK 0x1
239#define TCP_UPDATE_PARAMS_RETRANSMIT_RESTART_SHIFT 15
240 __le16 remote_mac_addr_lo;
241 __le16 remote_mac_addr_mid;
242 __le16 remote_mac_addr_hi;
243 __le16 mss;
244 u8 ttl;
245 u8 tos_or_tc;
246 __le32 ka_timeout;
247 __le32 ka_interval;
248 __le32 max_rt_time;
249 __le32 flow_label;
250 __le32 initial_rcv_wnd;
251 u8 ka_max_probe_cnt;
252 u8 reserved1[7];
253};
254
255
256struct tcp_upload_params {
257 __le32 rcv_next;
258 __le32 snd_una;
259 __le32 snd_next;
260 __le32 snd_max;
261 __le32 snd_wnd;
262 __le32 rcv_wnd;
263 __le32 snd_wl1;
264 __le32 cwnd;
265 __le32 ss_thresh;
266 __le16 srtt;
267 __le16 rtt_var;
268 __le32 ts_time;
269 __le32 ts_recent;
270 __le32 ts_recent_age;
271 __le32 total_rt;
272 __le32 ka_timeout_delta;
273 __le32 rt_timeout_delta;
274 u8 dup_ack_cnt;
275 u8 snd_wnd_probe_cnt;
276 u8 ka_probe_cnt;
277 u8 rt_cnt;
278 __le32 reserved;
279};
280
281#endif
282