1 /* 2 * Copyright (c) 2011-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_cmn_struct.h 22 * @brief Define the host data path converged API functions 23 * called by the host control SW and the OS interface module 24 */ 25 #ifndef _CDP_TXRX_CMN_STRUCT_H_ 26 #define _CDP_TXRX_CMN_STRUCT_H_ 27 28 /** 29 * For WIN legacy header compilation 30 * Temporary add dummy definitions 31 * should be removed properly WIN legacy code handle 32 */ 33 34 #include "htc_api.h" 35 #include "qdf_types.h" 36 #include "qdf_nbuf.h" 37 #include "qdf_atomic.h" 38 #ifdef DP_MOB_DEFS 39 #include <cdp_txrx_mob_def.h> 40 #endif 41 #include <cdp_txrx_handle.h> 42 #include <cdp_txrx_stats_struct.h> 43 #ifdef WLAN_RX_PKT_CAPTURE_ENH 44 #include "cdp_txrx_extd_struct.h" 45 #endif 46 47 #ifdef WLAN_MAX_CLIENTS_ALLOWED 48 #define OL_TXRX_NUM_LOCAL_PEER_IDS (WLAN_MAX_CLIENTS_ALLOWED + 1 + 1 + 1) 49 #endif 50 51 #ifndef OL_TXRX_NUM_LOCAL_PEER_IDS 52 /* 53 * Each AP will occupy one ID, so it will occupy two IDs for AP-AP mode. 54 * Clients will be assigned max 32 IDs. 55 * STA(associated)/P2P DEV(self-PEER) will get one ID. 56 */ 57 #define OL_TXRX_NUM_LOCAL_PEER_IDS (32 + 1 + 1 + 1) 58 #endif 59 60 #define CDP_BA_256_BIT_MAP_SIZE_DWORDS 8 61 #define CDP_BA_64_BIT_MAP_SIZE_DWORDS 2 62 #define CDP_RSSI_CHAIN_LEN 8 63 64 #define OL_TXRX_INVALID_PDEV_ID 0xff 65 #define OL_TXRX_INVALID_LOCAL_PEER_ID 0xffff 66 #define CDP_INVALID_VDEV_ID 0xff 67 68 /* Max vdev_stats_id(48) is as per the max vdevs supported by HW */ 69 #define CDP_MAX_VDEV_STATS_ID 0x30 70 /* Invalid vdev_stats_id */ 71 #define CDP_INVALID_VDEV_STATS_ID 0xFF 72 73 /* Options for Dump Statistics */ 74 #define CDP_HDD_STATS 0 75 #define CDP_TXRX_PATH_STATS 1 76 #define CDP_TXRX_HIST_STATS 2 77 #define CDP_TXRX_TSO_STATS 3 78 #define CDP_HDD_NETIF_OPER_HISTORY 4 79 #define CDP_DUMP_TX_FLOW_POOL_INFO 5 80 #define CDP_TXRX_DESC_STATS 6 81 #define CDP_HIF_STATS 7 82 #define CDP_LRO_STATS 8 83 #define CDP_NAPI_STATS 9 84 #define CDP_WLAN_RX_BUF_DEBUG_STATS 10 85 #define CDP_RX_RING_STATS 11 86 #define CDP_DP_NAPI_STATS 12 87 #define CDP_DP_RX_THREAD_STATS 13 88 #define CDP_SCHEDULER_STATS 21 89 #define CDP_TX_QUEUE_STATS 22 90 #define CDP_BUNDLE_STATS 23 91 #define CDP_CREDIT_STATS 24 92 #define CDP_DISCONNECT_STATS 25 93 #define CDP_DP_RX_FISA_STATS 26 94 #define CDP_DP_SWLM_STATS 27 95 #define CDP_DP_TX_HW_LATENCY_STATS 28 96 97 #define WME_AC_TO_TID(_ac) ( \ 98 ((_ac) == WME_AC_VO) ? 6 : \ 99 ((_ac) == WME_AC_VI) ? 5 : \ 100 ((_ac) == WME_AC_BK) ? 1 : \ 101 0) 102 103 #define TID_TO_WME_AC(_tid) ( \ 104 (((_tid) == 0) || ((_tid) == 3)) ? WME_AC_BE : \ 105 (((_tid) == 1) || ((_tid) == 2)) ? WME_AC_BK : \ 106 (((_tid) == 4) || ((_tid) == 5)) ? WME_AC_VI : \ 107 WME_AC_VO) 108 109 #define CDP_MU_MAX_USERS 37 110 #define CDP_MU_MAX_USER_INDEX (CDP_MU_MAX_USERS - 1) 111 #define CDP_INVALID_PEER 0xffff 112 #define CDP_INVALID_TID 31 113 #define CDP_INVALID_TX_ENCAP_TYPE 6 114 #define CDP_INVALID_SEC_TYPE 12 115 116 #define CDP_DATA_TID_MAX 8 117 #define CDP_DATA_NON_QOS_TID 16 118 119 #define CDP_NUM_SA_BW 4 120 #define CDP_PERCENT_MACRO 100 121 #define CDP_NUM_KB_IN_MB 1000 122 /* 123 * advance rx monitor filter 124 * */ 125 #define MON_FILTER_PASS 0x0001 126 #define MON_FILTER_OTHER 0x0002 127 #define MON_FILTER_ALL 0x0003 128 129 #define FILTER_MGMT_ALL 0xFFFF 130 #define FILTER_MGMT_ASSOC_REQ 0x0001 131 #define FILTER_MGMT_ASSOC_RES 0x0002 132 #define FILTER_MGMT_REASSOC_REQ 0x0004 133 #define FILTER_MGMT_REASSOC_RES 0x0008 134 #define FILTER_MGMT_PROBE_REQ 0x0010 135 #define FILTER_MGMT_PROBE_RES 0x0020 136 #define FILTER_MGMT_TIM_ADVT 0x0040 137 #define FILTER_MGMT_RESERVED_7 0x0080 138 #define FILTER_MGMT_BEACON 0x0100 139 #define FILTER_MGMT_ATIM 0x0200 140 #define FILTER_MGMT_DISASSOC 0x0400 141 #define FILTER_MGMT_AUTH 0x0800 142 #define FILTER_MGMT_DEAUTH 0x1000 143 #define FILTER_MGMT_ACTION 0x2000 144 #define FILTER_MGMT_ACT_NO_ACK 0x4000 145 #define FILTER_MGMT_RESERVED_15 0x8000 146 147 #define FILTER_CTRL_ALL 0xFFFF 148 #define FILTER_CTRL_RESERVED_1 0x0001 149 #define FILTER_CTRL_RESERVED_2 0x0002 150 #define FILTER_CTRL_TRIGGER 0x0004 151 #define FILTER_CTRL_RESERVED_4 0x0008 152 #define FILTER_CTRL_BF_REP_POLL 0x0010 153 #define FILTER_CTRL_VHT_NDP 0x0020 154 #define FILTER_CTRL_FRAME_EXT 0x0040 155 #define FILTER_CTRL_CTRLWRAP 0x0080 156 #define FILTER_CTRL_BA_REQ 0x0100 157 #define FILTER_CTRL_BA 0x0200 158 #define FILTER_CTRL_PSPOLL 0x0400 159 #define FILTER_CTRL_RTS 0x0800 160 #define FILTER_CTRL_CTS 0x1000 161 #define FILTER_CTRL_ACK 0x2000 162 #define FILTER_CTRL_CFEND 0x4000 163 #define FILTER_CTRL_CFEND_CFACK 0x8000 164 165 #define FILTER_DATA_ALL 0xFFFF 166 #define FILTER_DATA_MCAST 0x4000 167 #define FILTER_DATA_UCAST 0x8000 168 #define FILTER_DATA_DATA 0x0001 169 #define FILTER_DATA_NULL 0x0008 170 171 /* 172 * Multiply rate by 2 to avoid float point 173 * and get rate in units of 500kbps 174 */ 175 #define CDP_11B_RATE_0MCS (11 * 2) 176 #define CDP_11B_RATE_1MCS (5.5 * 2) 177 #define CDP_11B_RATE_2MCS (2 * 2) 178 #define CDP_11B_RATE_3MCS (1 * 2) 179 #define CDP_11B_RATE_4MCS (11 * 2) 180 #define CDP_11B_RATE_5MCS (5.5 * 2) 181 #define CDP_11B_RATE_6MCS (2 * 2) 182 183 #define CDP_11A_RATE_0MCS (48 * 2) 184 #define CDP_11A_RATE_1MCS (24 * 2) 185 #define CDP_11A_RATE_2MCS (12 * 2) 186 #define CDP_11A_RATE_3MCS (6 * 2) 187 #define CDP_11A_RATE_4MCS (54 * 2) 188 #define CDP_11A_RATE_5MCS (36 * 2) 189 #define CDP_11A_RATE_6MCS (18 * 2) 190 #define CDP_11A_RATE_7MCS (9 * 2) 191 192 #define CDP_LEGACY_MCS0 0 193 #define CDP_LEGACY_MCS1 1 194 #define CDP_LEGACY_MCS2 2 195 #define CDP_LEGACY_MCS3 3 196 #define CDP_LEGACY_MCS4 4 197 #define CDP_LEGACY_MCS5 5 198 #define CDP_LEGACY_MCS6 6 199 #define CDP_LEGACY_MCS7 7 200 201 QDF_DECLARE_EWMA(tx_lag, 1024, 8) 202 struct cdp_stats_cookie; 203 204 /* 205 * DP configuration parameters 206 */ 207 enum cdp_cfg_param_type { 208 CDP_CFG_MAX_PEER_ID, 209 CDP_CFG_CCE_DISABLE, 210 CDP_CFG_NUM_PARAMS 211 }; 212 213 /* 214 * PPDU TYPE from FW - 215 * @CDP_PPDU_STATS_PPDU_TYPE_SU: single user type 216 * @CDP_PPDU_STATS_PPDU_TYPE_MU_MIMO: multi user mu-mimo 217 * @CDP_PPDU_STATS_PPDU_TYPE_MU_OFDMA: multi user ofdma 218 * @CDP_PPDU_STATS_PPDU_TYPE_MU_MIMO_OFDMA: multi user mu-mimo ofdma 219 * @CDP_PPDU_STATS_PPDU_TYPE_UL_TRIG: ul trigger ppdu 220 * @CDP_PPDU_STATS_PPDU_TYPE_BURST_BCN: burst beacon 221 * @CDP_PPDU_STATS_PPDU_TYPE_UL_BSR_RESP: bsr respond 222 * @CDP_PPDU_STATS_PPDU_TYPE_UL_BSR_TRIG: bsr trigger 223 * @CDP_PPDU_STATS_PPDU_TYPE_UL_RESP: ul response 224 * @CDP_PPDU_STATS_PPDU_TYPE_UNKNOWN 225 */ 226 enum CDP_PPDU_STATS_PPDU_TYPE { 227 CDP_PPDU_STATS_PPDU_TYPE_SU = 0, 228 CDP_PPDU_STATS_PPDU_TYPE_MU_MIMO = 1, 229 CDP_PPDU_STATS_PPDU_TYPE_MU_OFDMA = 2, 230 CDP_PPDU_STATS_PPDU_TYPE_MU_MIMO_OFDMA = 4, 231 CDP_PPDU_STATS_PPDU_TYPE_UL_TRIG = 5, 232 CDP_PPDU_STATS_PPDU_TYPE_BURST_BCN = 6, 233 CDP_PPDU_STATS_PPDU_TYPE_UL_BSR_RESP = 7, 234 CDP_PPDU_STATS_PPDU_TYPE_UL_BSR_TRIG = 8, 235 CDP_PPDU_STATS_PPDU_TYPE_UL_RESP = 9, 236 CDP_PPDU_STATS_PPDU_TYPE_UNKNOWN = 0x1F, 237 }; 238 239 /* 240 * htt_dbg_stats_type - 241 * bit positions for each stats type within a stats type bitmask 242 * The bitmask contains 24 bits. 243 */ 244 enum htt_cmn_dbg_stats_type { 245 HTT_DBG_CMN_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */ 246 HTT_DBG_CMN_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */ 247 HTT_DBG_CMN_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */ 248 HTT_DBG_CMN_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */ 249 HTT_DBG_CMN_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */ 250 HTT_DBG_CMN_STATS_TIDQ = 5, /* bit 5 -> 0x20 */ 251 HTT_DBG_CMN_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */ 252 HTT_DBG_CMN_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */ 253 HTT_DBG_CMN_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */ 254 HTT_DBG_CMN_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */ 255 HTT_DBG_CMN_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */ 256 HTT_DBG_CMN_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */ 257 HTT_DBG_CMN_STATS_RESET_INFO = 12, /* bit 12 -> 0x1000 */ 258 HTT_DBG_CMN_STATS_MAC_WDOG_INFO = 13, /* bit 13 -> 0x2000 */ 259 HTT_DBG_CMN_STATS_TX_DESC_INFO = 14, /* bit 14 -> 0x4000 */ 260 HTT_DBG_CMN_STATS_TX_FETCH_MGR_INFO = 15, /* bit 15 -> 0x8000 */ 261 HTT_DBG_CMN_STATS_TX_PFSCHED_INFO = 16, /* bit 16 -> 0x10000 */ 262 HTT_DBG_CMN_STATS_TX_PATH_STATS_INFO = 17, /* bit 17 -> 0x20000 */ 263 /* bits 18-23 currently reserved */ 264 265 /* keep this last */ 266 HTT_DBG_CMN_NUM_STATS, 267 HTT_DBG_CMN_NUM_STATS_INVALID = 31, /* bit 31 -> 0x80000000 */ 268 }; 269 270 /* 271 * cdp_host_txrx_stats: Different types of host stats 272 * @TXRX_HOST_STATS_INVALID: Invalid option 273 * @TXRX_RX_RATE_STATS: Rx rate info 274 * @TXRX_TX_RATE_STATS: Tx rate info 275 * @TXRX_TX_HOST_STATS: Print Tx stats 276 * @TXRX_RX_HOST_STATS: Print host Rx stats 277 * @TXRX_CLEAR_STATS: clear all host stats 278 * @TXRX_SRNG_PTR_STATS: Print SRNG pointer stats 279 * @TXRX_RX_MON_STATS: Print monitor mode stats 280 * @TXRX_REO_QUEUE_STATS: Print Per peer REO Queue Stats 281 * @TXRX_SOC_CFG_PARAMS: Print soc cfg params info 282 * @TXRX_PDEV_CFG_PARAMS: Print pdev cfg params info 283 * @TXRX_NAPI_STATS: Print NAPI scheduling statistics 284 * @TXRX_SOC_INTERRUPT_STATS: Print soc interrupt stats 285 * @TXRX_HAL_REG_WRITE_STATS: Hal Reg Write stats 286 * @TXRX_SOC_REO_HW_DESC_DUMP: HW REO queue desc dump 287 * @TXRX_SOC_WBM_IDLE_HPTP_DUMP: WBM idle link desc SRNG HP/TP dump 288 * @TXRX_SRNG_USAGE_WM_STATS: SRNG usage watermark stats 289 */ 290 enum cdp_host_txrx_stats { 291 TXRX_HOST_STATS_INVALID = -1, 292 TXRX_CLEAR_STATS = 0, 293 TXRX_RX_RATE_STATS = 1, 294 TXRX_TX_RATE_STATS = 2, 295 TXRX_TX_HOST_STATS = 3, 296 TXRX_RX_HOST_STATS = 4, 297 TXRX_AST_STATS = 5, 298 TXRX_SRNG_PTR_STATS = 6, 299 TXRX_RX_MON_STATS = 7, 300 TXRX_REO_QUEUE_STATS = 8, 301 TXRX_SOC_CFG_PARAMS = 9, 302 TXRX_PDEV_CFG_PARAMS = 10, 303 TXRX_NAPI_STATS = 11, 304 TXRX_SOC_INTERRUPT_STATS = 12, 305 TXRX_SOC_FSE_STATS = 13, 306 TXRX_HAL_REG_WRITE_STATS = 14, 307 TXRX_SOC_REO_HW_DESC_DUMP = 15, 308 TXRX_SOC_WBM_IDLE_HPTP_DUMP = 16, 309 TXRX_SRNG_USAGE_WM_STATS = 17, 310 TXRX_HOST_STATS_MAX, 311 }; 312 313 /* 314 * cdp_ppdu_ftype: PPDU Frame Type 315 * @CDP_PPDU_FTYPE_DATA: SU or MU Data Frame 316 * @CDP_PPDU_FTYPE_CTRL: Control/Management Frames 317 * @CDP_PPDU_FTYPE_BAR: SU or MU BAR frames 318 */ 319 enum cdp_ppdu_ftype { 320 CDP_PPDU_FTYPE_CTRL, 321 CDP_PPDU_FTYPE_DATA, 322 CDP_PPDU_FTYPE_BAR, 323 CDP_PPDU_FTYPE_MAX 324 }; 325 326 327 /** 328 * @brief General specification of the tx frame contents 329 * 330 * @details 331 * for efficiency, the HTT packet type values correspond 332 * to the bit positions of the WAL packet type values, so the 333 * translation is a simple shift operation. 334 */ 335 enum htt_cmn_pkt_type { 336 htt_cmn_pkt_type_raw = 0, 337 htt_cmn_pkt_type_native_wifi = 1, 338 htt_cmn_pkt_type_ethernet = 2, 339 htt_cmn_pkt_type_mgmt = 3, 340 htt_cmn_pkt_type_eth2 = 4, 341 342 /* keep this last */ 343 htt_cmn_pkt_num_types 344 }; 345 346 /** 347 * @General description of HTT received packets status 348 * It is similar to htt_rx_status enum 349 * but is added as a cdp enum can be freely used in OL_IF layer 350 */ 351 enum htt_cmn_rx_status { 352 htt_cmn_rx_status_unknown = 0x0, 353 htt_cmn_rx_status_ok, 354 htt_cmn_rx_status_err_fcs, 355 htt_cmn_rx_status_err_dup, 356 htt_cmn_rx_status_err_replay, 357 htt_cmn_rx_status_inv_peer, 358 htt_cmn_rx_status_ctrl_mgmt_null = 0x08, 359 htt_cmn_rx_status_tkip_mic_err = 0x09, 360 htt_cmn_rx_status_decrypt_err = 0x0A, 361 htt_cmn_rx_status_mpdu_length_err = 0x0B, 362 htt_cmn_rx_status_err_misc = 0xFF 363 }; 364 365 366 enum cdp_host_reo_dest_ring { 367 cdp_host_reo_dest_ring_unknown = 0, 368 cdp_host_reo_dest_ring_1 = 1, 369 cdp_host_reo_dest_ring_2 = 2, 370 cdp_host_reo_dest_ring_3 = 3, 371 cdp_host_reo_dest_ring_4 = 4, 372 }; 373 374 enum htt_cmn_t2h_en_stats_type { 375 /* keep this alwyas first */ 376 HTT_CMN_T2H_EN_STATS_TYPE_START = 0, 377 378 /** ppdu_common_stats is the payload */ 379 HTT_CMN_T2H_EN_STATS_TYPE_COMMON = 1, 380 /** ppdu_sant_stats is the payload */ 381 HTT_CMN_T2H_EN_STATS_TYPE_SANT = 2, 382 /** ppdu_common_stats_v2 is the payload */ 383 HTT_CMN_T2H_EN_STATS_TYPE_COMMON_V2 = 3, 384 385 /* Keep this last */ 386 HTT_CMN_T2H_EN_STATS_TYPE_END = 0x1f, 387 }; 388 389 enum htt_cmn_t2h_en_stats_status { 390 /* Keep this first always */ 391 HTT_CMN_T2H_EN_STATS_STATUS_PARTIAL = 0, 392 HTT_CMN_T2H_EN_STATS_STATUS_PRESENT = 1, 393 HTT_CMN_T2H_EN_STATS_STATUS_ERROR = 2, 394 HTT_CMN_T2H_EN_STATS_STATUS_INVALID = 3, 395 396 397 /* keep this always last */ 398 HTT_CMN_T2H_EN_STATS_STATUS_SERIES_DONE = 7, 399 }; 400 401 /** 402 * enum cdp_peer_type - Peer type 403 * @CDP_INVALID_PEER_TYPE: invalid peer type 404 * @CDP_LINK_PEER_TYPE: legacy peer or link peer for MLO connection 405 * @CDP_MLD_PEER_TYPE: MLD peer for MLO connection 406 * @CDP_WILD_PEER_TYPE: used to set peer type for same mld/link mac addr 407 */ 408 enum cdp_peer_type { 409 CDP_INVALID_PEER_TYPE, 410 CDP_LINK_PEER_TYPE, 411 CDP_MLD_PEER_TYPE, 412 CDP_WILD_PEER_TYPE, 413 }; 414 415 /** 416 * struct cdp_peer_setup_info: MLO connection info for cdp_peer_setup() 417 * @mld_peer_mac: mld peer mac address pointer 418 * @is_first_link: set true for first MLO link peer 419 * @is_primary_link: set true for MLO primary link peer 420 * @primary_umac_id: primary umac_id 421 */ 422 struct cdp_peer_setup_info { 423 uint8_t *mld_peer_mac; 424 uint8_t is_first_link:1, 425 is_primary_link:1; 426 uint8_t primary_umac_id; 427 }; 428 429 /** 430 * struct cdp_peer_info: peer info for dp hash find 431 * @vdev_id: Vdev ID 432 * @mac_addr: peer mac address to search 433 * @mac_addr_is_aligned: true only if mac_addr type is 434 "union dp_align_mac_addr", otherwise set false always. 435 * @peer_type: link or MLD peer type 436 */ 437 struct cdp_peer_info { 438 uint8_t vdev_id; 439 uint8_t *mac_addr; 440 bool mac_addr_is_aligned; 441 enum cdp_peer_type peer_type; 442 }; 443 444 /** 445 * struct ol_txrx_peer_state - Peer state information 446 */ 447 enum ol_txrx_peer_state { 448 OL_TXRX_PEER_STATE_INVALID, 449 OL_TXRX_PEER_STATE_DISC, /* initial state */ 450 OL_TXRX_PEER_STATE_CONN, /* authentication in progress */ 451 OL_TXRX_PEER_STATE_AUTH, /* authentication successful */ 452 }; 453 454 /** 455 * struct ol_txrx_ast_type - AST entry type information 456 */ 457 enum cdp_txrx_ast_entry_type { 458 CDP_TXRX_AST_TYPE_NONE, /* static ast entry for connected peer */ 459 CDP_TXRX_AST_TYPE_STATIC, /* static ast entry for connected peer */ 460 CDP_TXRX_AST_TYPE_SELF, /* static ast entry for self peer (STA mode) */ 461 CDP_TXRX_AST_TYPE_WDS, /* WDS peer ast entry type*/ 462 CDP_TXRX_AST_TYPE_WDS_HM, /* HM WDS entry */ 463 CDP_TXRX_AST_TYPE_STA_BSS, /* BSS entry(STA mode) */ 464 CDP_TXRX_AST_TYPE_DA, /* AST entry based on Destination address */ 465 CDP_TXRX_AST_TYPE_WDS_HM_SEC, /* HM WDS entry for secondary radio */ 466 CDP_TXRX_AST_TYPE_MLD, /* AST entry type for MLD peer */ 467 CDP_TXRX_AST_TYPE_MAX 468 }; 469 470 /* 471 * cdp_ast_free_status: status passed to callback function before freeing ast 472 * @CDP_TXRX_AST_DELETED - AST is deleted from FW and delete response received 473 * @CDP_TXRX_AST_DELETE_IN_PROGRESS - AST delete command sent to FW and host 474 * is waiting for FW response 475 */ 476 enum cdp_ast_free_status { 477 CDP_TXRX_AST_DELETED, 478 CDP_TXRX_AST_DELETE_IN_PROGRESS, 479 }; 480 481 /** 482 * txrx_ast_free_cb - callback registered for ast free 483 * @ctrl_soc: control path soc context 484 * @cdp_soc: DP soc context 485 * @cookie: cookie 486 * @cdp_ast_free_status: ast free status 487 */ 488 typedef void (*txrx_ast_free_cb)(struct cdp_ctrl_objmgr_psoc *ctrl_soc, 489 struct cdp_soc *cdp_soc, 490 void *cookie, 491 enum cdp_ast_free_status); 492 493 /** 494 * struct cdp_ast_entry_info - AST entry information 495 * @peer_mac_addr: mac address of peer on which AST entry is added 496 * @type: ast entry type 497 * @vdev_id: vdev_id 498 * @pdev_id: pdev_id 499 * @peer_id: peer_id 500 * 501 * This structure holds the ast entry information 502 * 503 */ 504 struct cdp_ast_entry_info { 505 uint8_t peer_mac_addr[QDF_MAC_ADDR_SIZE]; 506 enum cdp_txrx_ast_entry_type type; 507 uint8_t vdev_id; 508 uint8_t pdev_id; 509 uint16_t peer_id; 510 }; 511 512 #define MIC_SEQ_CTR_SIZE 6 513 514 enum cdp_rx_frame_type { 515 cdp_rx_frame_type_802_11, 516 cdp_rx_frame_type_802_3, 517 }; 518 519 /** 520 * struct cdp_rx_mic_err_info - rx mic error information 521 * @frame_type: frame type - 0 - 802.11 frame 522 * - 1 - 802.3 frame 523 * @data: 802.11 frame 524 * @ta_mac_addr: transmitter mac address 525 * @da_mac_addr: destination mac address 526 * @tsc: sequence number 527 * @key_id: Key ID 528 * @multicast: flag for multicast 529 * @vdev_id: vdev ID 530 * 531 * This structure holds rx mic error information 532 * 533 */ 534 struct cdp_rx_mic_err_info { 535 uint8_t frame_type; 536 uint8_t *data; 537 struct qdf_mac_addr ta_mac_addr; 538 struct qdf_mac_addr da_mac_addr; 539 uint8_t tsc[MIC_SEQ_CTR_SIZE]; 540 uint8_t key_id; 541 bool multicast; 542 uint16_t vdev_id; 543 }; 544 545 #ifdef WLAN_SUPPORT_MSCS 546 /** 547 * struct cdp_mscs_params - MSCS parameters obtained 548 * from handshake 549 * @user_pri_bitmap - User priority bitmap 550 * @user_pri_limit - User priority limit 551 * @classifier_type - TCLAS Classifier type 552 * @classifier_mask - TCLAS Classifier mask 553 */ 554 struct cdp_mscs_params { 555 uint8_t user_pri_bitmap; 556 uint8_t user_pri_limit; 557 uint8_t classifier_type; 558 uint8_t classifier_mask; 559 }; 560 #endif 561 562 /** 563 * struct cdp_sec_type - security type information 564 */ 565 enum cdp_sec_type { 566 cdp_sec_type_none, 567 cdp_sec_type_wep128, 568 cdp_sec_type_wep104, 569 cdp_sec_type_wep40, 570 cdp_sec_type_tkip, 571 cdp_sec_type_tkip_nomic, 572 cdp_sec_type_aes_ccmp, 573 cdp_sec_type_wapi, 574 cdp_sec_type_aes_ccmp_256, 575 cdp_sec_type_aes_gcmp, 576 cdp_sec_type_aes_gcmp_256, 577 578 /* keep this last! */ 579 cdp_num_sec_types 580 }; 581 582 /** 583 * struct cdp_tx_exception_metadata - Exception path parameters 584 * @peer_id: Peer id of the peer 585 * @tid: Transmit Identifier 586 * @tx_encap_type: Transmit encap type (i.e. Raw, Native Wi-Fi, Ethernet) 587 * @sec_type: sec_type to be passed to HAL 588 * @is_tx_sniffer: Indicates if the packet has to be sniffed 589 * @ppdu_cookie: 16-bit ppdu cookie that has to be replayed back in completions 590 * 591 * This structure holds the parameters needed in the exception path of tx 592 * 593 */ 594 struct cdp_tx_exception_metadata { 595 uint16_t peer_id; 596 uint8_t tid; 597 uint16_t tx_encap_type; 598 enum cdp_sec_type sec_type; 599 uint8_t is_tx_sniffer :1, 600 is_intrabss_fwd :1; 601 uint16_t ppdu_cookie; 602 #ifdef QCA_SUPPORT_WDS_EXTENDED 603 uint8_t is_wds_extended; 604 #endif 605 }; 606 607 /** 608 * wlan_op_mode - Virtual device operation mode 609 * @wlan_op_mode_unknown: Unknown mode 610 * @wlan_op_mode_ap: AP mode 611 * @wlan_op_mode_ibss: IBSS mode 612 * @wlan_op_mode_sta: STA (client) mode 613 * @wlan_op_mode_monitor: Monitor mode 614 * @wlan_op_mode_ocb: OCB mode 615 * @wlan_op_mode_ndi: NDI mode 616 */ 617 enum wlan_op_mode { 618 wlan_op_mode_unknown, 619 wlan_op_mode_ap, 620 wlan_op_mode_ibss, 621 wlan_op_mode_sta, 622 wlan_op_mode_monitor, 623 wlan_op_mode_ocb, 624 wlan_op_mode_ndi, 625 }; 626 627 /** 628 * enum wlan_op_subtype - Virtual device subtype 629 * @wlan_op_subtype_none: Subtype not applicable 630 * @wlan_op_subtype_p2p_device: P2P device 631 * @wlan_op_subtye_p2p_cli: P2P Client 632 * @wlan_op_subtype_p2p_go: P2P GO 633 * 634 * This enum lists the subtypes of a particular virtual 635 * device. 636 */ 637 enum wlan_op_subtype { 638 wlan_op_subtype_none, 639 wlan_op_subtype_p2p_device, 640 wlan_op_subtype_p2p_cli, 641 wlan_op_subtype_p2p_go, 642 }; 643 644 /** 645 * struct cdp_vdev_info - Vdev information 646 * @vdev_mac_addr: mac address of the vdev 647 * @vdev_id: ID of the vdev 648 * @vdev_stats_id: Stats ID of the vdev 649 * @op_mode: Operation mode of the vdev 650 * @subtype: subtype of the vdev 651 * @mld_mac_addr: MLD mac addr of the current vdev. 652 */ 653 struct cdp_vdev_info { 654 uint8_t *vdev_mac_addr; 655 uint8_t vdev_id; 656 uint8_t vdev_stats_id; 657 enum wlan_op_mode op_mode; 658 enum wlan_op_subtype subtype; 659 #ifdef WLAN_FEATURE_11BE_MLO 660 uint8_t *mld_mac_addr; 661 #endif 662 }; 663 664 typedef struct cdp_soc_t *ol_txrx_soc_handle; 665 666 /** 667 * ol_txrx_vdev_delete_cb - callback registered during vdev 668 * detach 669 */ 670 typedef void (*ol_txrx_vdev_delete_cb)(void *context); 671 672 /** 673 * ol_txrx_peer_unmap_sync_cb - callback registered during peer detach sync 674 */ 675 typedef QDF_STATUS(*ol_txrx_peer_unmap_sync_cb)(uint8_t vdev_id, 676 uint32_t peer_id_cnt, 677 uint16_t *peer_id_list); 678 679 /** 680 * ol_txrx_pkt_direction - Packet Direction 681 * @rx_direction: rx path packet 682 * @tx_direction: tx path packet 683 */ 684 enum txrx_direction { 685 rx_direction = 1, 686 tx_direction = 0, 687 }; 688 689 /** 690 * enum cdp_capabilities- DP capabilities 691 * @CDP_CFG_DP_TSO: TSO capability 692 * @CDP_CFG_DP_LRO: LRO capability 693 * @CDP_CFG_DP_SG: Scatter Gather capability 694 * @CDP_CFG_DP_GRO: GRO capability 695 * @CDP_CFG_DP_OL_TX_CSUM: Hardware based TX checksum capability 696 * @CDP_CFG_DP_OL_RX_CSUM: Hardware based RX checksum capability 697 * @CDP_CFG_DP_RAWMODE: RAW mode capability 698 * @CDP_CFG_DP_PEER_FLOW_CTRL: Peer flow-control capability 699 * @CDP_CFG_DP_MARK_NOTIFY_FRAME_SUPPORT: mark notify frames capability 700 */ 701 enum cdp_capabilities { 702 CDP_CFG_DP_TSO, 703 CDP_CFG_DP_LRO, 704 CDP_CFG_DP_SG, 705 CDP_CFG_DP_GRO, 706 CDP_CFG_DP_OL_TX_CSUM, 707 CDP_CFG_DP_OL_RX_CSUM, 708 CDP_CFG_DP_RAWMODE, 709 CDP_CFG_DP_PEER_FLOW_CTRL, 710 CDP_CFG_DP_MARK_NOTIFY_FRAME_SUPPORT, 711 }; 712 713 /** 714 * ol_txrx_nbuf_classify - Packet classification object 715 * @peer_id: unique peer identifier from fw 716 * @tid: traffic identifier(could be overridden) 717 * @pkt_tid: traffic identifier(cannot be overridden) 718 * @pkt_tos: ip header tos value 719 * @pkt_dscp: ip header dscp value 720 * @tos: index value in map 721 * @dscp: DSCP_TID map index 722 * @is_mcast: multicast pkt check 723 * @is_eap: eapol pkt check 724 * @is_arp: arp pkt check 725 * @is_tcp: tcp pkt check 726 * @is_dhcp: dhcp pkt check 727 * @is_igmp: igmp pkt check 728 * @is_ipv4: ip version 4 pkt check 729 * @is_ipv6: ip version 6 pkt check 730 */ 731 struct ol_txrx_nbuf_classify { 732 uint16_t peer_id; 733 uint8_t tid; 734 uint8_t pkt_tid; 735 uint8_t pkt_tos; 736 uint8_t pkt_dscp; 737 uint8_t tos; 738 uint8_t dscp; 739 uint8_t is_mcast; 740 uint8_t is_eap; 741 uint8_t is_arp; 742 uint8_t is_tcp; 743 uint8_t is_dhcp; 744 uint8_t is_igmp; 745 uint8_t is_ipv4; 746 uint8_t is_ipv6; 747 }; 748 749 /** 750 * ol_osif_vdev_handle - paque handle for OS shim virtual device 751 * object 752 */ 753 struct ol_osif_vdev_t; 754 typedef struct ol_osif_vdev_t *ol_osif_vdev_handle; 755 756 #ifdef QCA_SUPPORT_WDS_EXTENDED 757 struct ol_osif_peer_t; 758 typedef struct ol_osif_peer_t *ol_osif_peer_handle; 759 #endif 760 761 /** 762 * connectivity_stats_pkt_status - data pkt type 763 * @PKT_TYPE_REQ: Request packet 764 * @PKT_TYPE_RSP: Response packet 765 * @PKT_TYPE_TX_DROPPED: TX packet dropped 766 * @PKT_TYPE_RX_DROPPED: RX packet dropped 767 * @PKT_TYPE_RX_DELIVERED: RX packet delivered 768 * @PKT_TYPE_RX_REFUSED: RX packet refused 769 * @PKT_TYPE_TX_HOST_FW_SENT: TX packet FW sent 770 * @PKT_TYPE_TX_ACK_CNT:TC packet acked 771 * @PKT_TYPE_NONE: Invalid packet 772 */ 773 enum connectivity_stats_pkt_status { 774 PKT_TYPE_REQ, 775 PKT_TYPE_RSP, 776 PKT_TYPE_TX_DROPPED, 777 PKT_TYPE_RX_DROPPED, 778 PKT_TYPE_RX_DELIVERED, 779 PKT_TYPE_RX_REFUSED, 780 PKT_TYPE_TX_HOST_FW_SENT, 781 PKT_TYPE_TX_ACK_CNT, 782 PKT_TYPE_NONE, 783 }; 784 785 /** 786 * ol_txrx_mgmt_tx_cb - tx management delivery notification 787 * callback function 788 */ 789 typedef void 790 (*ol_txrx_mgmt_tx_cb)(void *ctxt, qdf_nbuf_t tx_mgmt_frm, int had_error); 791 792 /** 793 * ol_txrx_data_tx_cb - Function registered with the data path 794 * that is called when tx frames marked as "no free" are 795 * done being transmitted 796 */ 797 typedef void 798 (*ol_txrx_data_tx_cb)(void *ctxt, qdf_nbuf_t tx_frm, int had_error); 799 800 /** 801 * ol_txrx_tx_fp - top-level transmit function 802 * @soc - dp soc handle 803 * @vdev_id - handle to the virtual device object 804 * @msdu_list - list of network buffers 805 */ 806 typedef qdf_nbuf_t (*ol_txrx_tx_fp)(struct cdp_soc_t *soc, uint8_t vdev_id, 807 qdf_nbuf_t msdu_list); 808 809 /** 810 * ol_txrx_tx_exc_fp - top-level transmit function on exception path 811 * @soc - dp soc handle 812 * @vdev_id - handle to the virtual device object 813 * @msdu_list - list of network buffers 814 * @tx_exc_metadata - structure that holds parameters to exception path 815 */ 816 typedef qdf_nbuf_t (*ol_txrx_tx_exc_fp)(struct cdp_soc_t *soc, uint8_t vdev_id, 817 qdf_nbuf_t msdu_list, 818 struct cdp_tx_exception_metadata 819 *tx_exc_metadata); 820 821 /** 822 * ol_txrx_completion_fp - top-level transmit function 823 * for tx completion 824 * @skb: skb data 825 * @osif_dev: the virtual device's OS shim object 826 * @flag: flag 827 */ 828 typedef void (*ol_txrx_completion_fp)(qdf_nbuf_t skb, 829 void *osif_dev, uint16_t flag); 830 831 /** 832 * ol_txrx_classify_critical_pkt_fp - classification cb for critical frames 833 * @osif_dev: the virtual device's OS shim object 834 * @skb: skb data 835 */ 836 typedef void (*ol_txrx_classify_critical_pkt_fp)(void *osif_dev, 837 qdf_nbuf_t skb); 838 /** 839 * ol_txrx_tx_flow_control_fp - tx flow control notification 840 * function from txrx to OS shim 841 * @osif_dev - the virtual device's OS shim object 842 * @tx_resume - tx os q should be resumed or not 843 */ 844 typedef void (*ol_txrx_tx_flow_control_fp)(void *osif_dev, 845 bool tx_resume); 846 847 /** 848 * ol_txrx_tx_flow_control_is_pause_fp - is tx paused by flow control 849 * function from txrx to OS shim 850 * @osif_dev - the virtual device's OS shim object 851 * 852 * Return: true if tx is paused by flow control 853 */ 854 typedef bool (*ol_txrx_tx_flow_control_is_pause_fp)(void *osif_dev); 855 856 /** 857 * ol_txrx_rx_fp - receive function to hand batches of data 858 * frames from txrx to OS shim 859 * @data_vdev - handle to the OSIF virtual device object 860 * @msdu_list - list of network buffers 861 */ 862 typedef QDF_STATUS(*ol_txrx_rx_fp)(void *osif_dev, qdf_nbuf_t msdu_list); 863 864 typedef QDF_STATUS(*ol_txrx_fisa_rx_fp)(void *soc, 865 void *dp_vdev, 866 qdf_nbuf_t msdu_list); 867 868 typedef QDF_STATUS(*ol_txrx_fisa_flush_fp)(void *soc, int ring_num); 869 /** 870 * ol_txrx_rx_flush_fp - receive function to hand batches of data 871 * frames from txrx to OS shim 872 * @osif_dev: handle to the OSIF virtual device object 873 * @vdev_id: vdev_if of the packets to be flushed 874 */ 875 typedef QDF_STATUS(*ol_txrx_rx_flush_fp)(void *osif_dev, uint8_t vdev_id); 876 877 /** 878 * ol_txrx_rx_gro_flush_ind - function to send GRO flush indication to stack 879 * for a given RX Context Id. 880 * @osif_dev - handle to the OSIF virtual device object 881 * @rx_ctx_id - Rx context Id for which gro flush should happen 882 */ 883 typedef QDF_STATUS(*ol_txrx_rx_gro_flush_ind_fp)(void *osif_dev, 884 int rx_ctx_id); 885 886 /** 887 * ol_txrx_stats_rx_fp - receive function to hand batches of data 888 * frames from txrx to OS shim 889 * @skb: skb data 890 * @osif_dev: the virtual device's OS shim object 891 * @action: data packet type 892 * @pkt_type: packet data type 893 */ 894 typedef void (*ol_txrx_stats_rx_fp)(struct sk_buff *skb, 895 void *osif_dev, enum connectivity_stats_pkt_status action, 896 uint8_t *pkt_type); 897 898 /** 899 * ol_txrx_get_key_fp - function to gey key based on keyix and peer 900 * mac address 901 * @osif_dev - the virtual device's OS shim object 902 * @key_buf - pointer to store key 903 * @mac_addr - pointer to mac address 904 * @keyix - key id 905 */ 906 typedef QDF_STATUS(*ol_txrx_get_key_fp)(void *osif_dev, uint8_t *key_buf, uint8_t *mac_addr, uint8_t keyix); 907 908 /** 909 * ol_txrx_rsim_rx_decap_fp - raw mode simulation function to decap the 910 * packets in receive path. 911 * @osif_dev - the virtual device's OS shim object 912 * @list_head - poniter to head of receive packet queue to decap 913 * @list_tail - poniter to tail of receive packet queue to decap 914 * @peer_mac - mac address of peer handler 915 */ 916 typedef QDF_STATUS(*ol_txrx_rsim_rx_decap_fp)(void *osif_dev, 917 qdf_nbuf_t *list_head, 918 qdf_nbuf_t *list_tail); 919 920 /* ol_txrx_rx_fp - external tx free function to read per packet stats and 921 * free tx buffer externally 922 * @netbuf - tx network buffer 923 */ 924 typedef void (*ol_txrx_tx_free_ext_fp)(qdf_nbuf_t netbuf); 925 926 /** 927 * ol_txrx_rx_check_wai_fp - OSIF WAPI receive function 928 */ 929 typedef bool (*ol_txrx_rx_check_wai_fp)(ol_osif_vdev_handle vdev, 930 qdf_nbuf_t mpdu_head, 931 qdf_nbuf_t mpdu_tail); 932 /** 933 * ol_txrx_rx_mon_fp - OSIF monitor mode receive function for single 934 * MPDU (802.11 format) 935 */ 936 typedef void (*ol_txrx_rx_mon_fp)(ol_osif_vdev_handle vdev, 937 qdf_nbuf_t mpdu, 938 void *rx_status); 939 940 /** 941 * ol_txrx_proxy_arp_fp - proxy arp function pointer 942 */ 943 typedef int (*ol_txrx_proxy_arp_fp)(ol_osif_vdev_handle vdev, 944 qdf_nbuf_t netbuf); 945 946 /* 947 * ol_txrx_mcast_me_fp - function pointer for multicast enhancement 948 */ 949 typedef int (*ol_txrx_mcast_me_fp)(ol_osif_vdev_handle vdev, 950 qdf_nbuf_t netbuf); 951 952 /** 953 * ol_txrx_stats_callback - statistics notify callback 954 */ 955 typedef void (*ol_txrx_stats_callback)(void *ctxt, 956 enum htt_cmn_dbg_stats_type type, 957 uint8_t *buf, int bytes); 958 959 /** 960 * ol_txrx_pktdump_cb - callback for packet dump feature 961 */ 962 typedef void (*ol_txrx_pktdump_cb)(ol_txrx_soc_handle soc, 963 uint8_t pdev_id, 964 uint8_t vdev_id, 965 qdf_nbuf_t netbuf, 966 enum qdf_dp_tx_rx_status status, 967 enum qdf_pkt_type type); 968 969 /** 970 * ol_txrx_get_tsf_time - callback to get tsf time 971 */ 972 typedef QDF_STATUS(*ol_txrx_get_tsf_time)(void *osif_dev, uint64_t input_time, 973 uint64_t *tsf_time); 974 975 /** 976 * ol_txrx_ops - (pointers to) the functions used for tx and rx 977 * data xfer 978 * 979 * There are two portions of these txrx operations. 980 * The rx portion is filled in by OSIF SW before calling 981 * ol_txrx_osif_vdev_register; inside the ol_txrx_osif_vdev_register 982 * the txrx SW stores a copy of these rx function pointers, to use 983 * as it delivers rx data frames to the OSIF SW. 984 * The tx portion is filled in by the txrx SW inside 985 * ol_txrx_osif_vdev_register; when the function call returns, 986 * the OSIF SW stores a copy of these tx functions to use as it 987 * delivers tx data frames to the txrx SW. 988 * 989 * @tx.std - the tx function pointer for standard data 990 * frames This function pointer is set by the txrx SW 991 * perform host-side transmit operations based on 992 * whether a HL or LL host/target interface is in use. 993 * @tx.flow_control_cb - the transmit flow control 994 * function that is registered by the 995 * OSIF which is called from txrx to 996 * indicate whether the transmit OS 997 * queues should be paused/resumed 998 * @rx.rx - the OS shim rx function to deliver rx data 999 * frames to. This can have different values for 1000 * different virtual devices, e.g. so one virtual 1001 * device's OS shim directly hands rx frames to the OS, 1002 * but another virtual device's OS shim filters out P2P 1003 * messages before sending the rx frames to the OS. The 1004 * netbufs delivered to the osif_rx function are in the 1005 * format specified by the OS to use for tx and rx 1006 * frames (either 802.3 or native WiFi). In case RX Threads are enabled, pkts 1007 * are given to the thread, instead of the stack via this pointer. 1008 * @rx.rx_eapol - This rx function pointer used to receive only eapol frames 1009 * @rx.stack - function to give packets to the stack. Differs from @rx.rx. 1010 * In case RX Threads are enabled, this pointer holds the callback to give 1011 * packets to the stack. 1012 * @rx.rx_gro_flush - GRO flush indication to stack for a given RX CTX ID 1013 * @rx.wai_check - the tx function pointer for WAPI frames 1014 * @rx.mon - the OS shim rx monitor function to deliver 1015 * monitor data to Though in practice, it is probable 1016 * that the same function will be used for delivering 1017 * rx monitor data for all virtual devices, in theory 1018 * each different virtual device can have a different 1019 * OS shim function for accepting rx monitor data. The 1020 * netbufs delivered to the osif_rx_mon function are in 1021 * 802.11 format. Each netbuf holds a 802.11 MPDU, not 1022 * an 802.11 MSDU. Depending on compile-time 1023 * configuration, each netbuf may also have a 1024 * monitor-mode encapsulation header such as a radiotap 1025 * header added before the MPDU contents. 1026 * @rx.std - the OS shim rx function to deliver rx data 1027 * @proxy_arp - proxy arp function pointer - specified by 1028 * OS shim, stored by txrx 1029 * @get_key - function pointer to get key of the peer with 1030 * specific key index 1031 */ 1032 struct ol_txrx_ops { 1033 /* tx function pointers - specified by txrx, stored by OS shim */ 1034 struct { 1035 ol_txrx_tx_fp tx; 1036 ol_txrx_tx_exc_fp tx_exception; 1037 ol_txrx_tx_free_ext_fp tx_free_ext; 1038 ol_txrx_completion_fp tx_comp; 1039 ol_txrx_classify_critical_pkt_fp tx_classify_critical_pkt_cb; 1040 } tx; 1041 1042 /* rx function pointers - specified by OS shim, stored by txrx */ 1043 struct { 1044 ol_txrx_rx_fp rx; 1045 #ifdef QCA_SUPPORT_EAPOL_OVER_CONTROL_PORT 1046 ol_txrx_rx_fp rx_eapol; 1047 #endif 1048 ol_txrx_rx_fp rx_stack; 1049 ol_txrx_rx_flush_fp rx_flush; 1050 ol_txrx_rx_gro_flush_ind_fp rx_gro_flush; 1051 ol_txrx_rx_check_wai_fp wai_check; 1052 ol_txrx_rx_mon_fp mon; 1053 ol_txrx_stats_rx_fp stats_rx; 1054 ol_txrx_rsim_rx_decap_fp rsim_rx_decap; 1055 ol_txrx_fisa_rx_fp osif_fisa_rx; 1056 ol_txrx_fisa_flush_fp osif_fisa_flush; 1057 } rx; 1058 /* proxy arp function pointer - specified by OS shim, stored by txrx */ 1059 ol_txrx_proxy_arp_fp proxy_arp; 1060 ol_txrx_mcast_me_fp me_convert; 1061 1062 ol_txrx_get_key_fp get_key; 1063 ol_txrx_get_tsf_time get_tsf_time; 1064 }; 1065 1066 /** 1067 * ol_txrx_stats_req - specifications of the requested 1068 * statistics 1069 */ 1070 struct ol_txrx_stats_req { 1071 uint32_t stats_type_upload_mask; /* which stats to upload */ 1072 uint32_t stats_type_reset_mask; /* which stats to reset */ 1073 1074 /* stats will be printed if either print element is set */ 1075 struct { 1076 int verbose; /* verbose stats printout */ 1077 int concise; /* concise stats printout (takes precedence) */ 1078 } print; /* print uploaded stats */ 1079 1080 /* stats notify callback will be invoked if fp is non-NULL */ 1081 struct { 1082 ol_txrx_stats_callback fp; 1083 void *ctxt; 1084 } callback; 1085 1086 /* stats will be copied into the specified buffer if buf is non-NULL */ 1087 struct { 1088 uint8_t *buf; 1089 int byte_limit; /* don't copy more than this */ 1090 } copy; 1091 1092 /* 1093 * If blocking is true, the caller will take the specified semaphore 1094 * to wait for the stats to be uploaded, and the driver will release 1095 * the semaphore when the stats are done being uploaded. 1096 */ 1097 struct { 1098 int blocking; 1099 /*Note: this needs to change to some qdf_* type */ 1100 qdf_semaphore_t *sem_ptr; 1101 } wait; 1102 }; 1103 1104 1105 /* DP soc struct definition */ 1106 struct cdp_soc_t { 1107 struct cdp_ops *ops; 1108 struct ol_if_ops *ol_ops; 1109 }; 1110 1111 /* 1112 * cdp_peer_param_type: different types of parameters 1113 * to set values in peer 1114 * @CDP_CONFIG_NAWDS: Enable nawds mode 1115 * @CDP_CONFIG_NAC: Enable nac 1116 * @CDP_CONFIG_ISOLATION : Enable isolation 1117 * @CDP_CONFIG_IN_TWT : In TWT session or not 1118 */ 1119 enum cdp_peer_param_type { 1120 CDP_CONFIG_NAWDS, 1121 CDP_CONFIG_NAC, 1122 CDP_CONFIG_ISOLATION, 1123 CDP_CONFIG_IN_TWT, 1124 }; 1125 1126 /* 1127 * cdp_pdev_param_type: different types of parameters 1128 * to set values in pdev 1129 * @CDP_CONFIG_DEBUG_SNIFFER: Enable debug sniffer feature 1130 * @CDP_CONFIG_BPR_ENABLE: Enable bcast probe feature 1131 * @CDP_CONFIG_PRIMARY_RADIO: Configure radio as primary 1132 * @CDP_CONFIG_ENABLE_PERPKT_TXSTATS: Enable per packet statistics 1133 * @CDP_CONFIG_IGMPMLD_OVERRIDE: Override IGMP/MLD 1134 * @CDP_CONFIG_IGMPMLD_TID: Configurable TID value when igmmld_override is set 1135 * @CDP_CONFIG_ARP_DBG_CONF: Enable ARP debug 1136 * @CDP_CONFIG_CAPTURE_LATENCY: Capture time latency 1137 * @CDP_INGRESS_STATS: Accumulate ingress statistics 1138 * @CDP_OSIF_DROP: Accumulate drops in OSIF layer 1139 * @CDP_CONFIG_ENH_RX_CAPTURE: Enable enhanced RX capture 1140 * @CDP_CONFIG_ENH_TX_CAPTURE: Enable enhanced TX capture 1141 * @CDP_CONFIG_HMMC_TID_OVERRIDE: Enable hmmc tid override 1142 * @CDP_CONFIG_HMMC_TID_VALUE: set hmmc tid value 1143 * @CDP_CONFIG_TX_CAPTURE: set tx capture 1144 * @CDP_CHAN_NOISE_FLOOR: set channel noise floor 1145 * @CDP_CONFIG_VOW: set/get vow config 1146 * @CDP_TIDQ_OVERRIDE: set/get tid queue override 1147 * @CDP_TIDMAP_PRTY: set/get tid map prty 1148 * @CDP_TX_PENDING: get tx pending 1149 * @CDP_FILTER_NEIGH_PEERS: filter neighbour peers 1150 * @CDP_FILTER_UCAST_DATA: filter unicast data 1151 * @CDP_FILTER_MCAST_DATA: filter multicast data 1152 * @CDP_FILTER_NO_DATA: filter no data 1153 * @CDP_MONITOR_CHANNEL: monitor channel 1154 * @CDP_MONITOR_FREQUENCY: monitor frequency 1155 * @CDP_CONFIG_BSS_COLOR: configure bss color 1156 * @CDP_SET_ATF_STATS_ENABLE: set ATF stats flag 1157 * @CDP_CONFIG_SPECIAL_VAP: Configure Special vap 1158 * @CDP_RESET_SCAN_SPCL_VAP_STATS_ENABLE: Enable scan spcl vap stats reset 1159 * @CDP_ISOLATION: set isolation flag 1160 * @CDP_CONFIG_UNDECODED_METADATA_CAPTURE_ENABLE: Undecoded metadata capture 1161 */ 1162 enum cdp_pdev_param_type { 1163 CDP_CONFIG_DEBUG_SNIFFER, 1164 CDP_CONFIG_BPR_ENABLE, 1165 CDP_CONFIG_PRIMARY_RADIO, 1166 CDP_CONFIG_ENABLE_PERPKT_TXSTATS, 1167 CDP_CONFIG_IGMPMLD_OVERRIDE, 1168 CDP_CONFIG_IGMPMLD_TID, 1169 CDP_CONFIG_ARP_DBG_CONF, 1170 CDP_CONFIG_CAPTURE_LATENCY, 1171 CDP_INGRESS_STATS, 1172 CDP_OSIF_DROP, 1173 CDP_CONFIG_ENH_RX_CAPTURE, 1174 CDP_CONFIG_ENH_TX_CAPTURE, 1175 CDP_CONFIG_HMMC_TID_OVERRIDE, 1176 CDP_CONFIG_HMMC_TID_VALUE, 1177 CDP_CONFIG_TX_CAPTURE, 1178 CDP_CHAN_NOISE_FLOOR, 1179 CDP_CONFIG_VOW, 1180 CDP_TIDQ_OVERRIDE, 1181 CDP_TIDMAP_PRTY, 1182 CDP_TX_PENDING, 1183 CDP_FILTER_NEIGH_PEERS, 1184 CDP_FILTER_UCAST_DATA, 1185 CDP_FILTER_MCAST_DATA, 1186 CDP_FILTER_NO_DATA, 1187 CDP_MONITOR_CHANNEL, 1188 CDP_MONITOR_FREQUENCY, 1189 CDP_CONFIG_BSS_COLOR, 1190 CDP_SET_ATF_STATS_ENABLE, 1191 CDP_CONFIG_SPECIAL_VAP, 1192 CDP_RESET_SCAN_SPCL_VAP_STATS_ENABLE, 1193 CDP_CONFIG_ENHANCED_STATS_ENABLE, 1194 CDP_ISOLATION, 1195 CDP_CONFIG_UNDECODED_METADATA_CAPTURE_ENABLE, 1196 }; 1197 1198 /* 1199 * cdp_config_param_type: union of different types of parameters 1200 * to set values into dp handles. 1201 * 1202 * @cdp_peer_param_nawds: Enable nawds mode 1203 * @cdp_peer_param_isolation: Enable isolation 1204 * @cdp_peer_param_in_twt: in TWT session or not 1205 * @cdp_peer_param_nac: Enable nac 1206 * 1207 * @cdp_vdev_param_nawds: set nawds enable/disable 1208 * @cdp_vdev_param_mcast_en: enable/disable multicast enhancement 1209 * @cdp_vdev_param_wds: wds sta 1210 * @cdp_vdev_param_mec: MEC enable flags 1211 * @cdp_vdev_param_proxysta: proxy sta 1212 * @cdp_vdev_param_tdls_flags: tdls link flags 1213 * @cdp_vdev_param_ap_brdg_en: set ap_bridging enable/disable 1214 * @cdp_vdev_param_cipher_en: set cipher type based on security 1215 * @cdp_vdev_param_qwrap_isolation: qwrap isolation mode 1216 * @cdp_vdev_param_tx_encap: tx encap type 1217 * @cdp_vdev_param_rx_decap: rx decap type 1218 * @cdp_vdev_param_mesh_rx_filter: set mesh rx filter 1219 * @cdp_vdev_param_tidmap_prty: set tid vdev prty 1220 * @cdp_vdev_param_tidmap_tbl_id: set tidmap table id 1221 * @cdp_vdev_param_mesh_mode: set mesh mode 1222 * @cdp_vdev_param_safe_mode: set safe mode 1223 * @cdp_vdev_param_drop_unenc: set drop unencrypted flag 1224 * @cdp_vdev_param_hlos_tid_override: set hlos tid override 1225 * @cdp_vdev_param_peer_authorize: set peer authorize 1226 * @cdp_vdev_param_peer_tid_latency_enable: set peer tid latency enable flag 1227 * @cdp_vdev_param_mesh_tid: config tatency tid on vdev 1228 * @cdp_vdev_param_dscp_tid_map_id: set dscp to tid map id 1229 * @cdp_vdev_param_mcast_vdev: set mcast vdev params 1230 * @cdp_vdev_param_wrap: qwrap ap vap 1231 * 1232 * @cdp_pdev_param_dbg_snf: Enable debug sniffer feature 1233 * @cdp_pdev_param_bpr_enable: Enable bcast probe feature 1234 * @cdp_pdev_param_primary_radio: Configure radio as primary 1235 * @cdp_pdev_param_en_perpkt_txstats: Enable per packet statistics 1236 * @cdp_pdev_param_igmpmld_override: Override IGMP/MLD 1237 * @cdp_pdev_param_igmpmld_tid: TID value when igmmld_override is set 1238 * @cdp_pdev_param_arp_dbg_conf: Enable ARP debug 1239 * @cdp_pdev_param_cptr_latcy: Capture time latency 1240 * @cdp_pdev_param_ingrs_stats: Accumulate ingress statistics 1241 * @cdp_pdev_param_osif_drop: Accumulate drops in OSIF layer 1242 * @cdp_pdev_param_en_rx_cap: Enable enhanced RX capture 1243 * @cdp_pdev_param_en_tx_cap: Enable enhanced TX capture 1244 * @cdp_pdev_param_hmmc_tid_ovrd: Enable hmmc tid override 1245 * @cdp_pdev_param_hmmc_tid: set hmmc tid value 1246 * @cdp_pdev_param_tx_capture: set tx capture 1247 * @cdp_pdev_param_chn_noise_flr: set channel noise floor 1248 * @cdp_pdev_param_cfg_vow: set/get vow config 1249 * @cdp_pdev_param_tidq_override: set/get tid queue override 1250 * @cdp_pdev_param_mon_freq: set monitor frequency 1251 * @cdp_pdev_param_bss_color: configure bss color 1252 * @cdp_pdev_param_tidmap_prty: set/get tid map prty 1253 * @cdp_pdev_param_tx_pending: get tx pending 1254 * @cdp_pdev_param_fltr_neigh_peers: filter neighbour peers 1255 * @cdp_pdev_param_fltr_ucast: filter unicast data 1256 * @cdp_pdev_param_fltr_mcast: filter multicast data 1257 * @cdp_pdev_param_fltr_none: filter no data 1258 * @cdp_pdev_param_monitor_chan: monitor channel 1259 * @cdp_pdev_param_atf_stats_enable: ATF stats enable 1260 * @cdp_pdev_param_config_special_vap: Configure Special vap 1261 * @cdp_pdev_param_isolation : set isolation mode 1262 * 1263 * @cdp_psoc_param_en_rate_stats: set rate stats enable/disable 1264 * @cdp_psoc_param_en_nss_cfg: set nss cfg 1265 * @cdp_ipa_enabled : set ipa mode 1266 * @cdp_psoc_param_vdev_stats_hw_offload: Configure HW vdev stats offload 1267 * @cdp_pdev_param_undecoded_metadata_enable: Undecoded metadata capture enable 1268 */ 1269 typedef union cdp_config_param_t { 1270 /* peer params */ 1271 bool cdp_peer_param_nawds; 1272 bool cdp_peer_param_isolation; 1273 uint8_t cdp_peer_param_nac; 1274 bool cdp_peer_param_in_twt; 1275 1276 /* vdev params */ 1277 bool cdp_vdev_param_wds; 1278 bool cdp_vdev_param_mec; 1279 bool cdp_vdev_param_nawds; 1280 bool cdp_vdev_param_proxysta; 1281 bool cdp_vdev_param_tdls_flags; 1282 bool cdp_vdev_param_ap_brdg_en; 1283 bool cdp_vdev_param_qwrap_isolation; 1284 bool cdp_vdev_param_update_multipass; 1285 uint8_t cdp_vdev_param_da_war; 1286 uint8_t cdp_vdev_param_mcast_en; 1287 uint8_t cdp_vdev_param_igmp_mcast_en; 1288 uint8_t cdp_vdev_param_tidmap_prty; 1289 uint8_t cdp_vdev_param_tidmap_tbl_id; 1290 uint32_t cdp_vdev_param_aging_tmr; 1291 uint32_t cdp_vdev_param_cipher_en; 1292 uint32_t cdp_vdev_param_tx_encap; 1293 uint32_t cdp_vdev_param_rx_decap; 1294 uint32_t cdp_vdev_param_mesh_rx_filter; 1295 uint32_t cdp_vdev_param_mesh_mode; 1296 uint32_t cdp_vdev_param_safe_mode; 1297 uint32_t cdp_vdev_param_drop_unenc; 1298 uint8_t cdp_vdev_param_hlos_tid_override; 1299 bool cdp_vdev_param_wds_ext; 1300 uint8_t cdp_vdev_param_peer_authorize; 1301 uint8_t cdp_vdev_param_peer_tid_latency_enable; 1302 uint8_t cdp_vdev_param_mesh_tid; 1303 uint8_t cdp_vdev_param_dscp_tid_map_id; 1304 bool cdp_vdev_param_mcast_vdev; 1305 bool cdp_vdev_param_wrap; 1306 1307 /* pdev params */ 1308 bool cdp_pdev_param_cptr_latcy; 1309 bool cdp_pdev_param_hmmc_tid_ovrd; 1310 bool cdp_pdev_param_fltr_neigh_peers; 1311 bool cdp_pdev_param_cfg_vow; 1312 bool cdp_pdev_param_fltr_mcast; 1313 bool cdp_pdev_param_fltr_none; 1314 bool cdp_pdev_param_fltr_ucast; 1315 uint8_t cdp_pdev_param_primary_radio; 1316 uint8_t cdp_pdev_param_en_rx_cap; 1317 uint8_t cdp_pdev_param_en_tx_cap; 1318 uint8_t cdp_pdev_param_tx_capture; 1319 uint8_t cdp_pdev_param_hmmc_tid; 1320 uint8_t cdp_pdev_param_tidmap_prty; 1321 uint8_t cdp_pdev_param_igmpmld_override; 1322 uint8_t cdp_pdev_param_igmpmld_tid; 1323 uint8_t cdp_pdev_param_arp_dbg_conf; 1324 uint8_t cdp_pdev_param_tidq_override; 1325 uint8_t cdp_pdev_param_bss_color; 1326 uint16_t cdp_pdev_param_chn_noise_flr; 1327 qdf_freq_t cdp_pdev_param_mon_freq; 1328 int cdp_pdev_param_dbg_snf; 1329 int cdp_pdev_param_bpr_enable; 1330 int cdp_pdev_param_monitor_chan; 1331 uint32_t cdp_pdev_param_ingrs_stats; 1332 uint32_t cdp_pdev_param_osif_drop; 1333 uint32_t cdp_pdev_param_en_perpkt_txstats; 1334 uint32_t cdp_pdev_param_tx_pending; 1335 bool cdp_pdev_param_atf_stats_enable; 1336 bool cdp_pdev_param_config_special_vap; 1337 bool cdp_pdev_param_reset_scan_spcl_vap_stats_enable; 1338 bool cdp_pdev_param_enhanced_stats_enable; 1339 bool cdp_pdev_param_isolation; 1340 1341 /* psoc params */ 1342 bool cdp_psoc_param_en_rate_stats; 1343 int cdp_psoc_param_en_nss_cfg; 1344 int cdp_psoc_param_preferred_hw_mode; 1345 bool cdp_psoc_param_pext_stats; 1346 1347 bool cdp_skip_bar_update; 1348 bool cdp_ipa_enabled; 1349 bool cdp_psoc_param_vdev_stats_hw_offload; 1350 bool cdp_pdev_param_undecoded_metadata_enable; 1351 bool cdp_sawf_enabled; 1352 bool cdp_drop_3addr_mcast; 1353 } cdp_config_param_type; 1354 1355 /** 1356 * cdp_rx_enh_capture_mode - Rx enhanced capture modes 1357 * @CDP_RX_ENH_CAPTURE_DISABLED: Disable Rx enhance capture 1358 * @CDP_RX_ENH_CAPTURE_MPDU: Enable capture of 128 bytes of each MPDU 1359 * @CDP_RX_ENH_CAPTURE_MPDU_MSDU: Enable capture of 128 bytes of each MSDU 1360 */ 1361 enum cdp_rx_enh_capture_mode { 1362 CDP_RX_ENH_CAPTURE_DISABLED = 0, 1363 CDP_RX_ENH_CAPTURE_MPDU, 1364 CDP_RX_ENH_CAPTURE_MPDU_MSDU, 1365 }; 1366 1367 /** 1368 * cdp_rx_enh_capture_peer - Rx enhanced capture peer filtering 1369 * @CDP_RX_ENH_CAPTURE_PEER_DISABLED: Disable Rx ENH capture peer filtering 1370 * @CDP_RX_ENH_CAPTURE_PEER_ENABLED: Enable Rx ENH capture peer filtering 1371 */ 1372 enum cdp_rx_enh_capture_peer { 1373 CDP_RX_ENH_CAPTURE_PEER_DISABLED = 0, 1374 CDP_RX_ENH_CAPTURE_PEER_ENABLED, 1375 }; 1376 1377 /** 1378 * cdp_tx_enh_capture_mode - Tx enhanced capture modes 1379 * @CDP_TX_ENH_CAPTURE_DISABLED: Disable Tx enhance capture for all peers 1380 * @CDP_TX_ENH_CAPTURE_ENABLE_ALL_PEERS: Enable tx capture for all peers 1381 * @CDP_TX_ENH_CAPTURE_ENDIS_PER_PEER: Enable/disable per peer as necessary 1382 */ 1383 enum cdp_tx_enh_capture_mode { 1384 CDP_TX_ENH_CAPTURE_DISABLED = 0, 1385 CDP_TX_ENH_CAPTURE_ENABLE_ALL_PEERS, 1386 CDP_TX_ENH_CAPTURE_ENDIS_PER_PEER, 1387 CDP_TX_ENH_CAPTURE_MAX, 1388 }; 1389 1390 /* 1391 * enum cdp_pdev_bpr_param - different types of parameters 1392 * to set value in pdev 1393 * @CDP_BPR_DISABLE: Set bpr to disable state 1394 * @CDP_BPR_ENABLE: set bpr to enable state 1395 * 1396 * Enum indicating bpr state to enable/disable. 1397 */ 1398 enum cdp_pdev_bpr_param { 1399 CDP_BPR_DISABLE, 1400 CDP_BPR_ENABLE, 1401 }; 1402 1403 /* 1404 * cdp_vdev_param_type: different types of parameters 1405 * to set values in vdev 1406 * @CDP_ENABLE_NAWDS: set nawds enable/disable 1407 * @CDP_ENABLE_MCAST_EN: enable/disable multicast enhancement 1408 * @CDP_ENABLE_WDS: wds sta 1409 * @CDP_ENABLE_MEC: MEC enable flags 1410 * @CDP_ENABLE_PROXYSTA: proxy sta 1411 * @CDP_UPDATE_TDLS_FLAGS: tdls link flags 1412 * @CDP_ENABLE_AP_BRIDGE: set ap_bridging enable/disable 1413 * @CDP_ENABLE_CIPHER : set cipher type based on security 1414 * @CDP_ENABLE_QWRAP_ISOLATION: qwrap isolation mode 1415 * @CDP_TX_ENCAP_TYPE: tx encap type 1416 * @CDP_RX_DECAP_TYPE: rx decap type 1417 * @CDP_MESH_RX_FILTER: set mesh rx filter 1418 * @CDP_TID_VDEV_PRTY: set tid vdev prty 1419 * @CDP_TIDMAP_TBL_ID: set tidmap table id 1420 * @CDP_MESH_MODE: set mesh mode 1421 * @CDP_SAFEMODE: set safe mode 1422 * @CDP_DROP_UNENC: set drop unencrypted flag 1423 * @CDP_ENABLE_IGMP_MCAST_EN: enable/disable igmp multicast enhancement 1424 * @CDP_ENABLE_HLOS_TID_OVERRIDE: set hlos tid override flag 1425 * @CDP_CFG_WDS_EXT: enable/disable wds ext feature 1426 * @CDP_ENABLE_PEER_AUTHORIZE: enable peer authorize flag 1427 * @CDP_ENABLE_PEER_TID_LATENCY: set peer tid latency enable flag 1428 * @CDP_SET_VAP_MESH_TID : Set latency tid in vap 1429 * @CDP_UPDATE_DSCP_TO_TID_MAP: Set DSCP to TID map id 1430 * @CDP_SET_MCAST_VDEV : Set primary mcast vdev 1431 * @CDP_ENABLE_WRAP: qwrap ap 1432 */ 1433 enum cdp_vdev_param_type { 1434 CDP_ENABLE_NAWDS, 1435 CDP_ENABLE_MCAST_EN, 1436 CDP_ENABLE_WDS, 1437 CDP_ENABLE_MEC, 1438 CDP_ENABLE_DA_WAR, 1439 CDP_ENABLE_PROXYSTA, 1440 CDP_UPDATE_TDLS_FLAGS, 1441 CDP_CFG_WDS_AGING_TIMER, 1442 CDP_ENABLE_AP_BRIDGE, 1443 CDP_ENABLE_CIPHER, 1444 CDP_ENABLE_QWRAP_ISOLATION, 1445 CDP_UPDATE_MULTIPASS, 1446 CDP_TX_ENCAP_TYPE, 1447 CDP_RX_DECAP_TYPE, 1448 CDP_MESH_RX_FILTER, 1449 CDP_TID_VDEV_PRTY, 1450 CDP_TIDMAP_TBL_ID, 1451 #ifdef MESH_MODE_SUPPORT 1452 CDP_MESH_MODE, 1453 #endif 1454 CDP_SAFEMODE, 1455 CDP_DROP_UNENC, 1456 CDP_ENABLE_IGMP_MCAST_EN, 1457 CDP_ENABLE_HLOS_TID_OVERRIDE, 1458 #ifdef QCA_SUPPORT_WDS_EXTENDED 1459 CDP_CFG_WDS_EXT, 1460 #endif /* QCA_SUPPORT_WDS_EXTENDED */ 1461 CDP_ENABLE_PEER_AUTHORIZE, 1462 #ifdef WLAN_SUPPORT_MESH_LATENCY 1463 CDP_ENABLE_PEER_TID_LATENCY, 1464 CDP_SET_VAP_MESH_TID, 1465 #endif 1466 #ifdef WLAN_VENDOR_SPECIFIC_BAR_UPDATE 1467 CDP_SKIP_BAR_UPDATE_AP, 1468 #endif 1469 CDP_UPDATE_DSCP_TO_TID_MAP, 1470 CDP_SET_MCAST_VDEV, 1471 CDP_DROP_3ADDR_MCAST, 1472 CDP_ENABLE_WRAP, 1473 }; 1474 1475 /* 1476 * cdp_psoc_param_type: different types of parameters 1477 * to set values in psoc 1478 * @CDP_ENABLE_RATE_STATS: set rate stats enable/disable 1479 * @CDP_SET_NSS_CFG: set nss cfg 1480 * @CDP_SET_PREFERRED_HW_MODE: set preferred hw mode 1481 * @CDP_CFG_PEER_EXT_STATS: Peer extended stats mode. 1482 * @CDP_IPA_ENABLE : set IPA enable mode. 1483 * @CDP_CFG_VDEV_STATS_HW_OFFLOAD: HW Vdev stats config 1484 */ 1485 enum cdp_psoc_param_type { 1486 CDP_ENABLE_RATE_STATS, 1487 CDP_SET_NSS_CFG, 1488 CDP_SET_PREFERRED_HW_MODE, 1489 CDP_CFG_PEER_EXT_STATS, 1490 CDP_IPA_ENABLE, 1491 CDP_CFG_VDEV_STATS_HW_OFFLOAD, 1492 CDP_SAWF_ENABLE, 1493 }; 1494 1495 #define TXRX_FW_STATS_TXSTATS 1 1496 #define TXRX_FW_STATS_RXSTATS 2 1497 #define TXRX_FW_STATS_RX_RATE_INFO 3 1498 #define TXRX_FW_STATS_PHYSTATS 4 1499 #define TXRX_FW_STATS_PHYSTATS_CONCISE 5 1500 #define TXRX_FW_STATS_TX_RATE_INFO 6 1501 #define TXRX_FW_STATS_TID_STATE 7 1502 #define TXRX_FW_STATS_HOST_STATS 8 1503 #define TXRX_FW_STATS_CLEAR_HOST_STATS 9 1504 #define TXRX_FW_STATS_CE_STATS 10 1505 #define TXRX_FW_STATS_VOW_UMAC_COUNTER 11 1506 #define TXRX_FW_STATS_ME_STATS 12 1507 #define TXRX_FW_STATS_TXBF_INFO 13 1508 #define TXRX_FW_STATS_SND_INFO 14 1509 #define TXRX_FW_STATS_ERROR_INFO 15 1510 #define TXRX_FW_STATS_TX_SELFGEN_INFO 16 1511 #define TXRX_FW_STATS_TX_MU_INFO 17 1512 #define TXRX_FW_SIFS_RESP_INFO 18 1513 #define TXRX_FW_RESET_STATS 19 1514 #define TXRX_FW_MAC_WDOG_STATS 20 1515 #define TXRX_FW_MAC_DESC_STATS 21 1516 #define TXRX_FW_MAC_FETCH_MGR_STATS 22 1517 #define TXRX_FW_MAC_PREFETCH_MGR_STATS 23 1518 #define TXRX_FW_STATS_DURATION_INFO 24 1519 #define TXRX_FW_STATS_DURATION_INFO_RESET 25 1520 #define TXRX_FW_HALPHY_STATS 26 1521 #define TXRX_FW_COEX_STATS 27 1522 1523 #define PER_RADIO_FW_STATS_REQUEST 0 1524 #define PER_VDEV_FW_STATS_REQUEST 1 1525 /** 1526 * enum data_stall_log_event_indicator - Module triggering data stall 1527 * @DATA_STALL_LOG_INDICATOR_UNUSED: Unused 1528 * @DATA_STALL_LOG_INDICATOR_HOST_DRIVER: Host driver indicates data stall 1529 * @DATA_STALL_LOG_INDICATOR_FIRMWARE: FW indicates data stall 1530 * @DATA_STALL_LOG_INDICATOR_FRAMEWORK: Framework indicates data stall 1531 * 1532 * Enum indicating the module that indicates data stall event 1533 */ 1534 enum data_stall_log_event_indicator { 1535 DATA_STALL_LOG_INDICATOR_UNUSED, 1536 DATA_STALL_LOG_INDICATOR_HOST_DRIVER, 1537 DATA_STALL_LOG_INDICATOR_FIRMWARE, 1538 DATA_STALL_LOG_INDICATOR_FRAMEWORK, 1539 }; 1540 1541 /** 1542 * enum data_stall_log_event_type - data stall event type 1543 * @DATA_STALL_LOG_NONE 1544 * @DATA_STALL_LOG_FW_VDEV_PAUSE 1545 * @DATA_STALL_LOG_HWSCHED_CMD_FILTER 1546 * @DATA_STALL_LOG_HWSCHED_CMD_FLUSH 1547 * @DATA_STALL_LOG_FW_RX_REFILL_FAILED 1548 * @DATA_STALL_LOG_FW_RX_FCS_LEN_ERROR 1549 * @DATA_STALL_LOG_FW_WDOG_ERRORS 1550 * @DATA_STALL_LOG_BB_WDOG_ERROR 1551 * @DATA_STALL_LOG_POST_TIM_NO_TXRX_ERROR 1552 * @DATA_STALL_LOG_HOST_STA_TX_TIMEOUT 1553 * @DATA_STALL_LOG_HOST_SOFTAP_TX_TIMEOUT 1554 * @DATA_STALL_LOG_NUD_FAILURE 1555 * 1556 * Enum indicating data stall event type 1557 */ 1558 enum data_stall_log_event_type { 1559 DATA_STALL_LOG_NONE, 1560 DATA_STALL_LOG_FW_VDEV_PAUSE, 1561 DATA_STALL_LOG_HWSCHED_CMD_FILTER, 1562 DATA_STALL_LOG_HWSCHED_CMD_FLUSH, 1563 DATA_STALL_LOG_FW_RX_REFILL_FAILED, 1564 DATA_STALL_LOG_FW_RX_FCS_LEN_ERROR, 1565 DATA_STALL_LOG_FW_WDOG_ERRORS, 1566 DATA_STALL_LOG_BB_WDOG_ERROR, 1567 DATA_STALL_LOG_POST_TIM_NO_TXRX_ERROR, 1568 /* Stall events triggered by host/framework start from 0x100 onwards. */ 1569 DATA_STALL_LOG_HOST_STA_TX_TIMEOUT = 0x100, 1570 DATA_STALL_LOG_HOST_SOFTAP_TX_TIMEOUT, 1571 DATA_STALL_LOG_NUD_FAILURE, 1572 }; 1573 1574 /** 1575 * enum data_stall_log_recovery_type - data stall recovery type 1576 * @DATA_STALL_LOG_RECOVERY_NONE, 1577 * @DATA_STALL_LOG_RECOVERY_CONNECT_DISCONNECT, 1578 * @DATA_STALL_LOG_RECOVERY_TRIGGER_PDR 1579 * 1580 * Enum indicating data stall recovery type 1581 */ 1582 enum data_stall_log_recovery_type { 1583 DATA_STALL_LOG_RECOVERY_NONE = 0, 1584 DATA_STALL_LOG_RECOVERY_CONNECT_DISCONNECT, 1585 DATA_STALL_LOG_RECOVERY_TRIGGER_PDR, 1586 }; 1587 1588 /** 1589 * struct data_stall_event_info - data stall info 1590 * @indicator: Module triggering data stall 1591 * @data_stall_type: data stall event type 1592 * @vdev_id_bitmap: vdev_id_bitmap 1593 * @pdev_id: pdev id 1594 * @recovery_type: data stall recovery type 1595 */ 1596 struct data_stall_event_info { 1597 uint32_t indicator; 1598 uint32_t data_stall_type; 1599 uint32_t vdev_id_bitmap; 1600 uint32_t pdev_id; 1601 uint32_t recovery_type; 1602 }; 1603 1604 typedef void (*data_stall_detect_cb)(struct data_stall_event_info *); 1605 1606 /* 1607 * enum cdp_stats - options for host and firmware 1608 * statistics 1609 * @CDP_TXRX_STATS_1: HTT Pdev tx stats 1610 * @CDP_TXRX_STATS_2: HTT Pdev rx stats 1611 * @CDP_TXRX_STATS_3: HTT Pdev Tx HW Queue stats 1612 * @CDP_TXRX_STATS_4: HTT Pdev Tx HW Sched stats 1613 * @CDP_TXRX_STATS_5: HTT Pdev error stats 1614 * @CDP_TXRX_STATS_6: HTT TQM stats 1615 * @CDP_TXRX_STATS_7: HTT TQM CMDQ stats 1616 * @CDP_TXRX_STATS_8: HTT Tx_de_cmn thread stats 1617 * @CDP_TXRX_STATS_9: HTT Pdev Tx rate stats 1618 * @CDP_TXRX_STATS_10: HTT Pdev Rx rate stats 1619 * @CDP_TXRX_STATS_11: HTT Peer stats 1620 * @CDP_TXRX_STATS_12: HTT Tx Self Gen Info 1621 * @CDP_TXRX_STATS_13: HTT Tx MU HWQ stats 1622 * @CDP_TXRX_STATS_14: HTT Ring interface info stats 1623 * @CDP_TXRX_STATS_15: HTT SRNG info stats 1624 * @CDP_TXRX_STATS_16: HTT SFM info stats 1625 * @CDP_TXRX_STATS_17: HTT Pdev tx mu mimo sched info 1626 * @CDP_TXRX_STATS_18: HTT Peer list details 1627 * @CDP_TXRX_STATS_19: Reserved 1628 * @CDP_TXRX_STATS_20: Reset Host stats 1629 * @CDP_TXRX_STATS_21: Host Rx rate stats 1630 * @CDP_TXRX_STATS_22: Host Tx rate stats 1631 * @CDP_TXRX_STATS_23: Host Tx stats 1632 * @CDP_TXRX_STATS_24: Host Rx stats 1633 * @CDP_TXRX_STATS_25: Host Ast stats 1634 * @CDP_TXRX_STATS_26: Host Head/Tail Pointer stats 1635 * @CDP_TXRX_STATS_27: Host Monitor mode stats 1636 * @CDP_TXRX_STATS_28: Host Peer entry stats 1637 * @CDP_TXRX_STATS_29: Host Soc config params info 1638 * @CDP_TXRX_STATS_30: Host Pdev config params info 1639 * @CDP_TXRX_STATS_31: Host DP Interrupt Stats 1640 */ 1641 enum cdp_stats { 1642 CDP_TXRX_STATS_0 = 0, 1643 CDP_TXRX_STATS_1, 1644 CDP_TXRX_STATS_2, 1645 CDP_TXRX_STATS_3, 1646 CDP_TXRX_STATS_4, 1647 CDP_TXRX_STATS_5, 1648 CDP_TXRX_STATS_6, 1649 CDP_TXRX_STATS_7, 1650 CDP_TXRX_STATS_8, 1651 CDP_TXRX_STATS_9, 1652 CDP_TXRX_STATS_10, 1653 CDP_TXRX_STATS_11, 1654 CDP_TXRX_STATS_12, 1655 CDP_TXRX_STATS_13, 1656 CDP_TXRX_STATS_14, 1657 CDP_TXRX_STATS_15, 1658 CDP_TXRX_STATS_16, 1659 CDP_TXRX_STATS_17, 1660 CDP_TXRX_STATS_18, 1661 CDP_TXRX_STATS_19, 1662 CDP_TXRX_STATS_20, 1663 CDP_TXRX_STATS_21, 1664 CDP_TXRX_STATS_22, 1665 CDP_TXRX_STATS_23, 1666 CDP_TXRX_STATS_24, 1667 CDP_TXRX_STATS_25, 1668 CDP_TXRX_STATS_26, 1669 CDP_TXRX_STATS_27, 1670 CDP_TXRX_STATS_28, 1671 CDP_TXRX_STATS_29, 1672 CDP_TXRX_STATS_30, 1673 CDP_TXRX_STATS_31, 1674 CDP_TXRX_STATS_HTT_MAX = 256, 1675 CDP_TXRX_MAX_STATS = 265, 1676 }; 1677 1678 /* 1679 * Different Stat update types sent to OL_IF 1680 * @UPDATE_PEER_STATS: update peer stats 1681 * @UPDATE_VDEV_STATS: update vdev stats 1682 * @UPDATE_PDE_STATS: Update pdev stats 1683 */ 1684 enum cdp_stat_update_type { 1685 UPDATE_PEER_STATS = 0, 1686 UPDATE_VDEV_STATS = 1, 1687 UPDATE_PDEV_STATS = 2, 1688 }; 1689 1690 /* 1691 * struct cdp_tx_sojourn_stats - Tx sojourn stats 1692 * @ppdu_seq_id: ppdu_seq_id from tx completion 1693 * @avg_sojourn_msdu: average sojourn msdu time 1694 * @sum_sojourn_msdu: sum sojourn msdu time 1695 * @num_msdu: number of msdus per ppdu 1696 * @cookie: cookie to be used by upper layer 1697 */ 1698 struct cdp_tx_sojourn_stats { 1699 uint32_t ppdu_seq_id; 1700 qdf_ewma_tx_lag avg_sojourn_msdu[CDP_DATA_TID_MAX]; 1701 uint32_t sum_sojourn_msdu[CDP_DATA_TID_MAX]; 1702 uint32_t num_msdus[CDP_DATA_TID_MAX]; 1703 struct cdp_stats_cookie *cookie; 1704 }; 1705 1706 /** 1707 * struct cdp_delayed_tx_completion_ppdu_user - Delayed Tx PPDU completion 1708 * per-user information 1709 * @frame_ctrl: frame control field in 802.11 header 1710 * @qos_ctrl: QoS control field in 802.11 header 1711 * @mpdu_tried: number of mpdus tried 1712 * @ltf_size: ltf_size 1713 * @stbc: stbc 1714 * @he_re: he_re (range extension) 1715 * @txbf: txbf 1716 * @bw: Transmission bandwidth 1717 * <enum 2 transmit_bw_20_MHz> 1718 * <enum 3 transmit_bw_40_MHz> 1719 * <enum 4 transmit_bw_80_MHz> 1720 * <enum 5 transmit_bw_160_MHz> 1721 * @nss: NSS 1,2, ...8 1722 * @mcs: MCS index 1723 * @preamble: preamble 1724 * @gi: guard interval 800/400/1600/3200 ns 1725 * @dcm: dcm 1726 * @ldpc: ldpc 1727 * @ru_start: RU start index 1728 * @ru_tones: RU tones length 1729 * @is_mcast: MCAST or UCAST 1730 * @user_pos: user position 1731 * @mu_group_id: mu group id 1732 * @ppdu_start_timestamp: 64 bits ppdu start timestamp 1733 * @ppdu_end_timestamp: 64 bits ppdu end timestamp 1734 */ 1735 struct cdp_delayed_tx_completion_ppdu_user { 1736 uint32_t frame_ctrl:16, 1737 qos_ctrl:16; 1738 uint32_t mpdu_tried_ucast:16, 1739 mpdu_tried_mcast:16; 1740 uint32_t ltf_size:2, 1741 stbc:1, 1742 he_re:1, 1743 txbf:4, 1744 bw:4, 1745 nss:4, 1746 mcs:4, 1747 preamble:4, 1748 gi:4, 1749 dcm:1, 1750 ldpc:1, 1751 delayed_ba:1; 1752 uint16_t ru_start; 1753 uint16_t ru_tones; 1754 bool is_mcast; 1755 uint32_t user_pos; 1756 uint32_t mu_group_id; 1757 uint64_t ppdu_start_timestamp; 1758 uint64_t ppdu_end_timestamp; 1759 }; 1760 1761 /** 1762 * struct cdp_tx_completion_ppdu_user - Tx PPDU completion per-user information 1763 * @completion_status: completion status - OK/Filter/Abort/Timeout 1764 * @tid: TID number 1765 * @peer_id: Peer ID 1766 * @ba_size: Block-Ack size 1767 * @frame_ctrl: frame control field in 802.11 header 1768 * @qos_ctrl: QoS control field in 802.11 header 1769 * @mpdu_tried: number of mpdus tried 1770 * @mpdu_success: number of mpdus successfully transmitted 1771 * @long_retries: long retries 1772 * @short_retries: short retries 1773 * @is_ampdu: mpdu aggregate or non-aggregate? 1774 * @success_bytes: bytes successfully transmitted 1775 * @retry_bytes: bytes retried 1776 * @retry_mpdus: mpdus retried 1777 * @failed_msdus: MSDUs failed transmission 1778 * @duration: user duration in ppdu 1779 * @ltf_size: ltf_size 1780 * @stbc: stbc 1781 * @he_re: he_re (range extension) 1782 * @txbf: txbf 1783 * @bw: Transmission bandwidth 1784 * <enum 2 transmit_bw_20_MHz> 1785 * <enum 3 transmit_bw_40_MHz> 1786 * <enum 4 transmit_bw_80_MHz> 1787 * <enum 5 transmit_bw_160_MHz> 1788 * @nss: NSS 1,2, ...8 1789 * @mcs: MCS index 1790 * @preamble: preamble 1791 * @gi: guard interval 800/400/1600/3200 ns 1792 * @dcm: dcm 1793 * @ldpc: ldpc 1794 * @delayed_ba: delayed ba bit 1795 * @ack_ba_tlv: ack ba recv tlv bit 1796 * @ppdu_type: SU/MU_MIMO/MU_OFDMA/MU_MIMO_OFDMA/UL_TRIG/BURST_BCN/UL_BSR_RESP/ 1797 * @pream_punct: Preamble Punctured PPDU 1798 * UL_BSR_TRIG/UNKNOWN 1799 * @is_seq_num_valid: 1800 * 1 - stats tlv has valid sequence number 1801 * 0 - payload has valid sequence number 1802 * @ba_seq_no: Block Ack sequence number 1803 * @ba_bitmap: Block Ack bitmap 1804 * @start_seqa: Sequence number of first MPDU 1805 * @enq_bitmap: Enqueue MPDU bitmap 1806 * @ru_start: RU start index 1807 * @ru_tones: RU tones length 1808 * @is_mcast: MCAST or UCAST 1809 * @tx_rate: Transmission Rate 1810 * @user_pos: user position 1811 * @mu_group_id: mu group id 1812 * @rix: rate index 1813 * @cookie: cookie to used by upper layer 1814 * @is_ppdu_cookie_valid : Indicates that ppdu_cookie is valid 1815 * @ppdu_cookie: 16-bit ppdu_cookie 1816 * @sa_is_training: smart antenna training packets indication 1817 * @rssi_chain: rssi chain per bandwidth 1818 * @usr_ack_rssi: overall per user ack rssi 1819 * @sa_tx_antenna: antenna in which packet is transmitted 1820 * @sa_max_rates: smart antenna tx feedback info max rates 1821 * @sa_goodput: smart antenna tx feedback info goodput 1822 * @current_rate_per: Moving average per 1823 * @last_enq_seq: last equeue sequence number 1824 * @is_bss_peer: is bss peer check 1825 * @mpdu_q: queue of mpdu in a ppdu 1826 * @mpdus: MPDU list based on enqueue sequence bitmap 1827 * @pending_retries: pending MPDUs (retries) 1828 * @tlv_bitmap: per user tlv bitmap 1829 * @skip: tx capture skip flag 1830 * @mon_procd: to indicate user processed in ppdu of the sched cmd 1831 * @debug_copied: flag to indicate bar frame copied 1832 * @peer_last_delayed_ba: flag to indicate peer last delayed ba 1833 * @phy_tx_time_us: Phy TX duration for the User 1834 * @mpdu_bytes: accumulated bytes per mpdu for mem limit feature 1835 * @punc_mode: puncutured mode to indicate punctured bw 1836 * @punc_pattern_bitmap: bitmap indicating punctured pattern 1837 */ 1838 struct cdp_tx_completion_ppdu_user { 1839 uint32_t completion_status:8, 1840 tid:8, 1841 peer_id:16; 1842 uint8_t mac_addr[6]; 1843 uint16_t ba_size; 1844 uint32_t frame_ctrl:16, 1845 qos_ctrl:16; 1846 uint32_t mpdu_tried_ucast:16, 1847 mpdu_tried_mcast:16; 1848 uint16_t mpdu_success:16; 1849 uint16_t mpdu_failed:16; 1850 uint32_t long_retries:4, 1851 short_retries:4, 1852 tx_ratecode:16, 1853 is_ampdu:1, 1854 ppdu_type:5, 1855 pream_punct:1, 1856 is_seq_num_valid:1; 1857 uint32_t success_bytes; 1858 uint32_t retry_bytes; 1859 uint32_t failed_bytes; 1860 uint32_t success_msdus:16, 1861 retry_msdus:16; 1862 uint32_t retry_mpdus; 1863 uint32_t failed_msdus:16, 1864 duration:16; 1865 uint32_t ltf_size:2, 1866 stbc:1, 1867 he_re:1, 1868 txbf:4, 1869 bw:4, 1870 nss:4, 1871 mcs:4, 1872 preamble:4, 1873 gi:4, 1874 dcm:1, 1875 ldpc:1, 1876 delayed_ba:1, 1877 ack_ba_tlv:1; 1878 uint32_t ba_seq_no; 1879 uint32_t ba_bitmap[CDP_BA_256_BIT_MAP_SIZE_DWORDS]; 1880 uint32_t start_seq; 1881 uint32_t enq_bitmap[CDP_BA_256_BIT_MAP_SIZE_DWORDS]; 1882 uint32_t failed_bitmap[CDP_BA_256_BIT_MAP_SIZE_DWORDS]; 1883 uint32_t num_mpdu:9, 1884 num_msdu:16; 1885 uint32_t tx_duration; 1886 uint16_t ru_start; 1887 uint16_t ru_tones; 1888 bool is_mcast; 1889 uint32_t tx_rate; 1890 uint32_t tx_ratekbps; 1891 /*ack rssi for separate chains*/ 1892 uint32_t ack_rssi[CDP_RSSI_CHAIN_LEN]; 1893 bool ack_rssi_valid; 1894 uint32_t usr_ack_rssi; 1895 uint32_t user_pos; 1896 uint32_t mu_group_id; 1897 uint32_t rix; 1898 uint8_t is_ppdu_cookie_valid; 1899 uint16_t ppdu_cookie; 1900 uint8_t sa_is_training; 1901 uint32_t rssi_chain[CDP_RSSI_CHAIN_LEN]; 1902 uint32_t sa_tx_antenna; 1903 /*Max rates for BW: 20MHZ, 40MHZ and 80MHZ and 160MHZ 1904 * |---------------------------------------| 1905 * | 16 bits | 16 bits | 16 bits | 16 bits | 1906 * | BW-1 | BW-2 | BW-3 | BW-4 | 1907 * | /\ \ | 1908 * | / \ \ | 1909 * | / \ \ | 1910 * | / \ \ | 1911 * | / \ \ | 1912 * | / \ \ | 1913 * |/ \ \ | 1914 * |[11|8] [5|8] \ | 1915 * | BW1 PADDED \ | 1916 * |---------------------------------------| 1917 */ 1918 uint16_t sa_max_rates[CDP_NUM_SA_BW]; 1919 uint32_t sa_goodput; 1920 /* below field is used to calculate goodput in non-training period 1921 * Note: As host is exposing goodput and hence current_rate_per is 1922 * of no use. It is just for Host computation. 1923 */ 1924 uint32_t current_rate_per; 1925 uint32_t last_enq_seq; 1926 1927 uint8_t is_bss_peer; 1928 1929 qdf_nbuf_queue_t mpdu_q; 1930 qdf_nbuf_t *mpdus; 1931 uint32_t pending_retries; 1932 uint32_t tlv_bitmap; 1933 bool skip; 1934 bool mon_procd; 1935 bool debug_copied; 1936 bool peer_last_delayed_ba; 1937 1938 uint16_t phy_tx_time_us; 1939 uint32_t mpdu_bytes; 1940 uint8_t punc_mode; 1941 uint16_t punc_pattern_bitmap; 1942 }; 1943 1944 /** 1945 * struct cdp_tx_indication_mpdu_info - Tx MPDU completion information 1946 * @ppdu_id: PPDU id 1947 * @duration: user duration in ppdu 1948 * @frame_type: frame type MGMT/CTRL/DATA/BAR 1949 * @frame_ctrl: frame control field in 802.11 header 1950 * @qos_ctrl: QoS control field in 802.11 header 1951 * @tid: TID number 1952 * @num_msdu: number of msdu in MPDU 1953 * @seq_no: Sequence number of first MPDU 1954 * @ltf_size: ltf_size 1955 * @stbc: stbc 1956 * @he_re: he_re (range extension) 1957 * @txbf: txbf 1958 * @bw: Transmission bandwidth 1959 * <enum 2 transmit_bw_20_MHz> 1960 * <enum 3 transmit_bw_40_MHz> 1961 * <enum 4 transmit_bw_80_MHz> 1962 * <enum 5 transmit_bw_160_MHz> 1963 * @nss: NSS 1,2, ...8 1964 * @mcs: MCS index 1965 * @preamble: preamble 1966 * @gi: guard interval 800/400/1600/3200 ns 1967 * @resp_type: response type 1968 * @mprot_type: medium protection type 1969 * @rts_success: rts success 1970 * @rts failure: rts failure 1971 * @channel: frequency 1972 * @channel_num: channel number 1973 * @ack_rssi: ack rssi 1974 * @ldpc: ldpc 1975 * @tx_rate: Transmission Rate 1976 * @mac_address: peer mac address 1977 * @bss_mac_address: bss mac address 1978 * @ppdu_start_timestamp: TSF at PPDU start 1979 * @ppdu_end_timestamp: TSF at PPDU end 1980 * @ba_start_seq: Block Ack sequence number 1981 * @ba_bitmap: Block Ack bitmap 1982 * @ppdu_cookie: 16-bit ppdu_cookie 1983 * @long_retries: long retries 1984 * @short_retries: short retries 1985 * @completion_status: completion status - OK/Filter/Abort/Timeout 1986 * @usr_idx: user index 1987 */ 1988 struct cdp_tx_indication_mpdu_info { 1989 uint32_t ppdu_id; 1990 uint32_t tx_duration; 1991 uint16_t frame_type; 1992 uint16_t frame_ctrl; 1993 uint16_t qos_ctrl; 1994 uint8_t tid; 1995 uint32_t num_msdu; 1996 uint32_t seq_no; 1997 uint32_t ltf_size:2, 1998 he_re:1, 1999 txbf:4, 2000 bw:4, 2001 nss:4, 2002 mcs:4, 2003 preamble:4, 2004 gi:4; 2005 uint32_t channel; 2006 uint8_t channel_num; 2007 uint32_t ack_rssi; 2008 uint32_t ldpc; 2009 uint32_t tx_rate; 2010 uint8_t mac_address[QDF_MAC_ADDR_SIZE]; 2011 uint8_t bss_mac_address[QDF_MAC_ADDR_SIZE]; 2012 uint64_t ppdu_start_timestamp; 2013 uint64_t ppdu_end_timestamp; 2014 uint32_t ba_start_seq; 2015 uint32_t ba_bitmap[CDP_BA_256_BIT_MAP_SIZE_DWORDS]; 2016 uint16_t ppdu_cookie; 2017 uint16_t long_retries:4, 2018 short_retries:4, 2019 completion_status:8; 2020 uint16_t resp_type:4, 2021 mprot_type:3, 2022 rts_success:1, 2023 rts_failure:1; 2024 uint8_t usr_idx; 2025 }; 2026 2027 /** 2028 * struct cdp_tx_indication_info - Tx capture information 2029 * @radiotap_done: Flag to say radiotap already done or not 2030 * 0 - radiotap not updated 2031 * 1 - radiotap header updated 2032 * @mpdu_info: Tx MPDU completion information 2033 * @mpdu_nbuf: reconstructed mpdu packet 2034 * @ppdu_desc: tx completion ppdu 2035 */ 2036 struct cdp_tx_indication_info { 2037 bool radiotap_done; 2038 struct cdp_tx_indication_mpdu_info mpdu_info; 2039 qdf_nbuf_t mpdu_nbuf; 2040 struct cdp_tx_completion_ppdu *ppdu_desc; 2041 #ifdef QCA_SUPPORT_LITE_MONITOR 2042 ol_osif_vdev_handle osif_vdev; 2043 #endif 2044 }; 2045 2046 /** 2047 * struct cdp_tx_mgmt_comp_info - Tx mgmt comp info 2048 * @ppdu_id: ppdu_id 2049 * @is_sgen_pkt: payload recevied from wmi or htt path 2050 * @retries_count: retries count 2051 * @tx_tsf: 64 bit timestamp 2052 */ 2053 struct cdp_tx_mgmt_comp_info { 2054 uint32_t ppdu_id; 2055 bool is_sgen_pkt; 2056 uint16_t retries_count; 2057 uint64_t tx_tsf; 2058 }; 2059 2060 /** 2061 * struct cdp_tx_completion_ppdu - Tx PPDU completion information 2062 * @completion_status: completion status - OK/Filter/Abort/Timeout 2063 * @ppdu_id: PPDU Id 2064 * @ppdu_seq_id: ppdu sequence id for sojourn stats 2065 * @vdev_id: VAP Id 2066 * @bar_num_users: BA response user count, based on completion common TLV 2067 * @num_users: Number of users 2068 * @max_users: Number of users from USR_INFO TLV 2069 * @drop_reason: drop reason from flush status 2070 * @is_flush: is_flush is set based on flush tlv 2071 * @flow_type: tx flow type from flush status 2072 * @queue_type: queue type from flush status 2073 * @num_mpdu: Number of MPDUs in PPDU 2074 * @num_msdu: Number of MSDUs in PPDU 2075 * @frame_type: frame SU or MU 2076 * @htt_frame_type: frame type from htt 2077 * @frame_ctrl: frame control of 80211 header 2078 * @channel: Channel informartion 2079 * @resp_type: response type 2080 * @mprot_type: medium protection type 2081 * @rts_success: rts success 2082 * @rts failure: rts failure 2083 * @phymode: phy mode 2084 * @ack_rssi: RSSI value of last ack packet (units=dB above noise floor) 2085 * @tx_duration: PPDU airtime 2086 * @ppdu_start_timestamp: TSF at PPDU start 2087 * @ppdu_end_timestamp: TSF at PPDU end 2088 * @ack_timestamp: TSF at the reception of ACK 2089 * @delayed_ba: Delayed ba flag 2090 * @beam_change: beam change bit in ppdu for he-information 2091 * @bss_color: 6 bit value for full bss color 2092 * @doppler: value for doppler (will be 0 most of the times) 2093 * @spatial_reuse: value for spatial reuse used in radiotap HE header 2094 * @usr_nss_sum: Sum of user nss 2095 * @usr_ru_tones_sum: Sum of user ru_tones 2096 * @bar_ppdu_id: BAR ppdu_id 2097 * @bar_tx_duration: BAR tx duration 2098 * @bar_ppdu_start_timestamp: BAR start timestamp 2099 * @bar_ppdu_end_timestamp: BAR end timestamp 2100 * @tlv_bitmap: tlv_bitmap for the PPDU 2101 * @sched_cmdid: schedule command id 2102 * @phy_ppdu_tx_time_us: Phy per PPDU TX duration 2103 * @ppdu_bytes: accumulated bytes per ppdu for mem limit feature 2104 * @user: per-User stats (array of per-user structures) 2105 */ 2106 struct cdp_tx_completion_ppdu { 2107 uint32_t ppdu_id; 2108 uint32_t ppdu_seq_id; 2109 uint16_t vdev_id; 2110 uint16_t bar_num_users; 2111 uint32_t num_users; 2112 uint8_t max_users; 2113 uint8_t last_usr_index; 2114 uint32_t drop_reason; 2115 uint32_t is_flush:1, 2116 flow_type:8, 2117 queue_type:8; 2118 uint32_t num_mpdu:9, 2119 num_msdu:16; 2120 uint16_t frame_type; 2121 uint16_t htt_frame_type; 2122 uint16_t frame_ctrl; 2123 uint16_t channel; 2124 uint16_t resp_type:4, 2125 mprot_type:3, 2126 rts_success:1, 2127 rts_failure:1; 2128 uint16_t phy_mode; 2129 uint32_t ack_rssi; 2130 uint32_t tx_duration; 2131 uint64_t ppdu_start_timestamp; 2132 uint64_t ppdu_end_timestamp; 2133 uint64_t ack_timestamp; 2134 bool delayed_ba; 2135 uint8_t beam_change; 2136 uint8_t bss_color; 2137 uint8_t doppler; 2138 uint8_t spatial_reuse; 2139 uint8_t usr_nss_sum; 2140 uint32_t usr_ru_tones_sum; 2141 uint32_t bar_ppdu_id; 2142 uint32_t bar_tx_duration; 2143 uint64_t bar_ppdu_start_timestamp; 2144 uint64_t bar_ppdu_end_timestamp; 2145 uint32_t tlv_bitmap; 2146 uint16_t sched_cmdid; 2147 uint16_t phy_ppdu_tx_time_us; 2148 uint32_t ppdu_bytes; 2149 struct cdp_tx_completion_ppdu_user user[]; 2150 }; 2151 2152 /** 2153 * struct cdp_dev_stats - Network device stats structure 2154 * @tx_packets: Tx total packets transmitted 2155 * @tx_errors : Tx error due to FW tx failure, Ring failure DMA etc 2156 * @tx_dropped: Tx dropped is same as tx errors as above 2157 * @rx_packets: Rx total packets transmitted 2158 * @rx_errors : Rx erros 2159 * @rx_dropped: Rx dropped stats 2160 * @tx_bytes : Tx total bytes transmitted 2161 * @rx_bytes : Rx total bytes transmitted 2162 */ 2163 struct cdp_dev_stats { 2164 uint32_t tx_packets; 2165 uint32_t tx_errors; 2166 uint32_t tx_dropped; 2167 uint32_t rx_packets; 2168 uint32_t rx_errors; 2169 uint32_t rx_dropped; 2170 uint64_t tx_bytes; 2171 uint64_t rx_bytes; 2172 }; 2173 2174 /** 2175 * struct cdp_rate_stats - Tx/Rx Rate statistics 2176 * @bw: Indicates the BW of the upcoming transmission - 2177 * <enum 2 transmit_bw_20_MHz> 2178 * <enum 3 transmit_bw_40_MHz> 2179 * <enum 4 transmit_bw_80_MHz> 2180 * <enum 5 transmit_bw_160_MHz> 2181 * @pkt_type: Transmit Packet Type 2182 * @stbc: When set, STBC transmission rate was used 2183 * @ldpc: When set, use LDPC transmission rates 2184 * @sgi: <enum 0 0_8_us_sgi > Legacy normal GI 2185 * <enum 1 0_4_us_sgi > Legacy short GI 2186 * <enum 2 1_6_us_sgi > HE related GI 2187 * <enum 3 3_2_us_sgi > HE 2188 * @mcs: Transmit MCS Rate 2189 * @ofdma: Set when the transmission was an OFDMA transmission 2190 * @tones_in_ru: The number of tones in the RU used. 2191 * @tsf: Lower 32 bits of the TSF (timestamp when ppdu transmission finished) 2192 * @peer_id: Peer ID of the flow or MPDU queue 2193 * @tid: TID of the flow or MPDU queue 2194 */ 2195 struct cdp_rate_stats { 2196 uint32_t rate_stats_info_valid:1, 2197 bw:2, 2198 pkt_type:4, 2199 stbc:1, 2200 ldpc:1, 2201 sgi:2, 2202 mcs:4, 2203 ofdma:1, 2204 tones_in_ru:12, 2205 resvd0:4; 2206 uint32_t tsf; 2207 uint16_t peer_id; 2208 uint8_t tid; 2209 }; 2210 2211 /** 2212 * struct cdp_tx_completion_msdu - Tx MSDU completion descriptor 2213 * @ppdu_id: PPDU to which this MSDU belongs 2214 * @transmit_cnt: Number of times this frame has been transmitted 2215 * @ack_frame_rssi: RSSI of the received ACK or BA frame 2216 * @first_msdu: Indicates this MSDU is the first MSDU in AMSDU 2217 * @last_msdu: Indicates this MSDU is the last MSDU in AMSDU 2218 * @msdu_part_of_amsdu : Indicates this MSDU was part of an A-MSDU in MPDU 2219 * @extd: Extended structure containing rate statistics 2220 */ 2221 struct cdp_tx_completion_msdu { 2222 uint32_t ppdu_id; 2223 uint8_t transmit_cnt; 2224 uint32_t ack_frame_rssi:8, 2225 resvd0:1, 2226 first_msdu:1, 2227 last_msdu:1, 2228 msdu_part_of_amsdu:1, 2229 resvd1:20; 2230 struct cdp_rate_stats extd; 2231 }; 2232 2233 /** 2234 * struct cdp_rx_stats_ppdu_user -- per user RX stats 2235 * @peer_id: Peer ID 2236 * @vdev_id: VAP ID 2237 * @is_ampdu: mpdu aggregate or non-aggregate? 2238 * @mu_ul_info_valid: MU UL info valid 2239 * @ofdma_ru_start_index: RU index number(0-73) 2240 * @ofdma_ru_width: size of RU in units of 1(26tone)RU 2241 * @nss: NSS 1,2, ...8 2242 * @mcs: MCS index 2243 * @user_index: user ID in multi-user case 2244 * @is_bss_peer - is bss peer check 2245 * @ast_index: ast index in multi-user case 2246 * @tid: TID number 2247 * @num_msdu: Number of MSDUs in PPDU 2248 * @udp_msdu_count: Number of UDP MSDUs in PPDU 2249 * @tcp_msdu_count: Number of TCP MSDUs in PPDU 2250 * @other_msdu_count: Number of MSDUs other than UDP and TCP MSDUs in PPDU 2251 * @frame_control: frame control field 2252 * @frame_control_info_valid: frame_control valid 2253 * @qos_control: qos control field 2254 * @qos_control_info_valid: qos_control valid 2255 * @data_sequence_control_info_valid: data_sequence_control_info valid 2256 * @first_data_seq_ctrl: Sequence control field of first data frame 2257 * @preamble: preamble 2258 * @ht_flag: ht flag 2259 * @vht_flag: vht flag 2260 * @he_re: he_re (range extension) 2261 * @mac_addr: Peer MAC Address 2262 * @mpdu_cnt_fcs_ok: Number of MPDUs in PPDU with fcs ok 2263 * @mpdu_cnt_fcs_err: Number of MPDUs in PPDU with fcs err 2264 * @mpdu_fcs_ok_bitmap - MPDU with fcs ok bitmap 2265 * @retries - number of retries 2266 * @rx_ratekpbs - rx rate in kbps 2267 * @rix - rate index 2268 * @mpdu_retries - retries of mpdu in rx 2269 * @rx_time_us - Rx duration 2270 */ 2271 struct cdp_rx_stats_ppdu_user { 2272 uint16_t peer_id; 2273 uint8_t vdev_id; 2274 bool is_ampdu; 2275 uint32_t mu_ul_info_valid:1, 2276 ofdma_ru_start_index:7, 2277 ofdma_ru_width:7, 2278 nss:4, 2279 mcs:4; 2280 /* user id */ 2281 uint8_t user_index; 2282 uint8_t is_bss_peer; 2283 uint32_t ast_index; 2284 uint32_t tid; 2285 uint32_t num_msdu; 2286 uint16_t tcp_msdu_count; 2287 uint16_t udp_msdu_count; 2288 uint16_t other_msdu_count; 2289 uint16_t frame_control; 2290 uint8_t frame_control_info_valid; 2291 uint16_t qos_control; 2292 uint8_t qos_control_info_valid; 2293 uint8_t data_sequence_control_info_valid; 2294 uint16_t first_data_seq_ctrl; 2295 uint32_t preamble_type; 2296 uint16_t ht_flags; 2297 uint16_t vht_flags; 2298 uint16_t he_flags; 2299 uint8_t mac_addr[QDF_MAC_ADDR_SIZE]; 2300 uint32_t mpdu_cnt_fcs_ok; 2301 uint32_t mpdu_cnt_fcs_err; 2302 uint32_t mpdu_fcs_ok_bitmap[QDF_MON_STATUS_MPDU_FCS_BMAP_NWORDS]; 2303 uint32_t mpdu_ok_byte_count; 2304 uint32_t mpdu_err_byte_count; 2305 uint32_t retries; 2306 uint32_t rx_ratekbps; 2307 uint32_t rix; 2308 uint32_t mpdu_retries; 2309 uint16_t rx_time_us; 2310 }; 2311 2312 /** 2313 * struct cdp_rx_indication_ppdu - Rx PPDU indication structure 2314 * @ppdu_id: PPDU Id 2315 * @is_ampdu: mpdu aggregate or non-aggregate? 2316 * @num_mpdu: Number of MPDUs in PPDU 2317 * @reserved: Reserved bits for future use 2318 * @num_msdu: Number of MSDUs in PPDU 2319 * @udp_msdu_count: Number of UDP MSDUs in PPDU 2320 * @tcp_msdu_count: Number of TCP MSDUs in PPDU 2321 * @other_msdu_count: Number of MSDUs other than UDP and TCP MSDUs in PPDU 2322 * @duration: PPDU duration 2323 * @tid: TID number 2324 * @peer_id: Peer ID 2325 * @vdev_id: VAP ID 2326 * @mac_addr: Peer MAC Address 2327 * @first_data_seq_ctrl: Sequence control field of first data frame 2328 * @ltf_size: ltf_size 2329 * @stbc: When set, STBC rate was used 2330 * @he_re: he_re (range extension) 2331 * @bw: Bandwidth 2332 * <enum 0 bw_20_MHz> 2333 * <enum 1 bw_40_MHz> 2334 * <enum 2 bw_80_MHz> 2335 * <enum 3 bw_160_MHz> 2336 * @nss: NSS 1,2, ...8 2337 * @mcs: MCS index 2338 * @preamble: preamble 2339 * @gi: <enum 0 0_8_us_sgi > Legacy normal GI 2340 * <enum 1 0_4_us_sgi > Legacy short GI 2341 * <enum 2 1_6_us_sgi > HE related GI 2342 * <enum 3 3_2_us_sgi > HE 2343 * @dcm: dcm 2344 * @ldpc: ldpc 2345 * @ppdu_type: SU/MU_MIMO/MU_OFDMA/MU_MIMO_OFDMA/UL_TRIG/BURST_BCN/UL_BSR_RESP/ 2346 * UL_BSR_TRIG/UNKNOWN 2347 * @rssi: RSSI value (units = dB above noise floor) 2348 * @timestamp: TSF at the reception of PPDU 2349 * @length: PPDU length 2350 * @channel: Channel informartion 2351 * @lsig_A: L-SIG in 802.11 PHY header 2352 * @frame_ctrl: frame control field 2353 * @rix: rate index 2354 * @rssi_chain: rssi chain per nss per bw 2355 * @cookie: cookie to used by upper layer 2356 * @user: per user stats in MU-user case 2357 * @nf: noise floor 2358 * @per_chain_rssi: rssi per antenna 2359 * @punc_bw: punctured bw 2360 * @phyrx_abort: rx aborted undecoded frame indication 2361 * @phyrx_abort_reason: abort reason defined in phyrx_abort_request_info 2362 * @l_sig_length: L SIG A length 2363 * @l_sig_a_parity: L SIG A parity 2364 * @l_sig_a_pkt_type: L SIG A info pkt type 2365 * @l_sig_a_implicit_sounding: L SIG A info captured implicit sounding 2366 * @ht_length: num of bytes in PSDU 2367 * @ht_smoothing: Indicate ht_smoothing 2368 * @ht_not_sounding: Indicate ht not sounding 2369 * @ht_aggregation: Indicate ht aggregation 2370 * @ht_stbc: Indicate ht stbc 2371 * @ht_crc: Indicate ht crc 2372 * @vht_crc: Indicate vht crc 2373 * @vht_no_txop_ps: Indicate TXOP power save mode 2374 * @bss_color_id: Indicate BSS color ID 2375 * @beam_change: Indicates whether spatial mapping is changed 2376 * @dl_ul_flag: Differentiates between DL and UL transmission 2377 * @transmit_mcs: Indicates the data MCS 2378 * @ldpc_extra_sym: LDPC extra symbol 2379 * @special_reuse: Spatial reuse 2380 * @ltf_sym: Indictaes HE NSTS 2381 * @txbf: Indicates whether beamforming is applied 2382 * @pe_disambiguity: packet extension disambiguity 2383 * @pre_fec_pad: packet extension a factor 2384 * @dopplar: Doppler support 2385 * @txop_duration: Indicates the remaining time in the current TXOP 2386 * @sig_b_mcs: MCS of HE-SIG-B 2387 * @sig_b_dcm: DCM of HE-SIG-B 2388 * @sig_b_sym: Number of symbols of HE-SIG-B 2389 * @sig_b_comp: Compression mode of HE-SIG-B 2390 * @he_crc: CRC for HE-SIG contents 2391 * @usr_nss_sum: Sum of user nss 2392 * @usr_ru_tones_sum: Sum of user ru_tones 2393 */ 2394 struct cdp_rx_indication_ppdu { 2395 uint32_t ppdu_id; 2396 uint16_t is_ampdu:1, 2397 num_mpdu:9, 2398 reserved:6; 2399 uint32_t num_msdu; 2400 uint32_t num_bytes; 2401 uint16_t udp_msdu_count; 2402 uint16_t tcp_msdu_count; 2403 uint16_t other_msdu_count; 2404 uint16_t duration; 2405 uint32_t tid:8, 2406 peer_id:16; 2407 uint8_t vdev_id; 2408 uint8_t mac_addr[6]; 2409 uint16_t first_data_seq_ctrl; 2410 union { 2411 uint32_t rate_info; 2412 struct { 2413 uint32_t ltf_size:2, 2414 stbc:1, 2415 he_re:1, 2416 bw:4, 2417 nss:4, 2418 mcs:4, 2419 preamble:4, 2420 gi:4, 2421 dcm:1, 2422 ldpc:1, 2423 ppdu_type:5; 2424 }; 2425 } u; 2426 uint32_t rix; 2427 uint32_t lsig_a; 2428 uint32_t rssi; 2429 uint64_t timestamp; 2430 uint32_t length; 2431 uint8_t channel; 2432 uint8_t beamformed; 2433 2434 uint32_t rx_ratekbps; 2435 uint32_t ppdu_rx_rate; 2436 2437 uint32_t retries; 2438 uint32_t rx_byte_count; 2439 uint16_t rx_ratecode; 2440 uint8_t fcs_error_mpdus; 2441 uint16_t frame_ctrl; 2442 int8_t rssi_chain[SS_COUNT][MAX_BW]; 2443 struct cdp_rx_su_evm_info evm_info; 2444 uint32_t rx_antenna; 2445 uint8_t num_users; 2446 struct cdp_rx_stats_ppdu_user user[CDP_MU_MAX_USERS]; 2447 uint32_t nf; 2448 uint8_t per_chain_rssi[MAX_CHAIN]; 2449 uint8_t is_mcast_bcast; 2450 #if defined(WLAN_CFR_ENABLE) && defined(WLAN_ENH_CFR_ENABLE) 2451 struct cdp_rx_ppdu_cfr_info cfr_info; 2452 #endif 2453 uint8_t punc_bw; 2454 #ifdef QCA_UNDECODED_METADATA_SUPPORT 2455 bool phyrx_abort; 2456 uint8_t phyrx_abort_reason; 2457 uint32_t l_sig_length:12, 2458 l_sig_a_parity:1, 2459 l_sig_a_pkt_type:4, 2460 l_sig_a_implicit_sounding:1, 2461 vht_crc:8, 2462 group_id:6; 2463 uint32_t ht_length:16, 2464 ht_smoothing:1, 2465 ht_not_sounding:1, 2466 ht_aggregation:1, 2467 ht_stbc:2, 2468 ht_crc:8, 2469 vht_no_txop_ps:1; 2470 uint32_t bss_color_id:6, 2471 beam_change:1, 2472 dl_ul_flag:1, 2473 transmit_mcs:4, 2474 ldpc_extra_sym:1, 2475 special_reuse:4, 2476 ltf_sym:3, 2477 txbf:1, 2478 pe_disambiguity:1, 2479 pre_fec_pad:4, 2480 dopplar:1; 2481 uint32_t txop_duration:7, 2482 sig_b_mcs:3, 2483 sig_b_dcm:1, 2484 sig_b_sym:4, 2485 sig_b_comp:1, 2486 he_crc:4; 2487 #endif 2488 uint8_t usr_nss_sum; 2489 uint32_t usr_ru_tones_sum; 2490 }; 2491 2492 /** 2493 * struct cdp_rx_indication_msdu - Rx MSDU info 2494 * @ppdu_id: PPDU to which the MSDU belongs 2495 * @msdu_len: Length of MSDU in bytes 2496 * @ack_frame_rssi: RSSI of the received ACK or BA frame 2497 * @first_msdu: Indicates this MSDU is the first MSDU in AMSDU 2498 * @last_msdu: Indicates this MSDU is the last MSDU in AMSDU 2499 * @msdu_part_of_amsdu : Indicates this MSDU was part of an A-MSDU in MPDU 2500 * @extd: Extended structure containing rate statistics 2501 */ 2502 struct cdp_rx_indication_msdu { 2503 uint32_t ppdu_id; 2504 uint16_t msdu_len; 2505 uint32_t ack_frame_rssi:8, 2506 resvd0:1, 2507 first_msdu:1, 2508 last_msdu:1, 2509 msdu_part_of_amsdu:1, 2510 msdu_part_of_ampdu:1, 2511 resvd1:19; 2512 struct cdp_rate_stats extd; 2513 }; 2514 2515 /** 2516 * struct cdp_config_params - Propagate configuration parameters to datapath 2517 * @tso_enable: Enable/Disable TSO 2518 * @lro_enable: Enable/Disable LRO 2519 * @gro_enable: Enable/Disable GRO 2520 * @flow_steering_enable: Enable/Disable Rx Hash based flow steering 2521 * @p2p_tcp_udp_checksumoffload: Enable/Disable TCP/UDP Checksum Offload for P2P 2522 * @nan_tcp_udp_checksumoffload: Enable/Disable TCP/UDP Checksum Offload for NAN 2523 * @tcp_udp_checksumoffload: Enable/Disable TCP/UDP Checksum Offload 2524 * @legacy_mode_checksumoffload_disable: Disable TCP/UDP Checksum Offload for 2525 * legacy modes. 2526 * @napi_enable: Enable/Disable Napi 2527 * @ipa_enable: Flag indicating if IPA is enabled or not 2528 * @tx_flow_stop_queue_threshold: Value to Pause tx queues 2529 * @tx_flow_start_queue_offset: Available Tx descriptors to unpause 2530 * tx queue 2531 * @tx_comp_loop_pkt_limit: Max # of packets to be processed in 1 tx comp loop 2532 * @rx_reap_loop_pkt_limit: Max # of packets to be processed in 1 rx reap loop 2533 * @rx_hp_oos_update_limit: Max # of HP OOS (out of sync) updates 2534 */ 2535 struct cdp_config_params { 2536 unsigned int tso_enable:1; 2537 unsigned int lro_enable:1; 2538 unsigned int gro_enable:1; 2539 unsigned int flow_steering_enable:1; 2540 unsigned int p2p_tcp_udp_checksumoffload:1; 2541 unsigned int nan_tcp_udp_checksumoffload:1; 2542 unsigned int tcp_udp_checksumoffload:1; 2543 unsigned int legacy_mode_checksumoffload_disable:1; 2544 unsigned int napi_enable:1; 2545 unsigned int ipa_enable:1; 2546 /* Set when QCA_LL_TX_FLOW_CONTROL_V2 is enabled */ 2547 uint8_t tx_flow_stop_queue_threshold; 2548 uint8_t tx_flow_start_queue_offset; 2549 uint32_t tx_comp_loop_pkt_limit; 2550 uint32_t rx_reap_loop_pkt_limit; 2551 uint32_t rx_hp_oos_update_limit; 2552 2553 }; 2554 2555 /** 2556 * cdp_txrx_stats_req: stats request wrapper 2557 * used to pass request information to cdp layer 2558 * @stats: type of stats requested 2559 * @param0: opaque argument 0 to be passed to htt 2560 * @param1: opaque argument 1 to be passed to htt 2561 * @param2: opaque argument 2 to be passed to htt 2562 * @param3: opaque argument 3 to be passed to htt 2563 * @mac id: mac_id 2564 */ 2565 struct cdp_txrx_stats_req { 2566 enum cdp_stats stats; 2567 uint32_t param0; 2568 uint32_t param1; 2569 uint32_t param2; 2570 uint32_t param3; 2571 uint32_t cookie_val; 2572 uint8_t mac_id; 2573 char *peer_addr; 2574 }; 2575 2576 /** 2577 * struct cdp_monitor_filter - monitor filter info 2578 * @mode: set filter mode 2579 * @fp_mgmt: set Filter Pass MGMT Configuration 2580 * @fp_ctrl: set Filter Pass CTRL Configuration 2581 * @fp_data: set Filter Pass DATA Configuration 2582 * @mo_mgmt: set Monitor Other MGMT Configuration 2583 * @mo_ctrl: set Monitor Other CTRL Configuration 2584 * @mo_data: set Monitor other DATA Configuration 2585 * 2586 */ 2587 struct cdp_monitor_filter { 2588 uint16_t mode; 2589 uint16_t fp_mgmt; 2590 uint16_t fp_ctrl; 2591 uint16_t fp_data; 2592 uint16_t mo_mgmt; 2593 uint16_t mo_ctrl; 2594 uint16_t mo_data; 2595 }; 2596 2597 /** 2598 * enum cdp_dp_cfg - CDP ENUMs to get to DP configation 2599 * @cfg_dp_enable_data_stall: context passed to be used by consumer 2600 * @cfg_dp_enable_p2p_ip_tcp_udp_checksum_offload: get P2P checksum config 2601 * @cfg_dp_enable_nan_ip_tcp_udp_checksum_offload: get NAN TX checksum config 2602 * @cfg_dp_enable_ip_tcp_udp_checksum_offload: get TX checksum config for others 2603 * @cfg_dp_tso_enable: get TSO enable config 2604 * @cfg_dp_lro_enable: get LRO enable config 2605 * @cfg_dp_gro_enable: get GRO enable config 2606 * @cfg_dp_tc_based_dyn_gro_enable: get TC based dynamic gro enable config 2607 * @cfg_dp_tc_ingress_prio: priority value to be checked for tc filters 2608 * @cfg_dp_tx_flow_start_queue_offset: get DP TX flow start queue offset 2609 * @cfg_dp_tx_flow_stop_queue_threshold: get DP TX flow stop queue threshold 2610 * @cfg_dp_ipa_uc_tx_buf_size: get IPA TX buf size config 2611 * @cfg_dp_ipa_uc_tx_partition_base: get IPA UC TX partition base config 2612 * @cfg_dp_ipa_uc_rx_ind_ring_count: get IPA rx indication ring count config 2613 * @cfg_dp_enable_flow_steering: get flow steerint enable config 2614 * @cfg_dp_reorder_offload_supported: get reorder offload support config 2615 * @cfg_dp_ce_classify_enable: get CE classify enable config 2616 * @cfg_dp_disable_intra_bss_fwd: get intra bss fwd config 2617 * @cfg_dp_pktlog_buffer_size: get packet log buffer size config 2618 * @cfg_dp_wow_check_rx_pending: get wow rx pending frame check config 2619 */ 2620 enum cdp_dp_cfg { 2621 cfg_dp_enable_data_stall, 2622 cfg_dp_enable_p2p_ip_tcp_udp_checksum_offload, 2623 cfg_dp_enable_nan_ip_tcp_udp_checksum_offload, 2624 cfg_dp_enable_ip_tcp_udp_checksum_offload, 2625 /* Disable checksum offload for legacy modes */ 2626 cfg_dp_disable_legacy_mode_csum_offload, 2627 cfg_dp_tso_enable, 2628 cfg_dp_lro_enable, 2629 cfg_dp_gro_enable, 2630 cfg_dp_tc_based_dyn_gro_enable, 2631 cfg_dp_tc_ingress_prio, 2632 cfg_dp_sg_enable, 2633 cfg_dp_tx_flow_start_queue_offset, 2634 cfg_dp_tx_flow_stop_queue_threshold, 2635 cfg_dp_ipa_uc_tx_buf_size, 2636 cfg_dp_ipa_uc_tx_partition_base, 2637 cfg_dp_ipa_uc_rx_ind_ring_count, 2638 cfg_dp_enable_flow_steering, 2639 cfg_dp_reorder_offload_supported, 2640 cfg_dp_ce_classify_enable, 2641 cfg_dp_disable_intra_bss_fwd, 2642 cfg_dp_pktlog_buffer_size, 2643 cfg_dp_wow_check_rx_pending, 2644 }; 2645 2646 /** 2647 * struct cdp_peer_cookie - cookie used when creating peer 2648 * @ctx: context passed to be used by consumer 2649 * @mac_addr: MAC address of peer 2650 * @peer_id: peer id 2651 * @pdev_id: pdev_id 2652 * @cookie: cookie to be used by consumer 2653 */ 2654 struct cdp_peer_cookie { 2655 struct cdp_stats_cookie *ctx; 2656 uint8_t mac_addr[QDF_MAC_ADDR_SIZE]; 2657 uint8_t peer_id; 2658 uint8_t pdev_id; 2659 uint8_t cookie; 2660 }; 2661 2662 #ifdef WLAN_SUPPORT_RX_FISA 2663 struct cdp_flow_stats { 2664 uint32_t aggr_count; 2665 uint32_t curr_aggr_count; 2666 uint32_t flush_count; 2667 uint32_t bytes_aggregated; 2668 }; 2669 #else 2670 /** 2671 * cdp_flow_stats - Per-Flow (5-tuple) statistics 2672 * @msdu_count: number of rx msdus matching this flow 2673 * @mon_msdu_count: number of msdus matching this flow in mon path 2674 * 2675 * HW also includes msdu_byte_count and timestamp, which 2676 * are not currently tracked in SW. 2677 */ 2678 struct cdp_flow_stats { 2679 uint32_t msdu_count; 2680 uint32_t mon_msdu_count; 2681 }; 2682 #endif 2683 2684 /** 2685 * cdp_flow_fst_operation - RX FST operations allowed 2686 */ 2687 enum cdp_flow_fst_operation { 2688 CDP_FLOW_FST_ENTRY_ADD, 2689 CDP_FLOW_FST_ENTRY_DEL, 2690 CDP_FLOW_FST_RX_BYPASS_ENABLE, 2691 CDP_FLOW_FST_RX_BYPASS_DISABLE 2692 }; 2693 2694 /** 2695 * cdp_flow_protocol_type - RX FST supported protocol types, mapped to HW spec 2696 */ 2697 enum cdp_flow_protocol_type { 2698 CDP_FLOW_PROTOCOL_TYPE_TCP = 6, 2699 CDP_FLOW_PROTOCOL_TYPE_UDP = 17, 2700 }; 2701 2702 /** 2703 * cdp_rx_flow_tuple_info - RX flow tuple info used for addition/deletion 2704 * @tuple_populated: 2705 * @is_exception: Flows which are added to flow table but not aggregated. 2706 * @bypass_fisa: Flow which are not added to flow table. 2707 * @dest_ip_127_96: destination IP address bit fields 96-127 2708 * @dest_ip_95_64: destination IP address bit fields 64-95 2709 * @dest_ip_63_32: destination IP address bit fields 32-63 2710 * @dest_ip_31_0: destination IP address bit fields 0-31 2711 * @src_ip_127_96: source IP address bit fields 96-127 2712 * @src_ip_95_64: source IP address bit fields 64-95 2713 * @src_ip_63_32: source IP address bit fields 32-63 2714 * @src_ip_31_0: source IP address bit fields 0-31 2715 * @dest_port: destination port of flow 2716 * @src_port: source port of flow 2717 * @l4_protocol: protocol type in flow (TCP/UDP) 2718 */ 2719 struct cdp_rx_flow_tuple_info { 2720 #ifdef WLAN_SUPPORT_RX_FISA 2721 uint8_t tuple_populated; 2722 uint8_t is_exception; 2723 bool bypass_fisa; 2724 #endif 2725 uint32_t dest_ip_127_96; 2726 uint32_t dest_ip_95_64; 2727 uint32_t dest_ip_63_32; 2728 uint32_t dest_ip_31_0; 2729 uint32_t src_ip_127_96; 2730 uint32_t src_ip_95_64; 2731 uint32_t src_ip_63_32; 2732 uint32_t src_ip_31_0; 2733 uint16_t dest_port; 2734 uint16_t src_port; 2735 uint16_t l4_protocol; 2736 }; 2737 2738 /** 2739 * cdp_rx_flow_info - RX flow info used for addition/deletion 2740 * @is_addr_ipv4: indicates whether given IP address is IPv4/IPv6 2741 * @op_code: add/delete/enable/disable operation requested 2742 * @flow_tupe_info: structure containing tuple info 2743 * @fse_metadata: metadata to be set in RX flow 2744 */ 2745 struct cdp_rx_flow_info { 2746 bool is_addr_ipv4; 2747 enum cdp_flow_fst_operation op_code; 2748 struct cdp_rx_flow_tuple_info flow_tuple_info; 2749 uint16_t fse_metadata; 2750 }; 2751 2752 #ifdef QCA_SUPPORT_SCAN_SPCL_VAP_STATS 2753 /** 2754 * cdp_scan_spcl_vap_stats - Special vap statistics info 2755 * @rx_ok_pkts: rx fcs ok pkts count 2756 * @rx_ok_bytes: rx fcs ok bytes count 2757 * @rx_err_pkts: rx fcs err pkts count 2758 * @rx_err_bytes: rx fcs err bytes count 2759 * @rx_mgmt_pkts: rx mgmt pkts count 2760 * @rx_ctrl_pkts: rx ctrl pkts count 2761 * @rx_data_pkts: rx data pkts count 2762 */ 2763 struct cdp_scan_spcl_vap_stats { 2764 uint64_t rx_ok_pkts; 2765 uint64_t rx_ok_bytes; 2766 uint64_t rx_err_pkts; 2767 uint64_t rx_err_bytes; 2768 uint64_t rx_mgmt_pkts; 2769 uint64_t rx_ctrl_pkts; 2770 uint64_t rx_data_pkts; 2771 }; 2772 #endif 2773 2774 /** 2775 * cdp_soc_attach_params 2776 * 2777 * @hif_handle: Opaque HIF handle 2778 * @htc_handle: Opaque HTC handle 2779 * @qdf_osdev: QDF device 2780 * @ol_ops: Offload Operations 2781 * @device_id: Device ID 2782 * @ml_context: DP ML object conext 2783 * @mlo_chip_id: MLO chip id, for legacy SOCs chip_id need to 0 2784 * @mlo_enabled: MLO enable bit 2785 */ 2786 struct cdp_soc_attach_params { 2787 struct hif_opaque_softc *hif_handle; 2788 HTC_HANDLE htc_handle; 2789 qdf_device_t qdf_osdev; 2790 struct ol_if_ops *ol_ops; 2791 uint16_t device_id; 2792 struct cdp_mlo_ctxt *ml_context; 2793 uint8_t mlo_chip_id; 2794 uint8_t mlo_enabled; 2795 }; 2796 2797 /* 2798 * cdp_pdev_attach_params 2799 * 2800 * @htc_handle: HTC handle for host-target interface 2801 * @qdf_osdev: QDF OS device 2802 * @pdev_id: PDEV ID 2803 * @mlo_link_id: ML link id 2804 */ 2805 struct cdp_pdev_attach_params { 2806 HTC_HANDLE htc_handle; 2807 qdf_device_t qdf_osdev; 2808 uint8_t pdev_id; 2809 uint32_t mlo_link_id; 2810 }; 2811 #endif 2812