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