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