blob: accba0e6b70481c47c400b233dcbe0a35c3c7fc6 [file] [log] [blame]
Yuval Mintz7a9b6b82016-06-03 14:35:33 +03001/* QLogic qed NIC Driver
2 * Copyright (c) 2015 QLogic Corporation
3 *
4 * This software is available under the terms of the GNU General Public License
5 * (GPL) Version 2, available from the file COPYING in the main directory of
6 * this source tree.
7 */
8
9#ifndef __TCP_COMMON__
10#define __TCP_COMMON__
11
12#define TCP_INVALID_TIMEOUT_VAL -1
13
14enum tcp_connect_mode {
15 TCP_CONNECT_ACTIVE,
16 TCP_CONNECT_PASSIVE,
17 MAX_TCP_CONNECT_MODE
18};
19
20struct tcp_init_params {
21 __le32 max_cwnd;
22 __le16 dup_ack_threshold;
23 __le16 tx_sws_timer;
24 __le16 min_rto;
25 __le16 min_rto_rt;
26 __le16 max_rto;
27 u8 maxfinrt;
28 u8 reserved[1];
29};
30
31enum tcp_ip_version {
32 TCP_IPV4,
33 TCP_IPV6,
34 MAX_TCP_IP_VERSION
35};
36
37struct tcp_offload_params {
38 __le16 local_mac_addr_lo;
39 __le16 local_mac_addr_mid;
40 __le16 local_mac_addr_hi;
41 __le16 remote_mac_addr_lo;
42 __le16 remote_mac_addr_mid;
43 __le16 remote_mac_addr_hi;
44 __le16 vlan_id;
45 u8 flags;
46#define TCP_OFFLOAD_PARAMS_TS_EN_MASK 0x1
47#define TCP_OFFLOAD_PARAMS_TS_EN_SHIFT 0
48#define TCP_OFFLOAD_PARAMS_DA_EN_MASK 0x1
49#define TCP_OFFLOAD_PARAMS_DA_EN_SHIFT 1
50#define TCP_OFFLOAD_PARAMS_KA_EN_MASK 0x1
51#define TCP_OFFLOAD_PARAMS_KA_EN_SHIFT 2
52#define TCP_OFFLOAD_PARAMS_NAGLE_EN_MASK 0x1
53#define TCP_OFFLOAD_PARAMS_NAGLE_EN_SHIFT 3
54#define TCP_OFFLOAD_PARAMS_DA_CNT_EN_MASK 0x1
55#define TCP_OFFLOAD_PARAMS_DA_CNT_EN_SHIFT 4
56#define TCP_OFFLOAD_PARAMS_FIN_SENT_MASK 0x1
57#define TCP_OFFLOAD_PARAMS_FIN_SENT_SHIFT 5
58#define TCP_OFFLOAD_PARAMS_FIN_RECEIVED_MASK 0x1
59#define TCP_OFFLOAD_PARAMS_FIN_RECEIVED_SHIFT 6
60#define TCP_OFFLOAD_PARAMS_RESERVED0_MASK 0x1
61#define TCP_OFFLOAD_PARAMS_RESERVED0_SHIFT 7
62 u8 ip_version;
63 __le32 remote_ip[4];
64 __le32 local_ip[4];
65 __le32 flow_label;
66 u8 ttl;
67 u8 tos_or_tc;
68 __le16 remote_port;
69 __le16 local_port;
70 __le16 mss;
71 u8 rcv_wnd_scale;
72 u8 connect_mode;
73 __le16 srtt;
74 __le32 cwnd;
75 __le32 ss_thresh;
76 __le16 reserved1;
77 u8 ka_max_probe_cnt;
78 u8 dup_ack_theshold;
79 __le32 rcv_next;
80 __le32 snd_una;
81 __le32 snd_next;
82 __le32 snd_max;
83 __le32 snd_wnd;
84 __le32 rcv_wnd;
85 __le32 snd_wl1;
86 __le32 ts_time;
87 __le32 ts_recent;
88 __le32 ts_recent_age;
89 __le32 total_rt;
90 __le32 ka_timeout_delta;
91 __le32 rt_timeout_delta;
92 u8 dup_ack_cnt;
93 u8 snd_wnd_probe_cnt;
94 u8 ka_probe_cnt;
95 u8 rt_cnt;
96 __le16 rtt_var;
97 __le16 reserved2;
98 __le32 ka_timeout;
99 __le32 ka_interval;
100 __le32 max_rt_time;
101 __le32 initial_rcv_wnd;
102 u8 snd_wnd_scale;
103 u8 ack_frequency;
104 __le16 da_timeout_value;
105 __le32 ts_ticks_per_second;
106};
107
108struct tcp_offload_params_opt2 {
109 __le16 local_mac_addr_lo;
110 __le16 local_mac_addr_mid;
111 __le16 local_mac_addr_hi;
112 __le16 remote_mac_addr_lo;
113 __le16 remote_mac_addr_mid;
114 __le16 remote_mac_addr_hi;
115 __le16 vlan_id;
116 u8 flags;
117#define TCP_OFFLOAD_PARAMS_OPT2_TS_EN_MASK 0x1
118#define TCP_OFFLOAD_PARAMS_OPT2_TS_EN_SHIFT 0
119#define TCP_OFFLOAD_PARAMS_OPT2_DA_EN_MASK 0x1
120#define TCP_OFFLOAD_PARAMS_OPT2_DA_EN_SHIFT 1
121#define TCP_OFFLOAD_PARAMS_OPT2_KA_EN_MASK 0x1
122#define TCP_OFFLOAD_PARAMS_OPT2_KA_EN_SHIFT 2
123#define TCP_OFFLOAD_PARAMS_OPT2_RESERVED0_MASK 0x1F
124#define TCP_OFFLOAD_PARAMS_OPT2_RESERVED0_SHIFT 3
125 u8 ip_version;
126 __le32 remote_ip[4];
127 __le32 local_ip[4];
128 __le32 flow_label;
129 u8 ttl;
130 u8 tos_or_tc;
131 __le16 remote_port;
132 __le16 local_port;
133 __le16 mss;
134 u8 rcv_wnd_scale;
135 u8 connect_mode;
136 __le16 syn_ip_payload_length;
137 __le32 syn_phy_addr_lo;
138 __le32 syn_phy_addr_hi;
139 __le32 reserved1[22];
140};
141
142enum tcp_seg_placement_event {
143 TCP_EVENT_ADD_PEN,
144 TCP_EVENT_ADD_NEW_ISLE,
145 TCP_EVENT_ADD_ISLE_RIGHT,
146 TCP_EVENT_ADD_ISLE_LEFT,
147 TCP_EVENT_JOIN,
148 TCP_EVENT_NOP,
149 MAX_TCP_SEG_PLACEMENT_EVENT
150};
151
152struct tcp_update_params {
153 __le16 flags;
154#define TCP_UPDATE_PARAMS_REMOTE_MAC_ADDR_CHANGED_MASK 0x1
155#define TCP_UPDATE_PARAMS_REMOTE_MAC_ADDR_CHANGED_SHIFT 0
156#define TCP_UPDATE_PARAMS_MSS_CHANGED_MASK 0x1
157#define TCP_UPDATE_PARAMS_MSS_CHANGED_SHIFT 1
158#define TCP_UPDATE_PARAMS_TTL_CHANGED_MASK 0x1
159#define TCP_UPDATE_PARAMS_TTL_CHANGED_SHIFT 2
160#define TCP_UPDATE_PARAMS_TOS_OR_TC_CHANGED_MASK 0x1
161#define TCP_UPDATE_PARAMS_TOS_OR_TC_CHANGED_SHIFT 3
162#define TCP_UPDATE_PARAMS_KA_TIMEOUT_CHANGED_MASK 0x1
163#define TCP_UPDATE_PARAMS_KA_TIMEOUT_CHANGED_SHIFT 4
164#define TCP_UPDATE_PARAMS_KA_INTERVAL_CHANGED_MASK 0x1
165#define TCP_UPDATE_PARAMS_KA_INTERVAL_CHANGED_SHIFT 5
166#define TCP_UPDATE_PARAMS_MAX_RT_TIME_CHANGED_MASK 0x1
167#define TCP_UPDATE_PARAMS_MAX_RT_TIME_CHANGED_SHIFT 6
168#define TCP_UPDATE_PARAMS_FLOW_LABEL_CHANGED_MASK 0x1
169#define TCP_UPDATE_PARAMS_FLOW_LABEL_CHANGED_SHIFT 7
170#define TCP_UPDATE_PARAMS_INITIAL_RCV_WND_CHANGED_MASK 0x1
171#define TCP_UPDATE_PARAMS_INITIAL_RCV_WND_CHANGED_SHIFT 8
172#define TCP_UPDATE_PARAMS_KA_MAX_PROBE_CNT_CHANGED_MASK 0x1
173#define TCP_UPDATE_PARAMS_KA_MAX_PROBE_CNT_CHANGED_SHIFT 9
174#define TCP_UPDATE_PARAMS_KA_EN_CHANGED_MASK 0x1
175#define TCP_UPDATE_PARAMS_KA_EN_CHANGED_SHIFT 10
176#define TCP_UPDATE_PARAMS_NAGLE_EN_CHANGED_MASK 0x1
177#define TCP_UPDATE_PARAMS_NAGLE_EN_CHANGED_SHIFT 11
178#define TCP_UPDATE_PARAMS_KA_EN_MASK 0x1
179#define TCP_UPDATE_PARAMS_KA_EN_SHIFT 12
180#define TCP_UPDATE_PARAMS_NAGLE_EN_MASK 0x1
181#define TCP_UPDATE_PARAMS_NAGLE_EN_SHIFT 13
182#define TCP_UPDATE_PARAMS_KA_RESTART_MASK 0x1
183#define TCP_UPDATE_PARAMS_KA_RESTART_SHIFT 14
184#define TCP_UPDATE_PARAMS_RETRANSMIT_RESTART_MASK 0x1
185#define TCP_UPDATE_PARAMS_RETRANSMIT_RESTART_SHIFT 15
186 __le16 remote_mac_addr_lo;
187 __le16 remote_mac_addr_mid;
188 __le16 remote_mac_addr_hi;
189 __le16 mss;
190 u8 ttl;
191 u8 tos_or_tc;
192 __le32 ka_timeout;
193 __le32 ka_interval;
194 __le32 max_rt_time;
195 __le32 flow_label;
196 __le32 initial_rcv_wnd;
197 u8 ka_max_probe_cnt;
198 u8 reserved1[7];
199};
200
201struct tcp_upload_params {
202 __le32 rcv_next;
203 __le32 snd_una;
204 __le32 snd_next;
205 __le32 snd_max;
206 __le32 snd_wnd;
207 __le32 rcv_wnd;
208 __le32 snd_wl1;
209 __le32 cwnd;
210 __le32 ss_thresh;
211 __le16 srtt;
212 __le16 rtt_var;
213 __le32 ts_time;
214 __le32 ts_recent;
215 __le32 ts_recent_age;
216 __le32 total_rt;
217 __le32 ka_timeout_delta;
218 __le32 rt_timeout_delta;
219 u8 dup_ack_cnt;
220 u8 snd_wnd_probe_cnt;
221 u8 ka_probe_cnt;
222 u8 rt_cnt;
223 __le32 reserved;
224};
225
226#endif /* __TCP_COMMON__ */