Yuval Mintz | 7a9b6b8 | 2016-06-03 14:35:33 +0300 | [diff] [blame] | 1 | /* QLogic qed NIC Driver |
Mintz, Yuval | e8f1cb5 | 2017-01-01 13:57:00 +0200 | [diff] [blame] | 2 | * Copyright (c) 2015-2017 QLogic Corporation |
Yuval Mintz | 7a9b6b8 | 2016-06-03 14:35:33 +0300 | [diff] [blame] | 3 | * |
Mintz, Yuval | e8f1cb5 | 2017-01-01 13:57:00 +0200 | [diff] [blame] | 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. |
Yuval Mintz | 7a9b6b8 | 2016-06-03 14:35:33 +0300 | [diff] [blame] | 31 | */ |
| 32 | |
| 33 | #ifndef __TCP_COMMON__ |
| 34 | #define __TCP_COMMON__ |
| 35 | |
| 36 | #define TCP_INVALID_TIMEOUT_VAL -1 |
| 37 | |
Yuval Mintz | 05fafbf | 2016-08-19 09:33:31 +0300 | [diff] [blame] | 38 | struct ooo_opaque { |
| 39 | __le32 cid; |
| 40 | u8 drop_isle; |
| 41 | u8 drop_size; |
| 42 | u8 ooo_opcode; |
| 43 | u8 ooo_isle; |
| 44 | }; |
| 45 | |
Yuval Mintz | 7a9b6b8 | 2016-06-03 14:35:33 +0300 | [diff] [blame] | 46 | enum tcp_connect_mode { |
| 47 | TCP_CONNECT_ACTIVE, |
| 48 | TCP_CONNECT_PASSIVE, |
| 49 | MAX_TCP_CONNECT_MODE |
| 50 | }; |
| 51 | |
| 52 | struct tcp_init_params { |
Yuval Mintz | 05fafbf | 2016-08-19 09:33:31 +0300 | [diff] [blame] | 53 | __le32 two_msl_timer; |
Yuval Mintz | 7a9b6b8 | 2016-06-03 14:35:33 +0300 | [diff] [blame] | 54 | __le16 tx_sws_timer; |
Yuval Mintz | 7a9b6b8 | 2016-06-03 14:35:33 +0300 | [diff] [blame] | 55 | u8 maxfinrt; |
Yuval Mintz | 05fafbf | 2016-08-19 09:33:31 +0300 | [diff] [blame] | 56 | u8 reserved[9]; |
Yuval Mintz | 7a9b6b8 | 2016-06-03 14:35:33 +0300 | [diff] [blame] | 57 | }; |
| 58 | |
| 59 | enum tcp_ip_version { |
| 60 | TCP_IPV4, |
| 61 | TCP_IPV6, |
| 62 | MAX_TCP_IP_VERSION |
| 63 | }; |
| 64 | |
| 65 | struct 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 | |
| 136 | struct 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 | |
| 170 | enum 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, |
Mintz, Yuval | be086e7 | 2017-03-11 18:39:18 +0200 | [diff] [blame] | 176 | TCP_EVENT_DELETE_ISLES, |
Yuval Mintz | 7a9b6b8 | 2016-06-03 14:35:33 +0300 | [diff] [blame] | 177 | TCP_EVENT_NOP, |
| 178 | MAX_TCP_SEG_PLACEMENT_EVENT |
| 179 | }; |
| 180 | |
| 181 | struct tcp_update_params { |
| 182 | __le16 flags; |
| 183 | #define TCP_UPDATE_PARAMS_REMOTE_MAC_ADDR_CHANGED_MASK 0x1 |
| 184 | #define TCP_UPDATE_PARAMS_REMOTE_MAC_ADDR_CHANGED_SHIFT 0 |
| 185 | #define TCP_UPDATE_PARAMS_MSS_CHANGED_MASK 0x1 |
| 186 | #define TCP_UPDATE_PARAMS_MSS_CHANGED_SHIFT 1 |
| 187 | #define TCP_UPDATE_PARAMS_TTL_CHANGED_MASK 0x1 |
| 188 | #define TCP_UPDATE_PARAMS_TTL_CHANGED_SHIFT 2 |
| 189 | #define TCP_UPDATE_PARAMS_TOS_OR_TC_CHANGED_MASK 0x1 |
| 190 | #define TCP_UPDATE_PARAMS_TOS_OR_TC_CHANGED_SHIFT 3 |
| 191 | #define TCP_UPDATE_PARAMS_KA_TIMEOUT_CHANGED_MASK 0x1 |
| 192 | #define TCP_UPDATE_PARAMS_KA_TIMEOUT_CHANGED_SHIFT 4 |
| 193 | #define TCP_UPDATE_PARAMS_KA_INTERVAL_CHANGED_MASK 0x1 |
| 194 | #define TCP_UPDATE_PARAMS_KA_INTERVAL_CHANGED_SHIFT 5 |
| 195 | #define TCP_UPDATE_PARAMS_MAX_RT_TIME_CHANGED_MASK 0x1 |
| 196 | #define TCP_UPDATE_PARAMS_MAX_RT_TIME_CHANGED_SHIFT 6 |
| 197 | #define TCP_UPDATE_PARAMS_FLOW_LABEL_CHANGED_MASK 0x1 |
| 198 | #define TCP_UPDATE_PARAMS_FLOW_LABEL_CHANGED_SHIFT 7 |
| 199 | #define TCP_UPDATE_PARAMS_INITIAL_RCV_WND_CHANGED_MASK 0x1 |
| 200 | #define TCP_UPDATE_PARAMS_INITIAL_RCV_WND_CHANGED_SHIFT 8 |
| 201 | #define TCP_UPDATE_PARAMS_KA_MAX_PROBE_CNT_CHANGED_MASK 0x1 |
| 202 | #define TCP_UPDATE_PARAMS_KA_MAX_PROBE_CNT_CHANGED_SHIFT 9 |
| 203 | #define TCP_UPDATE_PARAMS_KA_EN_CHANGED_MASK 0x1 |
| 204 | #define TCP_UPDATE_PARAMS_KA_EN_CHANGED_SHIFT 10 |
| 205 | #define TCP_UPDATE_PARAMS_NAGLE_EN_CHANGED_MASK 0x1 |
| 206 | #define TCP_UPDATE_PARAMS_NAGLE_EN_CHANGED_SHIFT 11 |
| 207 | #define TCP_UPDATE_PARAMS_KA_EN_MASK 0x1 |
| 208 | #define TCP_UPDATE_PARAMS_KA_EN_SHIFT 12 |
| 209 | #define TCP_UPDATE_PARAMS_NAGLE_EN_MASK 0x1 |
| 210 | #define TCP_UPDATE_PARAMS_NAGLE_EN_SHIFT 13 |
| 211 | #define TCP_UPDATE_PARAMS_KA_RESTART_MASK 0x1 |
| 212 | #define TCP_UPDATE_PARAMS_KA_RESTART_SHIFT 14 |
| 213 | #define TCP_UPDATE_PARAMS_RETRANSMIT_RESTART_MASK 0x1 |
| 214 | #define TCP_UPDATE_PARAMS_RETRANSMIT_RESTART_SHIFT 15 |
| 215 | __le16 remote_mac_addr_lo; |
| 216 | __le16 remote_mac_addr_mid; |
| 217 | __le16 remote_mac_addr_hi; |
| 218 | __le16 mss; |
| 219 | u8 ttl; |
| 220 | u8 tos_or_tc; |
| 221 | __le32 ka_timeout; |
| 222 | __le32 ka_interval; |
| 223 | __le32 max_rt_time; |
| 224 | __le32 flow_label; |
| 225 | __le32 initial_rcv_wnd; |
| 226 | u8 ka_max_probe_cnt; |
| 227 | u8 reserved1[7]; |
| 228 | }; |
| 229 | |
| 230 | struct tcp_upload_params { |
| 231 | __le32 rcv_next; |
| 232 | __le32 snd_una; |
| 233 | __le32 snd_next; |
| 234 | __le32 snd_max; |
| 235 | __le32 snd_wnd; |
| 236 | __le32 rcv_wnd; |
| 237 | __le32 snd_wl1; |
| 238 | __le32 cwnd; |
| 239 | __le32 ss_thresh; |
| 240 | __le16 srtt; |
| 241 | __le16 rtt_var; |
| 242 | __le32 ts_time; |
| 243 | __le32 ts_recent; |
| 244 | __le32 ts_recent_age; |
| 245 | __le32 total_rt; |
| 246 | __le32 ka_timeout_delta; |
| 247 | __le32 rt_timeout_delta; |
| 248 | u8 dup_ack_cnt; |
| 249 | u8 snd_wnd_probe_cnt; |
| 250 | u8 ka_probe_cnt; |
| 251 | u8 rt_cnt; |
| 252 | __le32 reserved; |
| 253 | }; |
| 254 | |
| 255 | #endif /* __TCP_COMMON__ */ |