1 /* 2 * Copyright (c) 2017-2021 The Linux Foundation. All rights reserved. 3 * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved. 4 * 5 * Permission to use, copy, modify, and/or distribute this software for 6 * any purpose with or without fee is hereby granted, provided that the 7 * above copyright notice and this permission notice appear in all 8 * copies. 9 * 10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL 11 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED 12 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE 13 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL 14 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR 15 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 16 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 17 * PERFORMANCE OF THIS SOFTWARE. 18 */ 19 /** 20 * @file cdp_txrx_ops.h 21 * @brief Define the host data path converged API functions 22 * called by the host control SW and the OS interface module 23 */ 24 #ifndef _CDP_TXRX_CMN_OPS_H_ 25 #define _CDP_TXRX_CMN_OPS_H_ 26 27 #include <cdp_txrx_cmn_struct.h> 28 #include <cdp_txrx_stats_struct.h> 29 #include "cdp_txrx_handle.h" 30 #include <cdp_txrx_mon_struct.h> 31 #include "wlan_objmgr_psoc_obj.h" 32 #include <wmi_unified_api.h> 33 #include <wdi_event_api.h> 34 35 #ifdef IPA_OFFLOAD 36 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 10, 0)) || \ 37 defined(CONFIG_IPA_WDI_UNIFIED_API) 38 #include <qdf_ipa_wdi3.h> 39 #else 40 #include <qdf_ipa.h> 41 #endif 42 #endif 43 44 /** 45 * bitmap values to indicate special handling of peer_delete 46 */ 47 #define CDP_PEER_DELETE_NO_SPECIAL 0 48 #define CDP_PEER_DO_NOT_START_UNMAP_TIMER 1 49 50 struct hif_opaque_softc; 51 52 /* same as ieee80211_nac_param */ 53 enum cdp_nac_param_cmd { 54 /* IEEE80211_NAC_PARAM_ADD */ 55 CDP_NAC_PARAM_ADD = 1, 56 /* IEEE80211_NAC_PARAM_DEL */ 57 CDP_NAC_PARAM_DEL, 58 /* IEEE80211_NAC_PARAM_LIST */ 59 CDP_NAC_PARAM_LIST, 60 }; 61 62 /** 63 * enum cdp_tx_filter_action - TX peer filtering action 64 * @CDP_TX_FILTER_ACTION_ADD: add peer 65 * @CDP_TX_FILTER_ACTION_DEL: delete peer 66 * 67 * whether add or delete 68 */ 69 enum cdp_tx_filter_action { 70 /* add peer mac address*/ 71 CDP_TX_FILTER_ACTION_ADD = 1, 72 /* delete peer mac address */ 73 CDP_TX_FILTER_ACTION_DEL, 74 /* Enable Tx peer filtering */ 75 CDP_TX_FILTER_ACTION_ENABLE_FILTERING, 76 /* Clear Tx peer filtering */ 77 CDP_TX_FILTER_ACTION_CLEAR_FILTERING, 78 }; 79 80 #define CDP_DELBA_INTERVAL_MS 3000 81 /** 82 * enum cdp_delba_rcode - CDP reason code for sending DELBA 83 * @CDP_DELBA_REASON_NONE: None 84 * @CDP_DELBA_2K_JUMP: Sending DELBA from 2k_jump_handle 85 */ 86 enum cdp_delba_rcode { 87 CDP_DELBA_REASON_NONE = 0, 88 CDP_DELBA_2K_JUMP, 89 }; 90 91 /** 92 * enum vdev_peer_protocol_enter_exit - whether ingress or egress 93 * @CDP_VDEV_PEER_PROTOCOL_IS_INGRESS: ingress 94 * @CDP_VDEV_PEER_PROTOCOL_IS_EGRESS: egress 95 * 96 * whether ingress or egress 97 */ 98 enum vdev_peer_protocol_enter_exit { 99 CDP_VDEV_PEER_PROTOCOL_IS_INGRESS, 100 CDP_VDEV_PEER_PROTOCOL_IS_EGRESS 101 }; 102 103 /** 104 * enum vdev_peer_protocol_tx_rx - whether tx or rx 105 * @CDP_VDEV_PEER_PROTOCOL_IS_TX: tx 106 * @CDP_VDEV_PEER_PROTOCOL_IS_RX: rx 107 * 108 * whether tx or rx 109 */ 110 enum vdev_peer_protocol_tx_rx { 111 CDP_VDEV_PEER_PROTOCOL_IS_TX, 112 CDP_VDEV_PEER_PROTOCOL_IS_RX 113 }; 114 115 /** 116 * enum vdev_ll_conn_actions - Actions to informvdev about 117 * low latency connection. 118 * @CDP_VDEV_LL_CONN_ADD: Add Low latency connection 119 * @CDP_VDEV_LL_CONN_DEL: Delete Low latency connection 120 */ 121 enum vdev_ll_conn_actions { 122 CDP_VDEV_LL_CONN_ADD, 123 CDP_VDEV_LL_CONN_DEL 124 }; 125 126 /** 127 * enum cdp_peer_txq_flush_policy: Values for peer TX TID queues flush policy 128 * @CDP_PEER_TXQ_FLUSH_POLICY_NONE: No flush policy configured 129 * @CDP_PEER_TXQ_FLUSH_POLICY_IMMEDIATE: Flush peer TX TID queue(s) immediately 130 * @CDP_PEER_TXQ_FLUSH_POLICY_TWT_SP_END: Flush peer TX TID queue(s) at SP end 131 * 132 * This is used to map the 'flush_policy' in WMI_PEER_FLUSH_POLICY_CMDID 133 */ 134 enum cdp_peer_txq_flush_policy { 135 CDP_PEER_TXQ_FLUSH_POLICY_NONE = 0, 136 CDP_PEER_TXQ_FLUSH_POLICY_IMMEDIATE = 1, 137 CDP_PEER_TXQ_FLUSH_POLICY_TWT_SP_END = 2, 138 139 /* keep last */ 140 CDP_PEER_TXQ_FLUSH_POLICY_INVALID, 141 }; 142 143 /** 144 * struct cdp_mlo_ops - MLO ops for multichip 145 * @mlo_soc_setup: setup DP mlo for SOC 146 * @mlo_soc_teardown: teardown DP mlo for SOC 147 * @mlo_setup_complete: indication to DP that all SOCs mlo is setup 148 * @mlo_update_delta_tsf2: update delta tsf2 for link 149 * @mlo_update_delta_tqm: update delta tqm for SOC 150 * @mlo_update_mlo_ts_offset: update MLO timestamp offset for SOC 151 */ 152 #if defined(WLAN_FEATURE_11BE_MLO) && defined(WLAN_MLO_MULTI_CHIP) 153 struct cdp_mlo_ops { 154 void (*mlo_soc_setup)(struct cdp_soc_t *cdp_soc, 155 struct cdp_mlo_ctxt *mlo_ctxt); 156 void (*mlo_soc_teardown)(struct cdp_soc_t *cdp_soc, 157 struct cdp_mlo_ctxt *mlo_ctxt); 158 QDF_STATUS (*update_mlo_ptnr_list)(struct cdp_soc_t *soc_hdl, 159 int8_t *vdev_ids, uint8_t num_vdevs, 160 uint8_t vdev_id); 161 void (*mlo_setup_complete)(struct cdp_mlo_ctxt *mlo_ctxt); 162 void (*mlo_update_delta_tsf2)(struct cdp_soc_t *soc_hdl, 163 uint8_t pdev_id, 164 uint64_t delta_tsf2); 165 void (*mlo_update_delta_tqm)(struct cdp_soc_t *soc_hdl, 166 uint64_t delta_tqm); 167 void (*mlo_update_mlo_ts_offset)(struct cdp_soc_t *soc_hdl, 168 uint64_t offset); 169 }; 170 #endif 171 172 /****************************************************************************** 173 * 174 * Control Interface (A Interface) 175 * 176 *****************************************************************************/ 177 178 struct cdp_cmn_ops { 179 180 QDF_STATUS (*txrx_soc_attach_target)(ol_txrx_soc_handle soc); 181 182 int (*txrx_pdev_attach_target)(ol_txrx_soc_handle soc, uint8_t pdev_id); 183 184 QDF_STATUS (*txrx_vdev_attach) 185 (struct cdp_soc_t *soc, uint8_t pdev_id, 186 struct cdp_vdev_info *vdev_info); 187 188 QDF_STATUS 189 (*txrx_vdev_detach)(struct cdp_soc_t *cdp_soc, uint8_t vdev_id, 190 ol_txrx_vdev_delete_cb callback, 191 void *cb_context); 192 193 QDF_STATUS (*txrx_pdev_attach) 194 (ol_txrx_soc_handle soc, 195 struct cdp_pdev_attach_params *params); 196 197 int (*txrx_pdev_post_attach)(struct cdp_soc_t *soc, uint8_t pdev_id); 198 199 void 200 (*txrx_pdev_pre_detach)(struct cdp_soc_t *soc, uint8_t pdev_id, 201 int force); 202 203 QDF_STATUS 204 (*txrx_pdev_detach)(struct cdp_soc_t *psoc, uint8_t pdev_id, 205 int force); 206 207 /** 208 * txrx_pdev_deinit() - Deinitialize pdev and dp ring memory 209 * @soc: soc dp handle 210 * @pdev_id: id of Dp pdev handle 211 * @force: Force deinit or not 212 * 213 * Return: QDF_STATUS 214 */ 215 QDF_STATUS 216 (*txrx_pdev_deinit)(struct cdp_soc_t *soc, uint8_t pdev_id, 217 int force); 218 219 QDF_STATUS 220 (*txrx_peer_create) 221 (ol_txrx_soc_handle soc, uint8_t vdev_id, 222 uint8_t *peer_mac_addr, enum cdp_peer_type peer_type); 223 224 QDF_STATUS 225 (*txrx_peer_setup)(struct cdp_soc_t *soc_hdl, uint8_t vdev_id, 226 uint8_t *peer_mac, 227 struct cdp_peer_setup_info *setup_info); 228 229 QDF_STATUS 230 (*txrx_cp_peer_del_response) 231 (ol_txrx_soc_handle soc, uint8_t vdev_id, 232 uint8_t *peer_mac_addr); 233 234 QDF_STATUS 235 (*txrx_peer_teardown) 236 (struct cdp_soc_t *soc, uint8_t vdev_id, uint8_t *peer_mac); 237 238 int (*txrx_peer_add_ast) 239 (ol_txrx_soc_handle soc, uint8_t vdev_id, uint8_t *peer_mac, 240 uint8_t *mac_addr, enum cdp_txrx_ast_entry_type type, 241 uint32_t flags); 242 243 int (*txrx_peer_update_ast) 244 (ol_txrx_soc_handle soc, uint8_t vdev_id, uint8_t *peer_mac, 245 uint8_t *mac_addr, uint32_t flags); 246 247 bool (*txrx_peer_get_ast_info_by_soc) 248 (ol_txrx_soc_handle soc, uint8_t *ast_mac_addr, 249 struct cdp_ast_entry_info *ast_entry_info); 250 251 bool (*txrx_peer_get_ast_info_by_pdev) 252 (ol_txrx_soc_handle soc, uint8_t *ast_mac_addr, 253 uint8_t pdev_id, 254 struct cdp_ast_entry_info *ast_entry_info); 255 256 QDF_STATUS (*txrx_peer_ast_delete_by_soc) 257 (ol_txrx_soc_handle soc, uint8_t *ast_mac_addr, 258 txrx_ast_free_cb callback, 259 void *cookie); 260 261 QDF_STATUS (*txrx_peer_ast_delete_by_pdev) 262 (ol_txrx_soc_handle soc, uint8_t *ast_mac_addr, 263 uint8_t pdev_id, 264 txrx_ast_free_cb callback, 265 void *cookie); 266 267 QDF_STATUS 268 (*txrx_peer_delete)(struct cdp_soc_t *soc, uint8_t vdev_id, 269 uint8_t *peer_mac, uint32_t bitmap, 270 enum cdp_peer_type peer_type); 271 272 QDF_STATUS (*txrx_set_monitor_mode)(struct cdp_soc_t *soc, 273 uint8_t vdev_id, 274 uint8_t smart_monitor); 275 void (*txrx_peer_delete_sync)(struct cdp_soc_t *soc, uint8_t vdev_id, 276 uint8_t *peer_mac, 277 QDF_STATUS(*delete_cb)( 278 uint8_t vdev_id, 279 uint32_t peerid_cnt, 280 uint16_t *peerid_list), 281 uint32_t bitmap); 282 283 void (*txrx_peer_unmap_sync_cb_set)(struct cdp_soc_t *soc_hdl, 284 uint8_t pdev_id, 285 ol_txrx_peer_unmap_sync_cb 286 peer_unmap_sync); 287 288 QDF_STATUS 289 (*txrx_get_peer_mac_from_peer_id) 290 (struct cdp_soc_t *cdp_soc, 291 uint32_t peer_id, uint8_t *peer_mac); 292 293 void 294 (*txrx_vdev_tx_lock)(struct cdp_soc_t *soc, uint8_t vdev_id); 295 296 void 297 (*txrx_vdev_tx_unlock)(struct cdp_soc_t *soc, uint8_t vdev_id); 298 299 QDF_STATUS 300 (*txrx_ath_getstats)(struct cdp_soc_t *soc, uint8_t id, 301 struct cdp_dev_stats *stats, uint8_t type); 302 303 QDF_STATUS 304 (*txrx_set_gid_flag)(struct cdp_soc_t *soc, uint8_t pdev_id, 305 u_int8_t *mem_status, 306 u_int8_t *user_position); 307 308 uint32_t (*txrx_fw_supported_enh_stats_version)(struct cdp_soc_t *soc, 309 uint8_t pdev_id); 310 311 QDF_STATUS 312 (*txrx_if_mgmt_drain)(struct cdp_soc_t *soc, uint8_t pdev_id, 313 int force); 314 315 QDF_STATUS 316 (*txrx_set_curchan)(struct cdp_soc_t *soc, uint8_t pdev_id, 317 uint32_t chan_mhz); 318 319 QDF_STATUS 320 (*txrx_set_privacy_filters) 321 (struct cdp_soc_t *soc, uint8_t vdev_id, void *filter, 322 uint32_t num); 323 324 uint32_t (*txrx_get_cfg)(struct cdp_soc_t *soc, enum cdp_dp_cfg cfg); 325 326 /******************************************************************** 327 * Data Interface (B Interface) 328 ********************************************************************/ 329 330 QDF_STATUS 331 (*txrx_vdev_register)(struct cdp_soc_t *soc, uint8_t vdev_id, 332 ol_osif_vdev_handle osif_vdev, 333 struct ol_txrx_ops *txrx_ops); 334 335 int (*txrx_mgmt_send)(struct cdp_soc_t *soc, uint8_t vdev_id, 336 qdf_nbuf_t tx_mgmt_frm, uint8_t type); 337 338 int (*txrx_mgmt_send_ext)(struct cdp_soc_t *soc, uint8_t vdev_id, 339 qdf_nbuf_t tx_mgmt_frm, uint8_t type, 340 uint8_t use_6mbps, uint16_t chanfreq); 341 342 /** 343 * ol_txrx_mgmt_tx_cb - tx management delivery notification 344 * callback function 345 */ 346 347 QDF_STATUS 348 (*txrx_mgmt_tx_cb_set)(struct cdp_soc_t *soc, uint8_t pdev_id, 349 uint8_t type, 350 ol_txrx_mgmt_tx_cb download_cb, 351 ol_txrx_mgmt_tx_cb ota_ack_cb, 352 void *ctxt); 353 354 /** 355 * ol_txrx_data_tx_cb - Function registered with the data path 356 * that is called when tx frames marked as "no free" are 357 * done being transmitted 358 */ 359 360 void (*txrx_data_tx_cb_set)(struct cdp_soc_t *soc, uint8_t vdev_id, 361 ol_txrx_data_tx_cb callback, void *ctxt); 362 363 qdf_nbuf_t (*tx_send_exc) 364 (ol_txrx_soc_handle soc, uint8_t vdev_id, qdf_nbuf_t msdu_list, 365 struct cdp_tx_exception_metadata *tx_exc_metadata); 366 367 /******************************************************************* 368 * Statistics and Debugging Interface (C Interface) 369 ********************************************************************/ 370 371 int (*txrx_aggr_cfg)(struct cdp_soc_t *soc, uint8_t vdev_id, 372 int max_subfrms_ampdu, 373 int max_subfrms_amsdu); 374 375 A_STATUS 376 (*txrx_fw_stats_get)(struct cdp_soc_t *soc, uint8_t vdev_id, 377 struct ol_txrx_stats_req *req, 378 bool per_vdev, bool response_expected); 379 380 int (*txrx_debug)(struct cdp_soc_t *soc, uint8_t vdev_id, 381 int debug_specs); 382 383 QDF_STATUS 384 (*txrx_fw_stats_cfg)(struct cdp_soc_t *soc, uint8_t vdev_id, 385 uint8_t cfg_stats_type, uint32_t cfg_val); 386 387 void (*txrx_print_level_set)(unsigned level); 388 389 /** 390 * ol_txrx_get_vdev_mac_addr() - Return mac addr of vdev 391 * @soc: datapath soc handle 392 * @vdev_id: vdev id 393 * 394 * Return: vdev mac address 395 */ 396 uint8_t * (*txrx_get_vdev_mac_addr)(struct cdp_soc_t *soc, 397 uint8_t vdev_id); 398 399 /** 400 * ol_txrx_get_ctrl_pdev_from_vdev() - Return control pdev of vdev 401 * @soc: datapath soc handle 402 * @vdev_id: vdev id 403 * 404 * Return: Handle to control pdev 405 */ 406 struct cdp_cfg *(*txrx_get_ctrl_pdev_from_vdev)(struct cdp_soc_t *soc, 407 uint8_t vdev_id); 408 409 /** 410 * txrx_get_mon_vdev_from_pdev() - Return monitor mode vdev 411 * @soc: datapath soc handle 412 * @pdev: pdev id 413 * 414 * Return: vdev_id 415 */ 416 uint8_t (*txrx_get_mon_vdev_from_pdev)(struct cdp_soc_t *soc, 417 uint8_t pdev_id); 418 419 void (*txrx_soc_detach)(struct cdp_soc_t *soc); 420 421 /** 422 * txrx_soc_deinit() - Deinitialize dp soc and dp ring memory 423 * @soc: Opaque Dp handle 424 * 425 * Return None 426 */ 427 void (*txrx_soc_deinit)(struct cdp_soc_t *soc); 428 429 /** 430 * txrx_soc_init() - Initialize dp soc and dp ring memory 431 * @soc: Opaque Dp handle 432 * @ctrl_psoc: Opaque Cp handle 433 * @htchdl: Opaque htc handle 434 * @hifhdl: Opaque hif handle 435 * 436 * Return: None 437 */ 438 void *(*txrx_soc_init)(struct cdp_soc_t *soc, 439 struct cdp_ctrl_objmgr_psoc *ctrl_psoc, 440 struct hif_opaque_softc *hif_handle, 441 HTC_HANDLE htc_handle, qdf_device_t qdf_osdev, 442 struct ol_if_ops *ol_ops, uint16_t device_id); 443 444 QDF_STATUS (*txrx_pdev_init)(ol_txrx_soc_handle soc, 445 HTC_HANDLE htc_handle, 446 qdf_device_t qdf_osdev, 447 uint8_t pdev_id); 448 449 /** 450 * txrx_tso_soc_attach() - TSO attach handler triggered during 451 * dynamic tso activation 452 * @soc: Opaque Dp handle 453 * 454 * Return: QDF status 455 */ 456 QDF_STATUS (*txrx_tso_soc_attach)(struct cdp_soc_t *soc); 457 458 /** 459 * txrx_tso_soc_detach() - TSO detach handler triggered during 460 * dynamic tso de-activation 461 * @soc: Opaque Dp handle 462 * 463 * Return: QDF status 464 */ 465 QDF_STATUS (*txrx_tso_soc_detach)(struct cdp_soc_t *soc); 466 int (*addba_resp_tx_completion)(struct cdp_soc_t *cdp_soc, 467 uint8_t *peer_mac, 468 uint16_t vdev_id, uint8_t tid, 469 int status); 470 471 int (*addba_requestprocess)(struct cdp_soc_t *cdp_soc, 472 uint8_t *peer_mac, 473 uint16_t vdev_id, 474 uint8_t dialogtoken, 475 uint16_t tid, uint16_t batimeout, 476 uint16_t buffersize, 477 uint16_t startseqnum); 478 479 QDF_STATUS 480 (*addba_responsesetup)(struct cdp_soc_t *cdp_soc, 481 uint8_t *peer_mac, 482 uint16_t vdev_id, uint8_t tid, 483 uint8_t *dialogtoken, uint16_t *statuscode, 484 uint16_t *buffersize, uint16_t *batimeout); 485 486 int (*delba_process)(struct cdp_soc_t *cdp_soc, uint8_t *peer_mac, 487 uint16_t vdev_id, int tid, uint16_t reasoncode); 488 489 QDF_STATUS (*tid_update_ba_win_size)(ol_txrx_soc_handle soc, 490 uint8_t *peer_mac, 491 uint16_t vdev_id, uint8_t tid, 492 uint16_t buffersize); 493 /** 494 * delba_tx_completion() - Indicate delba tx status 495 * @cdp_soc: soc handle 496 * @peer_mac: Peer mac address 497 * @vdev_id: vdev id 498 * @tid: Tid number 499 * @status: Tx completion status 500 * 501 * Return: 0 on Success, 1 on failure 502 */ 503 int (*delba_tx_completion)(struct cdp_soc_t *cdp_soc, uint8_t *peer_mac, 504 uint16_t vdev_id, 505 uint8_t tid, int status); 506 507 QDF_STATUS 508 (*set_addba_response)(struct cdp_soc_t *cdp_soc, uint8_t *peer_mac, 509 uint16_t vdev_id, uint8_t tid, 510 uint16_t statuscode); 511 512 QDF_STATUS 513 (*set_vdev_dscp_tid_map)(struct cdp_soc_t *soc_handle, 514 uint8_t vdev_id, uint8_t map_id); 515 int (*txrx_get_total_per)(struct cdp_soc_t *soc, uint8_t pdev_id); 516 517 void (*flush_cache_rx_queue)(void); 518 519 QDF_STATUS (*set_pdev_dscp_tid_map)(struct cdp_soc_t *soc_handle, 520 uint8_t pdev_id, 521 uint8_t map_id, 522 uint8_t tos, uint8_t tid); 523 524 QDF_STATUS (*txrx_stats_request)(struct cdp_soc_t *soc_handle, 525 uint8_t vdev_id, 526 struct cdp_txrx_stats_req *req); 527 528 QDF_STATUS (*display_stats)(struct cdp_soc_t *psoc, uint16_t value, 529 enum qdf_stats_verbosity_level level); 530 531 QDF_STATUS (*txrx_intr_attach)(struct cdp_soc_t *soc_handle); 532 void (*txrx_intr_detach)(struct cdp_soc_t *soc_handle); 533 QDF_STATUS (*set_pn_check)(struct cdp_soc_t *soc_handle, 534 uint8_t vdev_id, uint8_t *peermac, 535 enum cdp_sec_type sec_type, 536 uint32_t *rx_pn); 537 538 QDF_STATUS(*set_key_sec_type)(struct cdp_soc_t *soc_handle, 539 uint8_t vdev_id, uint8_t *peermac, 540 enum cdp_sec_type sec_type, 541 bool is_unicast); 542 543 QDF_STATUS (*update_config_parameters)(struct cdp_soc *psoc, 544 struct cdp_config_params *params); 545 546 void *(*get_dp_txrx_handle)(ol_txrx_soc_handle soc, uint8_t pdev_id); 547 void (*set_dp_txrx_handle)(ol_txrx_soc_handle soc, uint8_t pdev_id, 548 void *dp_hdl); 549 550 void *(*get_vdev_dp_ext_txrx_handle)(struct cdp_soc_t *soc, 551 uint8_t vdev_id); 552 QDF_STATUS (*set_vdev_dp_ext_txrx_handle)(struct cdp_soc_t *soc, 553 uint8_t vdev_id, 554 uint16_t size); 555 556 void *(*get_soc_dp_txrx_handle)(struct cdp_soc *soc_handle); 557 void (*set_soc_dp_txrx_handle)(struct cdp_soc *soc_handle, 558 void *dp_txrx_handle); 559 560 QDF_STATUS (*map_pdev_to_lmac)(ol_txrx_soc_handle soc, uint8_t pdev_id, 561 uint32_t lmac_id); 562 563 QDF_STATUS (*handle_mode_change)(ol_txrx_soc_handle soc, 564 uint8_t pdev_id, uint32_t lmac_id); 565 566 QDF_STATUS (*set_pdev_status_down)(struct cdp_soc_t *soc_handle, 567 uint8_t pdev_id, bool is_pdev_down); 568 569 QDF_STATUS (*txrx_peer_reset_ast) 570 (ol_txrx_soc_handle soc, uint8_t *ast_macaddr, 571 uint8_t *peer_macaddr, uint8_t vdev_id); 572 573 QDF_STATUS (*txrx_peer_reset_ast_table)(ol_txrx_soc_handle soc, 574 uint8_t vdev_id); 575 576 void (*txrx_peer_flush_ast_table)(ol_txrx_soc_handle soc); 577 void (*txrx_set_ba_aging_timeout)(struct cdp_soc_t *soc_handle, 578 uint8_t ac, uint32_t value); 579 void (*txrx_get_ba_aging_timeout)(struct cdp_soc_t *soc_handle, 580 uint8_t ac, uint32_t *value); 581 582 QDF_STATUS (*txrx_peer_map_attach)(ol_txrx_soc_handle soc, 583 uint32_t num_peers, 584 uint32_t max_ast_index, 585 uint8_t peer_map_unmap_v); 586 587 QDF_STATUS (*set_soc_param)(ol_txrx_soc_handle soc, 588 enum cdp_soc_param_t param, 589 uint32_t value); 590 591 ol_txrx_tx_fp tx_send; 592 593 /* tx_fast_send will be called only in AP mode when all the 594 * transmit path features are disabled including extended stats 595 */ 596 ol_txrx_tx_fast_fp tx_fast_send; 597 598 void (*set_tx_pause)(ol_txrx_soc_handle soc, bool flag); 599 600 /** 601 * txrx_get_os_rx_handles_from_vdev() - Return function, osif vdev 602 * to deliver pkt to stack. 603 * @soc: datapath soc handle 604 * @vdev: vdev id 605 * @stack_fn: pointer to - function pointer to deliver RX pkt to stack 606 * @osif_vdev: pointer to - osif vdev to deliver RX packet to. 607 */ 608 void (*txrx_get_os_rx_handles_from_vdev) 609 (ol_txrx_soc_handle soc, 610 uint8_t vdev_id, 611 ol_txrx_rx_fp *stack_fn, 612 ol_osif_vdev_handle *osif_vdev); 613 614 void (*set_rate_stats_ctx)(struct cdp_soc_t *soc, 615 void *ctx); 616 617 int (*txrx_classify_update) 618 (struct cdp_soc_t *soc, uint8_t vdev_id, qdf_nbuf_t skb, 619 enum txrx_direction, struct ol_txrx_nbuf_classify *nbuf_class); 620 621 bool (*get_dp_capabilities)(struct cdp_soc_t *soc, 622 enum cdp_capabilities dp_caps); 623 void* (*get_rate_stats_ctx)(struct cdp_soc_t *soc); 624 QDF_STATUS (*txrx_peer_flush_rate_stats)(struct cdp_soc_t *soc, 625 uint8_t pdev_id, 626 void *buf); 627 void* (*txrx_peer_get_peerstats_ctx)(struct cdp_soc_t *soc, 628 uint8_t vdev_id, 629 uint8_t *mac_addr); 630 631 QDF_STATUS (*txrx_flush_rate_stats_request)(struct cdp_soc_t *soc, 632 uint8_t pdev_id); 633 QDF_STATUS (*set_pdev_pcp_tid_map)(struct cdp_soc_t *soc, 634 uint8_t pdev_id, 635 uint8_t pcp, uint8_t tid); 636 QDF_STATUS (*set_vdev_pcp_tid_map)(struct cdp_soc_t *soc, 637 uint8_t vdev_id, 638 uint8_t pcp, uint8_t tid); 639 #ifdef DP_RX_UDP_OVER_PEER_ROAM 640 QDF_STATUS (*txrx_update_roaming_peer)(struct cdp_soc_t *soc, 641 uint8_t vdev_id, 642 uint8_t *peer_mac, 643 uint32_t auth_status); 644 #endif 645 646 #ifdef QCA_MULTIPASS_SUPPORT 647 QDF_STATUS (*set_vlan_groupkey)(struct cdp_soc_t *soc, uint8_t vdev_id, 648 uint16_t vlan_id, uint16_t group_key); 649 #endif 650 651 uint16_t (*get_peer_mac_list) 652 (ol_txrx_soc_handle soc, uint8_t vdev_id, 653 u_int8_t newmac[][QDF_MAC_ADDR_SIZE], uint16_t mac_cnt, 654 bool limit); 655 uint16_t (*get_peer_id)(ol_txrx_soc_handle soc, 656 uint8_t vdev_id, 657 uint8_t *mac); 658 #ifdef QCA_SUPPORT_WDS_EXTENDED 659 QDF_STATUS (*set_wds_ext_peer_rx)(ol_txrx_soc_handle soc, 660 uint8_t vdev_id, 661 uint8_t *mac, 662 ol_txrx_rx_fp rx, 663 ol_osif_peer_handle osif_peer); 664 #endif /* QCA_SUPPORT_WDS_EXTENDED */ 665 void (*txrx_drain)(ol_txrx_soc_handle soc); 666 int (*get_free_desc_poolsize)(struct cdp_soc_t *soc); 667 #ifdef WLAN_SYSFS_DP_STATS 668 QDF_STATUS (*txrx_sysfs_fill_stats)(ol_txrx_soc_handle soc, 669 char *buf, uint32_t buf_size); 670 QDF_STATUS (*txrx_sysfs_set_stat_type)(ol_txrx_soc_handle soc, 671 uint32_t stat_type, 672 uint32_t mac_id); 673 #endif /* WLAN_SYSFS_DP_STATS */ 674 #ifdef WLAN_FEATURE_PKT_CAPTURE_V2 675 void (*set_pkt_capture_mode)(struct cdp_soc_t *soc, bool val); 676 #endif 677 678 #ifdef FEATURE_RUNTIME_PM 679 void (*set_rtpm_tput_policy)(struct cdp_soc_t *soc, bool val); 680 #endif 681 682 #if defined(WLAN_FEATURE_11BE_MLO) && defined(WLAN_MLO_MULTI_CHIP) 683 void (*txrx_recovery_vdev_flush_peers)(struct cdp_soc_t *soc, 684 uint8_t vdev_id, 685 bool mlo_peers_only); 686 #endif 687 QDF_STATUS (*txrx_umac_reset_deinit)(ol_txrx_soc_handle soc); 688 void (*txrx_get_tsf_time)(struct cdp_soc_t *soc_hdl, uint32_t tsf_id, 689 uint32_t mac_id, uint64_t *tsf, 690 uint64_t *tsf_sync_soc_time); 691 692 }; 693 694 struct cdp_ctrl_ops { 695 696 int 697 (*txrx_mempools_attach)(ol_txrx_soc_handle dp_soc); 698 int 699 (*txrx_update_filter_neighbour_peers)( 700 struct cdp_soc_t *soc, uint8_t vdev_id, 701 uint32_t cmd, uint8_t *macaddr); 702 703 /* Is this similar to ol_txrx_peer_state_update() in MCL */ 704 /** 705 * @brief Update the authorize peer object at association time 706 * @details 707 * For the host-based implementation of rate-control, it 708 * updates the peer/node-related parameters within rate-control 709 * context of the peer at association. 710 * 711 * @param soc_hdl - pointer to the soc object 712 * @param vdev_id - id of the virtual object 713 * @param peer_mac - mac address of the node's object 714 * @authorize - either to authorize or unauthorize peer 715 * 716 * @return QDF_STATUS 717 */ 718 QDF_STATUS 719 (*txrx_peer_authorize)(struct cdp_soc_t *soc_hdl, 720 uint8_t vdev_id, 721 uint8_t *peer_mac, 722 u_int32_t authorize); 723 bool 724 (*txrx_peer_get_authorize)(struct cdp_soc_t *soc_hdl, 725 uint8_t vdev_id, 726 uint8_t *peer_mac); 727 728 void (*tx_flush_buffers)(struct cdp_soc_t *soc, uint8_t vdev_id); 729 730 int (*txrx_is_target_ar900b)(struct cdp_soc_t *soc_hdl); 731 732 QDF_STATUS 733 (*txrx_set_vdev_param)(struct cdp_soc_t *soc, uint8_t vdev_id, 734 enum cdp_vdev_param_type param, 735 cdp_config_param_type val); 736 737 /** 738 * @brief Set the reo dest ring num of the radio 739 * @details 740 * Set the reo destination ring no on which we will receive 741 * pkts for this radio. 742 * 743 * @txrx_soc - soc handle 744 * @param pdev_id - id of physical device 745 * @return the reo destination ring number 746 * @param reo_dest_ring_num - value ranges between 1 - 4 747 */ 748 QDF_STATUS (*txrx_set_pdev_reo_dest)( 749 struct cdp_soc_t *txrx_soc, 750 uint8_t pdev_id, 751 enum cdp_host_reo_dest_ring reo_dest_ring_num); 752 753 /** 754 * @brief Get the reo dest ring num of the radio 755 * @details 756 * Get the reo destination ring no on which we will receive 757 * pkts for this radio. 758 * 759 * @txrx_soc - soc handle 760 * @param pdev_id - id of physical device 761 * @return the reo destination ring number 762 */ 763 enum cdp_host_reo_dest_ring (*txrx_get_pdev_reo_dest)( 764 struct cdp_soc_t *txrx_soc, 765 uint8_t pdev_id); 766 767 int (*txrx_wdi_event_sub)(struct cdp_soc_t *soc, uint8_t pdev_id, 768 wdi_event_subscribe *event_cb_sub, 769 uint32_t event); 770 771 int (*txrx_wdi_event_unsub)(struct cdp_soc_t *soc, uint8_t pdev_id, 772 wdi_event_subscribe *event_cb_sub, 773 uint32_t event); 774 775 int (*txrx_get_sec_type)(ol_txrx_soc_handle soc, uint8_t vdev_id, 776 uint8_t *peer_mac, uint8_t sec_idx); 777 778 QDF_STATUS 779 (*txrx_update_mgmt_txpow_vdev)(struct cdp_soc_t *soc, 780 uint8_t vdev_id, 781 uint8_t subtype, uint8_t tx_power); 782 783 /** 784 * txrx_set_pdev_param() - callback to set pdev parameter 785 * @soc: opaque soc handle 786 * @pdev_id:id of data path pdev handle 787 * @val: value of pdev_tx_capture 788 * 789 * Return: status: 0 - Success, non-zero: Failure 790 */ 791 QDF_STATUS (*txrx_set_pdev_param)(struct cdp_soc_t *soc, 792 uint8_t pdev_id, 793 enum cdp_pdev_param_type type, 794 cdp_config_param_type val); 795 796 QDF_STATUS (*txrx_get_pdev_param)(struct cdp_soc_t *soc, 797 uint8_t pdev_id, 798 enum cdp_pdev_param_type type, 799 cdp_config_param_type *val); 800 801 QDF_STATUS (*txrx_set_peer_param)(struct cdp_soc_t *soc, 802 uint8_t vdev_id, uint8_t *peer_mac, 803 enum cdp_peer_param_type param, 804 cdp_config_param_type val); 805 806 QDF_STATUS (*txrx_get_peer_param)(struct cdp_soc_t *soc, 807 uint8_t vdev_id, uint8_t *peer_mac, 808 enum cdp_peer_param_type param, 809 cdp_config_param_type *val); 810 811 void * (*txrx_get_pldev)(struct cdp_soc_t *soc, uint8_t pdev_id); 812 void (*txrx_peer_flush_frags)(struct cdp_soc_t *soc, uint8_t vdev_id, 813 uint8_t *peer_mac); 814 815 #ifdef VDEV_PEER_PROTOCOL_COUNT 816 void (*txrx_peer_protocol_cnt)(struct cdp_soc_t *soc, 817 int8_t vdev_id, 818 qdf_nbuf_t nbuf, 819 bool is_egress, 820 bool is_rx); 821 #endif 822 #ifdef ATH_SUPPORT_NAC_RSSI 823 QDF_STATUS (*txrx_vdev_config_for_nac_rssi)(struct cdp_soc_t *cdp_soc, 824 uint8_t vdev_id, 825 enum cdp_nac_param_cmd cmd, 826 char *bssid, 827 char *client_macaddr, 828 uint8_t chan_num); 829 830 QDF_STATUS (*txrx_vdev_get_neighbour_rssi)(struct cdp_soc_t *cdp_soc, 831 uint8_t vdev_id, 832 char *macaddr, 833 uint8_t *rssi); 834 #endif 835 836 #ifdef WLAN_SUPPORT_MSCS 837 QDF_STATUS 838 (*txrx_record_mscs_params) ( 839 struct cdp_soc_t *soc, uint8_t *macaddr, 840 uint8_t vdev_id, 841 struct cdp_mscs_params *mscs_params, 842 bool active); 843 #endif 844 845 QDF_STATUS 846 (*set_key)(struct cdp_soc_t *soc, uint8_t vdev_id, uint8_t *mac, 847 bool is_unicast, uint32_t *key); 848 849 QDF_STATUS (*txrx_get_vdev_param)(struct cdp_soc_t *soc, 850 uint8_t vdev_id, 851 enum cdp_vdev_param_type param, 852 cdp_config_param_type *val); 853 int (*enable_peer_based_pktlog)(struct cdp_soc_t *cdp_soc, 854 uint8_t pdev_id, 855 uint8_t *macaddr, uint8_t enb_dsb); 856 857 QDF_STATUS 858 (*calculate_delay_stats)(struct cdp_soc_t *cdp_soc, 859 uint8_t vdev_id, qdf_nbuf_t nbuf); 860 #ifdef WLAN_SUPPORT_RX_PROTOCOL_TYPE_TAG 861 QDF_STATUS (*txrx_update_pdev_rx_protocol_tag)( 862 struct cdp_soc_t *soc, uint8_t pdev_id, 863 uint32_t protocol_mask, uint16_t protocol_type, 864 uint16_t tag); 865 #ifdef WLAN_SUPPORT_RX_TAG_STATISTICS 866 void (*txrx_dump_pdev_rx_protocol_tag_stats)( 867 struct cdp_soc_t *soc, uint8_t pdev_id, 868 uint16_t protocol_type); 869 #endif /* WLAN_SUPPORT_RX_TAG_STATISTICS */ 870 #endif /* WLAN_SUPPORT_RX_PROTOCOL_TYPE_TAG */ 871 #ifdef WLAN_SUPPORT_RX_FLOW_TAG 872 QDF_STATUS (*txrx_set_rx_flow_tag)( 873 struct cdp_soc_t *cdp_soc, uint8_t pdev_id, 874 struct cdp_rx_flow_info *flow_info); 875 QDF_STATUS (*txrx_dump_rx_flow_tag_stats)( 876 struct cdp_soc_t *cdp_soc, uint8_t pdev_id, 877 struct cdp_rx_flow_info *flow_info); 878 #endif /* WLAN_SUPPORT_RX_FLOW_TAG */ 879 #ifdef QCA_MULTIPASS_SUPPORT 880 void (*txrx_peer_set_vlan_id)(struct cdp_soc_t *cdp_soc, 881 uint8_t vdev_id, uint8_t *peer_mac, 882 uint16_t vlan_id); 883 #endif 884 #if defined(WLAN_TX_PKT_CAPTURE_ENH) || defined(WLAN_RX_PKT_CAPTURE_ENH) 885 QDF_STATUS (*txrx_update_peer_pkt_capture_params)( 886 ol_txrx_soc_handle soc, uint8_t pdev_id, 887 bool is_rx_pkt_cap_enable, uint8_t is_tx_pkt_cap_enable, 888 uint8_t *peer_mac); 889 #endif /* WLAN_TX_PKT_CAPTURE_ENH || WLAN_RX_PKT_CAPTURE_ENH */ 890 QDF_STATUS 891 (*txrx_set_psoc_param)(struct cdp_soc_t *soc, 892 enum cdp_psoc_param_type param, 893 cdp_config_param_type val); 894 895 QDF_STATUS (*txrx_get_psoc_param)(ol_txrx_soc_handle soc, 896 enum cdp_psoc_param_type type, 897 cdp_config_param_type *val); 898 #ifdef VDEV_PEER_PROTOCOL_COUNT 899 /* 900 * Enable per-peer protocol counters 901 */ 902 void (*txrx_enable_peer_protocol_count)(struct cdp_soc_t *soc, 903 int8_t vdev_id, bool enable); 904 void (*txrx_set_peer_protocol_drop_mask)(struct cdp_soc_t *soc, 905 int8_t vdev_id, int mask); 906 int (*txrx_is_peer_protocol_count_enabled)(struct cdp_soc_t *soc, 907 int8_t vdev_id); 908 int (*txrx_get_peer_protocol_drop_mask)(struct cdp_soc_t *soc, 909 int8_t vdev_id); 910 911 #endif 912 913 #if defined(WLAN_FEATURE_TSF_UPLINK_DELAY) || defined(WLAN_CONFIG_TX_DELAY) 914 void (*txrx_set_delta_tsf)(struct cdp_soc_t *soc, uint8_t vdev_id, 915 uint32_t delta_tsf); 916 #endif 917 #ifdef WLAN_FEATURE_TSF_UPLINK_DELAY 918 QDF_STATUS (*txrx_set_tsf_ul_delay_report)(struct cdp_soc_t *soc, 919 uint8_t vdev_id, 920 bool enable); 921 QDF_STATUS (*txrx_get_uplink_delay)(struct cdp_soc_t *soc, 922 uint8_t vdev_id, 923 uint32_t *val); 924 #endif 925 #ifdef QCA_UNDECODED_METADATA_SUPPORT 926 QDF_STATUS (*txrx_set_pdev_phyrx_error_mask)(struct cdp_soc_t *soc, 927 uint8_t pdev_id, 928 uint32_t mask, 929 uint32_t mask_cont); 930 QDF_STATUS (*txrx_get_pdev_phyrx_error_mask)(struct cdp_soc_t *soc, 931 uint8_t pdev_id, 932 uint32_t *mask, 933 uint32_t *mask_cont); 934 #endif 935 }; 936 937 struct cdp_me_ops { 938 939 void (*tx_me_alloc_descriptor)(struct cdp_soc_t *soc, 940 uint8_t pdev_id); 941 942 void (*tx_me_free_descriptor)(struct cdp_soc_t *soc, uint8_t pdev_id); 943 944 uint16_t (*tx_me_convert_ucast)(struct cdp_soc_t *soc, uint8_t vdev_id, 945 qdf_nbuf_t wbuf, u_int8_t newmac[][6], 946 uint8_t newmaccnt, uint8_t tid, 947 bool is_igmp, bool is_dms_pkt); 948 }; 949 950 /** 951 * struct cdp_mon_ops - host mon ops 952 * @txrx_reset_monitor_mode: Handler to reset monitor mode 953 * @txrx_deliver_tx_mgmt: deliver mgmt tx frame 954 * @txrx_set_advance_monitor_filter: set advanced monitor mode 955 * @config_full_mon_mode: configure full monitor mode 956 * @txrx_enable_mon_reap_timer: Enable/Disable reap timer of monitor status ring 957 */ 958 struct cdp_mon_ops { 959 960 QDF_STATUS (*txrx_reset_monitor_mode) 961 (ol_txrx_soc_handle soc, uint8_t pdev_id, u_int8_t smart_monitor); 962 963 QDF_STATUS (*txrx_deliver_tx_mgmt) 964 (struct cdp_soc_t *cdp_soc, uint8_t pdev_id, qdf_nbuf_t nbuf); 965 966 /* HK advance monitor filter support */ 967 QDF_STATUS (*txrx_set_advance_monitor_filter) 968 (struct cdp_soc_t *soc_hdl, uint8_t pdev_id, 969 struct cdp_monitor_filter *filter_val); 970 971 /* Configure full monitor mode */ 972 QDF_STATUS 973 (*config_full_mon_mode)(struct cdp_soc_t *soc, uint8_t val); 974 QDF_STATUS (*soc_config_full_mon_mode)(struct cdp_pdev *cdp_pdev, 975 uint8_t val); 976 977 /* Get monitor mode pdev stats */ 978 QDF_STATUS 979 (*get_mon_pdev_rx_stats)(struct cdp_soc_t *soc, uint8_t pdev_id, 980 struct cdp_pdev_mon_stats *stats); 981 982 /* Configure monitor status srng reap timer */ 983 bool (*txrx_enable_mon_reap_timer)(struct cdp_soc_t *soc_hdl, 984 enum cdp_mon_reap_source source, 985 bool enable); 986 987 #ifdef QCA_SUPPORT_LITE_MONITOR 988 /* set lite monitor config */ 989 QDF_STATUS 990 (*txrx_set_lite_mon_config)( 991 struct cdp_soc_t *soc, 992 struct cdp_lite_mon_filter_config *mon_config, 993 uint8_t pdev_id); 994 995 /* get lite monitor config */ 996 QDF_STATUS 997 (*txrx_get_lite_mon_config)( 998 struct cdp_soc_t *soc, 999 struct cdp_lite_mon_filter_config *mon_config, 1000 uint8_t pdev_id); 1001 1002 /* set lite monitor peer config */ 1003 QDF_STATUS 1004 (*txrx_set_lite_mon_peer_config)( 1005 struct cdp_soc_t *soc, 1006 struct cdp_lite_mon_peer_config *peer_config, 1007 uint8_t pdev_id); 1008 1009 /* get lite monitor peer list */ 1010 QDF_STATUS 1011 (*txrx_get_lite_mon_peer_config)( 1012 struct cdp_soc_t *soc, 1013 struct cdp_lite_mon_peer_info *info, 1014 uint8_t pdev_id); 1015 1016 /* get lite monitor enable/disable status */ 1017 int 1018 (*txrx_is_lite_mon_enabled)(struct cdp_soc_t *soc, 1019 uint8_t pdev_id, 1020 uint8_t direction); 1021 #endif 1022 /*To set RSSI dbm converstion params in monitor pdev */ 1023 QDF_STATUS (*txrx_set_mon_pdev_params_rssi_dbm_conv) 1024 (struct cdp_soc_t *soc, 1025 struct cdp_rssi_db2dbm_param_dp *params); 1026 }; 1027 1028 struct cdp_host_stats_ops { 1029 int (*txrx_host_stats_get)(struct cdp_soc_t *soc, uint8_t vdev_id, 1030 struct ol_txrx_stats_req *req); 1031 1032 QDF_STATUS (*txrx_host_stats_clr)(struct cdp_soc_t *soc, 1033 uint8_t vdev_id); 1034 1035 QDF_STATUS 1036 (*txrx_host_ce_stats)(struct cdp_soc_t *soc, uint8_t vdev_id); 1037 1038 int (*txrx_stats_publish)(struct cdp_soc_t *soc, uint8_t pdev_id, 1039 struct cdp_stats_extd *buf); 1040 /** 1041 * @brief Enable enhanced stats functionality. 1042 * 1043 * @param soc - the soc handle 1044 * @param pdev_id - pdev_id of pdev 1045 * @return - QDF_STATUS 1046 */ 1047 QDF_STATUS (*txrx_enable_enhanced_stats)(struct cdp_soc_t *soc, 1048 uint8_t pdev_id); 1049 1050 /** 1051 * @brief Disable enhanced stats functionality. 1052 * 1053 * @param soc - the soc handle 1054 * @param pdev_id - pdev_id of pdev 1055 * @return - QDF_STATUS 1056 */ 1057 QDF_STATUS (*txrx_disable_enhanced_stats)(struct cdp_soc_t *soc, 1058 uint8_t pdev_id); 1059 1060 QDF_STATUS 1061 (*tx_print_tso_stats)(struct cdp_soc_t *soc, uint8_t vdev_id); 1062 1063 QDF_STATUS 1064 (*tx_rst_tso_stats)(struct cdp_soc_t *soc, uint8_t vdev_id); 1065 1066 QDF_STATUS 1067 (*tx_print_sg_stats)(struct cdp_soc_t *soc, uint8_t vdev_id); 1068 1069 QDF_STATUS 1070 (*tx_rst_sg_stats)(struct cdp_soc_t *soc, uint8_t vdev_id); 1071 1072 QDF_STATUS 1073 (*print_rx_cksum_stats)(struct cdp_soc_t *soc, uint8_t vdev_id); 1074 1075 QDF_STATUS 1076 (*rst_rx_cksum_stats)(struct cdp_soc_t *soc, uint8_t vdev_id); 1077 1078 QDF_STATUS 1079 (*txrx_host_me_stats)(struct cdp_soc_t *soc, uint8_t vdev_id); 1080 1081 QDF_STATUS 1082 (*txrx_per_peer_stats)(struct cdp_soc_t *soc, uint8_t *addr); 1083 1084 int (*txrx_host_msdu_ttl_stats)(struct cdp_soc_t *soc, uint8_t vdev_id, 1085 struct ol_txrx_stats_req *req); 1086 1087 int (*ol_txrx_update_peer_stats)(struct cdp_soc_t *soc, 1088 uint8_t pdev_id, 1089 uint8_t *addr, void *stats, 1090 uint32_t last_tx_rate_mcs, 1091 uint32_t stats_id); 1092 1093 QDF_STATUS 1094 (*get_fw_peer_stats)(struct cdp_soc_t *soc, uint8_t pdev_id, 1095 uint8_t *addr, 1096 uint32_t cap, uint32_t copy_stats); 1097 1098 QDF_STATUS 1099 (*get_htt_stats)(struct cdp_soc_t *soc, uint8_t pdev_id, 1100 void *data, 1101 uint32_t data_len); 1102 QDF_STATUS 1103 (*txrx_update_pdev_stats)(struct cdp_soc_t *soc, 1104 uint8_t pdev_id, void *data, 1105 uint16_t stats_id); 1106 QDF_STATUS 1107 (*txrx_get_peer_stats_param)(struct cdp_soc_t *soc, 1108 uint8_t vdev_id, 1109 uint8_t *peer_mac, 1110 enum cdp_peer_stats_type type, 1111 cdp_peer_stats_param_t *buf); 1112 QDF_STATUS 1113 (*txrx_get_peer_stats)(struct cdp_soc_t *soc, uint8_t vdev_id, 1114 uint8_t *peer_mac, 1115 struct cdp_peer_stats *peer_stats); 1116 QDF_STATUS 1117 (*txrx_get_soc_stats)(struct cdp_soc_t *soc, 1118 struct cdp_soc_stats *soc_stats); 1119 QDF_STATUS 1120 (*txrx_reset_peer_ald_stats)(struct cdp_soc_t *soc, 1121 uint8_t vdev_id, 1122 uint8_t *peer_mac); 1123 QDF_STATUS 1124 (*txrx_reset_peer_stats)(struct cdp_soc_t *soc, 1125 uint8_t vdev_id, uint8_t *peer_mac); 1126 int 1127 (*txrx_get_vdev_stats)(struct cdp_soc_t *soc, uint8_t vdev_id, 1128 void *buf, bool is_aggregate); 1129 int 1130 (*txrx_process_wmi_host_vdev_stats)(ol_txrx_soc_handle soc, 1131 void *data, uint32_t len, 1132 uint32_t stats_id); 1133 int 1134 (*txrx_get_vdev_extd_stats)(struct cdp_soc_t *soc, 1135 uint8_t vdev_id, 1136 wmi_host_vdev_extd_stats *buffer); 1137 QDF_STATUS 1138 (*txrx_update_vdev_stats)(struct cdp_soc_t *soc, 1139 uint8_t vdev_id, void *buf, 1140 uint16_t stats_id); 1141 int 1142 (*txrx_get_radio_stats)(struct cdp_soc_t *soc, uint8_t pdev_id, 1143 void *buf); 1144 QDF_STATUS 1145 (*txrx_get_pdev_stats)(struct cdp_soc_t *soc, uint8_t pdev_id, 1146 struct cdp_pdev_stats *buf); 1147 int 1148 (*txrx_get_ratekbps)(int preamb, int mcs, 1149 int htflag, int gintval); 1150 1151 QDF_STATUS 1152 (*txrx_update_peer_stats)(struct cdp_soc_t *soc, uint8_t vdev_id, 1153 uint8_t *peer_mac, void *stats, 1154 uint32_t last_tx_rate_mcs, 1155 uint32_t stats_id); 1156 1157 #ifdef QCA_SUPPORT_SCAN_SPCL_VAP_STATS 1158 QDF_STATUS 1159 (*txrx_get_scan_spcl_vap_stats)(struct cdp_soc_t *soc, uint8_t vdev_id, 1160 struct cdp_scan_spcl_vap_stats *stats); 1161 #endif 1162 1163 QDF_STATUS 1164 (*txrx_get_peer_delay_stats)(struct cdp_soc_t *soc, uint8_t vdev_id, 1165 uint8_t *peer_mac, 1166 struct cdp_delay_tid_stats *delay_stats); 1167 1168 QDF_STATUS 1169 (*txrx_get_peer_jitter_stats)(struct cdp_soc_t *soc, uint8_t pdev_id, 1170 uint8_t vdev_id, uint8_t *peer_mac, 1171 struct cdp_peer_tid_stats *tid_stats); 1172 1173 QDF_STATUS 1174 (*txrx_alloc_vdev_stats_id)(struct cdp_soc_t *soc, 1175 uint8_t *vdev_stats_id); 1176 1177 void (*txrx_reset_vdev_stats_id)(struct cdp_soc_t *soc, 1178 uint8_t vdev_stats_id); 1179 1180 #ifdef WLAN_TX_PKT_CAPTURE_ENH 1181 QDF_STATUS 1182 (*get_peer_tx_capture_stats)(struct cdp_soc_t *soc, uint8_t vdev_id, 1183 uint8_t *peer_mac, 1184 struct cdp_peer_tx_capture_stats *stats); 1185 1186 QDF_STATUS 1187 (*get_pdev_tx_capture_stats)(struct cdp_soc_t *soc, uint8_t pdev_id, 1188 struct cdp_pdev_tx_capture_stats *stats); 1189 #endif /* WLAN_TX_PKT_CAPTURE_ENH */ 1190 #ifdef HW_TX_DELAY_STATS_ENABLE 1191 void 1192 (*enable_disable_vdev_tx_delay_stats)(struct cdp_soc_t *soc, 1193 uint8_t vdev_id, 1194 uint8_t value); 1195 uint8_t (*is_tx_delay_stats_enabled)(struct cdp_soc_t *soc_hdl, 1196 uint8_t vdev_id); 1197 #endif 1198 QDF_STATUS 1199 (*txrx_get_pdev_tid_stats)(struct cdp_soc_t *soc, uint8_t pdev_id, 1200 struct cdp_tid_stats_intf *tid_stats); 1201 #ifdef WLAN_TELEMETRY_STATS_SUPPORT 1202 QDF_STATUS 1203 (*txrx_pdev_telemetry_stats)( 1204 struct cdp_soc_t *soc, 1205 uint8_t pdev_id, 1206 struct cdp_pdev_telemetry_stats *stats); 1207 QDF_STATUS 1208 (*txrx_peer_telemetry_stats)( 1209 struct cdp_soc_t *soc, 1210 uint8_t *addr, 1211 struct cdp_peer_telemetry_stats *stats); 1212 #endif 1213 QDF_STATUS 1214 (*txrx_get_peer_extd_rate_link_stats) 1215 (struct cdp_soc_t *soc, uint8_t *mac_addr); 1216 QDF_STATUS 1217 (*get_pdev_obss_stats)(struct cdp_soc_t *soc, uint8_t pdev_id, 1218 struct cdp_pdev_obss_pd_stats_tlv *buf); 1219 QDF_STATUS (*clear_pdev_obss_pd_stats)(struct cdp_soc_t *soc, 1220 uint8_t pdev_id); 1221 }; 1222 1223 struct cdp_wds_ops { 1224 QDF_STATUS 1225 (*txrx_set_wds_rx_policy)(struct cdp_soc_t *soc, uint8_t vdev_id, 1226 u_int32_t val); 1227 QDF_STATUS 1228 (*txrx_wds_peer_tx_policy_update)(struct cdp_soc_t *soc, 1229 uint8_t vdev_id, uint8_t *peer_mac, 1230 int wds_tx_ucast, int wds_tx_mcast); 1231 int (*vdev_set_wds)(struct cdp_soc_t *soc, uint8_t vdev_id, 1232 uint32_t val); 1233 }; 1234 1235 struct cdp_raw_ops { 1236 QDF_STATUS 1237 (*rsim_get_astentry)(struct cdp_soc_t *soc, uint8_t vdev_id, 1238 qdf_nbuf_t *pnbuf, struct cdp_raw_ast *raw_ast); 1239 }; 1240 1241 #ifdef PEER_FLOW_CONTROL 1242 struct cdp_pflow_ops { 1243 uint32_t (*pflow_update_pdev_params)(struct cdp_soc_t *soc, 1244 uint8_t pdev_id, 1245 enum _dp_param_t, 1246 uint32_t, void *); 1247 }; 1248 #endif /* PEER_FLOW_CONTROL */ 1249 1250 #define LRO_IPV4_SEED_ARR_SZ 5 1251 #define LRO_IPV6_SEED_ARR_SZ 11 1252 1253 /** 1254 * struct cdp_lro_hash_config - set rx_offld(LRO/GRO) init parameters 1255 * @lro_enable: indicates whether rx_offld is enabled 1256 * @tcp_flag: If the TCP flags from the packet do not match 1257 * the values in this field after masking with TCP flags mask 1258 * below, packet is not rx_offld eligible 1259 * @tcp_flag_mask: field for comparing the TCP values provided 1260 * above with the TCP flags field in the received packet 1261 * @toeplitz_hash_ipv4: contains seed needed to compute the flow id 1262 * 5-tuple toeplitz hash for ipv4 packets 1263 * @toeplitz_hash_ipv6: contains seed needed to compute the flow id 1264 * 5-tuple toeplitz hash for ipv6 packets 1265 */ 1266 struct cdp_lro_hash_config { 1267 uint32_t lro_enable; 1268 uint32_t tcp_flag:9, 1269 tcp_flag_mask:9; 1270 uint32_t toeplitz_hash_ipv4[LRO_IPV4_SEED_ARR_SZ]; 1271 uint32_t toeplitz_hash_ipv6[LRO_IPV6_SEED_ARR_SZ]; 1272 }; 1273 1274 struct ol_if_ops { 1275 void 1276 (*peer_set_default_routing)(struct cdp_ctrl_objmgr_psoc *ctrl_psoc, 1277 uint8_t pdev_id, uint8_t *peer_macaddr, 1278 uint8_t vdev_id, 1279 bool hash_based, uint8_t ring_num, 1280 uint8_t lmac_peer_id_msb); 1281 QDF_STATUS 1282 (*peer_rx_reorder_queue_setup)(struct cdp_ctrl_objmgr_psoc *ctrl_psoc, 1283 uint8_t pdev_id, 1284 uint8_t vdev_id, uint8_t *peer_mac, 1285 qdf_dma_addr_t hw_qdesc, int tid, 1286 uint16_t queue_num, 1287 uint8_t ba_window_size_valid, 1288 uint16_t ba_window_size); 1289 QDF_STATUS 1290 (*peer_rx_reorder_queue_remove)(struct cdp_ctrl_objmgr_psoc *ctrl_psoc, 1291 uint8_t pdev_id, 1292 uint8_t vdev_id, uint8_t *peer_macaddr, 1293 uint32_t tid_mask); 1294 int (*peer_unref_delete)(struct cdp_ctrl_objmgr_psoc *psoc, 1295 uint8_t pdev_id, 1296 uint8_t *peer_mac, 1297 uint8_t *vdev_mac, enum wlan_op_mode opmode); 1298 bool (*is_hw_dbs_capable)(struct wlan_objmgr_psoc *psoc); 1299 int (*peer_add_wds_entry)(struct cdp_ctrl_objmgr_psoc *soc, 1300 uint8_t vdev_id, 1301 uint8_t *peer_macaddr, 1302 uint16_t peer_id, 1303 const uint8_t *dest_macaddr, 1304 uint8_t *next_node_mac, 1305 uint32_t flags, 1306 uint8_t type); 1307 int (*peer_update_wds_entry)(struct cdp_ctrl_objmgr_psoc *soc, 1308 uint8_t vdev_id, 1309 uint8_t *dest_macaddr, 1310 uint8_t *peer_macaddr, 1311 uint32_t flags); 1312 void (*peer_del_wds_entry)(struct cdp_ctrl_objmgr_psoc *soc, 1313 uint8_t vdev_id, 1314 uint8_t *wds_macaddr, 1315 uint8_t type, 1316 uint8_t delete_in_fw); 1317 #ifdef WLAN_FEATURE_MULTI_AST_DEL 1318 void (*peer_del_multi_wds_entry)( 1319 struct cdp_ctrl_objmgr_psoc *soc, 1320 uint8_t vdev_id, 1321 struct peer_del_multi_wds_entries *wds_list); 1322 #endif 1323 QDF_STATUS 1324 (*lro_hash_config)(struct cdp_ctrl_objmgr_psoc *psoc, uint8_t pdev_id, 1325 struct cdp_lro_hash_config *rx_offld_hash); 1326 1327 void (*update_dp_stats)(void *soc, void *stats, uint16_t id, 1328 uint8_t type); 1329 #ifdef FEATURE_NAC_RSSI 1330 uint8_t (*rx_invalid_peer)(struct cdp_ctrl_objmgr_psoc *soc, 1331 uint8_t pdev_id, void *msg); 1332 #else 1333 uint8_t (*rx_invalid_peer)(uint8_t vdev_id, void *wh); 1334 #endif 1335 1336 int (*peer_map_event)(struct cdp_ctrl_objmgr_psoc *psoc, 1337 uint16_t peer_id, uint16_t hw_peer_id, 1338 uint8_t vdev_id, uint8_t *peer_mac_addr, 1339 enum cdp_txrx_ast_entry_type peer_type, 1340 uint32_t tx_ast_hashidx); 1341 1342 int (*peer_unmap_event)(struct cdp_ctrl_objmgr_psoc *psoc, 1343 uint16_t peer_id, 1344 uint8_t vdev_id, uint8_t *mac_addr); 1345 1346 int (*get_dp_cfg_param)(struct cdp_ctrl_objmgr_psoc *psoc, 1347 enum cdp_cfg_param_type param_num); 1348 1349 void (*rx_mic_error)(struct cdp_ctrl_objmgr_psoc *psoc, 1350 uint8_t pdev_id, 1351 struct cdp_rx_mic_err_info *info); 1352 1353 bool (*rx_frag_tkip_demic)(struct cdp_ctrl_objmgr_psoc *psoc, 1354 uint8_t vdev_id, uint8_t *peer_mac_addr, 1355 qdf_nbuf_t nbuf, 1356 uint16_t hdr_space); 1357 1358 uint8_t (*freq_to_channel)(struct cdp_ctrl_objmgr_psoc *psoc, 1359 uint8_t pdev_id, uint16_t freq); 1360 1361 uint8_t (*freq_to_band)(struct cdp_ctrl_objmgr_psoc *psoc, 1362 uint8_t pdev_id, uint16_t freq); 1363 1364 QDF_STATUS(*set_mec_timer)(struct cdp_ctrl_objmgr_psoc *psoc, 1365 uint8_t vdev_id, uint16_t mec_timer_val); 1366 1367 #ifdef ATH_SUPPORT_NAC_RSSI 1368 int (*config_fw_for_nac_rssi)(struct cdp_ctrl_objmgr_psoc *psoc, 1369 uint8_t pdev_id, 1370 u_int8_t vdev_id, 1371 enum cdp_nac_param_cmd cmd, char *bssid, 1372 char *client_macaddr, uint8_t chan_num); 1373 1374 int 1375 (*config_bssid_in_fw_for_nac_rssi)(struct cdp_ctrl_objmgr_psoc *psoc, 1376 uint8_t pdev_id, u_int8_t vdev_id, 1377 enum cdp_nac_param_cmd cmd, 1378 char *bssid, char *client_mac); 1379 #endif 1380 int (*peer_sta_kickout)(struct cdp_ctrl_objmgr_psoc *psoc, 1381 uint16_t pdev_id, uint8_t *peer_macaddr); 1382 1383 /** 1384 * send_delba() - Send delba to peer 1385 * @psoc: Objmgr soc handle 1386 * @vdev_id: dp vdev id 1387 * @peer_macaddr: Peer mac addr 1388 * @tid: Tid number 1389 * @reason_code: Reason code 1390 * @cdp_rcode: CDP reason code for sending DELBA 1391 * 1392 * Return: 0 for success, non-zero for failure 1393 */ 1394 int (*send_delba)(struct cdp_ctrl_objmgr_psoc *psoc, uint8_t vdev_id, 1395 uint8_t *peer_macaddr, uint8_t tid, 1396 uint8_t reason_code, uint8_t cdp_rcode); 1397 1398 int 1399 (*peer_delete_multiple_wds_entries)(struct cdp_ctrl_objmgr_psoc *psoc, 1400 uint8_t vdev_id, 1401 uint8_t *dest_macaddr, 1402 uint8_t *peer_macaddr, 1403 uint32_t flags); 1404 int 1405 (*pdev_update_lmac_n_target_pdev_id)(struct cdp_ctrl_objmgr_psoc *psoc, 1406 uint8_t *pdev_id, 1407 uint8_t *lmac_id, 1408 uint8_t *target_pdev_id); 1409 bool (*is_roam_inprogress)(uint32_t vdev_id); 1410 enum QDF_GLOBAL_MODE (*get_con_mode)(void); 1411 #ifdef QCA_PEER_MULTIQ_SUPPORT 1412 int (*peer_ast_flowid_map)(struct cdp_ctrl_objmgr_psoc *ol_soc_handle, 1413 uint16_t peer_id, uint8_t vdev_id, 1414 uint8_t *peer_mac_addr); 1415 #endif 1416 #ifdef DP_MEM_PRE_ALLOC 1417 void *(*dp_prealloc_get_context)(uint32_t ctxt_type, size_t ctxt_size); 1418 1419 QDF_STATUS(*dp_prealloc_put_context)(uint32_t ctxt_type, void *vaddr); 1420 void *(*dp_prealloc_get_consistent)(uint32_t *size, 1421 void **base_vaddr_unaligned, 1422 qdf_dma_addr_t *paddr_unaligned, 1423 qdf_dma_addr_t *paddr_aligned, 1424 uint32_t align, 1425 uint32_t ring_type); 1426 void (*dp_prealloc_put_consistent)(qdf_size_t size, 1427 void *vaddr_unligned, 1428 qdf_dma_addr_t paddr); 1429 void (*dp_get_multi_pages)(uint32_t desc_type, 1430 size_t element_size, 1431 uint16_t element_num, 1432 struct qdf_mem_multi_page_t *pages, 1433 bool cacheable); 1434 void (*dp_put_multi_pages)(uint32_t desc_type, 1435 struct qdf_mem_multi_page_t *pages); 1436 #endif 1437 int (*get_soc_nss_cfg)(struct cdp_ctrl_objmgr_psoc *ol_soc_handle); 1438 1439 char *(*get_device_name)(struct cdp_ctrl_objmgr_psoc *ctrl_psoc, 1440 uint8_t pdev_id); 1441 QDF_STATUS(*nss_stats_clr)(struct cdp_ctrl_objmgr_psoc *psoc, 1442 uint8_t vdev_id); 1443 int (*dp_rx_get_pending)(ol_txrx_soc_handle soc); 1444 void (*dp_rx_sched_refill_thread)(ol_txrx_soc_handle soc); 1445 /* TODO: Add any other control path calls required to OL_IF/WMA layer */ 1446 #ifdef QCA_SUPPORT_WDS_EXTENDED 1447 void (*rx_wds_ext_peer_learn)(struct cdp_ctrl_objmgr_psoc *ctrl_psoc, 1448 uint16_t peer_id, uint8_t vdev_id, 1449 uint8_t *peer_macaddr); 1450 #endif /* QCA_SUPPORT_WDS_EXTENDED */ 1451 #ifdef WLAN_SUPPORT_MESH_LATENCY 1452 QDF_STATUS(*peer_update_mesh_latency_params)( 1453 struct cdp_ctrl_objmgr_psoc *psoc, 1454 uint8_t vdev_id, uint8_t *peer_mac, uint8_t tid, 1455 uint32_t service_interval_dl, uint32_t burst_size_dl, 1456 uint32_t service_interval_ul, uint32_t burst_size_ul, 1457 uint8_t add_or_sub, uint8_t ac); 1458 #endif 1459 uint32_t (*dp_get_tx_inqueue)(ol_txrx_soc_handle soc); 1460 QDF_STATUS(*dp_send_unit_test_cmd)(uint32_t vdev_id, 1461 uint32_t module_id, 1462 uint32_t arg_count, uint32_t *arg); 1463 1464 #ifdef QCA_SUPPORT_LITE_MONITOR 1465 int (*config_lite_mon_peer)(struct cdp_ctrl_objmgr_psoc *psoc, 1466 uint8_t pdev_id, 1467 uint8_t vdev_id, 1468 enum cdp_nac_param_cmd cmd, 1469 uint8_t *peer_mac); 1470 int (*config_lite_mon_tx_peer)(struct cdp_ctrl_objmgr_psoc *psoc, 1471 uint8_t pdev_id, uint8_t vdev_id, 1472 enum cdp_tx_filter_action cmd, 1473 uint8_t *peer_mac); 1474 #endif 1475 #ifdef WLAN_SUPPORT_SCS 1476 bool (*peer_scs_rule_match)(struct cdp_ctrl_objmgr_psoc *psoc, 1477 uint8_t vdev_id, uint32_t rule_id, 1478 uint8_t *peer_mac); 1479 #endif 1480 #ifdef DP_UMAC_HW_RESET_SUPPORT 1481 void (*dp_update_tx_hardstart)(struct cdp_ctrl_objmgr_psoc *psoc, 1482 uint8_t vdev_id, 1483 struct ol_txrx_hardtart_ctxt *ctxt); 1484 #endif 1485 #if defined(IPA_WDS_EASYMESH_FEATURE) && defined(FEATURE_AST) 1486 void (*peer_send_wds_disconnect)(struct cdp_ctrl_objmgr_psoc *psoc, 1487 uint8_t *mac_addr, uint8_t vdev_id); 1488 #endif 1489 }; 1490 1491 #ifdef DP_PEER_EXTENDED_API 1492 /** 1493 * struct cdp_misc_ops - mcl ops not classified 1494 * @set_ibss_vdev_heart_beat_timer: Update ibss vdev heart beat timer 1495 * @set_wmm_param: set wmm parameters 1496 * @bad_peer_txctl_set_setting: configure bad peer tx limit setting 1497 * @bad_peer_txctl_update_threshold: configure bad peer tx threshold limit 1498 * @hl_tdls_flag_reset: reset tdls flag for vdev 1499 * @tx_non_std: Allow the control-path SW to send data frames 1500 * @get_vdev_id: get vdev id 1501 * @set_wisa_mode: set wisa mode for a vdev 1502 * @txrx_data_stall_cb_register: register data stall callback 1503 * @txrx_data_stall_cb_deregister: deregister data stall callback 1504 * @txrx_post_data_stall_event: post data stall event 1505 * @runtime_suspend: ensure TXRX is ready to runtime suspend 1506 * @runtime_resume: ensure TXRX is ready to runtime resume 1507 * @get_opmode: get operation mode of vdev 1508 * @mark_first_wakeup_packet: set flag to indicate that fw is compatible for 1509 marking first packet after wow wakeup 1510 * @update_mac_id: update mac_id for vdev 1511 * @flush_rx_frames: flush rx frames on the queue 1512 * @get_intra_bss_fwd_pkts_count: to get the total tx and rx packets that 1513 has been forwarded from txrx layer 1514 without going to upper layers 1515 * @pkt_log_init: handler to initialize packet log 1516 * @pkt_log_con_service: handler to connect packet log service 1517 * @get_num_rx_contexts: handler to get number of RX contexts 1518 * @register_packetdump_cb: register callback for different pktlog 1519 * @unregister_packetdump_cb: unregister callback for different pktlog 1520 * @pdev_reset_driver_del_ack: reset driver delayed ack enabled flag 1521 * @vdev_set_driver_del_ack_enable: set driver delayed ack enabled flag 1522 * 1523 * @vdev_inform_ll_conn: inform DP to add/delete a latency critical connection 1524 * for this particular vdev. 1525 * @set_swlm_enable: Enable or Disable Software Latency Manager. 1526 * @is_swlm_enabled: Check if Software latency manager is enabled or not. 1527 * @display_txrx_hw_info: Dump the DP rings info 1528 * @set_tx_flush_pending: Configures the ac/tid to be flushed and policy 1529 * to flush. 1530 * 1531 * set_bus_vote_lvl_high: The bus lvl is set to high or low based on tput 1532 * get_bus_vote_lvl_high: Get bus lvl to determine whether or not get 1533 * rx rate stats 1534 * 1535 * Function pointers for miscellaneous soc/pdev/vdev related operations. 1536 */ 1537 struct cdp_misc_ops { 1538 uint16_t (*set_ibss_vdev_heart_beat_timer)(struct cdp_soc_t *soc_hdl, 1539 uint8_t vdev_id, 1540 uint16_t timer_value_sec); 1541 void (*set_wmm_param)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id, 1542 struct ol_tx_wmm_param_t wmm_param); 1543 void (*bad_peer_txctl_set_setting)(struct cdp_soc_t *soc_hdl, 1544 uint8_t pdev_id, int enable, 1545 int period, int txq_limit); 1546 void (*bad_peer_txctl_update_threshold)(struct cdp_soc_t *soc_hdl, 1547 uint8_t pdev_id, 1548 int level, int tput_thresh, 1549 int tx_limit); 1550 void (*hl_tdls_flag_reset)(struct cdp_soc_t *soc_hdl, 1551 uint8_t vdev_id, bool flag); 1552 qdf_nbuf_t (*tx_non_std)(struct cdp_soc_t *soc_hdl, uint8_t vdev_id, 1553 enum ol_tx_spec tx_spec, qdf_nbuf_t msdu_list); 1554 uint16_t (*get_vdev_id)(struct cdp_vdev *vdev); 1555 uint32_t (*get_tx_ack_stats)(struct cdp_soc_t *soc_hdl, 1556 uint8_t vdev_id); 1557 QDF_STATUS (*set_wisa_mode)(struct cdp_soc_t *soc_hdl, 1558 uint8_t vdev_id, bool enable); 1559 QDF_STATUS (*txrx_data_stall_cb_register)(struct cdp_soc_t *soc_hdl, 1560 uint8_t pdev_id, 1561 data_stall_detect_cb cb); 1562 QDF_STATUS (*txrx_data_stall_cb_deregister)(struct cdp_soc_t *soc_hdl, 1563 uint8_t pdev_id, 1564 data_stall_detect_cb cb); 1565 void (*txrx_post_data_stall_event)( 1566 struct cdp_soc_t *soc_hdl, 1567 enum data_stall_log_event_indicator indicator, 1568 enum data_stall_log_event_type data_stall_type, 1569 uint32_t pdev_id, uint32_t vdev_id_bitmap, 1570 enum data_stall_log_recovery_type recovery_type); 1571 QDF_STATUS (*runtime_suspend)(struct cdp_soc_t *soc_hdl, 1572 uint8_t pdev_id); 1573 QDF_STATUS (*runtime_resume)(struct cdp_soc_t *soc_hdl, 1574 uint8_t pdev_id); 1575 int (*get_opmode)(struct cdp_soc_t *soc_hdl, uint8_t vdev_id); 1576 void (*mark_first_wakeup_packet)(struct cdp_soc_t *soc_hdl, 1577 uint8_t pdev_id, uint8_t value); 1578 void (*update_mac_id)(struct cdp_soc_t *soc_hdl, uint8_t vdev_id, 1579 uint8_t mac_id); 1580 void (*flush_rx_frames)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id, 1581 void *peer, bool drop); 1582 A_STATUS(*get_intra_bss_fwd_pkts_count)(struct cdp_soc_t *soc_hdl, 1583 uint8_t vdev_id, 1584 uint64_t *fwd_tx_packets, 1585 uint64_t *fwd_rx_packets); 1586 void (*pkt_log_init)(struct cdp_soc_t *soc_hdl, uint8_t pdev, 1587 void *scn); 1588 void (*pkt_log_con_service)(struct cdp_soc_t *soc_hdl, 1589 uint8_t pdev_id, void *scn); 1590 void (*pkt_log_exit)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id); 1591 int (*get_num_rx_contexts)(struct cdp_soc_t *soc_hdl); 1592 void (*register_pktdump_cb)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id, 1593 ol_txrx_pktdump_cb tx_cb, 1594 ol_txrx_pktdump_cb rx_cb); 1595 void (*unregister_pktdump_cb)(struct cdp_soc_t *soc_hdl, 1596 uint8_t pdev_id); 1597 void (*pdev_reset_driver_del_ack)(struct cdp_soc_t *soc_hdl, 1598 uint8_t pdev_id); 1599 void (*vdev_set_driver_del_ack_enable)(struct cdp_soc_t *soc_hdl, 1600 uint8_t vdev_id, 1601 unsigned long rx_packets, 1602 uint32_t time_in_ms, 1603 uint32_t high_th, 1604 uint32_t low_th); 1605 void (*vdev_set_bundle_require_flag)(uint8_t vdev_id, 1606 unsigned long tx_bytes, 1607 uint32_t time_in_ms, 1608 uint32_t high_th, 1609 uint32_t low_th); 1610 void (*pdev_reset_bundle_require_flag)(struct cdp_soc_t *soc_hdl, 1611 uint8_t pdev_id); 1612 QDF_STATUS (*txrx_ext_stats_request)(struct cdp_soc_t *soc_hdl, 1613 uint8_t pdev_id, 1614 struct cdp_txrx_ext_stats *req); 1615 QDF_STATUS (*request_rx_hw_stats)(struct cdp_soc_t *soc_hdl, 1616 uint8_t vdev_id); 1617 void (*reset_rx_hw_ext_stats)(struct cdp_soc_t *soc_hdl); 1618 QDF_STATUS (*vdev_inform_ll_conn)(struct cdp_soc_t *soc_hdl, 1619 uint8_t vdev_id, 1620 enum vdev_ll_conn_actions action); 1621 QDF_STATUS (*set_swlm_enable)(struct cdp_soc_t *soc_hdl, 1622 uint8_t val); 1623 uint8_t (*is_swlm_enabled)(struct cdp_soc_t *soc_hdl); 1624 void (*display_txrx_hw_info)(struct cdp_soc_t *soc_hdl); 1625 uint32_t (*get_tx_rings_grp_bitmap)(struct cdp_soc_t *soc_hdl); 1626 #ifdef WLAN_FEATURE_PEER_TXQ_FLUSH_CONF 1627 int (*set_peer_txq_flush_config)(struct cdp_soc_t *soc_hdl, 1628 uint8_t vdev_id, uint8_t *addr, 1629 uint8_t ac, uint32_t tid, 1630 enum cdp_peer_txq_flush_policy policy); 1631 #endif 1632 #ifdef FEATURE_RX_LINKSPEED_ROAM_TRIGGER 1633 void (*set_bus_vote_lvl_high)(struct cdp_soc_t *soc_hdl, bool high); 1634 bool (*get_bus_vote_lvl_high)(struct cdp_soc_t *soc_hdl); 1635 #endif 1636 }; 1637 1638 /** 1639 * struct cdp_ocb_ops - mcl ocb ops 1640 * @set_ocb_chan_info: set OCB channel info 1641 * @get_ocb_chan_info: get OCB channel info 1642 * 1643 * Function pointers for operations related to OCB. 1644 */ 1645 struct cdp_ocb_ops { 1646 void (*set_ocb_chan_info)(struct cdp_soc_t *soc_hdl, uint8_t vdev_id, 1647 struct ol_txrx_ocb_set_chan ocb_set_chan); 1648 struct ol_txrx_ocb_chan_info *(*get_ocb_chan_info)( 1649 struct cdp_soc_t *soc_hdl, uint8_t vdev_id); 1650 }; 1651 1652 /** 1653 * struct cdp_peer_ops - mcl peer related ops 1654 * @register_peer: 1655 * @clear_peer: 1656 * @find_peer_exist 1657 * @find_peer_exist_on_vdev 1658 * @find_peer_exist_on_other_vdev 1659 * @peer_state_update: 1660 * @get_vdevid: 1661 * @register_ocb_peer: 1662 * @peer_get_peer_mac_addr: 1663 * @get_peer_state: 1664 * @update_ibss_add_peer_num_of_vdev: 1665 * @copy_mac_addr_raw: 1666 * @add_last_real_peer: 1667 * @is_vdev_restore_last_peer: 1668 * @update_last_real_peer: 1669 */ 1670 struct cdp_peer_ops { 1671 QDF_STATUS (*register_peer)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id, 1672 struct ol_txrx_desc_type *sta_desc); 1673 QDF_STATUS (*clear_peer)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id, 1674 struct qdf_mac_addr peer_addr); 1675 bool (*find_peer_exist)(struct cdp_soc_t *soc, uint8_t pdev_id, 1676 uint8_t *peer_addr); 1677 bool (*find_peer_exist_on_vdev)(struct cdp_soc_t *soc, uint8_t vdev_id, 1678 uint8_t *peer_addr); 1679 bool (*find_peer_exist_on_other_vdev)(struct cdp_soc_t *soc, 1680 uint8_t vdev_id, 1681 uint8_t *peer_addr, 1682 uint16_t max_bssid); 1683 QDF_STATUS (*peer_state_update)(struct cdp_soc_t *soc, 1684 uint8_t *peer_addr, 1685 enum ol_txrx_peer_state state); 1686 QDF_STATUS (*get_vdevid)(struct cdp_soc_t *soc_hdl, uint8_t *peer_mac, 1687 uint8_t *vdev_id); 1688 struct cdp_vdev * (*get_vdev_by_peer_addr)(struct cdp_pdev *pdev, 1689 struct qdf_mac_addr peer_addr); 1690 QDF_STATUS (*register_ocb_peer)(uint8_t *mac_addr); 1691 uint8_t * (*peer_get_peer_mac_addr)(void *peer); 1692 int (*get_peer_state)(struct cdp_soc_t *soc, uint8_t vdev_id, 1693 uint8_t *peer_mac); 1694 struct cdp_vdev * (*get_vdev_for_peer)(void *peer); 1695 int16_t (*update_ibss_add_peer_num_of_vdev)(struct cdp_soc_t *soc, 1696 uint8_t vdev_id, 1697 int16_t peer_num_delta); 1698 void (*remove_peers_for_vdev)(struct cdp_vdev *vdev, 1699 ol_txrx_vdev_peer_remove_cb callback, 1700 void *callback_context, bool remove_last_peer); 1701 void (*remove_peers_for_vdev_no_lock)(struct cdp_vdev *vdev, 1702 ol_txrx_vdev_peer_remove_cb callback, 1703 void *callback_context); 1704 void (*copy_mac_addr_raw)(struct cdp_soc_t *soc, uint8_t vdev_id, 1705 uint8_t *bss_addr); 1706 void (*add_last_real_peer)(struct cdp_soc_t *soc, uint8_t pdev_id, 1707 uint8_t vdev_id); 1708 bool (*is_vdev_restore_last_peer)(struct cdp_soc_t *soc, 1709 uint8_t vdev_id, 1710 uint8_t *peer_mac); 1711 void (*update_last_real_peer)(struct cdp_soc_t *soc, uint8_t pdev_id, 1712 uint8_t vdev_id, bool restore_last_peer); 1713 void (*peer_detach_force_delete)(struct cdp_soc_t *soc_hdl, 1714 uint8_t vdev_id, uint8_t *peer_addr); 1715 void (*set_tdls_offchan_enabled)(struct cdp_soc_t *soc, uint8_t vdev_id, 1716 uint8_t *peer_mac, bool val); 1717 void (*set_peer_as_tdls_peer)(struct cdp_soc_t *soc, uint8_t vdev_id, 1718 uint8_t *peer_mac, bool val); 1719 void (*peer_flush_frags)(struct cdp_soc_t *soc_hdl, 1720 uint8_t vdev_id, uint8_t *peer_mac); 1721 }; 1722 1723 /** 1724 * struct cdp_mob_stats_ops - mcl mob stats ops 1725 * @clear_stats: handler to clear ol txrx stats 1726 * @stats: handler to update ol txrx stats 1727 */ 1728 struct cdp_mob_stats_ops { 1729 QDF_STATUS(*clear_stats)(struct cdp_soc_t *soc_hdl, 1730 uint8_t pdev_id, uint8_t bitmap); 1731 int (*stats)(uint8_t vdev_id, char *buffer, unsigned buf_len); 1732 }; 1733 1734 /** 1735 * struct cdp_pmf_ops - mcl protected management frame ops 1736 * @get_pn_info: handler to get pn info from peer 1737 * 1738 * Function pointers for pmf related operations. 1739 */ 1740 struct cdp_pmf_ops { 1741 void (*get_pn_info)(struct cdp_soc_t *soc, uint8_t *peer_mac, 1742 uint8_t vdev_id, uint8_t **last_pn_valid, 1743 uint64_t **last_pn, uint32_t **rmf_pn_replays); 1744 }; 1745 #endif 1746 1747 1748 #ifdef DP_FLOW_CTL 1749 /** 1750 * struct cdp_cfg_ops - mcl configuration ops 1751 * @set_cfg_rx_fwd_disabled: set rx_fwd_disabled flag 1752 * @set_cfg_packet_log_enabled: set is_packet_log_enabled flag 1753 * @cfg_attach: hardcode the configuration parameters 1754 * @vdev_rx_set_intrabss_fwd: set disable_intrabss_fwd flag 1755 * @is_rx_fwd_disabled: get the rx_fwd_disabled flag, 1756 * 1 enabled, 0 disabled. 1757 * @tx_set_is_mgmt_over_wmi_enabled: set is_mgmt_over_wmi_enabled flag to 1758 * indicate that mgmt over wmi is enabled 1759 * or not, 1760 * 1 for enabled, 0 for disable 1761 * @is_high_latency: get device is high or low latency device, 1762 * 1 high latency bus, 0 low latency bus 1763 * @set_flow_control_parameters: set flow control parameters 1764 * @set_flow_steering: set flow_steering_enabled flag 1765 * @set_ptp_rx_opt_enabled: set is_ptp_rx_opt_enabled flag 1766 * @set_new_htt_msg_format: set new_htt_msg_format flag 1767 * @set_peer_unmap_conf_support: set enable_peer_unmap_conf_support flag 1768 * @get_peer_unmap_conf_support: get enable_peer_unmap_conf_support flag 1769 * @set_tx_compl_tsf64: set enable_tx_compl_tsf64 flag, 1770 * 1 enabled, 0 disabled. 1771 * @get_tx_compl_tsf64: get enable_tx_compl_tsf64 flag, 1772 * 1 enabled, 0 disabled. 1773 */ 1774 struct cdp_cfg_ops { 1775 void (*set_cfg_rx_fwd_disabled)(struct cdp_cfg *cfg_pdev, 1776 uint8_t disable_rx_fwd); 1777 void (*set_cfg_packet_log_enabled)(struct cdp_cfg *cfg_pdev, 1778 uint8_t val); 1779 struct cdp_cfg * (*cfg_attach)(qdf_device_t osdev, void *cfg_param); 1780 void (*vdev_rx_set_intrabss_fwd)(struct cdp_soc_t *soc_hdl, 1781 uint8_t vdev_id, bool val); 1782 uint8_t (*is_rx_fwd_disabled)(struct cdp_vdev *vdev); 1783 void (*tx_set_is_mgmt_over_wmi_enabled)(uint8_t value); 1784 int (*is_high_latency)(struct cdp_cfg *cfg_pdev); 1785 void (*set_flow_control_parameters)(struct cdp_cfg *cfg_pdev, 1786 void *param); 1787 void (*set_flow_steering)(struct cdp_cfg *cfg_pdev, uint8_t val); 1788 void (*set_ptp_rx_opt_enabled)(struct cdp_cfg *cfg_pdev, uint8_t val); 1789 void (*set_new_htt_msg_format)(uint8_t val); 1790 void (*set_peer_unmap_conf_support)(bool val); 1791 bool (*get_peer_unmap_conf_support)(void); 1792 void (*set_tx_compl_tsf64)(bool val); 1793 bool (*get_tx_compl_tsf64)(void); 1794 }; 1795 1796 /** 1797 * struct cdp_flowctl_ops - mcl flow control 1798 * @flow_pool_map_handler: handler to map flow_id and pool descriptors 1799 * @flow_pool_unmap_handler: handler to unmap flow_id and pool descriptors 1800 * @register_pause_cb: handler to register tx pause callback 1801 * @set_desc_global_pool_size: handler to set global pool size 1802 * @dump_flow_pool_info: handler to dump global and flow pool info 1803 * @tx_desc_thresh_reached: handler to set tx desc threshold 1804 * 1805 * Function pointers for operations related to flow control 1806 */ 1807 struct cdp_flowctl_ops { 1808 QDF_STATUS (*flow_pool_map_handler)(struct cdp_soc_t *soc, 1809 uint8_t pdev_id, 1810 uint8_t vdev_id); 1811 void (*flow_pool_unmap_handler)(struct cdp_soc_t *soc, 1812 uint8_t pdev_id, 1813 uint8_t vdev_id); 1814 QDF_STATUS (*register_pause_cb)(struct cdp_soc_t *soc, 1815 tx_pause_callback); 1816 void (*set_desc_global_pool_size)(uint32_t num_msdu_desc); 1817 1818 void (*dump_flow_pool_info)(struct cdp_soc_t *soc_hdl); 1819 1820 bool (*tx_desc_thresh_reached)(struct cdp_soc_t *soc_hdl, 1821 uint8_t vdev_id); 1822 }; 1823 1824 /** 1825 * struct cdp_lflowctl_ops - mcl legacy flow control ops 1826 * @register_tx_flow_control: Register tx flow control callback 1827 * @set_vdev_tx_desc_limit: Set tx descriptor limit for a vdev 1828 * @set_vdev_os_queue_status: Set vdev queue status 1829 * @deregister_tx_flow_control_cb: Deregister tx flow control callback 1830 * @flow_control_cb: Call osif flow control callback 1831 * @get_tx_resource: Get tx resources and comapre with watermark 1832 * @ll_set_tx_pause_q_depth: set pause queue depth 1833 * @vdev_flush: Flush all packets on a particular vdev 1834 * @vdev_pause: Pause a particular vdev 1835 * @vdev_unpause: Unpause a particular vdev 1836 * 1837 * Function pointers for operations related to flow control 1838 */ 1839 struct cdp_lflowctl_ops { 1840 #ifdef QCA_HL_NETDEV_FLOW_CONTROL 1841 int (*register_tx_flow_control)(struct cdp_soc_t *soc_hdl, 1842 uint8_t pdev_id, 1843 tx_pause_callback flowcontrol); 1844 int (*set_vdev_tx_desc_limit)(struct cdp_soc_t *soc_hdl, 1845 uint8_t vdev_id, uint32_t chan_freq); 1846 int (*set_vdev_os_queue_status)(struct cdp_soc_t *soc_hdl, 1847 uint8_t vdev_id, 1848 enum netif_action_type action); 1849 #else 1850 int (*register_tx_flow_control)( 1851 struct cdp_soc_t *soc_hdl, 1852 uint8_t vdev_id, 1853 ol_txrx_tx_flow_control_fp flowControl, void *osif_fc_ctx, 1854 ol_txrx_tx_flow_control_is_pause_fp flow_control_is_pause); 1855 #endif /* QCA_HL_NETDEV_FLOW_CONTROL */ 1856 int (*deregister_tx_flow_control_cb)(struct cdp_soc_t *soc_hdl, 1857 uint8_t vdev_id); 1858 void (*flow_control_cb)(struct cdp_soc_t *soc_hdl, uint8_t vdev_id, 1859 bool tx_resume); 1860 bool (*get_tx_resource)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id, 1861 struct qdf_mac_addr peer_addr, 1862 unsigned int low_watermark, 1863 unsigned int high_watermark_offset); 1864 int (*ll_set_tx_pause_q_depth)(struct cdp_soc_t *soc, uint8_t vdev_id, 1865 int pause_q_depth); 1866 void (*vdev_flush)(struct cdp_soc_t *soc_hdl, uint8_t vdev_id); 1867 void (*vdev_pause)(struct cdp_soc_t *soc_hdl, uint8_t vdev_id, 1868 uint32_t reason, uint32_t pause_type); 1869 void (*vdev_unpause)(struct cdp_soc_t *soc_hdl, uint8_t vdev_id, 1870 uint32_t reason, uint32_t pause_type); 1871 }; 1872 1873 /** 1874 * struct cdp_throttle_ops - mcl throttle ops 1875 * @throttle_init_period: handler to initialize tx throttle time 1876 * @throttle_set_level: handler to set tx throttle level 1877 */ 1878 struct cdp_throttle_ops { 1879 void (*throttle_init_period)(struct cdp_soc_t *soc_hdl, 1880 uint8_t pdev_id, int period, 1881 uint8_t *dutycycle_level); 1882 void (*throttle_set_level)(struct cdp_soc_t *soc_hdl, 1883 uint8_t pdev_id, int level); 1884 }; 1885 #endif 1886 1887 #ifdef IPA_OFFLOAD 1888 /** 1889 * struct cdp_ipa_ops - mcl ipa data path ops 1890 * @ipa_get_resource: 1891 * @ipa_set_doorbell_paddr: 1892 * @ipa_iounmap_doorbell_vaddr: I/O unmap ipa doorbell vaddr 1893 * @ipa_set_active: 1894 * @ipa_op_response: 1895 * @ipa_register_op_cb: 1896 * @ipa_get_stat: 1897 * @ipa_tx_data_frame: 1898 * @ipa_tx_buf_smmu_mapping: Create SMMU mappings for Tx 1899 * @ipa_tx_buf_smmu_unmapping: Release SMMU mappings for Tx 1900 * buffers to IPA 1901 * @ipa_ast_create: Create/Update ast entry 1902 */ 1903 struct cdp_ipa_ops { 1904 QDF_STATUS (*ipa_get_resource)(struct cdp_soc_t *soc_hdl, 1905 uint8_t pdev_id); 1906 QDF_STATUS (*ipa_set_doorbell_paddr)(struct cdp_soc_t *soc_hdl, 1907 uint8_t pdev_id); 1908 QDF_STATUS (*ipa_iounmap_doorbell_vaddr)(struct cdp_soc_t *soc_hdl, 1909 uint8_t pdev_id); 1910 QDF_STATUS (*ipa_set_active)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id, 1911 bool uc_active, bool is_tx); 1912 QDF_STATUS (*ipa_op_response)(struct cdp_soc_t *soc_hdl, 1913 uint8_t pdev_id, uint8_t *op_msg); 1914 QDF_STATUS (*ipa_register_op_cb)(struct cdp_soc_t *soc_hdl, 1915 uint8_t pdev_id, 1916 void (*ipa_uc_op_cb_type) 1917 (uint8_t *op_msg, void *osif_ctxt), 1918 void *usr_ctxt); 1919 void (*ipa_deregister_op_cb)(struct cdp_soc_t *soc_hdl, 1920 uint8_t pdev_id); 1921 QDF_STATUS (*ipa_get_stat)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id); 1922 qdf_nbuf_t (*ipa_tx_data_frame)(struct cdp_soc_t *soc_hdl, 1923 uint8_t vdev_id, qdf_nbuf_t skb); 1924 void (*ipa_set_uc_tx_partition_base)(struct cdp_cfg *pdev, 1925 uint32_t value); 1926 #ifdef FEATURE_METERING 1927 QDF_STATUS (*ipa_uc_get_share_stats)(struct cdp_soc_t *soc_hdl, 1928 uint8_t pdev_id, 1929 uint8_t reset_stats); 1930 QDF_STATUS (*ipa_uc_set_quota)(struct cdp_soc_t *soc_hdl, 1931 uint8_t pdev_id, uint64_t quota_bytes); 1932 #endif 1933 QDF_STATUS (*ipa_enable_autonomy)(struct cdp_soc_t *soc_hdl, 1934 uint8_t pdev_id); 1935 QDF_STATUS (*ipa_disable_autonomy)(struct cdp_soc_t *soc_hdl, 1936 uint8_t pdev_id); 1937 1938 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 10, 0)) || \ 1939 defined(CONFIG_IPA_WDI_UNIFIED_API) 1940 QDF_STATUS (*ipa_setup)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id, 1941 void *ipa_i2w_cb, void *ipa_w2i_cb, 1942 void *ipa_wdi_meter_notifier_cb, 1943 uint32_t ipa_desc_size, void *ipa_priv, 1944 bool is_rm_enabled, uint32_t *tx_pipe_handle, 1945 uint32_t *rx_pipe_handle, bool is_smmu_enabled, 1946 qdf_ipa_sys_connect_params_t *sys_in, 1947 bool over_gsi, qdf_ipa_wdi_hdl_t hdl, 1948 qdf_ipa_wdi_hdl_t id, 1949 void *ipa_ast_notify_cb); 1950 #else /* CONFIG_IPA_WDI_UNIFIED_API */ 1951 QDF_STATUS (*ipa_setup)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id, 1952 void *ipa_i2w_cb, void *ipa_w2i_cb, 1953 void *ipa_wdi_meter_notifier_cb, 1954 uint32_t ipa_desc_size, void *ipa_priv, 1955 bool is_rm_enabled, uint32_t *tx_pipe_handle, 1956 uint32_t *rx_pipe_handle); 1957 #endif /* CONFIG_IPA_WDI_UNIFIED_API */ 1958 QDF_STATUS (*ipa_cleanup)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id, 1959 uint32_t tx_pipe_handle, 1960 uint32_t rx_pipe_handle, 1961 qdf_ipa_wdi_hdl_t hdl); 1962 QDF_STATUS (*ipa_setup_iface)(char *ifname, uint8_t *mac_addr, 1963 qdf_ipa_client_type_t prod_client, 1964 qdf_ipa_client_type_t cons_client, 1965 uint8_t session_id, bool is_ipv6_enabled, 1966 qdf_ipa_wdi_hdl_t hdl); 1967 QDF_STATUS (*ipa_cleanup_iface)(char *ifname, bool is_ipv6_enabled, 1968 qdf_ipa_wdi_hdl_t hdl); 1969 QDF_STATUS (*ipa_enable_pipes)(struct cdp_soc_t *soc_hdl, 1970 uint8_t pdev_id, qdf_ipa_wdi_hdl_t hdl); 1971 QDF_STATUS (*ipa_disable_pipes)(struct cdp_soc_t *soc_hdl, 1972 uint8_t pdev_id, qdf_ipa_wdi_hdl_t hdl); 1973 QDF_STATUS (*ipa_set_perf_level)(int client, 1974 uint32_t max_supported_bw_mbps, 1975 qdf_ipa_wdi_hdl_t hdl); 1976 bool (*ipa_rx_intrabss_fwd)(struct cdp_soc_t *soc_hdl, uint8_t vdev_id, 1977 qdf_nbuf_t nbuf, bool *fwd_success); 1978 QDF_STATUS (*ipa_tx_buf_smmu_mapping)(struct cdp_soc_t *soc_hdl, 1979 uint8_t pdev_id, 1980 const char *func, 1981 uint32_t line); 1982 QDF_STATUS (*ipa_tx_buf_smmu_unmapping)(struct cdp_soc_t *soc_hdl, 1983 uint8_t pdev_id, 1984 const char *func, 1985 uint32_t line); 1986 #ifdef IPA_WDS_EASYMESH_FEATURE 1987 QDF_STATUS (*ipa_ast_create)(struct cdp_soc_t *soc_hdl, 1988 qdf_ipa_ast_info_type_t *data); 1989 #endif 1990 }; 1991 #endif 1992 1993 #ifdef DP_POWER_SAVE 1994 /** 1995 * struct cdp_tx_delay_ops - mcl tx delay ops 1996 * @tx_delay: handler to get tx packet delay 1997 * @tx_delay_hist: handler to get tx packet delay histogram 1998 * @tx_packet_count: handler to get tx packet count 1999 * @tx_set_compute_interval: update compute interval period for TSM stats 2000 * 2001 * Function pointer for operations related to tx delay. 2002 */ 2003 struct cdp_tx_delay_ops { 2004 void (*tx_delay)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id, 2005 uint32_t *queue_delay_microsec, 2006 uint32_t *tx_delay_microsec, int category); 2007 void (*tx_delay_hist)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id, 2008 uint16_t *bin_values, int category); 2009 void (*tx_packet_count)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id, 2010 uint16_t *out_packet_count, 2011 uint16_t *out_packet_loss_count, int category); 2012 void (*tx_set_compute_interval)(struct cdp_soc_t *soc_hdl, 2013 uint8_t pdev_id, uint32_t interval); 2014 }; 2015 2016 /** 2017 * struct cdp_bus_ops - mcl bus suspend/resume ops 2018 * @bus_suspend: handler for bus suspend 2019 * @bus_resume: handler for bus resume 2020 * @process_wow_ack_rsp: handler for wow ack response 2021 * @process_target_suspend_req: handler for target suspend request 2022 */ 2023 struct cdp_bus_ops { 2024 QDF_STATUS (*bus_suspend)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id); 2025 QDF_STATUS (*bus_resume)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id); 2026 void (*process_wow_ack_rsp)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id); 2027 void (*process_target_suspend_req)(struct cdp_soc_t *soc_hdl, 2028 uint8_t pdev_id); 2029 }; 2030 #endif 2031 2032 #ifdef RECEIVE_OFFLOAD 2033 /** 2034 * struct cdp_rx_offld_ops - mcl host receive offload ops 2035 * @register_rx_offld_flush_cb: 2036 * @deregister_rx_offld_flush_cb: 2037 */ 2038 struct cdp_rx_offld_ops { 2039 void (*register_rx_offld_flush_cb)(void (rx_offld_flush_cb)(void *)); 2040 void (*deregister_rx_offld_flush_cb)(void); 2041 }; 2042 #endif 2043 2044 #if defined(WLAN_CFR_ENABLE) && defined(WLAN_ENH_CFR_ENABLE) 2045 /** 2046 * struct cdp_cfr_ops - host cfr ops 2047 * @txrx_cfr_filter: Handler to configure host rx monitor status ring 2048 * @txrx_get_cfr_rcc: Handler to get CFR mode 2049 * @txrx_set_cfr_rcc: Handler to enable/disable CFR mode 2050 * @txrx_get_cfr_dbg_stats: Handler to get debug statistics for CFR mode 2051 * @txrx_clear_cfr_dbg_stats: Handler to clear debug statistics for CFR mode 2052 */ 2053 struct cdp_cfr_ops { 2054 void (*txrx_cfr_filter)(struct cdp_soc_t *soc_hdl, 2055 uint8_t pdev_id, 2056 bool enable, 2057 struct cdp_monitor_filter *filter_val); 2058 bool (*txrx_get_cfr_rcc)(struct cdp_soc_t *soc_hdl, 2059 uint8_t pdev_id); 2060 void (*txrx_set_cfr_rcc)(struct cdp_soc_t *soc_hdl, 2061 uint8_t pdev_id, 2062 bool enable); 2063 void (*txrx_get_cfr_dbg_stats)(struct cdp_soc_t *soc_hdl, 2064 uint8_t pdev_id, 2065 struct cdp_cfr_rcc_stats *buf); 2066 void (*txrx_clear_cfr_dbg_stats)(struct cdp_soc_t *soc_hdl, 2067 uint8_t pdev_id); 2068 }; 2069 #endif 2070 2071 #ifdef WLAN_SUPPORT_MSCS 2072 /** 2073 * struct cdp_mscs_ops - data path ops for MSCS 2074 * @mscs_peer_lookup_n_get_priority: 2075 */ 2076 struct cdp_mscs_ops { 2077 int (*mscs_peer_lookup_n_get_priority)(struct cdp_soc_t *soc, 2078 uint8_t *src_mac, 2079 uint8_t *dst_mac, 2080 qdf_nbuf_t nbuf); 2081 }; 2082 #endif 2083 2084 #ifdef WLAN_SUPPORT_MESH_LATENCY 2085 /** 2086 * struct cdp_mesh_latency_ops - data path ops for Mesh latency 2087 * @mesh_latency_update_peer_parameter: 2088 */ 2089 struct cdp_mesh_latency_ops { 2090 QDF_STATUS (*mesh_latency_update_peer_parameter)( 2091 struct cdp_soc_t *soc, 2092 uint8_t *dest_mac, uint32_t service_interval_dl, 2093 uint32_t burst_size_dl, uint32_t service_interval_ul, 2094 uint32_t burst_size_ul, uint16_t priority, 2095 uint8_t add_or_sub); 2096 }; 2097 #endif 2098 2099 #ifdef WLAN_SUPPORT_SCS 2100 /** 2101 * struct cdp_scs_ops - data path ops for SCS 2102 * @scs_peer_lookup_n_rule_match : Handler for peer lookup and scs rule match 2103 */ 2104 struct cdp_scs_ops { 2105 bool (*scs_peer_lookup_n_rule_match)(struct cdp_soc_t *soc, 2106 uint32_t rule_id, 2107 uint8_t *dst_mac_addr); 2108 }; 2109 #endif 2110 2111 #ifdef CONFIG_SAWF_DEF_QUEUES 2112 struct cdp_sawf_ops { 2113 QDF_STATUS 2114 (*sawf_def_queues_map_req)(struct cdp_soc_t *soc, uint8_t *mac_addr, 2115 uint8_t svc_class_id); 2116 QDF_STATUS 2117 (*sawf_def_queues_unmap_req)(struct cdp_soc_t *soc, uint8_t *mac_addr, 2118 uint8_t svc_class_id); 2119 QDF_STATUS 2120 (*sawf_def_queues_get_map_report)(struct cdp_soc_t *soc, 2121 uint8_t *mac_addr); 2122 #ifdef CONFIG_SAWF 2123 QDF_STATUS 2124 (*txrx_get_peer_sawf_delay_stats)(struct cdp_soc_t *soc, 2125 uint32_t svc_id, uint8_t *mac, 2126 void *data); 2127 QDF_STATUS 2128 (*txrx_get_peer_sawf_tx_stats)(struct cdp_soc_t *soc, 2129 uint32_t svc_id, uint8_t *mac, 2130 void *data); 2131 QDF_STATUS 2132 (*sawf_mpdu_stats_req)(struct cdp_soc_t *soc, uint8_t enable); 2133 QDF_STATUS 2134 (*sawf_mpdu_details_stats_req)(struct cdp_soc_t *soc, uint8_t enable); 2135 QDF_STATUS 2136 (*txrx_sawf_set_mov_avg_params)(uint32_t num_pkt, uint32_t num_win); 2137 QDF_STATUS 2138 (*txrx_sawf_set_sla_params)(uint32_t num_pkt, uint32_t time_secs); 2139 QDF_STATUS 2140 (*txrx_sawf_init_telemtery_params)(void); 2141 QDF_STATUS 2142 (*telemetry_get_throughput_stats)(void *arg, uint64_t *in_bytes, 2143 uint64_t *in_cnt, uint64_t *tx_bytes, 2144 uint64_t *tx_cnt, uint8_t tid, 2145 uint8_t msduq); 2146 QDF_STATUS 2147 (*telemetry_get_mpdu_stats)(void *arg, uint64_t *svc_int_pass, 2148 uint64_t *svc_int_fail, 2149 uint64_t *burst_pass, uint64_t *burst_fail, 2150 uint8_t tid, uint8_t msduq); 2151 QDF_STATUS 2152 (*telemetry_get_drop_stats)(void *arg, uint64_t *pass, uint64_t *drop, 2153 uint64_t *drop_ttl, uint8_t tid, 2154 uint8_t msduq); 2155 #endif 2156 }; 2157 #endif 2158 2159 struct cdp_ops { 2160 struct cdp_cmn_ops *cmn_drv_ops; 2161 struct cdp_ctrl_ops *ctrl_ops; 2162 struct cdp_me_ops *me_ops; 2163 struct cdp_mon_ops *mon_ops; 2164 struct cdp_host_stats_ops *host_stats_ops; 2165 struct cdp_wds_ops *wds_ops; 2166 struct cdp_raw_ops *raw_ops; 2167 struct cdp_pflow_ops *pflow_ops; 2168 #ifdef DP_PEER_EXTENDED_API 2169 struct cdp_misc_ops *misc_ops; 2170 struct cdp_peer_ops *peer_ops; 2171 struct cdp_ocb_ops *ocb_ops; 2172 struct cdp_mob_stats_ops *mob_stats_ops; 2173 struct cdp_pmf_ops *pmf_ops; 2174 #endif 2175 #ifdef DP_FLOW_CTL 2176 struct cdp_cfg_ops *cfg_ops; 2177 struct cdp_flowctl_ops *flowctl_ops; 2178 struct cdp_lflowctl_ops *l_flowctl_ops; 2179 struct cdp_throttle_ops *throttle_ops; 2180 #endif 2181 #ifdef DP_POWER_SAVE 2182 struct cdp_bus_ops *bus_ops; 2183 struct cdp_tx_delay_ops *delay_ops; 2184 #endif 2185 #ifdef IPA_OFFLOAD 2186 struct cdp_ipa_ops *ipa_ops; 2187 #endif 2188 #ifdef RECEIVE_OFFLOAD 2189 struct cdp_rx_offld_ops *rx_offld_ops; 2190 #endif 2191 #if defined(WLAN_CFR_ENABLE) && defined(WLAN_ENH_CFR_ENABLE) 2192 struct cdp_cfr_ops *cfr_ops; 2193 #endif 2194 #ifdef WLAN_SUPPORT_MSCS 2195 struct cdp_mscs_ops *mscs_ops; 2196 #endif 2197 #ifdef WLAN_SUPPORT_MESH_LATENCY 2198 struct cdp_mesh_latency_ops *mesh_latency_ops; 2199 #endif 2200 #if defined(WLAN_FEATURE_11BE_MLO) && defined(WLAN_MLO_MULTI_CHIP) 2201 struct cdp_mlo_ops *mlo_ops; 2202 #endif 2203 #ifdef CONFIG_SAWF_DEF_QUEUES 2204 struct cdp_sawf_ops *sawf_ops; 2205 #endif 2206 #ifdef WLAN_SUPPORT_SCS 2207 struct cdp_scs_ops *scs_ops; 2208 #endif 2209 }; 2210 #endif 2211