1 2 /* Copyright (c) 2022, Qualcomm Innovation Center, Inc. All rights reserved. 3 * 4 * Permission to use, copy, modify, and/or distribute this software for any 5 * purpose with or without fee is hereby granted, provided that the above 6 * copyright notice and this permission notice appear in all copies. 7 * 8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 13 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 */ 16 17 18 19 20 21 22 23 24 25 26 #ifndef _RX_FLOW_SEARCH_ENTRY_H_ 27 #define _RX_FLOW_SEARCH_ENTRY_H_ 28 #if !defined(__ASSEMBLER__) 29 #endif 30 31 #define NUM_OF_DWORDS_RX_FLOW_SEARCH_ENTRY 16 32 33 34 struct rx_flow_search_entry { 35 #ifndef WIFI_BIT_ORDER_BIG_ENDIAN 36 uint32_t src_ip_127_96 : 32; 37 uint32_t src_ip_95_64 : 32; 38 uint32_t src_ip_63_32 : 32; 39 uint32_t src_ip_31_0 : 32; 40 uint32_t dest_ip_127_96 : 32; 41 uint32_t dest_ip_95_64 : 32; 42 uint32_t dest_ip_63_32 : 32; 43 uint32_t dest_ip_31_0 : 32; 44 uint32_t src_port : 16, 45 dest_port : 16; 46 uint32_t l4_protocol : 8, 47 valid : 1, 48 reserved_9 : 4, 49 service_code : 9, 50 priority_valid : 1, 51 use_ppe : 1, 52 reo_destination_indication : 5, 53 msdu_drop : 1, 54 reo_destination_handler : 2; 55 uint32_t metadata : 32; 56 uint32_t aggregation_count : 7, 57 lro_eligible : 1, 58 msdu_count : 24; 59 uint32_t msdu_byte_count : 32; 60 uint32_t timestamp : 32; 61 uint32_t cumulative_ip_length_pmac1 : 16, 62 cumulative_ip_length : 16; 63 uint32_t tcp_sequence_number : 32; 64 #else 65 uint32_t src_ip_127_96 : 32; 66 uint32_t src_ip_95_64 : 32; 67 uint32_t src_ip_63_32 : 32; 68 uint32_t src_ip_31_0 : 32; 69 uint32_t dest_ip_127_96 : 32; 70 uint32_t dest_ip_95_64 : 32; 71 uint32_t dest_ip_63_32 : 32; 72 uint32_t dest_ip_31_0 : 32; 73 uint32_t dest_port : 16, 74 src_port : 16; 75 uint32_t reo_destination_handler : 2, 76 msdu_drop : 1, 77 reo_destination_indication : 5, 78 use_ppe : 1, 79 priority_valid : 1, 80 service_code : 9, 81 reserved_9 : 4, 82 valid : 1, 83 l4_protocol : 8; 84 uint32_t metadata : 32; 85 uint32_t msdu_count : 24, 86 lro_eligible : 1, 87 aggregation_count : 7; 88 uint32_t msdu_byte_count : 32; 89 uint32_t timestamp : 32; 90 uint32_t cumulative_ip_length : 16, 91 cumulative_ip_length_pmac1 : 16; 92 uint32_t tcp_sequence_number : 32; 93 #endif 94 }; 95 96 97 98 99 #define RX_FLOW_SEARCH_ENTRY_SRC_IP_127_96_OFFSET 0x00000000 100 #define RX_FLOW_SEARCH_ENTRY_SRC_IP_127_96_LSB 0 101 #define RX_FLOW_SEARCH_ENTRY_SRC_IP_127_96_MSB 31 102 #define RX_FLOW_SEARCH_ENTRY_SRC_IP_127_96_MASK 0xffffffff 103 104 105 106 107 #define RX_FLOW_SEARCH_ENTRY_SRC_IP_95_64_OFFSET 0x00000004 108 #define RX_FLOW_SEARCH_ENTRY_SRC_IP_95_64_LSB 0 109 #define RX_FLOW_SEARCH_ENTRY_SRC_IP_95_64_MSB 31 110 #define RX_FLOW_SEARCH_ENTRY_SRC_IP_95_64_MASK 0xffffffff 111 112 113 114 115 #define RX_FLOW_SEARCH_ENTRY_SRC_IP_63_32_OFFSET 0x00000008 116 #define RX_FLOW_SEARCH_ENTRY_SRC_IP_63_32_LSB 0 117 #define RX_FLOW_SEARCH_ENTRY_SRC_IP_63_32_MSB 31 118 #define RX_FLOW_SEARCH_ENTRY_SRC_IP_63_32_MASK 0xffffffff 119 120 121 122 123 #define RX_FLOW_SEARCH_ENTRY_SRC_IP_31_0_OFFSET 0x0000000c 124 #define RX_FLOW_SEARCH_ENTRY_SRC_IP_31_0_LSB 0 125 #define RX_FLOW_SEARCH_ENTRY_SRC_IP_31_0_MSB 31 126 #define RX_FLOW_SEARCH_ENTRY_SRC_IP_31_0_MASK 0xffffffff 127 128 129 130 131 #define RX_FLOW_SEARCH_ENTRY_DEST_IP_127_96_OFFSET 0x00000010 132 #define RX_FLOW_SEARCH_ENTRY_DEST_IP_127_96_LSB 0 133 #define RX_FLOW_SEARCH_ENTRY_DEST_IP_127_96_MSB 31 134 #define RX_FLOW_SEARCH_ENTRY_DEST_IP_127_96_MASK 0xffffffff 135 136 137 138 139 #define RX_FLOW_SEARCH_ENTRY_DEST_IP_95_64_OFFSET 0x00000014 140 #define RX_FLOW_SEARCH_ENTRY_DEST_IP_95_64_LSB 0 141 #define RX_FLOW_SEARCH_ENTRY_DEST_IP_95_64_MSB 31 142 #define RX_FLOW_SEARCH_ENTRY_DEST_IP_95_64_MASK 0xffffffff 143 144 145 146 147 #define RX_FLOW_SEARCH_ENTRY_DEST_IP_63_32_OFFSET 0x00000018 148 #define RX_FLOW_SEARCH_ENTRY_DEST_IP_63_32_LSB 0 149 #define RX_FLOW_SEARCH_ENTRY_DEST_IP_63_32_MSB 31 150 #define RX_FLOW_SEARCH_ENTRY_DEST_IP_63_32_MASK 0xffffffff 151 152 153 154 155 #define RX_FLOW_SEARCH_ENTRY_DEST_IP_31_0_OFFSET 0x0000001c 156 #define RX_FLOW_SEARCH_ENTRY_DEST_IP_31_0_LSB 0 157 #define RX_FLOW_SEARCH_ENTRY_DEST_IP_31_0_MSB 31 158 #define RX_FLOW_SEARCH_ENTRY_DEST_IP_31_0_MASK 0xffffffff 159 160 161 162 163 #define RX_FLOW_SEARCH_ENTRY_SRC_PORT_OFFSET 0x00000020 164 #define RX_FLOW_SEARCH_ENTRY_SRC_PORT_LSB 0 165 #define RX_FLOW_SEARCH_ENTRY_SRC_PORT_MSB 15 166 #define RX_FLOW_SEARCH_ENTRY_SRC_PORT_MASK 0x0000ffff 167 168 169 170 171 #define RX_FLOW_SEARCH_ENTRY_DEST_PORT_OFFSET 0x00000020 172 #define RX_FLOW_SEARCH_ENTRY_DEST_PORT_LSB 16 173 #define RX_FLOW_SEARCH_ENTRY_DEST_PORT_MSB 31 174 #define RX_FLOW_SEARCH_ENTRY_DEST_PORT_MASK 0xffff0000 175 176 177 178 179 #define RX_FLOW_SEARCH_ENTRY_L4_PROTOCOL_OFFSET 0x00000024 180 #define RX_FLOW_SEARCH_ENTRY_L4_PROTOCOL_LSB 0 181 #define RX_FLOW_SEARCH_ENTRY_L4_PROTOCOL_MSB 7 182 #define RX_FLOW_SEARCH_ENTRY_L4_PROTOCOL_MASK 0x000000ff 183 184 185 186 187 #define RX_FLOW_SEARCH_ENTRY_VALID_OFFSET 0x00000024 188 #define RX_FLOW_SEARCH_ENTRY_VALID_LSB 8 189 #define RX_FLOW_SEARCH_ENTRY_VALID_MSB 8 190 #define RX_FLOW_SEARCH_ENTRY_VALID_MASK 0x00000100 191 192 193 194 195 #define RX_FLOW_SEARCH_ENTRY_RESERVED_9_OFFSET 0x00000024 196 #define RX_FLOW_SEARCH_ENTRY_RESERVED_9_LSB 9 197 #define RX_FLOW_SEARCH_ENTRY_RESERVED_9_MSB 12 198 #define RX_FLOW_SEARCH_ENTRY_RESERVED_9_MASK 0x00001e00 199 200 201 202 203 #define RX_FLOW_SEARCH_ENTRY_SERVICE_CODE_OFFSET 0x00000024 204 #define RX_FLOW_SEARCH_ENTRY_SERVICE_CODE_LSB 13 205 #define RX_FLOW_SEARCH_ENTRY_SERVICE_CODE_MSB 21 206 #define RX_FLOW_SEARCH_ENTRY_SERVICE_CODE_MASK 0x003fe000 207 208 209 210 211 #define RX_FLOW_SEARCH_ENTRY_PRIORITY_VALID_OFFSET 0x00000024 212 #define RX_FLOW_SEARCH_ENTRY_PRIORITY_VALID_LSB 22 213 #define RX_FLOW_SEARCH_ENTRY_PRIORITY_VALID_MSB 22 214 #define RX_FLOW_SEARCH_ENTRY_PRIORITY_VALID_MASK 0x00400000 215 216 217 218 219 #define RX_FLOW_SEARCH_ENTRY_USE_PPE_OFFSET 0x00000024 220 #define RX_FLOW_SEARCH_ENTRY_USE_PPE_LSB 23 221 #define RX_FLOW_SEARCH_ENTRY_USE_PPE_MSB 23 222 #define RX_FLOW_SEARCH_ENTRY_USE_PPE_MASK 0x00800000 223 224 225 226 227 #define RX_FLOW_SEARCH_ENTRY_REO_DESTINATION_INDICATION_OFFSET 0x00000024 228 #define RX_FLOW_SEARCH_ENTRY_REO_DESTINATION_INDICATION_LSB 24 229 #define RX_FLOW_SEARCH_ENTRY_REO_DESTINATION_INDICATION_MSB 28 230 #define RX_FLOW_SEARCH_ENTRY_REO_DESTINATION_INDICATION_MASK 0x1f000000 231 232 233 234 235 #define RX_FLOW_SEARCH_ENTRY_MSDU_DROP_OFFSET 0x00000024 236 #define RX_FLOW_SEARCH_ENTRY_MSDU_DROP_LSB 29 237 #define RX_FLOW_SEARCH_ENTRY_MSDU_DROP_MSB 29 238 #define RX_FLOW_SEARCH_ENTRY_MSDU_DROP_MASK 0x20000000 239 240 241 242 243 #define RX_FLOW_SEARCH_ENTRY_REO_DESTINATION_HANDLER_OFFSET 0x00000024 244 #define RX_FLOW_SEARCH_ENTRY_REO_DESTINATION_HANDLER_LSB 30 245 #define RX_FLOW_SEARCH_ENTRY_REO_DESTINATION_HANDLER_MSB 31 246 #define RX_FLOW_SEARCH_ENTRY_REO_DESTINATION_HANDLER_MASK 0xc0000000 247 248 249 250 251 #define RX_FLOW_SEARCH_ENTRY_METADATA_OFFSET 0x00000028 252 #define RX_FLOW_SEARCH_ENTRY_METADATA_LSB 0 253 #define RX_FLOW_SEARCH_ENTRY_METADATA_MSB 31 254 #define RX_FLOW_SEARCH_ENTRY_METADATA_MASK 0xffffffff 255 256 257 258 259 #define RX_FLOW_SEARCH_ENTRY_AGGREGATION_COUNT_OFFSET 0x0000002c 260 #define RX_FLOW_SEARCH_ENTRY_AGGREGATION_COUNT_LSB 0 261 #define RX_FLOW_SEARCH_ENTRY_AGGREGATION_COUNT_MSB 6 262 #define RX_FLOW_SEARCH_ENTRY_AGGREGATION_COUNT_MASK 0x0000007f 263 264 265 266 267 #define RX_FLOW_SEARCH_ENTRY_LRO_ELIGIBLE_OFFSET 0x0000002c 268 #define RX_FLOW_SEARCH_ENTRY_LRO_ELIGIBLE_LSB 7 269 #define RX_FLOW_SEARCH_ENTRY_LRO_ELIGIBLE_MSB 7 270 #define RX_FLOW_SEARCH_ENTRY_LRO_ELIGIBLE_MASK 0x00000080 271 272 273 274 275 #define RX_FLOW_SEARCH_ENTRY_MSDU_COUNT_OFFSET 0x0000002c 276 #define RX_FLOW_SEARCH_ENTRY_MSDU_COUNT_LSB 8 277 #define RX_FLOW_SEARCH_ENTRY_MSDU_COUNT_MSB 31 278 #define RX_FLOW_SEARCH_ENTRY_MSDU_COUNT_MASK 0xffffff00 279 280 281 282 283 #define RX_FLOW_SEARCH_ENTRY_MSDU_BYTE_COUNT_OFFSET 0x00000030 284 #define RX_FLOW_SEARCH_ENTRY_MSDU_BYTE_COUNT_LSB 0 285 #define RX_FLOW_SEARCH_ENTRY_MSDU_BYTE_COUNT_MSB 31 286 #define RX_FLOW_SEARCH_ENTRY_MSDU_BYTE_COUNT_MASK 0xffffffff 287 288 289 290 291 #define RX_FLOW_SEARCH_ENTRY_TIMESTAMP_OFFSET 0x00000034 292 #define RX_FLOW_SEARCH_ENTRY_TIMESTAMP_LSB 0 293 #define RX_FLOW_SEARCH_ENTRY_TIMESTAMP_MSB 31 294 #define RX_FLOW_SEARCH_ENTRY_TIMESTAMP_MASK 0xffffffff 295 296 297 298 299 #define RX_FLOW_SEARCH_ENTRY_CUMULATIVE_IP_LENGTH_PMAC1_OFFSET 0x00000038 300 #define RX_FLOW_SEARCH_ENTRY_CUMULATIVE_IP_LENGTH_PMAC1_LSB 0 301 #define RX_FLOW_SEARCH_ENTRY_CUMULATIVE_IP_LENGTH_PMAC1_MSB 15 302 #define RX_FLOW_SEARCH_ENTRY_CUMULATIVE_IP_LENGTH_PMAC1_MASK 0x0000ffff 303 304 305 306 307 #define RX_FLOW_SEARCH_ENTRY_CUMULATIVE_IP_LENGTH_OFFSET 0x00000038 308 #define RX_FLOW_SEARCH_ENTRY_CUMULATIVE_IP_LENGTH_LSB 16 309 #define RX_FLOW_SEARCH_ENTRY_CUMULATIVE_IP_LENGTH_MSB 31 310 #define RX_FLOW_SEARCH_ENTRY_CUMULATIVE_IP_LENGTH_MASK 0xffff0000 311 312 313 314 315 #define RX_FLOW_SEARCH_ENTRY_TCP_SEQUENCE_NUMBER_OFFSET 0x0000003c 316 #define RX_FLOW_SEARCH_ENTRY_TCP_SEQUENCE_NUMBER_LSB 0 317 #define RX_FLOW_SEARCH_ENTRY_TCP_SEQUENCE_NUMBER_MSB 31 318 #define RX_FLOW_SEARCH_ENTRY_TCP_SEQUENCE_NUMBER_MASK 0xffffffff 319 320 321 322 #endif 323