Merge branch 'for-4.11' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq
[linux-2.6-block.git] / include / linux / qed / tcp_common.h
CommitLineData
7a9b6b8f 1/* QLogic qed NIC Driver
e8f1cb50 2 * Copyright (c) 2015-2017 QLogic Corporation
7a9b6b8f 3 *
e8f1cb50
MY
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:
9 *
10 * Redistribution and use in source and binary forms, with or
11 * without modification, are permitted provided that the following
12 * conditions are met:
13 *
14 * - Redistributions of source code must retain the above
15 * copyright notice, this list of conditions and the following
16 * disclaimer.
17 *
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.
22 *
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
30 * SOFTWARE.
7a9b6b8f
YM
31 */
32
33#ifndef __TCP_COMMON__
34#define __TCP_COMMON__
35
36#define TCP_INVALID_TIMEOUT_VAL -1
37
05fafbfb
YM
38struct ooo_opaque {
39 __le32 cid;
40 u8 drop_isle;
41 u8 drop_size;
42 u8 ooo_opcode;
43 u8 ooo_isle;
44};
45
7a9b6b8f
YM
46enum tcp_connect_mode {
47 TCP_CONNECT_ACTIVE,
48 TCP_CONNECT_PASSIVE,
49 MAX_TCP_CONNECT_MODE
50};
51
52struct tcp_init_params {
05fafbfb 53 __le32 two_msl_timer;
7a9b6b8f 54 __le16 tx_sws_timer;
7a9b6b8f 55 u8 maxfinrt;
05fafbfb 56 u8 reserved[9];
7a9b6b8f
YM
57};
58
59enum tcp_ip_version {
60 TCP_IPV4,
61 TCP_IPV6,
62 MAX_TCP_IP_VERSION
63};
64
65struct tcp_offload_params {
66 __le16 local_mac_addr_lo;
67 __le16 local_mac_addr_mid;
68 __le16 local_mac_addr_hi;
69 __le16 remote_mac_addr_lo;
70 __le16 remote_mac_addr_mid;
71 __le16 remote_mac_addr_hi;
72 __le16 vlan_id;
73 u8 flags;
74#define TCP_OFFLOAD_PARAMS_TS_EN_MASK 0x1
75#define TCP_OFFLOAD_PARAMS_TS_EN_SHIFT 0
76#define TCP_OFFLOAD_PARAMS_DA_EN_MASK 0x1
77#define TCP_OFFLOAD_PARAMS_DA_EN_SHIFT 1
78#define TCP_OFFLOAD_PARAMS_KA_EN_MASK 0x1
79#define TCP_OFFLOAD_PARAMS_KA_EN_SHIFT 2
80#define TCP_OFFLOAD_PARAMS_NAGLE_EN_MASK 0x1
81#define TCP_OFFLOAD_PARAMS_NAGLE_EN_SHIFT 3
82#define TCP_OFFLOAD_PARAMS_DA_CNT_EN_MASK 0x1
83#define TCP_OFFLOAD_PARAMS_DA_CNT_EN_SHIFT 4
84#define TCP_OFFLOAD_PARAMS_FIN_SENT_MASK 0x1
85#define TCP_OFFLOAD_PARAMS_FIN_SENT_SHIFT 5
86#define TCP_OFFLOAD_PARAMS_FIN_RECEIVED_MASK 0x1
87#define TCP_OFFLOAD_PARAMS_FIN_RECEIVED_SHIFT 6
88#define TCP_OFFLOAD_PARAMS_RESERVED0_MASK 0x1
89#define TCP_OFFLOAD_PARAMS_RESERVED0_SHIFT 7
90 u8 ip_version;
91 __le32 remote_ip[4];
92 __le32 local_ip[4];
93 __le32 flow_label;
94 u8 ttl;
95 u8 tos_or_tc;
96 __le16 remote_port;
97 __le16 local_port;
98 __le16 mss;
99 u8 rcv_wnd_scale;
100 u8 connect_mode;
101 __le16 srtt;
102 __le32 cwnd;
103 __le32 ss_thresh;
104 __le16 reserved1;
105 u8 ka_max_probe_cnt;
106 u8 dup_ack_theshold;
107 __le32 rcv_next;
108 __le32 snd_una;
109 __le32 snd_next;
110 __le32 snd_max;
111 __le32 snd_wnd;
112 __le32 rcv_wnd;
113 __le32 snd_wl1;
114 __le32 ts_time;
115 __le32 ts_recent;
116 __le32 ts_recent_age;
117 __le32 total_rt;
118 __le32 ka_timeout_delta;
119 __le32 rt_timeout_delta;
120 u8 dup_ack_cnt;
121 u8 snd_wnd_probe_cnt;
122 u8 ka_probe_cnt;
123 u8 rt_cnt;
124 __le16 rtt_var;
125 __le16 reserved2;
126 __le32 ka_timeout;
127 __le32 ka_interval;
128 __le32 max_rt_time;
129 __le32 initial_rcv_wnd;
130 u8 snd_wnd_scale;
131 u8 ack_frequency;
132 __le16 da_timeout_value;
133 __le32 ts_ticks_per_second;
134};
135
136struct tcp_offload_params_opt2 {
137 __le16 local_mac_addr_lo;
138 __le16 local_mac_addr_mid;
139 __le16 local_mac_addr_hi;
140 __le16 remote_mac_addr_lo;
141 __le16 remote_mac_addr_mid;
142 __le16 remote_mac_addr_hi;
143 __le16 vlan_id;
144 u8 flags;
145#define TCP_OFFLOAD_PARAMS_OPT2_TS_EN_MASK 0x1
146#define TCP_OFFLOAD_PARAMS_OPT2_TS_EN_SHIFT 0
147#define TCP_OFFLOAD_PARAMS_OPT2_DA_EN_MASK 0x1
148#define TCP_OFFLOAD_PARAMS_OPT2_DA_EN_SHIFT 1
149#define TCP_OFFLOAD_PARAMS_OPT2_KA_EN_MASK 0x1
150#define TCP_OFFLOAD_PARAMS_OPT2_KA_EN_SHIFT 2
151#define TCP_OFFLOAD_PARAMS_OPT2_RESERVED0_MASK 0x1F
152#define TCP_OFFLOAD_PARAMS_OPT2_RESERVED0_SHIFT 3
153 u8 ip_version;
154 __le32 remote_ip[4];
155 __le32 local_ip[4];
156 __le32 flow_label;
157 u8 ttl;
158 u8 tos_or_tc;
159 __le16 remote_port;
160 __le16 local_port;
161 __le16 mss;
162 u8 rcv_wnd_scale;
163 u8 connect_mode;
164 __le16 syn_ip_payload_length;
165 __le32 syn_phy_addr_lo;
166 __le32 syn_phy_addr_hi;
167 __le32 reserved1[22];
168};
169
170enum tcp_seg_placement_event {
171 TCP_EVENT_ADD_PEN,
172 TCP_EVENT_ADD_NEW_ISLE,
173 TCP_EVENT_ADD_ISLE_RIGHT,
174 TCP_EVENT_ADD_ISLE_LEFT,
175 TCP_EVENT_JOIN,
176 TCP_EVENT_NOP,
177 MAX_TCP_SEG_PLACEMENT_EVENT
178};
179
180struct tcp_update_params {
181 __le16 flags;
182#define TCP_UPDATE_PARAMS_REMOTE_MAC_ADDR_CHANGED_MASK 0x1
183#define TCP_UPDATE_PARAMS_REMOTE_MAC_ADDR_CHANGED_SHIFT 0
184#define TCP_UPDATE_PARAMS_MSS_CHANGED_MASK 0x1
185#define TCP_UPDATE_PARAMS_MSS_CHANGED_SHIFT 1
186#define TCP_UPDATE_PARAMS_TTL_CHANGED_MASK 0x1
187#define TCP_UPDATE_PARAMS_TTL_CHANGED_SHIFT 2
188#define TCP_UPDATE_PARAMS_TOS_OR_TC_CHANGED_MASK 0x1
189#define TCP_UPDATE_PARAMS_TOS_OR_TC_CHANGED_SHIFT 3
190#define TCP_UPDATE_PARAMS_KA_TIMEOUT_CHANGED_MASK 0x1
191#define TCP_UPDATE_PARAMS_KA_TIMEOUT_CHANGED_SHIFT 4
192#define TCP_UPDATE_PARAMS_KA_INTERVAL_CHANGED_MASK 0x1
193#define TCP_UPDATE_PARAMS_KA_INTERVAL_CHANGED_SHIFT 5
194#define TCP_UPDATE_PARAMS_MAX_RT_TIME_CHANGED_MASK 0x1
195#define TCP_UPDATE_PARAMS_MAX_RT_TIME_CHANGED_SHIFT 6
196#define TCP_UPDATE_PARAMS_FLOW_LABEL_CHANGED_MASK 0x1
197#define TCP_UPDATE_PARAMS_FLOW_LABEL_CHANGED_SHIFT 7
198#define TCP_UPDATE_PARAMS_INITIAL_RCV_WND_CHANGED_MASK 0x1
199#define TCP_UPDATE_PARAMS_INITIAL_RCV_WND_CHANGED_SHIFT 8
200#define TCP_UPDATE_PARAMS_KA_MAX_PROBE_CNT_CHANGED_MASK 0x1
201#define TCP_UPDATE_PARAMS_KA_MAX_PROBE_CNT_CHANGED_SHIFT 9
202#define TCP_UPDATE_PARAMS_KA_EN_CHANGED_MASK 0x1
203#define TCP_UPDATE_PARAMS_KA_EN_CHANGED_SHIFT 10
204#define TCP_UPDATE_PARAMS_NAGLE_EN_CHANGED_MASK 0x1
205#define TCP_UPDATE_PARAMS_NAGLE_EN_CHANGED_SHIFT 11
206#define TCP_UPDATE_PARAMS_KA_EN_MASK 0x1
207#define TCP_UPDATE_PARAMS_KA_EN_SHIFT 12
208#define TCP_UPDATE_PARAMS_NAGLE_EN_MASK 0x1
209#define TCP_UPDATE_PARAMS_NAGLE_EN_SHIFT 13
210#define TCP_UPDATE_PARAMS_KA_RESTART_MASK 0x1
211#define TCP_UPDATE_PARAMS_KA_RESTART_SHIFT 14
212#define TCP_UPDATE_PARAMS_RETRANSMIT_RESTART_MASK 0x1
213#define TCP_UPDATE_PARAMS_RETRANSMIT_RESTART_SHIFT 15
214 __le16 remote_mac_addr_lo;
215 __le16 remote_mac_addr_mid;
216 __le16 remote_mac_addr_hi;
217 __le16 mss;
218 u8 ttl;
219 u8 tos_or_tc;
220 __le32 ka_timeout;
221 __le32 ka_interval;
222 __le32 max_rt_time;
223 __le32 flow_label;
224 __le32 initial_rcv_wnd;
225 u8 ka_max_probe_cnt;
226 u8 reserved1[7];
227};
228
229struct tcp_upload_params {
230 __le32 rcv_next;
231 __le32 snd_una;
232 __le32 snd_next;
233 __le32 snd_max;
234 __le32 snd_wnd;
235 __le32 rcv_wnd;
236 __le32 snd_wl1;
237 __le32 cwnd;
238 __le32 ss_thresh;
239 __le16 srtt;
240 __le16 rtt_var;
241 __le32 ts_time;
242 __le32 ts_recent;
243 __le32 ts_recent_age;
244 __le32 total_rt;
245 __le32 ka_timeout_delta;
246 __le32 rt_timeout_delta;
247 u8 dup_ack_cnt;
248 u8 snd_wnd_probe_cnt;
249 u8 ka_probe_cnt;
250 u8 rt_cnt;
251 __le32 reserved;
252};
253
254#endif /* __TCP_COMMON__ */