1 /* QLogic qed NIC Driver
2 * Copyright (c) 2015-2017 QLogic Corporation
4 * This software is available to you under a choice of one of two
5 * licenses. You may choose to be licensed under the terms of the GNU
6 * General Public License (GPL) Version 2, available from the file
7 * COPYING in the main directory of this source tree, or the
8 * OpenIB.org BSD license below:
10 * Redistribution and use in source and binary forms, with or
11 * without modification, are permitted provided that the following
14 * - Redistributions of source code must retain the above
15 * copyright notice, this list of conditions and the following
18 * - Redistributions in binary form must reproduce the above
19 * copyright notice, this list of conditions and the following
20 * disclaimer in the documentation and /or other materials
21 * provided with the distribution.
23 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
26 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
27 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
28 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
29 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
33 #ifndef __TCP_COMMON__
34 #define __TCP_COMMON__
36 /********************/
37 /* TCP FW CONSTANTS */
38 /********************/
40 #define TCP_INVALID_TIMEOUT_VAL -1
42 /* OOO opaque data received from LL2 */
51 /* tcp connect mode enum */
52 enum tcp_connect_mode
{
58 /* tcp function init parameters */
59 struct tcp_init_params
{
66 /* tcp IPv4/IPv6 enum */
73 /* tcp offload parameters */
74 struct 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
;
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
125 __le32 initial_rcv_wnd
;
133 __le32 ts_recent_age
;
135 __le32 ka_timeout_delta
;
136 __le32 rt_timeout_delta
;
138 u8 snd_wnd_probe_cnt
;
145 __le16 da_timeout_value
;
149 /* tcp offload parameters */
150 struct 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
;
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
181 __le16 syn_ip_payload_length
;
182 __le32 syn_phy_addr_lo
;
183 __le32 syn_phy_addr_hi
;
190 __le32 reserved3
[16];
193 /* tcp IPv4/IPv6 enum */
194 enum tcp_seg_placement_event
{
196 TCP_EVENT_ADD_NEW_ISLE
,
197 TCP_EVENT_ADD_ISLE_RIGHT
,
198 TCP_EVENT_ADD_ISLE_LEFT
,
200 TCP_EVENT_DELETE_ISLES
,
202 MAX_TCP_SEG_PLACEMENT_EVENT
205 /* tcp init parameters */
206 struct tcp_update_params
{
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
;
250 __le32 initial_rcv_wnd
;
255 /* toe upload parameters */
256 struct tcp_upload_params
{
270 __le32 ts_recent_age
;
272 __le32 ka_timeout_delta
;
273 __le32 rt_timeout_delta
;
275 u8 snd_wnd_probe_cnt
;
281 #endif /* __TCP_COMMON__ */