1 /* 2 * Copyright (c) 2016-2021 The Linux Foundation. All rights reserved. 3 * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved. 4 * 5 * Permission to use, copy, modify, and/or distribute this software for 6 * any purpose with or without fee is hereby granted, provided that the 7 * above copyright notice and this permission notice appear in all 8 * copies. 9 * 10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL 11 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED 12 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE 13 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL 14 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR 15 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 16 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 17 * PERFORMANCE OF THIS SOFTWARE. 18 */ 19 20 /** 21 * @file cdp_txrx_stats_struct.h 22 * @brief Define the host data path stats API functions 23 * called by the host control SW and the OS interface module 24 */ 25 #ifndef _CDP_TXRX_STATS_STRUCT_H_ 26 #define _CDP_TXRX_STATS_STRUCT_H_ 27 28 #include <qdf_types.h> 29 #include <cdp_txrx_hist_struct.h> 30 31 #define TXRX_STATS_LEVEL_OFF 0 32 #define TXRX_STATS_LEVEL_BASIC 1 33 #define TXRX_STATS_LEVEL_FULL 2 34 35 #define BSS_CHAN_INFO_READ 1 36 #define BSS_CHAN_INFO_READ_AND_CLEAR 2 37 38 #define TX_FRAME_TYPE_DATA 0 39 #define TX_FRAME_TYPE_MGMT 1 40 #define TX_FRAME_TYPE_BEACON 2 41 42 #ifndef TXRX_STATS_LEVEL 43 #define TXRX_STATS_LEVEL TXRX_STATS_LEVEL_BASIC 44 #endif 45 46 /* 1 additional MCS is for invalid values */ 47 #ifdef WLAN_FEATURE_11BE 48 #define MAX_MCS (16 + 1) 49 #define MAX_MCS_11BE 16 50 #define MAX_PUNCTURED_MODE 5 51 #else 52 #define MAX_MCS (14 + 1) 53 #endif 54 55 #define MCS_INVALID_ARRAY_INDEX MAX_MCS 56 #define MAX_MCS_11A 8 57 #define MAX_MCS_11B 7 58 #define MAX_MCS_11N 8 59 #define MAX_MCS_11AC 12 60 #define MAX_MCS_11AX 14 61 /* 1 additional GI is for invalid values */ 62 #define MAX_GI (4 + 1) 63 #define SS_COUNT 8 64 #define MAX_BW 8 65 #define MAX_RECEPTION_TYPES 4 66 67 #define CDP_MAX_RX_DEST_RINGS 8 68 #define CDP_MAX_TX_DATA_RINGS 5 69 #define CDP_MAX_WIFI_INT_ERROR_REASONS 5 70 /** 71 * This header file is being accessed in userspace applications. 72 * NR_CPUS is a linux kernel macro and cannot be accessible by user space apps. 73 * Defining maximum possible cpu count locally. 74 */ 75 #define CDP_NR_CPUS 8 76 77 #define MAX_TRANSMIT_TYPES 9 78 79 #define MAX_USER_POS 8 80 #define MAX_MU_GROUP_ID 64 81 82 #ifdef WLAN_FEATURE_11BE 83 #define MAX_RU_LOCATIONS 16 84 #else 85 #define MAX_RU_LOCATIONS 6 86 #endif 87 #define RU_26 1 88 #define RU_52 2 89 #define RU_106 4 90 #define RU_242 9 91 #define RU_484 18 92 #define RU_996 37 93 #ifdef WLAN_FEATURE_11BE 94 #define RU_2X996 74 95 #define RU_3X996 111 96 #define RU_4X996 148 97 #define RU_52_26 RU_52 + RU_26 98 #define RU_106_26 RU_106 + RU_26 99 #define RU_484_242 RU_484 + RU_242 100 #define RU_996_484 RU_996 + RU_484 101 #define RU_996_484_242 RU_996 + RU_484_242 102 #define RU_2X996_484 RU_2X996 + RU_484 103 #define RU_3X996_484 RU_3X996 + RU_484 104 #endif 105 106 107 /* WME stream classes */ 108 #define WME_AC_BE 0 /* best effort */ 109 #define WME_AC_BK 1 /* background */ 110 #define WME_AC_VI 2 /* video */ 111 #define WME_AC_VO 3 /* voice */ 112 #define WME_AC_MAX 4 /* MAX AC Value */ 113 114 #define CDP_MAX_RX_RINGS 8 /* max rx rings */ 115 #define CDP_MAX_TX_COMP_RINGS 5 /* max tx/completion rings */ 116 #define CDP_MAX_RX_WBM_RINGS 1 /* max rx wbm rings */ 117 118 #define CDP_MAX_TX_TQM_STATUS 9 /* max tx tqm completion status */ 119 #define CDP_MAX_TX_HTT_STATUS 7 /* max tx htt completion status */ 120 121 #define CDP_DMA_CODE_MAX 14 /* max rxdma error */ 122 #define CDP_REO_CODE_MAX 15 /* max reo error */ 123 124 #define CDP_MAX_LMACS 2 /* max lmacs */ 125 126 /* 127 * Max of TxRx context 128 */ 129 #define CDP_MAX_TXRX_CTX CDP_MAX_RX_RINGS 130 131 /* TID level VoW stats macros 132 * to add and get stats 133 */ 134 #define PFLOW_TXRX_TIDQ_STATS_ADD(_peer, _tid, _var, _val) \ 135 (((_peer)->tidq_stats[_tid]).stats[_var]) += _val 136 #define PFLOW_TXRX_TIDQ_STATS_GET(_peer, _tid, _var, _val) \ 137 ((_peer)->tidq_stats[_tid].stats[_var]) 138 /* 139 * Video only stats 140 */ 141 #define PFLOW_CTRL_PDEV_VIDEO_STATS_SET(_pdev, _var, _val) \ 142 (((_pdev)->vow.vistats[_var]).value) = _val 143 #define PFLOW_CTRL_PDEV_VIDEO_STATS_GET(_pdev, _var) \ 144 ((_pdev)->vow.vistats[_var].value) 145 #define PFLOW_CTRL_PDEV_VIDEO_STATS_ADD(_pdev, _var, _val) \ 146 (((_pdev)->vow.vistats[_var]).value) += _val 147 /* 148 * video delay stats 149 */ 150 #define PFLOW_CTRL_PDEV_DELAY_VIDEO_STATS_SET(_pdev, _var, _val) \ 151 (((_pdev)->vow.delaystats[_var]).value) = _val 152 #define PFLOW_CTRL_PDEV_DELAY_VIDEO_STATS_GET(_pdev, _var) \ 153 ((_pdev)->vow.delaystats[_var].value) 154 #define PFLOW_CTRL_PDEV_DELAY_VIDEO_STATS_ADD(_pdev, _var, _val) \ 155 (((_pdev)->vow.delaystats[_var]).value) += _val 156 /* 157 * Number of TLVs sent by FW. Needs to reflect 158 * HTT_PPDU_STATS_MAX_TAG declared in FW 159 */ 160 #define CDP_PPDU_STATS_MAX_TAG 14 161 #define CDP_MAX_DATA_TIDS 9 162 #define CDP_MAX_VOW_TID 4 163 164 #define CDP_MAX_TIDS 17 165 166 #define CDP_WDI_NUM_EVENTS WDI_NUM_EVENTS 167 168 #define CDP_FCTL_RETRY 0x0800 169 #define CDP_FC_IS_RETRY_SET(_fc) \ 170 ((_fc) & qdf_cpu_to_le16(CDP_FCTL_RETRY)) 171 172 #define CDP_INVALID_SNR 255 173 174 #define CDP_SNR_MULTIPLIER BIT(8) 175 #define CDP_SNR_MUL(x, mul) ((x) * (mul)) 176 #define CDP_SNR_RND(x, mul) ((((x) % (mul)) >= ((mul) / 2)) ?\ 177 ((x) + ((mul) - 1)) / (mul) : (x) / (mul)) 178 179 #define CDP_SNR_OUT(x) (CDP_SNR_RND((x), CDP_SNR_MULTIPLIER)) 180 #define CDP_SNR_IN(x) (CDP_SNR_MUL((x), CDP_SNR_MULTIPLIER)) 181 #define CDP_SNR_AVG(x, y) ((((x) << 2) + (y) - (x)) >> 2) 182 183 #define CDP_SNR_UPDATE_AVG(x, y) x = CDP_SNR_AVG((x), CDP_SNR_IN((y))) 184 185 /*Max SU EVM count */ 186 #define DP_RX_MAX_SU_EVM_COUNT 32 187 188 #define WDI_EVENT_BASE 0x100 189 190 #define CDP_TXRX_RATECODE_MCS_MASK 0xF 191 #define CDP_TXRX_RATECODE_NSS_MASK 0x3 192 #define CDP_TXRX_RATECODE_NSS_LSB 4 193 #define CDP_TXRX_RATECODE_PREM_MASK 0x3 194 #define CDP_TXRX_RATECODE_PREM_LSB 6 195 196 /* Below BW_GAIN should be added to the SNR value of every ppdu based on the 197 * bandwidth. This table is obtained from HALPHY. 198 * BW BW_Gain 199 * 20 0 200 * 40 3dBm 201 * 80 6dBm 202 * 160/80P80 9dBm 203 * 320 12dBm 204 */ 205 206 #define PKT_BW_GAIN_20MHZ 0 207 #define PKT_BW_GAIN_40MHZ 3 208 #define PKT_BW_GAIN_80MHZ 6 209 #define PKT_BW_GAIN_160MHZ 9 210 #ifdef WLAN_FEATURE_11BE 211 #define PKT_BW_GAIN_320MHZ 12 212 #endif 213 214 /** 215 * This enum is a direct replica of hal_rxdma_error_code enum. 216 * New element addition to the enum need to make a entry in this enum too. 217 * enum cdp_wifi_error_code - Code describing the type of WIFI error detected 218 * 219 * @CDP_WIFI_ERR_OVERFLOW: MPDU frame is not complete due to overflow 220 * @CDP_WIFI_ERR_MPDU_LENGTH: MPDU frame is not complete due to receiving 221 * incomplete MPDU from the PHY 222 * @CDP_WIFI_ERR_FCS: FCS check on the MPDU frame failed 223 * @CDP_WIFI_ERR_DECRYPT: Decryption error 224 * @CDP_WIFI_ERR_TKIP_MIC: TKIP MIC error 225 * @CDP_WIFI_ERR_UNENCRYPTED: Received a frame that was expected to be 226 * encrypted but wasn’t 227 * @CDP_WIFI_ERR_MSDU_LEN: MSDU related length error 228 * @CDP_WIFI_ERR_MSDU_LIMIT: Number of MSDUs in the MPDUs exceeded the max 229 * allowed 230 * @CDP_WIFI_ERR_WIFI_PARSE: Wifi parsing error 231 * @CDP_WIFI_ERR_AMSDU_PARSE: Amsdu parsing error 232 * @CDP_WIFI_ERR_SA_TIMEOUT: Source Address search timeout 233 * @CDP_WIFI_ERR_DA_TIMEOUT: Destination Address search timeout 234 * @CDP_WIFI_ERR_FLOW_TIMEOUT: Flow Search Timeout 235 * @CDP_WIFI_ERR_FLUSH_REQUEST: Flush request error 236 * @CDP_WIFI_ERR_AMSDU_FRAGMENT: Reported A-MSDU present along with a fragmented 237 * MPDU 238 * @CDP_WIFI_ERR_MULTICAST_ECHO: Reported a multicast echo error 239 * @CDP_WIFI_ERR_DUMMY: Dummy errors 240 */ 241 enum cdp_wifi_error_code { 242 CDP_WIFI_ERR_OVERFLOW = 0, 243 CDP_WIFI_ERR_MPDU_LENGTH, 244 CDP_WIFI_ERR_FCS, 245 CDP_WIFI_ERR_DECRYPT, 246 CDP_WIFI_ERR_TKIP_MIC, 247 CDP_WIFI_ERR_UNENCRYPTED, 248 CDP_WIFI_ERR_MSDU_LEN, 249 CDP_WIFI_ERR_MSDU_LIMIT, 250 CDP_WIFI_ERR_WIFI_PARSE, 251 CDP_WIFI_ERR_AMSDU_PARSE, 252 CDP_WIFI_ERR_SA_TIMEOUT, 253 CDP_WIFI_ERR_DA_TIMEOUT, 254 CDP_WIFI_ERR_FLOW_TIMEOUT, 255 CDP_WIFI_ERR_FLUSH_REQUEST, 256 CDP_WIFI_ERR_AMSDU_FRAGMENT, 257 CDP_WIFI_ERR_MULTICAST_ECHO, 258 CDP_WIFI_ERR_DUMMY = 31, 259 CDP_WIFI_ERR_MAX 260 }; 261 262 /** 263 * This enum is a direct replica of hal_reo_error_code enum. 264 * New element addition to the enum need to make a entry in this enum too. 265 * enum cdp_phy_rx_error_code - Error code describing the type of error detected 266 * 267 * @CDP_RX_ERR_QUEUE_ADDR_0: Rx queue descriptor is set to 0 268 * @CDP_RX_ERR_QUEUE_INVALID: Rx queue descriptor valid bit is NOT set 269 * @CDP_RX_ERR_AMPDU_IN_NON_BA: AMPDU frame received without BA session having 270 * been setup 271 * @CDP_RX_ERR_NON_BA_DUPLICATE: Non-BA session, SN equal to SSN retry bit set 272 * duplicate frame 273 * @CDP_RX_ERR_BA_DUPLICATE: BA session, duplicate frame 274 * @CDP_RX_ERR_REGULAR_FRAME_2K_JUMP: A normal management/data frame received 275 * with 2K jump in SN 276 * @CDP_RX_ERR_BAR_FRAME_2K_JUMP: A bar received with 2K jump in SSN 277 * @CDP_RX_ERR_REGULAR_FRAME_OOR: A normal management/data frame received with 278 * SN falling within the OOR window 279 * @CDP_RX_ERR_BAR_FRAME_OOR: A bar received with SSN falling within the OOR 280 * window 281 * @CDP_RX_ERR_BAR_FRAME_NO_BA_SESSION: A bar received without a BA session 282 * @CDP_RX_ERR_BAR_FRAME_SN_EQUALS_SSN: A bar received with SSN equal to SN 283 * @CDP_RX_ERR_PN_CHECK_FAILED: PN Check Failed packet 284 * @CDP_RX_ERR_2K_ERROR_HANDLING_FLAG_SET: Frame is forwarded as a result of 285 * the Seq_2k_error_detected_flag been set in the REO Queue descriptor 286 * @CDP_RX_ERR_PN_ERROR_HANDLING_FLAG_SET: Frame is forwarded as a result of 287 * the pn_error_detected_flag been set in the REO Queue descriptor 288 * @CDP_RX_ERR_QUEUE_BLOCKED_SET: Frame is forwarded as a result of the queue 289 * descriptor(address) being blocked as SW/FW seems to be currently in the 290 * process of making updates to this descriptor 291 */ 292 enum cdp_phy_rx_error_code { 293 CDP_RX_ERR_QUEUE_ADDR_0 = 0, 294 CDP_RX_ERR_QUEUE_INVALID, 295 CDP_RX_ERR_AMPDU_IN_NON_BA, 296 CDP_RX_ERR_NON_BA_DUPLICATE, 297 CDP_RX_ERR_BA_DUPLICATE, 298 CDP_RX_ERR_REGULAR_FRAME_2K_JUMP, 299 CDP_RX_ERR_BAR_FRAME_2K_JUMP, 300 CDP_RX_ERR_REGULAR_FRAME_OOR, 301 CDP_RX_ERR_BAR_FRAME_OOR, 302 CDP_RX_ERR_BAR_FRAME_NO_BA_SESSION, 303 CDP_RX_ERR_BAR_FRAME_SN_EQUALS_SSN, 304 CDP_RX_ERR_PN_CHECK_FAILED, 305 CDP_RX_ERR_2K_ERROR_HANDLING_FLAG_SET, 306 CDP_RX_ERR_PN_ERROR_HANDLING_FLAG_SET, 307 CDP_RX_ERR_QUEUE_BLOCKED_SET, 308 CDP_RX_ERR_MAX 309 }; 310 311 /* 312 * cdp_tx_transmit_type: Transmit type index 313 * SU: SU Transmit type index 314 * MU_MIMO: MU_MIMO Transmit type index 315 * MU_OFDMA: MU_OFDMA Transmit type index 316 * MU_MIMO_OFDMA: MU MIMO OFDMA Transmit type index 317 */ 318 enum cdp_tx_transmit_type { 319 SU = 0, 320 MU_MIMO, 321 MU_OFDMA, 322 MU_MIMO_OFDMA, 323 }; 324 325 /* 326 * cdp_ru_index: Different RU index 327 * 328 * RU_26_INDEX : 26-tone Resource Unit index 329 * RU_52_INDEX : 52-tone Resource Unit index 330 * RU_52_26_INDEX : 52_26-tone Resource Unit index 331 * RU_106_INDEX: 106-tone Resource Unit index 332 * RU_106_26_INDEX: 106_26-tone Resource Unit index 333 * RU_242_INDEX: 242-tone Resource Unit index 334 * RU_484_INDEX: 484-tone Resource Unit index 335 * RU_484_242_INDEX: 484_242-tone Resource Unit index 336 * RU_996_INDEX: 996-tone Resource Unit index 337 * RU_996_484_INDEX: 996_484-tone Resource Unit index 338 * RU_996_484_242_INDEX: 996_484_242-tone Resource Unit index 339 * RU_2X996_INDEX: 2X996-tone Resource Unit index 340 * RU_2X996_484_INDEX: 2X996_484-tone Resource Unit index 341 * RU_3X996_INDEX: 3X996-tone Resource Unit index 342 * RU_3X996_484_INDEX: 3X996_484-tone Resource Unit index 343 * RU_4X996_INDEX: 4X996-tone Resource Unit index 344 */ 345 346 #ifdef WLAN_FEATURE_11BE 347 enum cdp_ru_index { 348 RU_26_INDEX = 0, 349 RU_52_INDEX, 350 RU_52_26_INDEX, 351 RU_106_INDEX, 352 RU_106_26_INDEX, 353 RU_242_INDEX, 354 RU_484_INDEX, 355 RU_484_242_INDEX, 356 RU_996_INDEX, 357 RU_996_484_INDEX, 358 RU_996_484_242_INDEX, 359 RU_2X996_INDEX, 360 RU_2X996_484_INDEX, 361 RU_3X996_INDEX, 362 RU_3X996_484_INDEX, 363 RU_4X996_INDEX, 364 RU_INDEX_MAX, 365 }; 366 #else 367 enum cdp_ru_index { 368 RU_26_INDEX = 0, 369 RU_52_INDEX, 370 RU_106_INDEX, 371 RU_242_INDEX, 372 RU_484_INDEX, 373 RU_996_INDEX, 374 RU_INDEX_MAX, 375 }; 376 #endif 377 378 struct cdp_ru_debug { 379 char *ru_type; 380 }; 381 382 #ifdef WLAN_FEATURE_11BE 383 static const struct cdp_ru_debug cdp_ru_string[RU_INDEX_MAX] = { 384 { "RU_26" }, 385 { "RU_52" }, 386 { "RU_52_26" }, 387 { "RU_106" }, 388 { "RU_106_26" }, 389 { "RU_242" }, 390 { "RU_484" }, 391 { "RU_484_242" }, 392 { "RU_996" }, 393 { "RU_996_484" }, 394 { "RU_996_484_242" }, 395 { "RU_2x996" }, 396 { "RU_2x996_484" }, 397 { "RU_3x996" }, 398 { "RU_3x996_484" }, 399 { "RU_4x996" }, 400 }; 401 #else 402 static const struct cdp_ru_debug cdp_ru_string[RU_INDEX_MAX] = { 403 { "RU_26" }, 404 { "RU_52" }, 405 { "RU_106" }, 406 { "RU_242" }, 407 { "RU_484" }, 408 { "RU_996" } 409 }; 410 #endif 411 412 #ifdef FEATURE_TSO_STATS 413 /* Number of TSO Packet Statistics captured */ 414 #define CDP_MAX_TSO_PACKETS 5 415 /* Information for Number of Segments for a TSO Packet captured */ 416 #define CDP_MAX_TSO_SEGMENTS 2 417 /* Information for Number of Fragments for a TSO Segment captured */ 418 #define CDP_MAX_TSO_FRAGMENTS 6 419 #endif /* FEATURE_TSO_STATS */ 420 421 /* Different Packet Types */ 422 enum cdp_packet_type { 423 DOT11_A = 0, 424 DOT11_B = 1, 425 DOT11_N = 2, 426 DOT11_AC = 3, 427 DOT11_AX = 4, 428 #ifdef WLAN_FEATURE_11BE 429 DOT11_BE = 5, 430 #endif 431 DOT11_MAX, 432 }; 433 434 #define MCS_VALID 1 435 #define MCS_INVALID 0 436 437 #ifdef WLAN_FEATURE_11BE 438 #define CDP_IS_PKT_TYPE_SUPPORT_NSS(_pkt_type) \ 439 (DOT11_N == (_pkt_type) || DOT11_AC == (_pkt_type) || \ 440 DOT11_AX == (_pkt_type) || DOT11_BE == (_pkt_type)) 441 #else 442 #define CDP_IS_PKT_TYPE_SUPPORT_NSS(_pkt_type) \ 443 (DOT11_N == (_pkt_type) || DOT11_AC == (_pkt_type) || \ 444 DOT11_AX == (_pkt_type)) 445 #endif /* WLAN_FEATURE_11BE */ 446 447 #define CDP_MAX_MCS_STRING_LEN 34 448 /* 449 * struct cdp_rate_debug 450 * 451 * @mcs_type: print string for a given mcs 452 * @valid: valid mcs rate? 453 */ 454 struct cdp_rate_debug { 455 char mcs_type[CDP_MAX_MCS_STRING_LEN]; 456 uint8_t valid; 457 }; 458 459 #ifdef WLAN_FEATURE_11BE 460 static const struct cdp_rate_debug cdp_rate_string[DOT11_MAX][MAX_MCS] = { 461 { 462 {"OFDM 48 Mbps", MCS_VALID}, 463 {"OFDM 24 Mbps", MCS_VALID}, 464 {"OFDM 12 Mbps", MCS_VALID}, 465 {"OFDM 6 Mbps ", MCS_VALID}, 466 {"OFDM 54 Mbps", MCS_VALID}, 467 {"OFDM 36 Mbps", MCS_VALID}, 468 {"OFDM 18 Mbps", MCS_VALID}, 469 {"OFDM 9 Mbps ", MCS_VALID}, 470 {"INVALID ", MCS_INVALID}, 471 {"INVALID ", MCS_INVALID}, 472 {"INVALID ", MCS_INVALID}, 473 {"INVALID ", MCS_INVALID}, 474 {"INVALID ", MCS_INVALID}, 475 {"INVALID ", MCS_INVALID}, 476 {"INVALID ", MCS_INVALID}, 477 {"INVALID ", MCS_INVALID}, 478 {"INVALID ", MCS_INVALID}, 479 }, 480 { 481 {"CCK 11 Mbps Long ", MCS_VALID}, 482 {"CCK 5.5 Mbps Long ", MCS_VALID}, 483 {"CCK 2 Mbps Long ", MCS_VALID}, 484 {"CCK 1 Mbps Long ", MCS_VALID}, 485 {"CCK 11 Mbps Short ", MCS_VALID}, 486 {"CCK 5.5 Mbps Short", MCS_VALID}, 487 {"CCK 2 Mbps Short ", MCS_VALID}, 488 {"INVALID ", MCS_INVALID}, 489 {"INVALID ", MCS_INVALID}, 490 {"INVALID ", MCS_INVALID}, 491 {"INVALID ", MCS_INVALID}, 492 {"INVALID ", MCS_INVALID}, 493 {"INVALID ", MCS_INVALID}, 494 {"INVALID ", MCS_INVALID}, 495 {"INVALID ", MCS_INVALID}, 496 {"INVALID ", MCS_INVALID}, 497 {"INVALID ", MCS_INVALID}, 498 }, 499 { 500 {"HT MCS 0 (BPSK 1/2) ", MCS_VALID}, 501 {"HT MCS 1 (QPSK 1/2) ", MCS_VALID}, 502 {"HT MCS 2 (QPSK 3/4) ", MCS_VALID}, 503 {"HT MCS 3 (16-QAM 1/2)", MCS_VALID}, 504 {"HT MCS 4 (16-QAM 3/4)", MCS_VALID}, 505 {"HT MCS 5 (64-QAM 2/3)", MCS_VALID}, 506 {"HT MCS 6 (64-QAM 3/4)", MCS_VALID}, 507 {"HT MCS 7 (64-QAM 5/6)", MCS_VALID}, 508 {"INVALID ", MCS_INVALID}, 509 {"INVALID ", MCS_INVALID}, 510 {"INVALID ", MCS_INVALID}, 511 {"INVALID ", MCS_INVALID}, 512 {"INVALID ", MCS_INVALID}, 513 {"INVALID ", MCS_INVALID}, 514 {"INVALID ", MCS_INVALID}, 515 {"INVALID ", MCS_INVALID}, 516 {"INVALID ", MCS_INVALID}, 517 }, 518 { 519 {"VHT MCS 0 (BPSK 1/2) ", MCS_VALID}, 520 {"VHT MCS 1 (QPSK 1/2) ", MCS_VALID}, 521 {"VHT MCS 2 (QPSK 3/4) ", MCS_VALID}, 522 {"VHT MCS 3 (16-QAM 1/2) ", MCS_VALID}, 523 {"VHT MCS 4 (16-QAM 3/4) ", MCS_VALID}, 524 {"VHT MCS 5 (64-QAM 2/3) ", MCS_VALID}, 525 {"VHT MCS 6 (64-QAM 3/4) ", MCS_VALID}, 526 {"VHT MCS 7 (64-QAM 5/6) ", MCS_VALID}, 527 {"VHT MCS 8 (256-QAM 3/4) ", MCS_VALID}, 528 {"VHT MCS 9 (256-QAM 5/6) ", MCS_VALID}, 529 {"VHT MCS 10 (1024-QAM 3/4)", MCS_VALID}, 530 {"VHT MCS 11 (1024-QAM 5/6)", MCS_VALID}, 531 {"INVALID ", MCS_INVALID}, 532 {"INVALID ", MCS_INVALID}, 533 {"INVALID ", MCS_INVALID}, 534 {"INVALID ", MCS_INVALID}, 535 }, 536 { 537 {"HE MCS 0 (BPSK 1/2) ", MCS_VALID}, 538 {"HE MCS 1 (QPSK 1/2) ", MCS_VALID}, 539 {"HE MCS 2 (QPSK 3/4) ", MCS_VALID}, 540 {"HE MCS 3 (16-QAM 1/2) ", MCS_VALID}, 541 {"HE MCS 4 (16-QAM 3/4) ", MCS_VALID}, 542 {"HE MCS 5 (64-QAM 2/3) ", MCS_VALID}, 543 {"HE MCS 6 (64-QAM 3/4) ", MCS_VALID}, 544 {"HE MCS 7 (64-QAM 5/6) ", MCS_VALID}, 545 {"HE MCS 8 (256-QAM 3/4) ", MCS_VALID}, 546 {"HE MCS 9 (256-QAM 5/6) ", MCS_VALID}, 547 {"HE MCS 10 (1024-QAM 3/4)", MCS_VALID}, 548 {"HE MCS 11 (1024-QAM 5/6)", MCS_VALID}, 549 {"HE MCS 12 (4096-QAM 3/4)", MCS_VALID}, 550 {"HE MCS 13 (4096-QAM 5/6)", MCS_VALID}, 551 {"INVALID ", MCS_INVALID}, 552 {"INVALID ", MCS_INVALID}, 553 {"INVALID ", MCS_INVALID}, 554 }, 555 { 556 {"EHT MCS 0 (BPSK 1/2) ", MCS_VALID}, 557 {"EHT MCS 1 (QPSK 1/2) ", MCS_VALID}, 558 {"EHT MCS 2 (QPSK 3/4) ", MCS_VALID}, 559 {"EHT MCS 3 (16-QAM 1/2) ", MCS_VALID}, 560 {"EHT MCS 4 (16-QAM 3/4) ", MCS_VALID}, 561 {"EHT MCS 5 (64-QAM 2/3) ", MCS_VALID}, 562 {"EHT MCS 6 (64-QAM 3/4) ", MCS_VALID}, 563 {"EHT MCS 7 (64-QAM 5/6) ", MCS_VALID}, 564 {"EHT MCS 8 (256-QAM 3/4) ", MCS_VALID}, 565 {"EHT MCS 9 (256-QAM 5/6) ", MCS_VALID}, 566 {"EHT MCS 10 (1024-QAM 3/4)", MCS_VALID}, 567 {"EHT MCS 11 (1024-QAM 5/6)", MCS_VALID}, 568 {"EHT MCS 12 (4096-QAM 3/4)", MCS_VALID}, 569 {"EHT MCS 13 (4096-QAM 5/6)", MCS_VALID}, 570 {"EHT MCS 14 (BPSK-DCM 1/2)", MCS_VALID}, 571 {"EHT MCS 15 (BPSK-DCM 1/2)", MCS_VALID}, 572 {"INVALID ", MCS_INVALID}, 573 } 574 }; 575 #else 576 static const struct cdp_rate_debug cdp_rate_string[DOT11_MAX][MAX_MCS] = { 577 { 578 {"OFDM 48 Mbps", MCS_VALID}, 579 {"OFDM 24 Mbps", MCS_VALID}, 580 {"OFDM 12 Mbps", MCS_VALID}, 581 {"OFDM 6 Mbps ", MCS_VALID}, 582 {"OFDM 54 Mbps", MCS_VALID}, 583 {"OFDM 36 Mbps", MCS_VALID}, 584 {"OFDM 18 Mbps", MCS_VALID}, 585 {"OFDM 9 Mbps ", MCS_VALID}, 586 {"INVALID ", MCS_INVALID}, 587 {"INVALID ", MCS_INVALID}, 588 {"INVALID ", MCS_INVALID}, 589 {"INVALID ", MCS_INVALID}, 590 {"INVALID ", MCS_INVALID}, 591 }, 592 { 593 {"CCK 11 Mbps Long ", MCS_VALID}, 594 {"CCK 5.5 Mbps Long ", MCS_VALID}, 595 {"CCK 2 Mbps Long ", MCS_VALID}, 596 {"CCK 1 Mbps Long ", MCS_VALID}, 597 {"CCK 11 Mbps Short ", MCS_VALID}, 598 {"CCK 5.5 Mbps Short", MCS_VALID}, 599 {"CCK 2 Mbps Short ", MCS_VALID}, 600 {"INVALID ", MCS_INVALID}, 601 {"INVALID ", MCS_INVALID}, 602 {"INVALID ", MCS_INVALID}, 603 {"INVALID ", MCS_INVALID}, 604 {"INVALID ", MCS_INVALID}, 605 {"INVALID ", MCS_INVALID}, 606 }, 607 { 608 {"HT MCS 0 (BPSK 1/2) ", MCS_VALID}, 609 {"HT MCS 1 (QPSK 1/2) ", MCS_VALID}, 610 {"HT MCS 2 (QPSK 3/4) ", MCS_VALID}, 611 {"HT MCS 3 (16-QAM 1/2)", MCS_VALID}, 612 {"HT MCS 4 (16-QAM 3/4)", MCS_VALID}, 613 {"HT MCS 5 (64-QAM 2/3)", MCS_VALID}, 614 {"HT MCS 6 (64-QAM 3/4)", MCS_VALID}, 615 {"HT MCS 7 (64-QAM 5/6)", MCS_VALID}, 616 {"INVALID ", MCS_INVALID}, 617 {"INVALID ", MCS_INVALID}, 618 {"INVALID ", MCS_INVALID}, 619 {"INVALID ", MCS_INVALID}, 620 {"INVALID ", MCS_INVALID}, 621 }, 622 { 623 {"VHT MCS 0 (BPSK 1/2) ", MCS_VALID}, 624 {"VHT MCS 1 (QPSK 1/2) ", MCS_VALID}, 625 {"VHT MCS 2 (QPSK 3/4) ", MCS_VALID}, 626 {"VHT MCS 3 (16-QAM 1/2) ", MCS_VALID}, 627 {"VHT MCS 4 (16-QAM 3/4) ", MCS_VALID}, 628 {"VHT MCS 5 (64-QAM 2/3) ", MCS_VALID}, 629 {"VHT MCS 6 (64-QAM 3/4) ", MCS_VALID}, 630 {"VHT MCS 7 (64-QAM 5/6) ", MCS_VALID}, 631 {"VHT MCS 8 (256-QAM 3/4) ", MCS_VALID}, 632 {"VHT MCS 9 (256-QAM 5/6) ", MCS_VALID}, 633 {"VHT MCS 10 (1024-QAM 3/4)", MCS_VALID}, 634 {"VHT MCS 11 (1024-QAM 5/6)", MCS_VALID}, 635 {"INVALID ", MCS_INVALID}, 636 }, 637 { 638 {"HE MCS 0 (BPSK 1/2) ", MCS_VALID}, 639 {"HE MCS 1 (QPSK 1/2) ", MCS_VALID}, 640 {"HE MCS 2 (QPSK 3/4) ", MCS_VALID}, 641 {"HE MCS 3 (16-QAM 1/2) ", MCS_VALID}, 642 {"HE MCS 4 (16-QAM 3/4) ", MCS_VALID}, 643 {"HE MCS 5 (64-QAM 2/3) ", MCS_VALID}, 644 {"HE MCS 6 (64-QAM 3/4) ", MCS_VALID}, 645 {"HE MCS 7 (64-QAM 5/6) ", MCS_VALID}, 646 {"HE MCS 8 (256-QAM 3/4) ", MCS_VALID}, 647 {"HE MCS 9 (256-QAM 5/6) ", MCS_VALID}, 648 {"HE MCS 10 (1024-QAM 3/4)", MCS_VALID}, 649 {"HE MCS 11 (1024-QAM 5/6)", MCS_VALID}, 650 {"HE MCS 12 (4096-QAM 3/4)", MCS_VALID}, 651 {"HE MCS 13 (4096-QAM 5/6)", MCS_VALID}, 652 {"INVALID ", MCS_INVALID}, 653 } 654 }; 655 #endif 656 657 /* 658 * cdp_mu_packet_type: MU type index 659 * TXRX_TYPE_MU_MIMO: MU MIMO type index 660 * TXRX_TYPE_MU_OFDMA: MU OFDMA type index 661 * TXRX_TYPE_MU_MAX: MU MAX type index 662 */ 663 enum cdp_mu_packet_type { 664 TXRX_TYPE_MU_MIMO = 0, 665 TXRX_TYPE_MU_OFDMA = 1, 666 TXRX_TYPE_MU_MAX = 2, 667 }; 668 669 /* 670 * peer_stats_type: peer stats type 671 * PEER_TX_STATS: stats type for tx 672 * PEER_RX_STATS: stats type for rx 673 */ 674 enum peer_stats_type { 675 PEER_TX_STATS, 676 PEER_RX_STATS, 677 }; 678 679 enum WDI_EVENT { 680 WDI_EVENT_TX_STATUS = WDI_EVENT_BASE, 681 WDI_EVENT_OFFLOAD_ALL, 682 WDI_EVENT_RX_DESC_REMOTE, 683 WDI_EVENT_RX_PEER_INVALID, 684 WDI_EVENT_DBG_PRINT, /* NEED to integrate pktlog changes*/ 685 WDI_EVENT_RX_CBF_REMOTE, 686 WDI_EVENT_RATE_FIND, 687 WDI_EVENT_RATE_UPDATE, 688 WDI_EVENT_SW_EVENT, 689 WDI_EVENT_RX_DESC, 690 WDI_EVENT_LITE_T2H, 691 WDI_EVENT_LITE_RX, 692 WDI_EVENT_RX_PPDU_DESC, 693 WDI_EVENT_TX_PPDU_DESC, 694 WDI_EVENT_TX_MSDU_DESC, 695 WDI_EVENT_TX_DATA, 696 WDI_EVENT_RX_DATA, 697 WDI_EVENT_TX_MGMT_CTRL, 698 WDI_EVENT_TX_PKT_CAPTURE, 699 WDI_EVENT_HTT_STATS, 700 WDI_EVENT_TX_BEACON, 701 WDI_EVENT_PEER_STATS, 702 WDI_EVENT_TX_SOJOURN_STAT, 703 WDI_EVENT_UPDATE_DP_STATS, 704 WDI_EVENT_RX_MGMT_CTRL, 705 WDI_EVENT_PEER_CREATE, 706 WDI_EVENT_PEER_DESTROY, 707 WDI_EVENT_PEER_FLUSH_RATE_STATS, 708 WDI_EVENT_FLUSH_RATE_STATS_REQ, 709 WDI_EVENT_RX_MPDU, 710 WDI_EVENT_HMWDS_AST_ADD_STATUS, 711 WDI_EVENT_PEER_QOS_STATS, 712 WDI_EVENT_PKT_CAPTURE_TX_DATA, 713 WDI_EVENT_PKT_CAPTURE_RX_DATA, 714 WDI_EVENT_PKT_CAPTURE_RX_DATA_NO_PEER, 715 WDI_EVENT_PKT_CAPTURE_OFFLOAD_TX_DATA, 716 WDI_EVENT_RX_CBF, 717 WDI_EVENT_PKT_CAPTURE_PPDU_STATS, 718 WDI_EVENT_HOST_SW_EVENT, 719 WDI_EVENT_HYBRID_TX, 720 #ifdef WLAN_FEATURE_11BE_MLO 721 WDI_EVENT_MLO_TSTMP, 722 #endif 723 #ifdef QCA_UNDECODED_METADATA_SUPPORT 724 WDI_EVENT_RX_PPDU_DESC_UNDECODED_METADATA, 725 #endif 726 WDI_EVENT_LITE_MON_RX, 727 WDI_EVENT_LITE_MON_TX, 728 /* End of new event items */ 729 WDI_EVENT_LAST 730 }; 731 732 #define WDI_NUM_EVENTS WDI_EVENT_LAST - WDI_EVENT_BASE 733 734 struct cdp_stats_extd { 735 }; 736 737 /* TID level Tx/Rx stats 738 * 739 */ 740 enum cdp_txrx_tidq_stats { 741 /* Tx Counters */ 742 TX_MSDU_TOTAL_LINUX_SUBSYSTEM, 743 TX_MSDU_TOTAL_FROM_OSIF, 744 TX_MSDU_TX_COMP_PKT_CNT, 745 /* Rx Counters */ 746 RX_MSDU_TOTAL_FROM_FW, 747 RX_MSDU_MCAST_FROM_FW, 748 RX_TID_MISMATCH_FROM_FW, 749 RX_MSDU_MISC_PKTS, 750 RX_MSDU_IS_ARP, 751 RX_MSDU_IS_EAP, 752 RX_MSDU_IS_DHCP, 753 RX_AGGREGATE_10, 754 RX_AGGREGATE_20, 755 RX_AGGREGATE_30, 756 RX_AGGREGATE_40, 757 RX_AGGREGATE_50, 758 RX_AGGREGATE_60, 759 RX_AGGREGATE_MORE, 760 RX_AMSDU_1, 761 RX_AMSDU_2, 762 RX_AMSDU_3, 763 RX_AMSDU_4, 764 RX_AMSDU_MORE, 765 RX_MSDU_CHAINED_FROM_FW, 766 RX_MSDU_REORDER_FAILED_FROM_FW, 767 RX_MSDU_REORDER_FLUSHED_FROM_FW, 768 RX_MSDU_DISCARD_FROM_FW, 769 RX_MSDU_DUPLICATE_FROM_FW, 770 RX_MSDU_DELIVERED_TO_STACK, 771 TIDQ_STATS_MAX, 772 }; 773 774 struct cdp_tidq_stats { 775 uint32_t stats[TIDQ_STATS_MAX]; 776 }; 777 778 #if defined(WLAN_CFR_ENABLE) && defined(WLAN_ENH_CFR_ENABLE) 779 /** 780 * struct cdp_rx_ppdu_cfr_info - struct for storing ppdu info extracted from HW 781 * TLVs, this will be used for CFR correlation 782 * 783 * @bb_captured_channel : Set by RXPCU when MACRX_FREEZE_CAPTURE_CHANNEL TLV is 784 * sent to PHY, SW checks it to correlate current PPDU TLVs with uploaded 785 * channel information. 786 * 787 * @bb_captured_timeout : Set by RxPCU to indicate channel capture condition is 788 * met, but MACRX_FREEZE_CAPTURE_CHANNEL is not sent to PHY due to AST delay, 789 * which means the rx_frame_falling edge to FREEZE TLV ready time exceeds 790 * the threshold time defined by RXPCU register FREEZE_TLV_DELAY_CNT_THRESH. 791 * Bb_captured_reason is still valid in this case. 792 * 793 * @bb_captured_reason : Copy capture_reason of MACRX_FREEZE_CAPTURE_CHANNEL 794 * TLV to here for FW usage. Valid when bb_captured_channel or 795 * bb_captured_timeout is set. 796 * <enum 0 freeze_reason_TM> 797 * <enum 1 freeze_reason_FTM> 798 * <enum 2 freeze_reason_ACK_resp_to_TM_FTM> 799 * <enum 3 freeze_reason_TA_RA_TYPE_FILTER> 800 * <enum 4 freeze_reason_NDPA_NDP> 801 * <enum 5 freeze_reason_ALL_PACKET> 802 * <legal 0-5> 803 * 804 * @rx_location_info_valid: Indicates whether CFR DMA address in the PPDU TLV 805 * is valid 806 * <enum 0 rx_location_info_is_not_valid> 807 * <enum 1 rx_location_info_is_valid> 808 * <legal all> 809 * 810 * @chan_capture_status : capture status reported by ucode 811 * a. CAPTURE_IDLE: FW has disabled "REPETITIVE_CHE_CAPTURE_CTRL" 812 * b. CAPTURE_BUSY: previous PPDU’s channel capture upload DMA ongoing. (Note 813 * that this upload is triggered after receiving freeze_channel_capture TLV 814 * after last PPDU is rx) 815 * c. CAPTURE_ACTIVE: channel capture is enabled and no previous channel 816 * capture ongoing 817 * d. CAPTURE_NO_BUFFER: next buffer in IPC ring not available 818 * 819 * @rtt_che_buffer_pointer_high8 : The high 8 bits of the 40 bits pointer to 820 * external RTT channel information buffer 821 * 822 * @rtt_che_buffer_pointer_low32 : The low 32 bits of the 40 bits pointer to 823 * external RTT channel information buffer 824 * 825 * @rtt_cfo_measurement : raw cfo data extracted from hardware, which is 14 bit 826 * signed number. The first bit used for sign representation and 13 bits for 827 * fractional part. 828 * 829 * @agc_gain_info0: Chain 0 & chain 1 agc gain information reported by PHY 830 * 831 * @agc_gain_info1: Chain 2 & chain 3 agc gain information reported by PHY 832 * 833 * @agc_gain_info2: Chain 4 & chain 5 agc gain information reported by PHY 834 * 835 * @agc_gain_info3: Chain 6 & chain 7 agc gain information reported by PHY 836 * 837 * @rx_start_ts: Rx packet timestamp, the time the first L-STF ADC sample 838 * arrived at Rx antenna. 839 * 840 * @mcs_rate: Indicates the mcs/rate in which packet is received. 841 * If HT, 842 * 0-7: MCS0-MCS7 843 * If VHT, 844 * 0-9: MCS0 to MCS9 845 * If HE, 846 * 0-11: MCS0 to MCS11, 847 * 12-13: 4096QAM, 848 * 14-15: reserved 849 * If Legacy, 850 * 0: 48 Mbps 851 * 1: 24 Mbps 852 * 2: 12 Mbps 853 * 3: 6 Mbps 854 * 4: 54 Mbps 855 * 5: 36 Mbps 856 * 6: 18 Mbps 857 * 7: 9 Mbps 858 * 859 * @gi_type: Indicates the gaurd interval. 860 * 0: 0.8 us 861 * 1: 0.4 us 862 * 2: 1.6 us 863 * 3: 3.2 us 864 */ 865 struct cdp_rx_ppdu_cfr_info { 866 bool bb_captured_channel; 867 bool bb_captured_timeout; 868 uint8_t bb_captured_reason; 869 bool rx_location_info_valid; 870 uint8_t chan_capture_status; 871 uint8_t rtt_che_buffer_pointer_high8; 872 uint32_t rtt_che_buffer_pointer_low32; 873 int16_t rtt_cfo_measurement; 874 uint32_t agc_gain_info0; 875 uint32_t agc_gain_info1; 876 uint32_t agc_gain_info2; 877 uint32_t agc_gain_info3; 878 uint32_t rx_start_ts; 879 uint32_t mcs_rate; 880 uint32_t gi_type; 881 }; 882 #endif 883 /* 884 * struct cdp_rx_su_evm_info: Rx evm info 885 * @number_of_symbols: number of symbols 886 * @nss_count: number of spatial streams 887 * @pilot_count: number of pilot count 888 */ 889 struct cdp_rx_su_evm_info { 890 uint16_t number_of_symbols; 891 uint8_t nss_count; 892 uint8_t pilot_count; 893 uint32_t pilot_evm[DP_RX_MAX_SU_EVM_COUNT]; 894 }; 895 896 /* 897 * cdp_delay_stats_mode: Different types of delay statistics 898 * 899 * @CDP_DELAY_STATS_SW_ENQ: Stack to hw enqueue delay 900 * @CDP_DELAY_STATS_TX_INTERFRAME: Interframe delay at radio entry point 901 * @CDP_DELAY_STATS_FW_HW_TRANSMIT: Hw enqueue to tx completion delay 902 * @CDP_DELAY_STATS_REAP_STACK: Delay in ring reap to indicating network stack 903 * @CDP_DELAY_STATS_RX_INTERFRAME: Rx inteframe delay 904 * @CDP_DELAY_STATS_MODE_MAX: Maximum delay mode 905 */ 906 enum cdp_delay_stats_mode { 907 CDP_DELAY_STATS_SW_ENQ, 908 CDP_DELAY_STATS_TX_INTERFRAME, 909 CDP_DELAY_STATS_FW_HW_TRANSMIT, 910 CDP_DELAY_STATS_REAP_STACK, 911 CDP_DELAY_STATS_RX_INTERFRAME, 912 CDP_DELAY_STATS_MODE_MAX, 913 }; 914 915 /* 916 * cdp_delay_bucket_index 917 * Index to be used for all delay stats 918 */ 919 enum cdp_delay_bucket_index { 920 CDP_DELAY_BUCKET_0, 921 CDP_DELAY_BUCKET_1, 922 CDP_DELAY_BUCKET_2, 923 CDP_DELAY_BUCKET_3, 924 CDP_DELAY_BUCKET_4, 925 CDP_DELAY_BUCKET_5, 926 CDP_DELAY_BUCKET_6, 927 CDP_DELAY_BUCKET_7, 928 CDP_DELAY_BUCKET_8, 929 CDP_DELAY_BUCKET_9, 930 CDP_DELAY_BUCKET_10, 931 CDP_DELAY_BUCKET_11, 932 CDP_DELAY_BUCKET_12, 933 CDP_DELAY_BUCKET_MAX, 934 }; 935 936 /* 937 * struct cdp_tx_host_drop - packet drop due to following reasons. 938 */ 939 enum cdp_tx_sw_drop { 940 TX_DESC_ERR, 941 TX_HAL_RING_ACCESS_ERR, 942 TX_DMA_MAP_ERR, 943 TX_HW_ENQUEUE, 944 TX_SW_ENQUEUE, 945 TX_MAX_DROP, 946 }; 947 948 /* 949 * struct cdp_rx_host_drop - packet drop due to following reasons. 950 */ 951 enum cdp_rx_sw_drop { 952 INTRABSS_DROP, 953 MSDU_DONE_FAILURE, 954 INVALID_PEER_VDEV, 955 POLICY_CHECK_DROP, 956 MEC_DROP, 957 NAWDS_MCAST_DROP, 958 MESH_FILTER_DROP, 959 ENQUEUE_DROP, 960 RX_MAX_DROP, 961 }; 962 963 /* 964 * struct cdp_delay_stats 965 * @delay_bucket: division of buckets as per latency 966 * @min_delay: minimum delay 967 * @max_delay: maximum delay 968 * @avg_delay: average delay 969 */ 970 struct cdp_delay_stats { 971 uint64_t delay_bucket[CDP_DELAY_BUCKET_MAX]; 972 uint32_t min_delay; 973 uint32_t max_delay; 974 uint32_t avg_delay; 975 }; 976 977 /* 978 * struct cdp_tid_tx_stats 979 * @swq_delay: delay between wifi driver entry point and enqueue to HW in tx 980 * @hwtx_delay: delay between wifi driver exit (enqueue to HW) and tx completion 981 * @intfrm_delay: interframe delay 982 * @success_cnt: total successful transmit count 983 * @comp_fail_cnt: firmware drop found in tx completion path 984 * @swdrop_cnt: software drop in tx path 985 * @tqm_status_cnt: TQM completion status count 986 * @htt_status_cnt: HTT completion status count 987 */ 988 struct cdp_tid_tx_stats { 989 struct cdp_delay_stats swq_delay; 990 struct cdp_delay_stats hwtx_delay; 991 struct cdp_delay_stats intfrm_delay; 992 uint64_t success_cnt; 993 uint64_t comp_fail_cnt; 994 uint64_t swdrop_cnt[TX_MAX_DROP]; 995 uint64_t tqm_status_cnt[CDP_MAX_TX_TQM_STATUS]; 996 uint64_t htt_status_cnt[CDP_MAX_TX_HTT_STATUS]; 997 }; 998 999 /* 1000 * cdp_reo_error_stats 1001 * @err_src_reo_code_inv: Wireless Buffer Manager source receive reorder ring reason unknown 1002 * @err_reo_codes: Receive reoder error codes 1003 */ 1004 struct cdp_reo_error_stats { 1005 uint64_t err_src_reo_code_inv; 1006 uint64_t err_reo_codes[CDP_REO_CODE_MAX]; 1007 }; 1008 1009 /* 1010 * cdp_rxdma_error_stats 1011 * @err_src_rxdma_code_inv: DMA reason unknown count 1012 * @err_reo_codes: Receive reoder error codes count 1013 */ 1014 struct cdp_rxdma_error_stats { 1015 uint64_t err_src_rxdma_code_inv; 1016 uint64_t err_dma_codes[CDP_DMA_CODE_MAX]; 1017 }; 1018 1019 /* 1020 * struct cdp_tid_tx_stats 1021 * @to_stack_delay: Time taken between ring reap to indication to network stack 1022 * @intfrm_delay: Interframe rx delay 1023 * @delivered_cnt: Total packets indicated to stack 1024 * @intrabss_cnt: Rx total intraBSS frames 1025 * @msdu_cnt: number of msdu received from HW 1026 * @mcast_msdu_cnt: Num Mcast Msdus received from HW in Rx 1027 * @bcast_msdu_cnt: Num Bcast Msdus received from HW in Rx 1028 * @fail_cnt: Rx deliver drop counters 1029 * @reo_err: V3 reo error statistics 1030 * @rxdma_err: V3 rxdma error statistics 1031 */ 1032 struct cdp_tid_rx_stats { 1033 struct cdp_delay_stats to_stack_delay; 1034 struct cdp_delay_stats intfrm_delay; 1035 uint64_t delivered_to_stack; 1036 uint64_t intrabss_cnt; 1037 uint64_t msdu_cnt; 1038 uint64_t mcast_msdu_cnt; 1039 uint64_t bcast_msdu_cnt; 1040 uint64_t fail_cnt[RX_MAX_DROP]; 1041 struct cdp_reo_error_stats reo_err; 1042 struct cdp_rxdma_error_stats rxdma_err; 1043 }; 1044 1045 /* 1046 * struct cdp_tid_stats 1047 * @ingress_stack: Total packets received from linux stack 1048 * @osif_drop: drops in osif layer 1049 * @tid_tx_stats: transmit counters per tid 1050 * @tid_rx_stats: receive counters per tid 1051 */ 1052 struct cdp_tid_stats { 1053 uint64_t ingress_stack; 1054 uint64_t osif_drop; 1055 struct cdp_tid_tx_stats tid_tx_stats[CDP_MAX_TX_COMP_RINGS] 1056 [CDP_MAX_DATA_TIDS]; 1057 struct cdp_tid_rx_stats tid_rx_stats[CDP_MAX_RX_RINGS] 1058 [CDP_MAX_DATA_TIDS]; 1059 struct cdp_tid_rx_stats tid_rx_wbm_stats[CDP_MAX_RX_WBM_RINGS] 1060 [CDP_MAX_DATA_TIDS]; 1061 }; 1062 1063 /* 1064 * struct cdp_tid_stats_intf 1065 * @ingress_stack: Total packets received from linux stack 1066 * @osif_drop: drops in osif layer 1067 * @tx_total: total of per ring transmit counters per tid 1068 * @rx_total: total of per ring receive counters per tid 1069 */ 1070 struct cdp_tid_stats_intf { 1071 uint64_t ingress_stack; 1072 uint64_t osif_drop; 1073 struct cdp_tid_tx_stats tx_total[CDP_MAX_DATA_TIDS]; 1074 struct cdp_tid_rx_stats rx_total[CDP_MAX_DATA_TIDS]; 1075 }; 1076 1077 /* 1078 * struct cdp_delay_tx_stats: Tx delay stats 1079 * @tx_swq_delay: software enqueue delay 1080 * @hwtx_delay: HW enque to completion delay 1081 */ 1082 struct cdp_delay_tx_stats { 1083 struct cdp_hist_stats tx_swq_delay; 1084 struct cdp_hist_stats hwtx_delay; 1085 }; 1086 1087 /* 1088 * struct cdp_delay_rx_stats: Rx delay stats 1089 * @to_stack_delay: To stack delay 1090 */ 1091 struct cdp_delay_rx_stats { 1092 struct cdp_hist_stats to_stack_delay; 1093 }; 1094 1095 /* 1096 * struct cdp_delay_tid_stats: Delay tid stats 1097 * @tx_delay: Tx delay related stats 1098 * @rx_delay: Rx delay related stats 1099 */ 1100 struct cdp_delay_tid_stats { 1101 struct cdp_delay_tx_stats tx_delay; 1102 struct cdp_delay_rx_stats rx_delay; 1103 }; 1104 1105 /* struct cdp_pkt_info - packet info 1106 * @num: no of packets 1107 * @bytes: total no of bytes 1108 */ 1109 struct cdp_pkt_info { 1110 uint32_t num; 1111 uint64_t bytes; 1112 }; 1113 1114 /* struct cdp_pkt_type - packet type 1115 * @mcs_count: Counter array for each MCS index 1116 */ 1117 struct cdp_pkt_type { 1118 uint32_t mcs_count[MAX_MCS]; 1119 }; 1120 1121 /* 1122 * struct cdp_rx_mu - Rx MU Stats 1123 * @ppdu_nss[SS_COUNT]: Packet Count in spatial streams 1124 * @mpdu_cnt_fcs_ok: Rx success mpdu count 1125 * @mpdu_cnt_fcs_err: Rx fail mpdu count 1126 * @cdp_pkt_type: counter array for each MCS index 1127 */ 1128 struct cdp_rx_mu { 1129 uint32_t ppdu_nss[SS_COUNT]; 1130 uint32_t mpdu_cnt_fcs_ok; 1131 uint32_t mpdu_cnt_fcs_err; 1132 struct cdp_pkt_type ppdu; 1133 }; 1134 1135 /* struct cdp_tx_pkt_info - tx packet info 1136 * num_msdu - successful msdu 1137 * num_mpdu - successful mpdu from compltn common 1138 * mpdu_tried - mpdu tried 1139 * 1140 * tx packet info counter field for mpdu success/tried and msdu 1141 */ 1142 struct cdp_tx_pkt_info { 1143 uint32_t num_msdu; 1144 uint32_t num_mpdu; 1145 uint32_t mpdu_tried; 1146 }; 1147 1148 #ifdef FEATURE_TSO_STATS 1149 /** 1150 * struct cdp_tso_seg_histogram - Segment histogram for TCP Packets 1151 * @segs_1: packets with single segments 1152 * @segs_2_5: packets with 2-5 segments 1153 * @segs_6_10: packets with 6-10 segments 1154 * @segs_11_15: packets with 11-15 segments 1155 * @segs_16_20: packets with 16-20 segments 1156 * @segs_20_plus: packets with 20 plus segments 1157 */ 1158 struct cdp_tso_seg_histogram { 1159 uint64_t segs_1; 1160 uint64_t segs_2_5; 1161 uint64_t segs_6_10; 1162 uint64_t segs_11_15; 1163 uint64_t segs_16_20; 1164 uint64_t segs_20_plus; 1165 }; 1166 1167 /** 1168 * struct cdp_tso_packet_info - Stats for TSO segments within a TSO packet 1169 * @tso_seg: TSO Segment information 1170 * @num_seg: Number of segments 1171 * @tso_packet_len: Size of the tso packet 1172 * @tso_seg_idx: segment number 1173 */ 1174 struct cdp_tso_packet_info { 1175 struct qdf_tso_seg_t tso_seg[CDP_MAX_TSO_SEGMENTS]; 1176 uint8_t num_seg; 1177 size_t tso_packet_len; 1178 uint32_t tso_seg_idx; 1179 }; 1180 1181 /** 1182 * struct cdp_tso_info - stats for tso packets 1183 * @tso_packet_info: TSO packet information 1184 */ 1185 struct cdp_tso_info { 1186 struct cdp_tso_packet_info tso_packet_info[CDP_MAX_TSO_PACKETS]; 1187 }; 1188 #endif /* FEATURE_TSO_STATS */ 1189 1190 /** 1191 * struct cdp_tso_stats - TSO stats information 1192 * @num_tso_pkts: Total number of TSO Packets 1193 * @tso_comp: Total tso packet completions 1194 * @dropped_host: TSO packets dropped by host 1195 * @tso_no_mem_dropped: TSO packets dropped by host due to descriptor 1196 unavailablity 1197 * @dropped_target: TSO packets_dropped by target 1198 * @tso_info: Per TSO packet counters 1199 * @seg_histogram: TSO histogram stats 1200 */ 1201 struct cdp_tso_stats { 1202 struct cdp_pkt_info num_tso_pkts; 1203 uint32_t tso_comp; 1204 struct cdp_pkt_info dropped_host; 1205 struct cdp_pkt_info tso_no_mem_dropped; 1206 uint32_t dropped_target; 1207 #ifdef FEATURE_TSO_STATS 1208 struct cdp_tso_info tso_info; 1209 struct cdp_tso_seg_histogram seg_histogram; 1210 #endif /* FEATURE_TSO_STATS */ 1211 }; 1212 1213 #define CDP_PEER_STATS_START 0 1214 1215 enum cdp_peer_stats_type { 1216 cdp_peer_stats_min = CDP_PEER_STATS_START, 1217 /* Peer per pkt stats */ 1218 cdp_peer_per_pkt_stats_min = cdp_peer_stats_min, 1219 cdp_peer_tx_ucast = cdp_peer_per_pkt_stats_min, 1220 cdp_peer_tx_mcast, 1221 cdp_peer_tx_inactive_time, 1222 cdp_peer_rx_ucast, 1223 /* Add enum for peer per pkt stats before this */ 1224 cdp_peer_per_pkt_stats_max, 1225 1226 /* Peer extd stats */ 1227 cdp_peer_extd_stats_min, 1228 cdp_peer_tx_rate = cdp_peer_extd_stats_min, 1229 cdp_peer_tx_last_tx_rate, 1230 cdp_peer_tx_ratecode, 1231 cdp_peer_tx_flags, 1232 cdp_peer_tx_power, 1233 cdp_peer_rx_rate, 1234 cdp_peer_rx_last_rx_rate, 1235 cdp_peer_rx_ratecode, 1236 cdp_peer_rx_flags, 1237 cdp_peer_rx_avg_snr, 1238 cdp_peer_rx_snr, 1239 /* Add enum for peer extd stats before this */ 1240 cdp_peer_extd_stats_max, 1241 cdp_peer_stats_max = cdp_peer_extd_stats_max, 1242 }; 1243 1244 /* 1245 * The max size of cdp_peer_stats_param_t is limited to 16 bytes. 1246 * If the buffer size is exceeding this size limit, 1247 * dp_txrx_get_peer_stats is to be used instead. 1248 */ 1249 typedef union cdp_peer_stats_buf { 1250 /* Tx types */ 1251 struct cdp_pkt_info tx_ucast; 1252 struct cdp_pkt_info tx_mcast; 1253 uint32_t tx_rate; 1254 uint32_t last_tx_rate; 1255 uint32_t tx_inactive_time; 1256 uint32_t tx_flags; 1257 uint32_t tx_power; 1258 uint16_t tx_ratecode; 1259 1260 /* Rx types */ 1261 struct cdp_pkt_info rx_ucast; 1262 uint32_t rx_rate; 1263 uint32_t last_rx_rate; 1264 uint32_t rx_ratecode; 1265 uint32_t rx_flags; 1266 uint32_t rx_avg_snr; 1267 uint32_t rx_snr; 1268 } cdp_peer_stats_param_t; /* Max union size 16 bytes */ 1269 1270 /** 1271 * enum cdp_protocol_trace - Protocols supported by per-peer protocol trace 1272 * @CDP_TRACE_ICMP: ICMP packets 1273 * @CDP_TRACE_EAP: EAPOL packets 1274 * @CDP_TRACE_ARP: ARP packets 1275 * 1276 * Enumeration of all protocols supported by per-peer protocol trace feature 1277 */ 1278 enum cdp_protocol_trace { 1279 CDP_TRACE_ICMP, 1280 CDP_TRACE_EAP, 1281 CDP_TRACE_ARP, 1282 CDP_TRACE_MAX 1283 }; 1284 1285 /** 1286 * struct protocol_trace_count - type of count on per-peer protocol trace 1287 * @egress_cnt: how many packets go out of host driver 1288 * @ingress_cnt: how many packets come into the host driver 1289 * 1290 * Type of count on per-peer protocol trace 1291 */ 1292 struct protocol_trace_count { 1293 uint16_t egress_cnt; 1294 uint16_t ingress_cnt; 1295 }; 1296 /* struct cdp_tx_stats - tx stats 1297 * @cdp_pkt_info comp_pkt: Pkt Info for which completions were received 1298 * @cdp_pkt_info ucast: Unicast Packet Count 1299 * @cdp_pkt_info mcast: Multicast Packet Count 1300 * @cdp_pkt_info bcast: Broadcast Packet Count 1301 * @cdp_pkt_info nawds_mcast: NAWDS Multicast Packet Count 1302 * @cdp_pkt_info tx_success: Successful Tx Packets 1303 * @nawds_mcast_drop: NAWDS Multicast Drop Count 1304 * @protocol_trace_cnt: per-peer protocol counter 1305 * @tx_failed: Total Tx failure 1306 * @ofdma: Total Packets as ofdma 1307 * @stbc: Packets in STBC 1308 * @ldpc: Packets in LDPC 1309 * @retries: Packet retries 1310 * @retries_mpdu: mpdu number of successfully transmitted after retries 1311 * @non_amsdu_cnt: Number of MSDUs with no MSDU level aggregation 1312 * @amsdu_cnt: Number of MSDUs part of AMSDU 1313 * @tx_rate: Tx Rate 1314 * @last_tx_rate: Last tx rate for unicast packets 1315 * @last_tx_rate_mcs: Tx rate mcs for unicast packets 1316 * @mcast_last_tx_rate: Last tx rate for multicast packets 1317 * @mcast_last_tx_rate_mcs: Last tx rate mcs for multicast 1318 * @last_per: Tx Per 1319 * @rnd_avg_tx_rate: Rounded average tx rate 1320 * @avg_tx_rate: Average TX rate 1321 * @last_ack_rssi: RSSI of last acked packet 1322 * @tx_bytes_success_last: last Tx success bytes 1323 * @tx_data_success_last: last Tx success data 1324 * @tx_byte_rate: Bytes Trasmitted in last one sec 1325 * @tx_data_rate: Data Transmitted in last one sec 1326 * @sgi_count[MAX_GI]: SGI count 1327 * @pream_punct_cnt: Preamble Punctured count 1328 * @nss[SS_COUNT]: Packet count for different num_spatial_stream values 1329 * @bw[MAX_BW]: Packet Count for different bandwidths 1330 * @wme_ac_type[WME_AC_MAX]: Wireless Multimedia type Count 1331 * @excess_retries_per_ac[WME_AC_MAX]: Wireless Multimedia type Count 1332 * @dot11_tx_pkts: dot11 tx packets 1333 * @fw_rem: Discarded by firmware 1334 * @fw_rem_notx: firmware_discard_untransmitted 1335 * @fw_rem_tx: firmware_discard_transmitted 1336 * @age_out: aged out in mpdu/msdu queues 1337 * @fw_reason1: discarded by firmware reason 1 1338 * @fw_reason2: discarded by firmware reason 2 1339 * @fw_reason3: discarded by firmware reason 3 1340 * @fw_rem_queue_disable: dropped due to queue disable 1341 * @fw_rem_no_match: dropped due to fw no match command 1342 * @drop_threshold: dropped due to HW threshold 1343 * @drop_link_desc_na: dropped due resource not available in HW 1344 * @invalid_drop: Invalid msdu drop 1345 * @mcast_vdev_drop: MCAST drop configured for VDEV in HW 1346 * @invalid_rr: Invalid TQM release reason 1347 * @mcs_count: MCS Count 1348 * @an_tx_cnt: ald tx count 1349 * @an_tx_rates_used: ald rx rate used 1350 * @an_tx_bytes: ald tx bytes 1351 * @ald_txcount: ald tx count 1352 * @ald_lastper: ald last PER 1353 * @ald_max4msframelen: ald max frame len 1354 * @an_tx_ratecount: ald tx ratecount 1355 * @ald_retries: ald retries 1356 * @ald_ac_nobufs: #buffer overflows per node per AC 1357 * @ald_ac_excretries: #pkts dropped after excessive retries per node per AC 1358 * @rssi_chain: rssi chain 1359 * @inactive_time: inactive time in secs 1360 * @tx_flags: tx flags 1361 * @tx_power: Tx power latest 1362 * @is_tx_no_ack: no ack received 1363 * @tx_ratecode: Tx rate code of last frame 1364 * @is_tx_nodefkey: tx failed 'cuz no defkey 1365 * @is_tx_noheadroom: tx failed 'cuz no space 1366 * @is_crypto_enmicfail: 1367 * @is_tx_nonode: tx failed for no node 1368 * @is_tx_unknownmgt: tx of unknown mgt frame 1369 * @is_tx_badcipher: tx failed 'cuz key type 1370 * @ampdu_cnt: completion of aggregation 1371 * @non_ampdu_cnt: tx completion not aggregated 1372 * @failed_retry_count: packets failed due to retry above 802.11 retry limit 1373 * @retry_count: packets successfully send after one or more retry 1374 * @multiple_retry_count: packets successfully sent after more than one retry 1375 * @tx_ppdus: ppdus in tx 1376 * @tx_mpdus_success: mpdus successful in tx 1377 * @tx_mpdus_tried: mpdus tried in tx 1378 * @transmit_type: pkt info for tx transmit type 1379 * @mu_group_id: mumimo mu group id 1380 * @ru_start: RU start index 1381 * @ru_tones: RU tones size 1382 * @ru_loc: pkt info for RU location 26/ 52/ 106/ 242/ 484 counter 1383 * @num_ppdu_cookie_valid : Number of comp received with valid ppdu cookie 1384 * @tx_success_twt: Successful Tx Packets in TWT session 1385 * @nss_info: NSS 1,2, ...8 1386 * @mcs_info: MCS index 1387 * @bw_info: Bandwidth 1388 * <enum 0 bw_20_MHz> 1389 * <enum 1 bw_40_MHz> 1390 * <enum 2 bw_80_MHz> 1391 * <enum 3 bw_160_MHz> 1392 * @gi_info: <enum 0 0_8_us_sgi > Legacy normal GI 1393 * <enum 1 0_4_us_sgi > Legacy short GI 1394 * <enum 2 1_6_us_sgi > HE related GI 1395 * <enum 3 3_2_us_sgi > HE 1396 * @preamble_info: preamble 1397 * @last_tx_ts: last timestamp in jiffies when tx comp occurred 1398 * @su_be_ppdu_cnt: SU Tx packet count 1399 * @mu_be_ppdu_cnt: MU Tx packet count 1400 * @punc_bw[MAX_PUNCTURED_MODE]: MSDU count for punctured BW 1401 * @release_src_not_tqm: Counter to keep track of release source is not TQM 1402 * in TX completion status processing 1403 * @per: Packet error ratio 1404 */ 1405 struct cdp_tx_stats { 1406 struct cdp_pkt_info comp_pkt; 1407 struct cdp_pkt_info ucast; 1408 struct cdp_pkt_info mcast; 1409 struct cdp_pkt_info bcast; 1410 struct cdp_pkt_info nawds_mcast; 1411 #ifdef VDEV_PEER_PROTOCOL_COUNT 1412 struct protocol_trace_count protocol_trace_cnt[CDP_TRACE_MAX]; 1413 #endif 1414 struct cdp_pkt_info tx_success; 1415 uint32_t nawds_mcast_drop; 1416 uint32_t tx_failed; 1417 uint32_t ofdma; 1418 uint32_t stbc; 1419 uint32_t ldpc; 1420 uint32_t retries; 1421 uint32_t retries_mpdu; 1422 uint32_t non_amsdu_cnt; 1423 uint32_t amsdu_cnt; 1424 uint32_t tx_rate; 1425 uint32_t last_tx_rate; 1426 uint32_t last_tx_rate_mcs; 1427 uint32_t mcast_last_tx_rate; 1428 uint32_t mcast_last_tx_rate_mcs; 1429 uint32_t last_per; 1430 uint64_t rnd_avg_tx_rate; 1431 uint64_t avg_tx_rate; 1432 uint32_t last_ack_rssi; 1433 uint32_t tx_bytes_success_last; 1434 uint32_t tx_data_success_last; 1435 uint32_t tx_byte_rate; 1436 uint32_t tx_data_rate; 1437 uint32_t tx_data_ucast_last; 1438 uint32_t tx_data_ucast_rate; 1439 struct cdp_pkt_type pkt_type[DOT11_MAX]; 1440 uint32_t sgi_count[MAX_GI]; 1441 uint32_t pream_punct_cnt; 1442 1443 uint32_t nss[SS_COUNT]; 1444 1445 uint32_t bw[MAX_BW]; 1446 1447 uint32_t wme_ac_type[WME_AC_MAX]; 1448 1449 uint32_t excess_retries_per_ac[WME_AC_MAX]; 1450 struct cdp_pkt_info dot11_tx_pkts; 1451 1452 struct { 1453 struct cdp_pkt_info fw_rem; 1454 uint32_t fw_rem_notx; 1455 uint32_t fw_rem_tx; 1456 uint32_t age_out; 1457 uint32_t fw_reason1; 1458 uint32_t fw_reason2; 1459 uint32_t fw_reason3; 1460 uint32_t fw_rem_queue_disable; 1461 uint32_t fw_rem_no_match; 1462 uint32_t drop_threshold; 1463 uint32_t drop_link_desc_na; 1464 uint32_t invalid_drop; 1465 uint32_t mcast_vdev_drop; 1466 uint32_t invalid_rr; 1467 } dropped; 1468 1469 1470 uint32_t fw_tx_cnt; 1471 uint32_t fw_tx_bytes; 1472 uint32_t fw_txcount; 1473 uint32_t fw_max4msframelen; 1474 uint32_t fw_ratecount; 1475 1476 uint32_t ac_nobufs[WME_AC_MAX]; 1477 uint32_t rssi_chain[WME_AC_MAX]; 1478 uint32_t inactive_time; 1479 1480 uint32_t tx_flags; 1481 uint32_t tx_power; 1482 1483 /* MSDUs which the target sent but couldn't get an ack for */ 1484 struct cdp_pkt_info is_tx_no_ack; 1485 uint16_t tx_ratecode; 1486 1487 /*add for peer and upadted from ppdu*/ 1488 uint32_t ampdu_cnt; 1489 uint32_t non_ampdu_cnt; 1490 uint32_t failed_retry_count; 1491 uint32_t retry_count; 1492 uint32_t multiple_retry_count; 1493 uint32_t last_tx_rate_used; 1494 uint32_t tx_ppdus; 1495 uint32_t tx_mpdus_success; 1496 uint32_t tx_mpdus_tried; 1497 1498 struct cdp_tx_pkt_info transmit_type[MAX_TRANSMIT_TYPES]; 1499 uint32_t mu_group_id[MAX_MU_GROUP_ID]; 1500 uint32_t ru_start; 1501 uint32_t ru_tones; 1502 struct cdp_tx_pkt_info ru_loc[MAX_RU_LOCATIONS]; 1503 1504 uint32_t num_ppdu_cookie_valid; 1505 uint32_t no_ack_count[QDF_PROTO_SUBTYPE_MAX]; 1506 struct cdp_pkt_info tx_success_twt; 1507 1508 uint32_t nss_info:4, 1509 mcs_info:4, 1510 bw_info:4, 1511 gi_info:4, 1512 preamble_info:4; 1513 /* mpdu retry count in case of successful transmission */ 1514 uint32_t mpdu_success_with_retries; 1515 unsigned long last_tx_ts; 1516 #ifdef WLAN_FEATURE_11BE 1517 struct cdp_pkt_type su_be_ppdu_cnt; 1518 struct cdp_pkt_type mu_be_ppdu_cnt[TXRX_TYPE_MU_MAX]; 1519 uint32_t punc_bw[MAX_PUNCTURED_MODE]; 1520 #endif 1521 uint32_t release_src_not_tqm; 1522 uint32_t per; 1523 }; 1524 1525 /* struct cdp_rx_stats - rx Level Stats 1526 * @to_stack: Total packets sent up the stack 1527 * @rcvd_reo[CDP_MAX_RX_RINGS]: Packets received on the reo ring 1528 * @rx_lmac[CDP_MAX_LMACS]: Packets received on which lmac 1529 * @unicast: Total unicast packets 1530 * @multicast: Total multicast packets 1531 * @bcast: Broadcast Packet Count 1532 * @raw: Raw Pakets received 1533 * @nawds_mcast_drop: Total multicast packets 1534 * @mec_drop: Total MEC packets dropped 1535 * @last_rx_ts: last timestamp in jiffies when RX happened 1536 * @pkts: Intra BSS packets received 1537 * @fail: Intra BSS packets failed 1538 * @mdns_no_fwd: Intra BSS MDNS packets not forwarded 1539 * @protocol_trace_cnt: per-peer protocol counters 1540 * @mic_err: Rx MIC errors CCMP 1541 * @decrypt_err: Rx Decryption Errors CRC 1542 * @fcserr: rx MIC check failed (CCMP) 1543 * @pn_err: pn check failed 1544 * @oor_err: Rx OOR errors 1545 * @jump_2k_err: 2k jump errors 1546 * @rxdma_wifi_parse_err: rxdma wifi parse errors 1547 * @wme_ac_type[WME_AC_MAX]: Wireless Multimedia type Count 1548 * @reception_type[MAX_RECEPTION_TYPES]: Reception type os packets 1549 * @mcs_count[MAX_MCS]: mcs count 1550 * @sgi_count[MAX_GI]: sgi count 1551 * @nss[SS_COUNT]: packet count in spatiel Streams 1552 * @ppdu_nss[SS_COUNT]: PPDU packet count in spatial streams 1553 * @mpdu_cnt_fcs_ok: SU Rx success mpdu count 1554 * @mpdu_cnt_fcs_err: SU Rx fail mpdu count 1555 * @su_ax_ppdu_cnt: SU Rx packet count 1556 * @ppdu_cnt[MAX_RECEPTION_TYPES]: PPDU packet count in reception type 1557 * @rx_mu[TXRX_TYPE_MU_MAX]: Rx MU stats 1558 * @bw[MAX_BW]: Packet Count in different bandwidths 1559 * @non_ampdu_cnt: Number of MSDUs with no MPDU level aggregation 1560 * @ampdu_cnt: Number of MSDUs part of AMSPU 1561 * @non_amsdu_cnt: Number of MSDUs with no MSDU level aggregation 1562 * @amsdu_cnt: Number of MSDUs part of AMSDU 1563 * @bar_recv_cnt: Number of bar received 1564 * @avg_snr: Average snr 1565 * @rx_rate: Rx rate 1566 * @last_rx_rate: Previous rx rate 1567 * @rnd_avg_rx_rate: Rounded average rx rate 1568 * @avg_rx_rate: Average Rx rate 1569 * @dot11_rx_pkts: dot11 rx packets 1570 * @rx_bytes_last: last Rx success bytes 1571 * @rx_data_last: last rx success data 1572 * @rx_byte_rate: bytes received in last one sec 1573 * @rx_data_rate: data received in last one sec 1574 * @rx_retries: retries of packet in rx 1575 * @rx_mpdus: mpdu in rx 1576 * @rx_ppdus: ppdu in rx 1577 * @is_rx_tooshort: tooshort 1578 * @is_rx_decap: rx decap 1579 * @rx_ccmpmic: rx MIC check failed (CCMP) 1580 * @rx_tkipmic: rx MIC check failed (TKIP) 1581 * @rx_tkipicv: rx ICV check failed (TKIP) 1582 * @rx_wpimic: rx MIC check failed (WPI) 1583 * @rx_wepfail: rx wep processing failed 1584 * @rx_aggr: aggregation on rx 1585 * @rx_discard: packets discard in rx 1586 * @rx_ratecode: Rx rate code of last frame 1587 * @rx_flags: rx flags 1588 * @rx_snr_measured_time: Time at which snr is measured 1589 * @snr: SNR of received signal 1590 * @last_snr: Previous snr 1591 * @multipass_rx_pkt_drop: Dropped multipass rx pkt 1592 * @peer_unauth_rx_pkt_drop: Unauth rx packet drops 1593 * @policy_check_drop: policy check drops 1594 * @rx_mpdu_cnt: rx mpdu count per MCS rate 1595 * @nss_info: NSS 1,2, ...8 1596 * @mcs_info: MCS index 1597 * @bw_info: Bandwidth 1598 * <enum 0 bw_20_MHz> 1599 * <enum 1 bw_40_MHz> 1600 * <enum 2 bw_80_MHz> 1601 * <enum 3 bw_160_MHz> 1602 * @gi_info: <enum 0 0_8_us_sgi > Legacy normal GI 1603 * <enum 1 0_4_us_sgi > Legacy short GI 1604 * <enum 2 1_6_us_sgi > HE related GI 1605 * <enum 3 3_2_us_sgi > HE 1606 * @preamble_info: preamble 1607 * @to_stack_twt: Total packets sent up the stack in TWT session 1608 * @mpdu_retry_cnt: retries of mpdu in rx 1609 * @su_be_ppdu_cnt: SU Rx packet count for BE 1610 * @mu_be_ppdu_cnt: MU rx packet count for BE 1611 * @punc_bw[MAX_PUNCTURED_MODE]: MSDU count for punctured BW 1612 */ 1613 struct cdp_rx_stats { 1614 struct cdp_pkt_info to_stack; 1615 struct cdp_pkt_info rcvd_reo[CDP_MAX_RX_RINGS]; 1616 struct cdp_pkt_info rx_lmac[CDP_MAX_LMACS]; 1617 struct cdp_pkt_info unicast; 1618 struct cdp_pkt_info multicast; 1619 struct cdp_pkt_info bcast; 1620 struct cdp_pkt_info raw; 1621 uint32_t nawds_mcast_drop; 1622 struct cdp_pkt_info mec_drop; 1623 unsigned long last_rx_ts; 1624 struct { 1625 struct cdp_pkt_info pkts; 1626 struct cdp_pkt_info fail; 1627 uint32_t mdns_no_fwd; 1628 } intra_bss; 1629 #ifdef VDEV_PEER_PROTOCOL_COUNT 1630 struct protocol_trace_count protocol_trace_cnt[CDP_TRACE_MAX]; 1631 #endif 1632 1633 struct { 1634 uint32_t mic_err; 1635 uint32_t decrypt_err; 1636 uint32_t fcserr; 1637 uint32_t pn_err; 1638 uint32_t oor_err; 1639 uint32_t jump_2k_err; 1640 uint32_t rxdma_wifi_parse_err; 1641 } err; 1642 1643 uint32_t wme_ac_type[WME_AC_MAX]; 1644 uint32_t reception_type[MAX_RECEPTION_TYPES]; 1645 struct cdp_pkt_type pkt_type[DOT11_MAX]; 1646 uint32_t sgi_count[MAX_GI]; 1647 uint32_t nss[SS_COUNT]; 1648 uint32_t ppdu_nss[SS_COUNT]; 1649 uint32_t mpdu_cnt_fcs_ok; 1650 uint32_t mpdu_cnt_fcs_err; 1651 struct cdp_pkt_type su_ax_ppdu_cnt; 1652 uint32_t ppdu_cnt[MAX_RECEPTION_TYPES]; 1653 struct cdp_rx_mu rx_mu[TXRX_TYPE_MU_MAX]; 1654 uint32_t bw[MAX_BW]; 1655 uint32_t non_ampdu_cnt; 1656 uint32_t ampdu_cnt; 1657 uint32_t non_amsdu_cnt; 1658 uint32_t amsdu_cnt; 1659 uint32_t bar_recv_cnt; 1660 uint32_t avg_snr; 1661 uint32_t rx_rate; 1662 uint32_t last_rx_rate; 1663 uint32_t rnd_avg_rx_rate; 1664 uint32_t avg_rx_rate; 1665 struct cdp_pkt_info dot11_rx_pkts; 1666 1667 uint32_t rx_bytes_success_last; 1668 uint32_t rx_data_success_last; 1669 uint32_t rx_byte_rate; 1670 uint32_t rx_data_rate; 1671 1672 uint32_t rx_retries; 1673 uint32_t rx_mpdus; 1674 uint32_t rx_ppdus; 1675 1676 /*add for peer updated for ppdu*/ 1677 uint32_t rx_aggr; 1678 uint32_t rx_discard; 1679 uint32_t rx_ratecode; 1680 uint32_t rx_flags; 1681 uint32_t rx_snr_measured_time; 1682 uint8_t snr; 1683 uint8_t last_snr; 1684 uint32_t multipass_rx_pkt_drop; 1685 uint32_t peer_unauth_rx_pkt_drop; 1686 uint32_t policy_check_drop; 1687 uint32_t rx_mpdu_cnt[MAX_MCS]; 1688 uint32_t nss_info:4, 1689 mcs_info:4, 1690 bw_info:4, 1691 gi_info:4, 1692 preamble_info:4; 1693 struct cdp_pkt_info to_stack_twt; 1694 uint32_t mpdu_retry_cnt; 1695 #ifdef WLAN_FEATURE_11BE 1696 struct cdp_pkt_type su_be_ppdu_cnt; 1697 struct cdp_pkt_type mu_be_ppdu_cnt[TXRX_TYPE_MU_MAX]; 1698 uint32_t punc_bw[MAX_PUNCTURED_MODE]; 1699 #endif 1700 uint32_t mcast_3addr_drop; 1701 }; 1702 1703 /* struct cdp_tx_ingress_stats - Tx ingress Stats 1704 * @rcvd: Total packets received for transmission 1705 * @processed: Tx packets processed 1706 * @inspect_pkts: Total packets passed to inspect handler 1707 * @nawds_mcast: NAWDS Multicast Packet Count 1708 * @bcast: Number of broadcast packets 1709 * @raw_pkt: Total Raw packets 1710 * @dma_map_error: DMA map error 1711 * @num_frags_overflow_err: msdu's nbuf count exceeds num of segemnts 1712 * @num_seg: No of segments in TSO packets 1713 * @tso_pkt:total no of TSO packets 1714 * @non_tso_pkts: non - TSO packets 1715 * @dropped_host: TSO packets dropped by host 1716 * @dropped_target:TSO packets dropped by target 1717 * @sg_pkt: Total scatter gather packets 1718 * @non_sg_pkts: non SG packets 1719 * @dropped_host: SG packets dropped by host 1720 * @dropped_target: SG packets dropped by target 1721 * @dma_map_error: Dma map error 1722 * @mcast_pkt: total no of multicast conversion packets 1723 * @dropped_map_error: packets dropped due to map error 1724 * @dropped_self_mac: packets dropped due to self Mac address 1725 * @dropped_send_fail: Packets dropped due to send fail 1726 * @ucast: total unicast packets transmitted 1727 * @fail_seg_alloc: Segment allocation failure 1728 * @clone_fail: NBUF clone failure 1729 * @igmp_rcvd: igmp pkts received for conversion to ucast pkts 1730 * @igmp_ucast_converted: unicast pkts sent as part of VoW IGMP improvements 1731 * @dropped_pkt: Total scatter gather packets 1732 * @desc_na: Desc Not Available 1733 * @exc_desc_na: Exception desc Not Available 1734 * @ring_full: ring full 1735 * @enqueue_fail: hw enqueue fail 1736 * @dma_error: dma fail 1737 * @res_full: Resource Full: Congestion Control 1738 * @fail_per_pkt_vdev_id_check: Per pkt vdev id check 1739 * @drop_ingress: Packets dropped during Umac reset 1740 * @exception_fw: packets sent to fw 1741 * @completion_fw: packets completions received from fw 1742 * @cce_classified:Number of packets classified by CCE 1743 * @cce_classified_raw:Number of raw packets classified by CCE 1744 * @sniffer_rcvd: Number of packets received with ppdu cookie 1745 */ 1746 struct cdp_tx_ingress_stats { 1747 struct cdp_pkt_info rcvd; 1748 uint64_t rcvd_in_fast_xmit_flow; 1749 uint32_t rcvd_per_core[CDP_MAX_TX_DATA_RINGS]; 1750 struct cdp_pkt_info processed; 1751 struct cdp_pkt_info reinject_pkts; 1752 struct cdp_pkt_info inspect_pkts; 1753 struct cdp_pkt_info nawds_mcast; 1754 struct cdp_pkt_info bcast; 1755 1756 struct { 1757 struct cdp_pkt_info raw_pkt; 1758 uint32_t dma_map_error; 1759 uint32_t invalid_raw_pkt_datatype; 1760 uint32_t num_frags_overflow_err; 1761 } raw; 1762 1763 /* Scatter Gather packet info */ 1764 struct { 1765 struct cdp_pkt_info sg_pkt; 1766 struct cdp_pkt_info non_sg_pkts; 1767 struct cdp_pkt_info dropped_host; 1768 uint32_t dropped_target; 1769 uint32_t dma_map_error; 1770 } sg; 1771 1772 /* Multicast Enhancement packets info */ 1773 struct { 1774 struct cdp_pkt_info mcast_pkt; 1775 uint32_t dropped_map_error; 1776 uint32_t dropped_self_mac; 1777 uint32_t dropped_send_fail; 1778 uint32_t ucast; 1779 uint32_t fail_seg_alloc; 1780 uint32_t clone_fail; 1781 } mcast_en; 1782 1783 /* IGMP Multicast Enhancement packets info */ 1784 struct { 1785 uint32_t igmp_rcvd; 1786 uint32_t igmp_ucast_converted; 1787 } igmp_mcast_en; 1788 1789 /* Packets dropped on the Tx side */ 1790 struct { 1791 struct cdp_pkt_info dropped_pkt; 1792 struct cdp_pkt_info desc_na; 1793 struct cdp_pkt_info desc_na_exc_alloc_fail; 1794 struct cdp_pkt_info desc_na_exc_outstand; 1795 struct cdp_pkt_info exc_desc_na; 1796 uint32_t ring_full; 1797 uint32_t enqueue_fail; 1798 uint32_t dma_error; 1799 uint32_t res_full; 1800 /* headroom insufficient */ 1801 uint32_t headroom_insufficient; 1802 uint32_t fail_per_pkt_vdev_id_check; 1803 uint32_t drop_ingress; 1804 } dropped; 1805 1806 /* Mesh packets info */ 1807 struct { 1808 uint32_t exception_fw; 1809 uint32_t completion_fw; 1810 } mesh; 1811 1812 uint32_t cce_classified; 1813 uint32_t cce_classified_raw; 1814 struct cdp_pkt_info sniffer_rcvd; 1815 struct cdp_tso_stats tso_stats; 1816 }; 1817 1818 /* struct cdp_rx_ingress_stats - rx ingress stats 1819 * @reo_rcvd_pkt: packets received at REO block 1820 * @ null_q_desc_pkt: null queue desc pkt count 1821 * @ routed_eapol_pkt: routed eapol pkt count 1822 */ 1823 struct cdp_rx_ingress_stats { 1824 struct cdp_pkt_info reo_rcvd_pkt; 1825 struct cdp_pkt_info null_q_desc_pkt; 1826 struct cdp_pkt_info routed_eapol_pkt; 1827 }; 1828 1829 /* struct cdp_vdev_stats - vdev stats structure 1830 * @tx_i: ingress tx stats 1831 * @rx_i: ingress rx stats 1832 * @tx: cdp tx stats 1833 * @rx: cdp rx stats 1834 * @tso_stats: tso stats 1835 * @tid_tx_stats: tid tx stats 1836 */ 1837 struct cdp_vdev_stats { 1838 struct cdp_tx_ingress_stats tx_i; 1839 struct cdp_rx_ingress_stats rx_i; 1840 struct cdp_tx_stats tx; 1841 struct cdp_rx_stats rx; 1842 struct cdp_tso_stats tso_stats; 1843 #ifdef HW_TX_DELAY_STATS_ENABLE 1844 struct cdp_tid_tx_stats tid_tx_stats[CDP_MAX_TX_COMP_RINGS] 1845 [CDP_MAX_DATA_TIDS]; 1846 #endif 1847 }; 1848 1849 /* struct cdp_calibr_stats - Calibrated stats 1850 * @last_per: Tx last packet error rate 1851 * @tx_bytes_success_last: last Tx success bytes 1852 * @tx_data_success_last: last Tx success data 1853 * @tx_byte_rate: Bytes Trasmitted in last one sec 1854 * @tx_data_rate: Data Transmitted in last one sec 1855 * @tx_data_ucast_last: last unicast Tx bytes 1856 * @tx_data_ucast_rate: last unicast Tx data 1857 * @inactive_time: inactive time in secs 1858 * @rx_bytes_success_last: last Rx success bytes 1859 * @rx_data_success_last: last Rx success data 1860 * @rx_byte_rate: Bytes received in last one sec 1861 * @rx_data_rate: Data received in last one sec 1862 */ 1863 struct cdp_calibr_stats { 1864 struct { 1865 uint32_t last_per; 1866 uint32_t tx_bytes_success_last; 1867 uint32_t tx_data_success_last; 1868 uint32_t tx_byte_rate; 1869 uint32_t tx_data_rate; 1870 uint32_t tx_data_ucast_last; 1871 uint32_t tx_data_ucast_rate; 1872 uint32_t inactive_time; 1873 } tx; 1874 1875 struct { 1876 uint32_t rx_bytes_success_last; 1877 uint32_t rx_data_success_last; 1878 uint32_t rx_byte_rate; 1879 uint32_t rx_data_rate; 1880 } rx; 1881 }; 1882 1883 /* struct cdp_calibr_stats_intf: Calibrated stats interface 1884 * @to_stack: Total packets sent up the stack 1885 * @tx_success: Successful Tx Packets 1886 * @tx_ucast: Tx Unicast Packet Count 1887 */ 1888 struct cdp_calibr_stats_intf { 1889 struct cdp_pkt_info to_stack; 1890 struct cdp_pkt_info tx_success; 1891 struct cdp_pkt_info tx_ucast; 1892 }; 1893 1894 /* struct cdp_peer_stats - peer stats structure 1895 * @tx: cdp tx stats 1896 * @rx: cdp rx stats 1897 */ 1898 struct cdp_peer_stats { 1899 /* CDP Tx Stats */ 1900 struct cdp_tx_stats tx; 1901 /* CDP Rx Stats */ 1902 struct cdp_rx_stats rx; 1903 }; 1904 1905 /* struct cdp_peer_tid_stats - Per peer and per TID stats 1906 * @tx_avg_jitter: tx average jitter 1907 * @tx_avg_delay: tx average delay 1908 * @tx_avg_err: tx average error 1909 * @tx_total_success: tx total success 1910 * @tx_drop: tx drop 1911 */ 1912 struct cdp_peer_tid_stats { 1913 #ifdef WLAN_PEER_JITTER 1914 uint32_t tx_avg_jitter; 1915 uint32_t tx_avg_delay; 1916 uint64_t tx_avg_err; 1917 uint64_t tx_total_success; 1918 uint64_t tx_drop; 1919 #endif 1920 }; 1921 1922 /* struct cdp_interface_peer_stats - interface structure for txrx peer stats 1923 * @peer_mac: peer mac address 1924 * @vdev_id : vdev_id for the peer 1925 * @rssi_changed: denotes rssi is changed 1926 * @last_peer_tx_rate: peer tx rate for last transmission 1927 * @peer_tx_rate: tx rate for current transmission 1928 * @peer_rssi: current rssi value of peer 1929 * @tx_packet_count: tx packet count 1930 * @rx_packet_count: rx packet count 1931 * @tx_byte_count: tx byte count 1932 * @rx_byte_count: rx byte count 1933 * @per: per error rate 1934 * @ack_rssi: RSSI of the last ack received 1935 * @free_buff: free tx descriptor count 1936 * @rx_avg_snr: Avg Rx SNR 1937 */ 1938 struct cdp_interface_peer_stats { 1939 uint8_t peer_mac[QDF_MAC_ADDR_SIZE]; 1940 uint8_t vdev_id; 1941 uint8_t rssi_changed; 1942 uint32_t last_peer_tx_rate; 1943 uint32_t peer_tx_rate; 1944 uint32_t peer_rssi; 1945 uint32_t tx_packet_count; 1946 uint32_t rx_packet_count; 1947 uint32_t tx_byte_count; 1948 uint32_t rx_byte_count; 1949 uint32_t per; 1950 uint32_t ack_rssi; 1951 uint32_t free_buff; 1952 uint32_t rx_avg_snr; 1953 }; 1954 1955 /* struct cdp_interface_peer_qos_stats - interface structure for peer qos stats 1956 * @peer_mac: peer mac address 1957 * @frame_control: frame control field 1958 * @qos_control: qos control field 1959 * @frame_control_info_valid: frame_control valid 1960 * @qos_control_info_valid: qos_control valid 1961 * @vdev_id : vdev_id for the peer 1962 */ 1963 struct cdp_interface_peer_qos_stats { 1964 uint8_t peer_mac[QDF_MAC_ADDR_SIZE]; 1965 uint16_t frame_control; 1966 uint16_t qos_control; 1967 uint8_t frame_control_info_valid; 1968 uint8_t qos_control_info_valid; 1969 uint8_t vdev_id; 1970 }; 1971 1972 /* Tx completions per interrupt */ 1973 struct cdp_hist_tx_comp { 1974 uint32_t pkts_1; 1975 uint32_t pkts_2_20; 1976 uint32_t pkts_21_40; 1977 uint32_t pkts_41_60; 1978 uint32_t pkts_61_80; 1979 uint32_t pkts_81_100; 1980 uint32_t pkts_101_200; 1981 uint32_t pkts_201_plus; 1982 }; 1983 1984 /* Rx ring descriptors reaped per interrupt */ 1985 struct cdp_hist_rx_ind { 1986 uint32_t pkts_1; 1987 uint32_t pkts_2_20; 1988 uint32_t pkts_21_40; 1989 uint32_t pkts_41_60; 1990 uint32_t pkts_61_80; 1991 uint32_t pkts_81_100; 1992 uint32_t pkts_101_200; 1993 uint32_t pkts_201_plus; 1994 }; 1995 1996 struct cdp_htt_tlv_hdr { 1997 /* BIT [11 : 0] :- tag 1998 * BIT [23 : 12] :- length 1999 * BIT [31 : 24] :- reserved 2000 */ 2001 uint32_t tag__length; 2002 }; 2003 2004 #define HTT_STATS_SUBTYPE_MAX 16 2005 2006 struct cdp_htt_rx_pdev_fw_stats_tlv { 2007 struct cdp_htt_tlv_hdr tlv_hdr; 2008 2009 /* BIT [ 7 : 0] :- mac_id 2010 * BIT [31 : 8] :- reserved 2011 */ 2012 uint32_t mac_id__word; 2013 /* Num PPDU status processed from HW */ 2014 uint32_t ppdu_recvd; 2015 /* Num MPDU across PPDUs with FCS ok */ 2016 uint32_t mpdu_cnt_fcs_ok; 2017 /* Num MPDU across PPDUs with FCS err */ 2018 uint32_t mpdu_cnt_fcs_err; 2019 /* Num MSDU across PPDUs */ 2020 uint32_t tcp_msdu_cnt; 2021 /* Num MSDU across PPDUs */ 2022 uint32_t tcp_ack_msdu_cnt; 2023 /* Num MSDU across PPDUs */ 2024 uint32_t udp_msdu_cnt; 2025 /* Num MSDU across PPDUs */ 2026 uint32_t other_msdu_cnt; 2027 /* Num MPDU on FW ring indicated */ 2028 uint32_t fw_ring_mpdu_ind; 2029 /* Num MGMT MPDU given to protocol */ 2030 uint32_t fw_ring_mgmt_subtype[HTT_STATS_SUBTYPE_MAX]; 2031 /* Num ctrl MPDU given to protocol */ 2032 uint32_t fw_ring_ctrl_subtype[HTT_STATS_SUBTYPE_MAX]; 2033 /* Num mcast data packet received */ 2034 uint32_t fw_ring_mcast_data_msdu; 2035 /* Num broadcast data packet received */ 2036 uint32_t fw_ring_bcast_data_msdu; 2037 /* Num unicat data packet received */ 2038 uint32_t fw_ring_ucast_data_msdu; 2039 /* Num null data packet received */ 2040 uint32_t fw_ring_null_data_msdu; 2041 /* Num MPDU on FW ring dropped */ 2042 uint32_t fw_ring_mpdu_drop; 2043 2044 /* Num buf indication to offload */ 2045 uint32_t ofld_local_data_ind_cnt; 2046 /* Num buf recycle from offload */ 2047 uint32_t ofld_local_data_buf_recycle_cnt; 2048 /* Num buf indication to data_rx */ 2049 uint32_t drx_local_data_ind_cnt; 2050 /* Num buf recycle from data_rx */ 2051 uint32_t drx_local_data_buf_recycle_cnt; 2052 /* Num buf indication to protocol */ 2053 uint32_t local_nondata_ind_cnt; 2054 /* Num buf recycle from protocol */ 2055 uint32_t local_nondata_buf_recycle_cnt; 2056 2057 /* Num buf fed */ 2058 uint32_t fw_status_buf_ring_refill_cnt; 2059 /* Num ring empty encountered */ 2060 uint32_t fw_status_buf_ring_empty_cnt; 2061 /* Num buf fed */ 2062 uint32_t fw_pkt_buf_ring_refill_cnt; 2063 /* Num ring empty encountered */ 2064 uint32_t fw_pkt_buf_ring_empty_cnt; 2065 /* Num buf fed */ 2066 uint32_t fw_link_buf_ring_refill_cnt; 2067 /* Num ring empty encountered */ 2068 uint32_t fw_link_buf_ring_empty_cnt; 2069 2070 /* Num buf fed */ 2071 uint32_t host_pkt_buf_ring_refill_cnt; 2072 /* Num ring empty encountered */ 2073 uint32_t host_pkt_buf_ring_empty_cnt; 2074 /* Num buf fed */ 2075 uint32_t mon_pkt_buf_ring_refill_cnt; 2076 /* Num ring empty encountered */ 2077 uint32_t mon_pkt_buf_ring_empty_cnt; 2078 /* Num buf fed */ 2079 uint32_t mon_status_buf_ring_refill_cnt; 2080 /* Num ring empty encountered */ 2081 uint32_t mon_status_buf_ring_empty_cnt; 2082 /* Num buf fed */ 2083 uint32_t mon_desc_buf_ring_refill_cnt; 2084 /* Num ring empty encountered */ 2085 uint32_t mon_desc_buf_ring_empty_cnt; 2086 /* Num buf fed */ 2087 uint32_t mon_dest_ring_update_cnt; 2088 /* Num ring full encountered */ 2089 uint32_t mon_dest_ring_full_cnt; 2090 2091 /* Num rx suspend is attempted */ 2092 uint32_t rx_suspend_cnt; 2093 /* Num rx suspend failed */ 2094 uint32_t rx_suspend_fail_cnt; 2095 /* Num rx resume attempted */ 2096 uint32_t rx_resume_cnt; 2097 /* Num rx resume failed */ 2098 uint32_t rx_resume_fail_cnt; 2099 /* Num rx ring switch */ 2100 uint32_t rx_ring_switch_cnt; 2101 /* Num rx ring restore */ 2102 uint32_t rx_ring_restore_cnt; 2103 /* Num rx flush issued */ 2104 uint32_t rx_flush_cnt; 2105 }; 2106 2107 /* == TX PDEV STATS == */ 2108 struct cdp_htt_tx_pdev_stats_cmn_tlv { 2109 struct cdp_htt_tlv_hdr tlv_hdr; 2110 2111 /* BIT [ 7 : 0] :- mac_id 2112 * BIT [31 : 8] :- reserved 2113 */ 2114 uint32_t mac_id__word; 2115 /* Num queued to HW */ 2116 uint32_t hw_queued; 2117 /* Num PPDU reaped from HW */ 2118 uint32_t hw_reaped; 2119 /* Num underruns */ 2120 uint32_t underrun; 2121 /* Num HW Paused counter. */ 2122 uint32_t hw_paused; 2123 /* Num HW flush counter. */ 2124 uint32_t hw_flush; 2125 /* Num HW filtered counter. */ 2126 uint32_t hw_filt; 2127 /* Num PPDUs cleaned up in TX abort */ 2128 uint32_t tx_abort; 2129 /* Num MPDUs requed by SW */ 2130 uint32_t mpdu_requed; 2131 /* excessive retries */ 2132 uint32_t tx_xretry; 2133 /* Last used data hw rate code */ 2134 uint32_t data_rc; 2135 /* frames dropped due to excessive sw retries */ 2136 uint32_t mpdu_dropped_xretry; 2137 /* illegal rate phy errors */ 2138 uint32_t illgl_rate_phy_err; 2139 /* wal pdev continuous xretry */ 2140 uint32_t cont_xretry; 2141 /* wal pdev continuous xretry */ 2142 uint32_t tx_timeout; 2143 /* wal pdev resets */ 2144 uint32_t pdev_resets; 2145 /* PhY/BB underrun */ 2146 uint32_t phy_underrun; 2147 /* MPDU is more than txop limit */ 2148 uint32_t txop_ovf; 2149 /* Number of Sequences posted */ 2150 uint32_t seq_posted; 2151 /* Number of Sequences failed queueing */ 2152 uint32_t seq_failed_queueing; 2153 /* Number of Sequences completed */ 2154 uint32_t seq_completed; 2155 /* Number of Sequences restarted */ 2156 uint32_t seq_restarted; 2157 /* Number of MU Sequences posted */ 2158 uint32_t mu_seq_posted; 2159 /* Number of time HW ring is paused between seq switch within ISR */ 2160 uint32_t seq_switch_hw_paused; 2161 /* Number of times seq continuation in DSR */ 2162 uint32_t next_seq_posted_dsr; 2163 /* Number of times seq continuation in ISR */ 2164 uint32_t seq_posted_isr; 2165 /* Number of seq_ctrl cached. */ 2166 uint32_t seq_ctrl_cached; 2167 /* Number of MPDUs successfully transmitted */ 2168 uint32_t mpdu_count_tqm; 2169 /* Number of MSDUs successfully transmitted */ 2170 uint32_t msdu_count_tqm; 2171 /* Number of MPDUs dropped */ 2172 uint32_t mpdu_removed_tqm; 2173 /* Number of MSDUs dropped */ 2174 uint32_t msdu_removed_tqm; 2175 /* Num MPDUs flushed by SW, HWPAUSED, SW TXABORT (Reset,channel change) */ 2176 uint32_t mpdus_sw_flush; 2177 /* Num MPDUs filtered by HW, all filter condition (TTL expired) */ 2178 uint32_t mpdus_hw_filter; 2179 /* Num MPDUs truncated by PDG (TXOP, TBTT, PPDU_duration based on rate, dyn_bw) */ 2180 uint32_t mpdus_truncated; 2181 /* Num MPDUs that was tried but didn't receive ACK or BA */ 2182 uint32_t mpdus_ack_failed; 2183 /* Num MPDUs that was dropped due to expiry (MSDU TTL). */ 2184 uint32_t mpdus_expired; 2185 /* Num MPDUs that was retried within seq_ctrl (MGMT/LEGACY) */ 2186 uint32_t mpdus_seq_hw_retry; 2187 /* Num of TQM acked cmds processed */ 2188 uint32_t ack_tlv_proc; 2189 /* coex_abort_mpdu_cnt valid. */ 2190 uint32_t coex_abort_mpdu_cnt_valid; 2191 /* coex_abort_mpdu_cnt from TX FES stats. */ 2192 uint32_t coex_abort_mpdu_cnt; 2193 /* Number of total PPDUs(DATA, MGMT, excludes selfgen) tried over the air (OTA) */ 2194 uint32_t num_total_ppdus_tried_ota; 2195 /* Number of data PPDUs tried over the air (OTA) */ 2196 uint32_t num_data_ppdus_tried_ota; 2197 /* Num Local control/mgmt frames (MSDUs) queued */ 2198 uint32_t local_ctrl_mgmt_enqued; 2199 /* local_ctrl_mgmt_freed: 2200 * Num Local control/mgmt frames (MSDUs) done 2201 * It includes all local ctrl/mgmt completions 2202 * (acked, no ack, flush, TTL, etc) 2203 */ 2204 uint32_t local_ctrl_mgmt_freed; 2205 /* Num Local data frames (MSDUs) queued */ 2206 uint32_t local_data_enqued; 2207 /* local_data_freed: 2208 * Num Local data frames (MSDUs) done 2209 * It includes all local data completions 2210 * (acked, no ack, flush, TTL, etc) 2211 */ 2212 uint32_t local_data_freed; 2213 2214 /* Num MPDUs tried by SW */ 2215 uint32_t mpdu_tried; 2216 /* Num of waiting seq posted in isr completion handler */ 2217 uint32_t isr_wait_seq_posted; 2218 uint32_t tx_active_dur_us_low; 2219 uint32_t tx_active_dur_us_high; 2220 }; 2221 2222 struct cdp_htt_tx_pdev_stats_urrn_tlv_v { 2223 struct cdp_htt_tlv_hdr tlv_hdr; 2224 uint32_t urrn_stats[1]; /* HTT_TX_PDEV_MAX_URRN_STATS */ 2225 }; 2226 2227 /* NOTE: Variable length TLV, use length spec to infer array size */ 2228 struct cdp_htt_tx_pdev_stats_flush_tlv_v { 2229 struct cdp_htt_tlv_hdr tlv_hdr; 2230 uint32_t flush_errs[1]; /* HTT_TX_PDEV_MAX_FLUSH_REASON_STATS */ 2231 }; 2232 2233 /* NOTE: Variable length TLV, use length spec to infer array size */ 2234 struct cdp_htt_tx_pdev_stats_sifs_tlv_v { 2235 struct cdp_htt_tlv_hdr tlv_hdr; 2236 uint32_t sifs_status[1]; /* HTT_TX_PDEV_MAX_SIFS_BURST_STATS */ 2237 }; 2238 2239 /* NOTE: Variable length TLV, use length spec to infer array size */ 2240 struct cdp_htt_tx_pdev_stats_phy_err_tlv_v { 2241 struct cdp_htt_tlv_hdr tlv_hdr; 2242 uint32_t phy_errs[1]; /* HTT_TX_PDEV_MAX_PHY_ERR_STATS */ 2243 }; 2244 2245 /* == RX PDEV/SOC STATS == */ 2246 /* HTT_STATS_RX_SOC_FW_STATS_TAG */ 2247 struct cdp_htt_rx_soc_fw_stats_tlv { 2248 struct cdp_htt_tlv_hdr tlv_hdr; 2249 /* Num Packets received on REO FW ring */ 2250 uint32_t fw_reo_ring_data_msdu; 2251 /* Num bc/mc packets indicated from fw to host */ 2252 uint32_t fw_to_host_data_msdu_bcmc; 2253 /* Num unicast packets indicated from fw to host */ 2254 uint32_t fw_to_host_data_msdu_uc; 2255 /* Num remote buf recycle from offload */ 2256 uint32_t ofld_remote_data_buf_recycle_cnt; 2257 /* Num remote free buf given to offload */ 2258 uint32_t ofld_remote_free_buf_indication_cnt; 2259 }; 2260 2261 struct cdp_htt_rx_soc_fw_refill_ring_num_refill_tlv_v { 2262 struct cdp_htt_tlv_hdr tlv_hdr; 2263 /* Num total buf refilled from refill ring */ 2264 uint32_t refill_ring_num_refill[1]; /* HTT_RX_STATS_REFILL_MAX_RING */ 2265 }; 2266 2267 struct cdp_htt_rx_pdev_fw_ring_mpdu_err_tlv_v { 2268 struct cdp_htt_tlv_hdr tlv_hdr; 2269 /* Num error MPDU for each RxDMA error type */ 2270 uint32_t fw_ring_mpdu_err[1]; /* HTT_RX_STATS_RXDMA_MAX_ERR */ 2271 }; 2272 2273 struct cdp_htt_rx_pdev_fw_mpdu_drop_tlv_v { 2274 struct cdp_htt_tlv_hdr tlv_hdr; 2275 /* Num MPDU dropped */ 2276 uint32_t fw_mpdu_drop[1]; /* HTT_RX_STATS_FW_DROP_REASON_MAX */ 2277 }; 2278 2279 #define HTT_STATS_PHY_ERR_MAX 43 2280 2281 struct cdp_htt_rx_pdev_fw_stats_phy_err_tlv { 2282 struct cdp_htt_tlv_hdr tlv_hdr; 2283 2284 /* BIT [ 7 : 0] :- mac_id 2285 * BIT [31 : 8] :- reserved 2286 */ 2287 uint32_t mac_id__word; 2288 /* Num of phy err */ 2289 uint32_t total_phy_err_cnt; 2290 /* Counts of different types of phy errs 2291 * The mapping of PHY error types to phy_err array elements is HW dependent. 2292 * The only currently-supported mapping is shown below: 2293 * 2294 * 0 phyrx_err_phy_off Reception aborted due to receiving a PHY_OFF TLV 2295 * 1 phyrx_err_synth_off 2296 * 2 phyrx_err_ofdma_timing 2297 * 3 phyrx_err_ofdma_signal_parity 2298 * 4 phyrx_err_ofdma_rate_illegal 2299 * 5 phyrx_err_ofdma_length_illegal 2300 * 6 phyrx_err_ofdma_restart 2301 * 7 phyrx_err_ofdma_service 2302 * 8 phyrx_err_ppdu_ofdma_power_drop 2303 * 9 phyrx_err_cck_blokker 2304 * 10 phyrx_err_cck_timing 2305 * 11 phyrx_err_cck_header_crc 2306 * 12 phyrx_err_cck_rate_illegal 2307 * 13 phyrx_err_cck_length_illegal 2308 * 14 phyrx_err_cck_restart 2309 * 15 phyrx_err_cck_service 2310 * 16 phyrx_err_cck_power_drop 2311 * 17 phyrx_err_ht_crc_err 2312 * 18 phyrx_err_ht_length_illegal 2313 * 19 phyrx_err_ht_rate_illegal 2314 * 20 phyrx_err_ht_zlf 2315 * 21 phyrx_err_false_radar_ext 2316 * 22 phyrx_err_green_field 2317 * 23 phyrx_err_bw_gt_dyn_bw 2318 * 24 phyrx_err_leg_ht_mismatch 2319 * 25 phyrx_err_vht_crc_error 2320 * 26 phyrx_err_vht_siga_unsupported 2321 * 27 phyrx_err_vht_lsig_len_invalid 2322 * 28 phyrx_err_vht_ndp_or_zlf 2323 * 29 phyrx_err_vht_nsym_lt_zero 2324 * 30 phyrx_err_vht_rx_extra_symbol_mismatch 2325 * 31 phyrx_err_vht_rx_skip_group_id0 2326 * 32 phyrx_err_vht_rx_skip_group_id1to62 2327 * 33 phyrx_err_vht_rx_skip_group_id63 2328 * 34 phyrx_err_ofdm_ldpc_decoder_disabled 2329 * 35 phyrx_err_defer_nap 2330 * 36 phyrx_err_fdomain_timeout 2331 * 37 phyrx_err_lsig_rel_check 2332 * 38 phyrx_err_bt_collision 2333 * 39 phyrx_err_unsupported_mu_feedback 2334 * 40 phyrx_err_ppdu_tx_interrupt_rx 2335 * 41 phyrx_err_unsupported_cbf 2336 * 42 phyrx_err_other 2337 */ 2338 uint32_t phy_err[HTT_STATS_PHY_ERR_MAX]; 2339 }; 2340 2341 struct cdp_htt_rx_soc_fw_refill_ring_empty_tlv_v { 2342 struct cdp_htt_tlv_hdr tlv_hdr; 2343 /* Num ring empty encountered */ 2344 uint32_t refill_ring_empty_cnt[1]; /* HTT_RX_STATS_REFILL_MAX_RING */ 2345 }; 2346 2347 struct cdp_htt_tx_pdev_stats { 2348 struct cdp_htt_tx_pdev_stats_cmn_tlv cmn_tlv; 2349 struct cdp_htt_tx_pdev_stats_urrn_tlv_v underrun_tlv; 2350 struct cdp_htt_tx_pdev_stats_sifs_tlv_v sifs_tlv; 2351 struct cdp_htt_tx_pdev_stats_flush_tlv_v flush_tlv; 2352 struct cdp_htt_tx_pdev_stats_phy_err_tlv_v phy_err_tlv; 2353 }; 2354 2355 struct cdp_htt_rx_soc_stats_t { 2356 struct cdp_htt_rx_soc_fw_stats_tlv fw_tlv; 2357 struct cdp_htt_rx_soc_fw_refill_ring_empty_tlv_v fw_refill_ring_empty_tlv; 2358 struct cdp_htt_rx_soc_fw_refill_ring_num_refill_tlv_v fw_refill_ring_num_refill_tlv; 2359 }; 2360 2361 struct cdp_htt_rx_pdev_stats { 2362 struct cdp_htt_rx_soc_stats_t soc_stats; 2363 struct cdp_htt_rx_pdev_fw_stats_tlv fw_stats_tlv; 2364 struct cdp_htt_rx_pdev_fw_ring_mpdu_err_tlv_v fw_ring_mpdu_err_tlv; 2365 struct cdp_htt_rx_pdev_fw_mpdu_drop_tlv_v fw_ring_mpdu_drop; 2366 struct cdp_htt_rx_pdev_fw_stats_phy_err_tlv fw_stats_phy_err_tlv; 2367 }; 2368 2369 #ifdef WLAN_SUPPORT_RX_PROTOCOL_TYPE_TAG 2370 /* Since protocol type enumeration value is passed as CCE metadata 2371 * to firmware, add a constant offset before passing it to firmware 2372 */ 2373 #define RX_PROTOCOL_TAG_START_OFFSET 128 2374 /* This should align with packet type enumerations in ieee80211_ioctl.h 2375 * and wmi_unified_param.h files 2376 */ 2377 #define RX_PROTOCOL_TAG_MAX 24 2378 /* Macro that should be used to dump the statistics counter for all 2379 * protocol types 2380 */ 2381 #define RX_PROTOCOL_TAG_ALL 0xff 2382 #endif /* WLAN_SUPPORT_RX_PROTOCOL_TYPE_TAG */ 2383 2384 #ifdef WLAN_FEATURE_11BE 2385 #define OFDMA_NUM_RU_SIZE 16 2386 #else 2387 #define OFDMA_NUM_RU_SIZE 7 2388 #endif 2389 2390 #define OFDMA_NUM_USERS 37 2391 2392 #if defined(WLAN_CFR_ENABLE) && defined(WLAN_ENH_CFR_ENABLE) 2393 /* 2394 * mac_freeze_capture_reason - capture reason counters 2395 * @FREEZE_REASON_TM: When m_directed_ftm is enabled, this CFR data is 2396 * captured for a Timing Measurement (TM) frame. 2397 * @FREEZE_REASON_FTM: When m_directed_ftm is enabled, this CFR data is 2398 * captured for a Fine Timing Measurement (FTM) frame. 2399 * @FREEZE_REASON_ACK_RESP_TO_TM_FTM: When m_all_ftm_ack is enabled, this CFR 2400 * data is captured for an ACK received for the FTM/TM frame sent to a station. 2401 * @FREEZE_REASON_TA_RA_TYPE_FILTER: When m_ta_ra_filter is enabled, this CFR 2402 * data is captured for a PPDU received,since the CFR TA_RA filter is met. 2403 * @FREEZE_REASON_NDPA_NDP: When m_ndpa_ndp_directed(or)m_ndpa_ndp_all is 2404 * enabled, this CFR data is captured for an NDP frame received. 2405 * @FREEZE_REASON_ALL_PACKET: When m_all_packet is enabled, this CFR data is 2406 * captured for an incoming PPDU. 2407 */ 2408 enum mac_freeze_capture_reason { 2409 FREEZE_REASON_TM = 0, 2410 FREEZE_REASON_FTM, 2411 FREEZE_REASON_ACK_RESP_TO_TM_FTM, 2412 FREEZE_REASON_TA_RA_TYPE_FILTER, 2413 FREEZE_REASON_NDPA_NDP, 2414 FREEZE_REASON_ALL_PACKET, 2415 FREEZE_REASON_MAX, 2416 }; 2417 2418 /* 2419 * chan_capture_status: capture status counters 2420 * @CAPTURE_IDLE: CFR data is not captured, since VCSR setting for CFR/RCC is 2421 * not enabled. 2422 * @CAPTURE_BUSY: CFR data is not available, since previous channel 2423 * upload is in progress 2424 * @CAPTURE_ACTIVE: CFR data is captured in HW registers 2425 * @CAPTURE_NO_BUFFER: CFR data is not captured, since no buffer is available 2426 * in IPC ring to DMA CFR data 2427 */ 2428 enum chan_capture_status { 2429 CAPTURE_IDLE = 0, 2430 CAPTURE_BUSY, 2431 CAPTURE_ACTIVE, 2432 CAPTURE_NO_BUFFER, 2433 CAPTURE_MAX, 2434 }; 2435 2436 /* struct cdp_cfr_rcc_stats - CFR RCC debug statistics 2437 * @bb_captured_channel_cnt: No. of PPDUs for which MAC sent Freeze TLV to PHY 2438 * @bb_captured_timeout_cnt: No. of PPDUs for which CFR filter criteria matched 2439 * but MAC did not send Freeze TLV to PHY as time exceeded freeze tlv delay 2440 * count threshold 2441 * @rx_loc_info_valid_cnt: No. of PPDUs for which PHY could find a valid buffer 2442 * in ucode IPC ring 2443 * @chan_capture_status[]: capture status counters 2444 * [0] - No. of PPDUs with capture status CAPTURE_IDLE 2445 * [1] - No. of PPDUs with capture status CAPTURE_BUSY 2446 * [2] - No. of PPDUs with capture status CAPTURE_ACTIVE 2447 * [3] - No. of PPDUs with capture status CAPTURE_NO_BUFFER 2448 * @reason_cnt[]: capture reason counters 2449 * [0] - No. PPDUs filtered due to freeze_reason_TM 2450 * [1] - No. PPDUs filtered due to freeze_reason_FTM 2451 * [2] - No. PPDUs filtered due to freeze_reason_ACK_resp_to_TM_FTM 2452 * [3] - No. PPDUs filtered due to freeze_reason_TA_RA_TYPE_FILTER 2453 * [4] - No. PPDUs filtered due to freeze_reason_NDPA_NDP 2454 * [5] - No. PPDUs filtered due to freeze_reason_ALL_PACKET 2455 */ 2456 struct cdp_cfr_rcc_stats { 2457 uint64_t bb_captured_channel_cnt; 2458 uint64_t bb_captured_timeout_cnt; 2459 uint64_t rx_loc_info_valid_cnt; 2460 uint64_t chan_capture_status[CAPTURE_MAX]; 2461 uint64_t reason_cnt[FREEZE_REASON_MAX]; 2462 }; 2463 #else 2464 struct cdp_cfr_rcc_stats { 2465 }; 2466 #endif 2467 2468 /* struct cdp_per_cpu_packets - Per cpu packets 2469 * @num_cpus: Number of cpus 2470 * @pkts: packet count per core 2471 */ 2472 struct cdp_per_cpu_packets { 2473 uint8_t num_cpus; 2474 uint64_t pkts[CDP_NR_CPUS][CDP_MAX_RX_DEST_RINGS]; 2475 }; 2476 2477 /* struct cdp_soc_stats - soc stats 2478 * @tx.egress: Total packets transmitted 2479 * @tx.tx_invalid_peer: packets dropped on tx because of no peer 2480 * @tx.tx_hw_enq: Enqueues per tx hw ring 2481 * @tx.tx_hw_ring_full: descriptors in each tx hw ring 2482 * @tx.desc_in_use: Descriptors in use at soc 2483 * @tx.dropped_fw_removed: HW_release_reason == FW removed 2484 * @tx.invalid_release_source: tx completion release_src != HW or FW 2485 * @tx.wifi_internal_error: tx completion wifi_internal_error 2486 * @tx.non_wifi_internal_err: tx completion non_wifi_internal_error 2487 * @tx.tx_comp_loop_pkt_limit_hit: TX Comp loop packet limit hit 2488 * @tx.hp_oos2: Head pointer Out of sync at the end of dp_tx_comp_handler 2489 * @tx.tx_comp_exception: tx desc freed as part of vdev detach 2490 * @rx.ingress: Total rx packets count 2491 * @rx.err_ring_pkts: Total Packets in Rx Error ring 2492 * @rx.rx_frags: No of Fragments 2493 * @rx.rx_hw_reinject: No of reinjected packets 2494 * @rx.bar_frame: Number of bar frames received 2495 * @rx.rx_frag_err_len_error: Fragments dropped due to len errors in skb 2496 * @rx.rx_frag_err_no_peer: Fragments dropped due to no peer found 2497 * @rx.rx_frag_wait: No of incomplete fragments in waitlist 2498 * @rx.rx_frag_err: Fragments dropped due to errors 2499 * @rx.rx_frag_oor: Fragments received OOR causing sequence num mismatch 2500 * @rx.reap_loop_pkt_limit_hit: Reap loop packet limit hit 2501 * @rx.hp_oos2: Head pointer Out of sync at the end of dp_rx_process 2502 * @rx.near_full: Rx ring near full 2503 * @rx.msdu_scatter_wait_break: Break ring reaping as not all scattered msdu 2504 * received 2505 * @rx.rx_sw_route_drop: Number of frames routed from rx sw ring 2506 * @rx.rx_hw_route_drop: Number of frames routed from rx hw ring 2507 * @rx.rx_packets: packet count per core 2508 * @rx.err.rx_rejected: RX msdu rejected count on delivery to vdev stack_fn 2509 * @rx.err.raw_frm_drop: RX raw frame dropped count 2510 * @rx.err.phy_ring_access_fail: phy ring access Fail error count 2511 * @rx.err.phy_ring_access_full_fail: phy ring access full Fail error count 2512 * @rx.err.phy_rx_error: phy rx order ERR Count 2513 * @rx.err.phy_rx_dest_dup: phy rx order DEST Duplicate count 2514 * @rx.err.phy_wifi_rel_dup: phy wifi RELEASE Duplicate count 2515 * @rx.err.phy_rx_sw_err_dup: phy rx sw error Duplicate count 2516 * @rx.err.invalid_rbm: Invalid RBM error count 2517 * @rx.err.invalid_vdev: Invalid VDEV Error count 2518 * @rx.err.invalid_pdev: Invalid PDEV error count 2519 * @rx.err.pkt_delivered_no_peer: Pkts delivered to stack that no related peer 2520 * @rx.err.defrag_peer_uninit: Defrag peer uninit error count 2521 * @rx.err.invalid_sa_da_idx: Invalid sa_idx or da_idx 2522 * @rx.err.msdu_done_fail: MSDU DONE failures 2523 * @ex.err.rx_invalid_peer: Invalid PEER Error count 2524 * @rx.err.rx_invalid_peer_id: Invalid PEER ID count 2525 * @rx.err.rx_invalid_pkt_len: Invalid packet length count 2526 * @rx.err.rx_sw_error: RX sw error count 2527 * @rx.err.rx_desc_invalid_magic: RX DEST Desc Invalid Magic count 2528 * @rx.err.rx_hw_error: rx hw Error count 2529 * @rx.err.rx_hw_cmd_send_fail: Rx hw cmd send fail/requeue count 2530 * @rx.err.rx_hw_cmd_send_drain: Rx hw cmd send drain count 2531 * @rx.err.scatter_msdu: RX msdu drop count due to scatter 2532 * @rx.err.invalid_cookie: RX msdu drop count due to invalid cookie 2533 * @rx.err.stale_cookie: Count of stale cookie read in RX path 2534 * @rx.err.rx_2k_jump_delba_sent: Delba sent count due to RX 2k jump 2535 * @rx.err.rx_2k_jump_to_stack: RX 2k jump msdu indicated to stack count 2536 * @rx.err.rx_2k_jump_drop: RX 2k jump msdu dropped count 2537 * @rx.err.rx_hw_err_oor_drop: Rx HW OOR msdu drop count 2538 * @rx.err.rx_hw_err_oor_to_stack: Rx HW OOR msdu indicated to stack count 2539 * @rx.err.rx_hw_err_oor_sg_count: Rx HW OOR scattered msdu count 2540 * @rx.err.msdu_count_mismatch: Incorrect msdu count in MPDU desc info 2541 * @rx.err.invalid_link_cookie: Stale link desc cookie count 2542 * @rx.err.nbuf_sanity_fail: Nbuf sanity failure 2543 * @rx.err.dup_refill_link_desc: Duplicate link desc refilled 2544 * @rx.err.msdu_continuation_err: Incorrect msdu continuation bit in MSDU desc 2545 * @rx.err.ssn_update_count: Count of start sequence (ssn) updates 2546 * @rx.err.bar_handle_fail_count: Count of bar handling fail 2547 * @rx.err.intrabss_eapol_drop: EAPOL drop count in intrabss scenario 2548 * @rx.err.pn_in_dest_check_fail: PN check failed for 2K-jump or OOR error 2549 * @rx.err.msdu_len_err: MSDU len err count 2550 * @rx.err.rx_flush_count: Rx flush count 2551 * @ast.added: ast entry added count 2552 * @ast.deleted: ast entry deleted count 2553 * @ast.aged_out: ast entry aged out count 2554 * @ast.map_err: ast entry mapping error count 2555 * @ast.ast_mismatch: ast entry mismatch count 2556 * @mec.added: Mec added count 2557 * @mec.deleted: Mec deleted count 2558 */ 2559 struct cdp_soc_stats { 2560 struct { 2561 struct cdp_pkt_info egress; 2562 struct cdp_pkt_info tx_invalid_peer; 2563 uint32_t tx_hw_enq[CDP_MAX_TX_DATA_RINGS]; 2564 uint32_t tx_hw_ring_full[CDP_MAX_TX_DATA_RINGS]; 2565 uint32_t desc_in_use; 2566 uint32_t dropped_fw_removed; 2567 uint32_t invalid_release_source; 2568 uint32_t wifi_internal_error[CDP_MAX_WIFI_INT_ERROR_REASONS]; 2569 uint32_t non_wifi_internal_err; 2570 uint32_t tx_comp_loop_pkt_limit_hit; 2571 uint32_t hp_oos2; 2572 uint32_t tx_comp_exception; 2573 } tx; 2574 2575 struct { 2576 struct cdp_pkt_info ingress; 2577 uint32_t err_ring_pkts; 2578 uint32_t rx_frags; 2579 uint32_t rx_hw_reinject; 2580 uint32_t bar_frame; 2581 uint32_t rx_frag_err_len_error; 2582 uint32_t rx_frag_err_no_peer; 2583 uint32_t rx_frag_wait; 2584 uint32_t rx_frag_err; 2585 uint32_t rx_frag_oor; 2586 uint32_t reap_loop_pkt_limit_hit; 2587 uint32_t hp_oos2; 2588 uint32_t near_full; 2589 uint32_t msdu_scatter_wait_break; 2590 uint32_t rx_sw_route_drop; 2591 uint32_t rx_hw_route_drop; 2592 struct cdp_per_cpu_packets rx_packets; 2593 2594 struct { 2595 uint32_t rx_rejected; 2596 uint32_t rx_raw_frm_drop; 2597 uint32_t phy_ring_access_fail; 2598 uint32_t phy_ring_access_full_fail; 2599 uint32_t phy_rx_hw_error[CDP_MAX_RX_DEST_RINGS]; 2600 uint32_t phy_rx_hw_dest_dup; 2601 uint32_t phy_wifi_rel_dup; 2602 uint32_t phy_rx_sw_err_dup; 2603 uint32_t invalid_rbm; 2604 uint32_t invalid_vdev; 2605 uint32_t invalid_pdev; 2606 uint32_t pkt_delivered_no_peer; 2607 uint32_t defrag_peer_uninit; 2608 uint32_t invalid_sa_da_idx; 2609 uint32_t msdu_done_fail; 2610 struct cdp_pkt_info rx_invalid_peer; 2611 struct cdp_pkt_info rx_invalid_peer_id; 2612 struct cdp_pkt_info rx_invalid_pkt_len; 2613 uint32_t rx_sw_error[CDP_WIFI_ERR_MAX]; 2614 uint32_t rx_desc_invalid_magic; 2615 uint32_t rx_hw_error[CDP_RX_ERR_MAX]; 2616 uint32_t rx_hw_cmd_send_fail; 2617 uint32_t rx_hw_cmd_send_drain; 2618 uint32_t scatter_msdu; 2619 uint32_t invalid_cookie; 2620 uint32_t stale_cookie; 2621 uint32_t rx_2k_jump_delba_sent; 2622 uint32_t rx_2k_jump_to_stack; 2623 uint32_t rx_2k_jump_drop; 2624 uint32_t rx_hw_err_msdu_buf_rcved; 2625 uint32_t rx_hw_err_msdu_buf_invalid_cookie; 2626 uint32_t rx_hw_err_oor_drop; 2627 uint32_t rx_hw_err_oor_to_stack; 2628 uint32_t rx_hw_err_oor_sg_count; 2629 uint32_t msdu_count_mismatch; 2630 uint32_t invalid_link_cookie; 2631 uint32_t nbuf_sanity_fail; 2632 uint32_t dup_refill_link_desc; 2633 uint32_t msdu_continuation_err; 2634 uint32_t ssn_update_count; 2635 uint32_t bar_handle_fail_count; 2636 uint32_t intrabss_eapol_drop; 2637 uint32_t pn_in_dest_check_fail; 2638 uint32_t msdu_len_err; 2639 uint32_t rx_flush_count; 2640 } err; 2641 } rx; 2642 2643 struct { 2644 uint32_t added; 2645 uint32_t deleted; 2646 uint32_t aged_out; 2647 uint32_t map_err; 2648 uint32_t ast_mismatch; 2649 } ast; 2650 2651 struct { 2652 uint32_t added; 2653 uint32_t deleted; 2654 } mec; 2655 }; 2656 2657 #ifdef WLAN_TELEMETRY_STATS_SUPPORT 2658 /** 2659 * struct cdp_pdev_telemetry_stats- Structure to hold pdev telemetry stats 2660 * @tx_mpdu_failed: Tx mpdu failed 2661 * @tx_mpdu_total: Total tx mpdus 2662 */ 2663 struct cdp_pdev_telemetry_stats { 2664 uint32_t tx_mpdu_failed; 2665 uint32_t tx_mpdu_total; 2666 }; 2667 2668 /** 2669 * struct cdp_peer_telemetry_stats- Structure to hold peer telemetry stats 2670 * @tx_mpdu_retried: Tx mpdus retried 2671 * @tx_mpdu_total: Total tx mpdus 2672 * @rx_mpdu_retried: Rx mpdus retried 2673 * @rx_mpdu_total: Total rx mpdus 2674 * @airtime_consumption: airtime consumption of that peer 2675 * @snr: peer average snr 2676 */ 2677 struct cdp_peer_telemetry_stats { 2678 uint32_t tx_mpdu_retried; 2679 uint32_t tx_mpdu_total; 2680 uint32_t rx_mpdu_retried; 2681 uint32_t rx_mpdu_total; 2682 uint8_t airtime_consumption; 2683 uint8_t snr; 2684 }; 2685 #endif 2686 2687 /* struct cdp_pdev_stats - pdev stats 2688 * @msdu_not_done: packets dropped because msdu done bit not set 2689 * @mec:Multicast Echo check 2690 * @mesh_filter: Mesh Filtered packets 2691 * @mon_rx_drop: packets dropped on monitor vap 2692 * @wifi_parse: rxdma errors due to wifi parse error 2693 * @mon_radiotap_update_err: not enough space to update radiotap 2694 * @pkts: total packets replenished 2695 * @rxdma_err: rxdma errors for replenished 2696 * @nbuf_alloc_fail: nbuf alloc failed 2697 * @frag_alloc_fail: frag alloc failed 2698 * @map_err: Mapping failure 2699 * @x86_fail: x86 failures 2700 * @low_thresh_intrs: low threshold interrupts 2701 * @free_list: RX descriptors moving back to free list 2702 * @rx_raw_pkts: Rx Raw Packets 2703 * @mesh_mem_alloc: Mesh Rx Stats Alloc fail 2704 * @tso_desc_cnt: TSO descriptors 2705 * @sg_desc_cnt: SG Descriptors 2706 * @vlan_tag_stp_cnt: Vlan tagged Stp packets in wifi parse error 2707 * @desc_alloc_fail: desc alloc failed errors 2708 * @ip_csum_err: ip checksum errors 2709 * @tcp_udp_csum_err: tcp/udp checksum errors 2710 * @buf_freelist: buffers added back in freelist 2711 * @tx_i: Tx Ingress stats 2712 * @rx_i: Rx Ingress stats 2713 * @tx:CDP Tx Stats 2714 * @rx: CDP Rx Stats 2715 * @tx_comp_histogram: Number of Tx completions per interrupt 2716 * @rx_ind_histogram: Number of Rx ring descriptors reaped per interrupt 2717 * @ppdu_stats_counter: ppdu stats counter 2718 * @cdp_delayed_ba_not_recev: counter for delayed ba not received 2719 * @htt_tx_pdev_stats: htt pdev stats for tx 2720 * @htt_rx_pdev_stats: htt pdev stats for rx 2721 * @data_rx_ru_size: UL ofdma data ru size counter array 2722 * @nondata_rx_ru_size: UL ofdma non data ru size counter array 2723 * @data_rx_ppdu: data rx ppdu counter 2724 * @data_user: data user counter array 2725 * @tx_ppdu_proc: stats counter for tx ppdu processed 2726 * @ack_ba_comes_twice: stats counter for ack_ba_comes twice 2727 * @ppdu_drop: stats counter for ppdu_desc drop once threshold reached 2728 * @ppdu_wrap_drop: stats counter for ppdu desc drop on wrap around 2729 * @peer_unauth_rx_pkt_drop: stats counter for drops due to unauthorized peer 2730 * @telemetry_stats: pdev telemetry stats 2731 */ 2732 struct cdp_pdev_stats { 2733 struct { 2734 uint32_t msdu_not_done; 2735 uint32_t mec; 2736 uint32_t mesh_filter; 2737 uint32_t wifi_parse; 2738 /* Monitor mode related */ 2739 uint32_t mon_rx_drop; 2740 uint32_t mon_radiotap_update_err; 2741 } dropped; 2742 2743 struct { 2744 struct cdp_pkt_info pkts; 2745 uint32_t rxdma_err; 2746 uint32_t nbuf_alloc_fail; 2747 uint32_t frag_alloc_fail; 2748 uint32_t map_err; 2749 uint32_t x86_fail; 2750 uint32_t low_thresh_intrs; 2751 int32_t free_list; 2752 } replenish; 2753 2754 uint32_t rx_raw_pkts; 2755 uint32_t mesh_mem_alloc; 2756 uint32_t tso_desc_cnt; 2757 uint32_t sg_desc_cnt; 2758 uint32_t vlan_tag_stp_cnt; 2759 2760 /* Rx errors */ 2761 struct { 2762 uint32_t desc_alloc_fail; 2763 uint32_t desc_lt_alloc_fail; 2764 uint32_t ip_csum_err; 2765 uint32_t tcp_udp_csum_err; 2766 uint32_t rxdma_error; 2767 uint32_t reo_error; 2768 } err; 2769 2770 uint32_t buf_freelist; 2771 struct cdp_tx_ingress_stats tx_i; 2772 struct cdp_rx_ingress_stats rx_i; 2773 struct cdp_tx_stats tx; 2774 struct cdp_rx_stats rx; 2775 struct cdp_hist_tx_comp tx_comp_histogram; 2776 struct cdp_hist_rx_ind rx_ind_histogram; 2777 uint64_t ppdu_stats_counter[CDP_PPDU_STATS_MAX_TAG]; 2778 uint32_t cdp_delayed_ba_not_recev; 2779 2780 struct cdp_htt_tx_pdev_stats htt_tx_pdev_stats; 2781 struct cdp_htt_rx_pdev_stats htt_rx_pdev_stats; 2782 2783 /* Received wdi messages from fw */ 2784 uint32_t wdi_event[CDP_WDI_NUM_EVENTS]; 2785 struct cdp_tid_stats tid_stats; 2786 2787 /* numbers of data/nondata per RU sizes */ 2788 struct { 2789 uint32_t data_rx_ru_size[OFDMA_NUM_RU_SIZE]; 2790 uint32_t nondata_rx_ru_size[OFDMA_NUM_RU_SIZE]; 2791 uint32_t data_rx_ppdu; 2792 uint32_t data_users[OFDMA_NUM_USERS]; 2793 } ul_ofdma; 2794 2795 struct cdp_tso_stats tso_stats; 2796 struct cdp_cfr_rcc_stats rcc; 2797 2798 uint64_t tx_ppdu_proc; 2799 uint64_t ack_ba_comes_twice; 2800 uint64_t ppdu_drop; 2801 uint64_t ppdu_wrap_drop; 2802 2803 struct { 2804 uint64_t num_bufs_consumed; 2805 uint64_t num_pool_bufs_replenish; 2806 uint64_t num_bufs_alloc_success; 2807 } rx_buffer_pool; 2808 2809 struct { 2810 uint64_t num_bufs_refilled; 2811 uint64_t num_bufs_allocated; 2812 } rx_refill_buff_pool; 2813 2814 uint32_t peer_unauth_rx_pkt_drop; 2815 #ifdef WLAN_TELEMETRY_STATS_SUPPORT 2816 struct cdp_pdev_telemetry_stats telemetry_stats; 2817 #endif 2818 }; 2819 2820 /* struct cdp_peer_hmwds_ast_add_status - hmwds peer ast add status 2821 * @vdev_id: vdev id 2822 * @status: ast add status 2823 * @peer_mac: peer mac address 2824 * @ast_mac: ast node mac address 2825 */ 2826 struct cdp_peer_hmwds_ast_add_status { 2827 uint32_t vdev_id; 2828 uint32_t status; 2829 uint8_t peer_mac[QDF_MAC_ADDR_SIZE]; 2830 uint8_t ast_mac[QDF_MAC_ADDR_SIZE]; 2831 }; 2832 2833 /* 2834 * Enumeration of cdp soc parameters 2835 * @DP_SOC_PARAM_EAPOL_OVER_CONTROL_PORT: For sending EAPOL's over control port 2836 * @DP_SOC_PARAM_MULTI_PEER_GRP_CMD_SUPPORT: For sending bulk AST delete 2837 * @DP_SOC_PARAM_RSSI_DBM_CONV_SUPPORT: To set the rssi dbm support bit 2838 * @DP_SOC_PARAM_UMAC_HW_RESET_SUPPORT: Whether target supports UMAC HW reset 2839 */ 2840 enum cdp_soc_param_t { 2841 DP_SOC_PARAM_MSDU_EXCEPTION_DESC, 2842 DP_SOC_PARAM_CMEM_FSE_SUPPORT, 2843 DP_SOC_PARAM_MAX_AST_AGEOUT, 2844 DP_SOC_PARAM_EAPOL_OVER_CONTROL_PORT, 2845 DP_SOC_PARAM_MULTI_PEER_GRP_CMD_SUPPORT, 2846 DP_SOC_PARAM_RSSI_DBM_CONV_SUPPORT, 2847 DP_SOC_PARAM_UMAC_HW_RESET_SUPPORT, 2848 DP_SOC_PARAM_MAX, 2849 }; 2850 2851 #ifdef QCA_ENH_V3_STATS_SUPPORT 2852 /* 2853 * Enumeration of PDEV Configuration parameter 2854 */ 2855 enum _dp_param_t { 2856 DP_PARAM_MSDU_TTL, 2857 DP_PARAM_TOTAL_Q_SIZE_RANGE0, 2858 DP_PARAM_TOTAL_Q_SIZE_RANGE1, 2859 DP_PARAM_TOTAL_Q_SIZE_RANGE2, 2860 DP_PARAM_TOTAL_Q_SIZE_RANGE3, 2861 DP_PARAM_VIDEO_DELAY_STATS_FC, 2862 DP_PARAM_QFLUSHINTERVAL, 2863 DP_PARAM_TOTAL_Q_SIZE, 2864 DP_PARAM_MIN_THRESHOLD, 2865 DP_PARAM_MAX_Q_LIMIT, 2866 DP_PARAM_MIN_Q_LIMIT, 2867 DP_PARAM_CONG_CTRL_TIMER_INTV, 2868 DP_PARAM_STATS_TIMER_INTV, 2869 DP_PARAM_ROTTING_TIMER_INTV, 2870 DP_PARAM_LATENCY_PROFILE, 2871 DP_PARAM_HOSTQ_DUMP, 2872 DP_PARAM_TIDQ_MAP, 2873 DP_PARAM_VIDEO_STATS_FC, 2874 DP_PARAM_STATS_FC, 2875 2876 DP_PARAM_MAX, 2877 }; 2878 #endif 2879 /* Bitmasks for stats that can block */ 2880 #define EXT_TXRX_FW_STATS 0x0001 2881 2882 #define CDP_TX_CAP_HTT_MAX_FTYPE 19 2883 #define CDP_FC0_TYPE_SHIFT 2 2884 #define CDP_FC0_SUBTYPE_SHIFT 4 2885 #define CDP_FC0_TYPE_DATA 0x08 2886 #define CDP_FC0_SUBTYPE_MASK 0xf0 2887 2888 #define CDP_TXCAP_MAX_TYPE \ 2889 ((CDP_FC0_TYPE_DATA >> CDP_FC0_TYPE_SHIFT) + 1) 2890 #define CDP_TXCAP_MAX_SUBTYPE \ 2891 ((CDP_FC0_SUBTYPE_MASK >> CDP_FC0_SUBTYPE_SHIFT) + 1) 2892 2893 enum CDP_PEER_MSDU_DESC { 2894 PEER_MSDU_SUCC, 2895 PEER_MSDU_ENQ, 2896 PEER_MSDU_DEQ, 2897 PEER_MSDU_FLUSH, 2898 PEER_MSDU_DROP, 2899 PEER_MSDU_XRETRY, 2900 PEER_MSDU_DESC_MAX, 2901 }; 2902 2903 enum CDP_PEER_MPDU_DESC { 2904 PEER_MPDU_TRI, 2905 PEER_MPDU_SUCC, 2906 PEER_MPDU_RESTITCH, 2907 PEER_MPDU_ARR, 2908 PEER_MPDU_CLONE, 2909 PEER_MPDU_TO_STACK, 2910 PEER_MPDU_DESC_MAX, 2911 }; 2912 2913 /** 2914 * struct cdp_tid_q_len - Structure to hold consolidated queue length 2915 * @defer_msdu_len: Defered MSDU queue length 2916 * @tasklet_msdu_len: MSDU complete queue length 2917 * @pending_q_len: MSDU pending queue length 2918 */ 2919 struct cdp_tid_q_len { 2920 uint64_t defer_msdu_len; 2921 uint64_t tasklet_msdu_len; 2922 uint64_t pending_q_len; 2923 }; 2924 2925 /** 2926 * struct cdp_peer_tx_capture_stats - Structure to hold peer tx capture stats 2927 * @len_stats: Per TID defered, pending and completed msdu queue length 2928 * @mpdu: Mpdu success and restich count 2929 * @msdu: Msdu success and restich count 2930 */ 2931 struct cdp_peer_tx_capture_stats { 2932 struct cdp_tid_q_len len_stats[CDP_MAX_TIDS]; 2933 #ifdef WLAN_TX_PKT_CAPTURE_ENH_DEBUG 2934 uint32_t mpdu[PEER_MPDU_DESC_MAX]; 2935 uint32_t msdu[PEER_MSDU_DESC_MAX]; 2936 #endif 2937 }; 2938 2939 /** 2940 * struct cdp_pdev_tx_capture_stats - Structure to hold pdev tx capture stats 2941 * @peer_mismatch: Peer mismatched 2942 * @last_rcv_ppdu: Last received PPDU stats in ms 2943 * @ppdu_stats_queue_depth: PPDU stats queue depth 2944 * @ppdu_stats_defer_queue_depth: PPDU stats defered queue depth 2945 * @ppdu_dropped: PPDU dropped count 2946 * @pend_ppdu_dropped: Pending PPDU dropped count 2947 * @ppdu_flush_count: PPDU flush count 2948 * @msdu_threshold_drop: MSDU threshold drop count 2949 * @ctl_mgmt_q_len: Control management queue length 2950 * @retries_ctl_mgmt_q_len: Control management retries queue length 2951 * @htt_frame_type: HTT frame type 2952 * @len_stats: Consolidated msdu, ppdu and pending queue length 2953 */ 2954 struct cdp_pdev_tx_capture_stats { 2955 uint64_t peer_mismatch; 2956 uint32_t last_rcv_ppdu; 2957 uint32_t ppdu_stats_queue_depth; 2958 uint32_t ppdu_stats_defer_queue_depth; 2959 uint32_t ppdu_dropped; 2960 uint32_t pend_ppdu_dropped; 2961 uint32_t ppdu_flush_count; 2962 uint32_t msdu_threshold_drop; 2963 unsigned int ctl_mgmt_q_len[CDP_TXCAP_MAX_TYPE][CDP_TXCAP_MAX_SUBTYPE]; 2964 unsigned int retries_ctl_mgmt_q_len[CDP_TXCAP_MAX_TYPE] 2965 [CDP_TXCAP_MAX_SUBTYPE]; 2966 uint32_t htt_frame_type[CDP_TX_CAP_HTT_MAX_FTYPE]; 2967 struct cdp_tid_q_len len_stats; 2968 }; 2969 #endif 2970