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 * txrx_get_os_rx_handles_from_vdev() - Return function, osif vdev 594 * to deliver pkt to stack. 595 * @soc: datapath soc handle 596 * @vdev: vdev id 597 * @stack_fn: pointer to - function pointer to deliver RX pkt to stack 598 * @osif_vdev: pointer to - osif vdev to deliver RX packet to. 599 */ 600 void (*txrx_get_os_rx_handles_from_vdev) 601 (ol_txrx_soc_handle soc, 602 uint8_t vdev_id, 603 ol_txrx_rx_fp *stack_fn, 604 ol_osif_vdev_handle *osif_vdev); 605 606 void (*set_rate_stats_ctx)(struct cdp_soc_t *soc, 607 void *ctx); 608 609 int (*txrx_classify_update) 610 (struct cdp_soc_t *soc, uint8_t vdev_id, qdf_nbuf_t skb, 611 enum txrx_direction, struct ol_txrx_nbuf_classify *nbuf_class); 612 613 bool (*get_dp_capabilities)(struct cdp_soc_t *soc, 614 enum cdp_capabilities dp_caps); 615 void* (*get_rate_stats_ctx)(struct cdp_soc_t *soc); 616 QDF_STATUS (*txrx_peer_flush_rate_stats)(struct cdp_soc_t *soc, 617 uint8_t pdev_id, 618 void *buf); 619 void* (*txrx_peer_get_peerstats_ctx)(struct cdp_soc_t *soc, 620 uint8_t vdev_id, 621 uint8_t *mac_addr); 622 623 QDF_STATUS (*txrx_flush_rate_stats_request)(struct cdp_soc_t *soc, 624 uint8_t pdev_id); 625 QDF_STATUS (*set_pdev_pcp_tid_map)(struct cdp_soc_t *soc, 626 uint8_t pdev_id, 627 uint8_t pcp, uint8_t tid); 628 QDF_STATUS (*set_vdev_pcp_tid_map)(struct cdp_soc_t *soc, 629 uint8_t vdev_id, 630 uint8_t pcp, uint8_t tid); 631 #ifdef DP_RX_UDP_OVER_PEER_ROAM 632 QDF_STATUS (*txrx_update_roaming_peer)(struct cdp_soc_t *soc, 633 uint8_t vdev_id, 634 uint8_t *peer_mac, 635 uint32_t auth_status); 636 #endif 637 638 #ifdef QCA_MULTIPASS_SUPPORT 639 QDF_STATUS (*set_vlan_groupkey)(struct cdp_soc_t *soc, uint8_t vdev_id, 640 uint16_t vlan_id, uint16_t group_key); 641 #endif 642 643 uint16_t (*get_peer_mac_list) 644 (ol_txrx_soc_handle soc, uint8_t vdev_id, 645 u_int8_t newmac[][QDF_MAC_ADDR_SIZE], uint16_t mac_cnt, 646 bool limit); 647 uint16_t (*get_peer_id)(ol_txrx_soc_handle soc, 648 uint8_t vdev_id, 649 uint8_t *mac); 650 #ifdef QCA_SUPPORT_WDS_EXTENDED 651 QDF_STATUS (*set_wds_ext_peer_rx)(ol_txrx_soc_handle soc, 652 uint8_t vdev_id, 653 uint8_t *mac, 654 ol_txrx_rx_fp rx, 655 ol_osif_peer_handle osif_peer); 656 #endif /* QCA_SUPPORT_WDS_EXTENDED */ 657 void (*txrx_drain)(ol_txrx_soc_handle soc); 658 int (*get_free_desc_poolsize)(struct cdp_soc_t *soc); 659 #ifdef WLAN_SYSFS_DP_STATS 660 QDF_STATUS (*txrx_sysfs_fill_stats)(ol_txrx_soc_handle soc, 661 char *buf, uint32_t buf_size); 662 QDF_STATUS (*txrx_sysfs_set_stat_type)(ol_txrx_soc_handle soc, 663 uint32_t stat_type, 664 uint32_t mac_id); 665 #endif /* WLAN_SYSFS_DP_STATS */ 666 #ifdef WLAN_FEATURE_PKT_CAPTURE_V2 667 void (*set_pkt_capture_mode)(struct cdp_soc_t *soc, bool val); 668 #endif 669 670 #ifdef FEATURE_RUNTIME_PM 671 void (*set_rtpm_tput_policy)(struct cdp_soc_t *soc, bool val); 672 #endif 673 674 #if defined(WLAN_FEATURE_11BE_MLO) && defined(WLAN_MLO_MULTI_CHIP) 675 void (*txrx_recovery_vdev_flush_peers)(struct cdp_soc_t *soc, 676 uint8_t vdev_id, 677 bool mlo_peers_only); 678 #endif 679 QDF_STATUS (*txrx_umac_reset_deinit)(ol_txrx_soc_handle soc); 680 }; 681 682 struct cdp_ctrl_ops { 683 684 int 685 (*txrx_mempools_attach)(ol_txrx_soc_handle dp_soc); 686 int 687 (*txrx_update_filter_neighbour_peers)( 688 struct cdp_soc_t *soc, uint8_t vdev_id, 689 uint32_t cmd, uint8_t *macaddr); 690 691 /* Is this similar to ol_txrx_peer_state_update() in MCL */ 692 /** 693 * @brief Update the authorize peer object at association time 694 * @details 695 * For the host-based implementation of rate-control, it 696 * updates the peer/node-related parameters within rate-control 697 * context of the peer at association. 698 * 699 * @param soc_hdl - pointer to the soc object 700 * @param vdev_id - id of the virtual object 701 * @param peer_mac - mac address of the node's object 702 * @authorize - either to authorize or unauthorize peer 703 * 704 * @return QDF_STATUS 705 */ 706 QDF_STATUS 707 (*txrx_peer_authorize)(struct cdp_soc_t *soc_hdl, 708 uint8_t vdev_id, 709 uint8_t *peer_mac, 710 u_int32_t authorize); 711 bool 712 (*txrx_peer_get_authorize)(struct cdp_soc_t *soc_hdl, 713 uint8_t vdev_id, 714 uint8_t *peer_mac); 715 716 void (*tx_flush_buffers)(struct cdp_soc_t *soc, uint8_t vdev_id); 717 718 int (*txrx_is_target_ar900b)(struct cdp_soc_t *soc_hdl); 719 720 QDF_STATUS 721 (*txrx_set_vdev_param)(struct cdp_soc_t *soc, uint8_t vdev_id, 722 enum cdp_vdev_param_type param, 723 cdp_config_param_type val); 724 725 /** 726 * @brief Set the reo dest ring num of the radio 727 * @details 728 * Set the reo destination ring no on which we will receive 729 * pkts for this radio. 730 * 731 * @txrx_soc - soc handle 732 * @param pdev_id - id of physical device 733 * @return the reo destination ring number 734 * @param reo_dest_ring_num - value ranges between 1 - 4 735 */ 736 QDF_STATUS (*txrx_set_pdev_reo_dest)( 737 struct cdp_soc_t *txrx_soc, 738 uint8_t pdev_id, 739 enum cdp_host_reo_dest_ring reo_dest_ring_num); 740 741 /** 742 * @brief Get the reo dest ring num of the radio 743 * @details 744 * Get the reo destination ring no on which we will receive 745 * pkts for this radio. 746 * 747 * @txrx_soc - soc handle 748 * @param pdev_id - id of physical device 749 * @return the reo destination ring number 750 */ 751 enum cdp_host_reo_dest_ring (*txrx_get_pdev_reo_dest)( 752 struct cdp_soc_t *txrx_soc, 753 uint8_t pdev_id); 754 755 int (*txrx_wdi_event_sub)(struct cdp_soc_t *soc, uint8_t pdev_id, 756 wdi_event_subscribe *event_cb_sub, 757 uint32_t event); 758 759 int (*txrx_wdi_event_unsub)(struct cdp_soc_t *soc, uint8_t pdev_id, 760 wdi_event_subscribe *event_cb_sub, 761 uint32_t event); 762 763 int (*txrx_get_sec_type)(ol_txrx_soc_handle soc, uint8_t vdev_id, 764 uint8_t *peer_mac, uint8_t sec_idx); 765 766 QDF_STATUS 767 (*txrx_update_mgmt_txpow_vdev)(struct cdp_soc_t *soc, 768 uint8_t vdev_id, 769 uint8_t subtype, uint8_t tx_power); 770 771 /** 772 * txrx_set_pdev_param() - callback to set pdev parameter 773 * @soc: opaque soc handle 774 * @pdev_id:id of data path pdev handle 775 * @val: value of pdev_tx_capture 776 * 777 * Return: status: 0 - Success, non-zero: Failure 778 */ 779 QDF_STATUS (*txrx_set_pdev_param)(struct cdp_soc_t *soc, 780 uint8_t pdev_id, 781 enum cdp_pdev_param_type type, 782 cdp_config_param_type val); 783 784 QDF_STATUS (*txrx_get_pdev_param)(struct cdp_soc_t *soc, 785 uint8_t pdev_id, 786 enum cdp_pdev_param_type type, 787 cdp_config_param_type *val); 788 789 QDF_STATUS (*txrx_set_peer_param)(struct cdp_soc_t *soc, 790 uint8_t vdev_id, uint8_t *peer_mac, 791 enum cdp_peer_param_type param, 792 cdp_config_param_type val); 793 794 QDF_STATUS (*txrx_get_peer_param)(struct cdp_soc_t *soc, 795 uint8_t vdev_id, uint8_t *peer_mac, 796 enum cdp_peer_param_type param, 797 cdp_config_param_type *val); 798 799 void * (*txrx_get_pldev)(struct cdp_soc_t *soc, uint8_t pdev_id); 800 void (*txrx_peer_flush_frags)(struct cdp_soc_t *soc, uint8_t vdev_id, 801 uint8_t *peer_mac); 802 803 #ifdef VDEV_PEER_PROTOCOL_COUNT 804 void (*txrx_peer_protocol_cnt)(struct cdp_soc_t *soc, 805 int8_t vdev_id, 806 qdf_nbuf_t nbuf, 807 bool is_egress, 808 bool is_rx); 809 #endif 810 #ifdef ATH_SUPPORT_NAC_RSSI 811 QDF_STATUS (*txrx_vdev_config_for_nac_rssi)(struct cdp_soc_t *cdp_soc, 812 uint8_t vdev_id, 813 enum cdp_nac_param_cmd cmd, 814 char *bssid, 815 char *client_macaddr, 816 uint8_t chan_num); 817 818 QDF_STATUS (*txrx_vdev_get_neighbour_rssi)(struct cdp_soc_t *cdp_soc, 819 uint8_t vdev_id, 820 char *macaddr, 821 uint8_t *rssi); 822 #endif 823 824 #ifdef WLAN_SUPPORT_MSCS 825 QDF_STATUS 826 (*txrx_record_mscs_params) ( 827 struct cdp_soc_t *soc, uint8_t *macaddr, 828 uint8_t vdev_id, 829 struct cdp_mscs_params *mscs_params, 830 bool active); 831 #endif 832 833 QDF_STATUS 834 (*set_key)(struct cdp_soc_t *soc, uint8_t vdev_id, uint8_t *mac, 835 bool is_unicast, uint32_t *key); 836 837 QDF_STATUS (*txrx_get_vdev_param)(struct cdp_soc_t *soc, 838 uint8_t vdev_id, 839 enum cdp_vdev_param_type param, 840 cdp_config_param_type *val); 841 int (*enable_peer_based_pktlog)(struct cdp_soc_t *cdp_soc, 842 uint8_t pdev_id, 843 uint8_t *macaddr, uint8_t enb_dsb); 844 845 QDF_STATUS 846 (*calculate_delay_stats)(struct cdp_soc_t *cdp_soc, 847 uint8_t vdev_id, qdf_nbuf_t nbuf); 848 #ifdef WLAN_SUPPORT_RX_PROTOCOL_TYPE_TAG 849 QDF_STATUS (*txrx_update_pdev_rx_protocol_tag)( 850 struct cdp_soc_t *soc, uint8_t pdev_id, 851 uint32_t protocol_mask, uint16_t protocol_type, 852 uint16_t tag); 853 #ifdef WLAN_SUPPORT_RX_TAG_STATISTICS 854 void (*txrx_dump_pdev_rx_protocol_tag_stats)( 855 struct cdp_soc_t *soc, uint8_t pdev_id, 856 uint16_t protocol_type); 857 #endif /* WLAN_SUPPORT_RX_TAG_STATISTICS */ 858 #endif /* WLAN_SUPPORT_RX_PROTOCOL_TYPE_TAG */ 859 #ifdef WLAN_SUPPORT_RX_FLOW_TAG 860 QDF_STATUS (*txrx_set_rx_flow_tag)( 861 struct cdp_soc_t *cdp_soc, uint8_t pdev_id, 862 struct cdp_rx_flow_info *flow_info); 863 QDF_STATUS (*txrx_dump_rx_flow_tag_stats)( 864 struct cdp_soc_t *cdp_soc, uint8_t pdev_id, 865 struct cdp_rx_flow_info *flow_info); 866 #endif /* WLAN_SUPPORT_RX_FLOW_TAG */ 867 #ifdef QCA_MULTIPASS_SUPPORT 868 void (*txrx_peer_set_vlan_id)(struct cdp_soc_t *cdp_soc, 869 uint8_t vdev_id, uint8_t *peer_mac, 870 uint16_t vlan_id); 871 #endif 872 #if defined(WLAN_TX_PKT_CAPTURE_ENH) || defined(WLAN_RX_PKT_CAPTURE_ENH) 873 QDF_STATUS (*txrx_update_peer_pkt_capture_params)( 874 ol_txrx_soc_handle soc, uint8_t pdev_id, 875 bool is_rx_pkt_cap_enable, uint8_t is_tx_pkt_cap_enable, 876 uint8_t *peer_mac); 877 #endif /* WLAN_TX_PKT_CAPTURE_ENH || WLAN_RX_PKT_CAPTURE_ENH */ 878 QDF_STATUS 879 (*txrx_set_psoc_param)(struct cdp_soc_t *soc, 880 enum cdp_psoc_param_type param, 881 cdp_config_param_type val); 882 883 QDF_STATUS (*txrx_get_psoc_param)(ol_txrx_soc_handle soc, 884 enum cdp_psoc_param_type type, 885 cdp_config_param_type *val); 886 #ifdef VDEV_PEER_PROTOCOL_COUNT 887 /* 888 * Enable per-peer protocol counters 889 */ 890 void (*txrx_enable_peer_protocol_count)(struct cdp_soc_t *soc, 891 int8_t vdev_id, bool enable); 892 void (*txrx_set_peer_protocol_drop_mask)(struct cdp_soc_t *soc, 893 int8_t vdev_id, int mask); 894 int (*txrx_is_peer_protocol_count_enabled)(struct cdp_soc_t *soc, 895 int8_t vdev_id); 896 int (*txrx_get_peer_protocol_drop_mask)(struct cdp_soc_t *soc, 897 int8_t vdev_id); 898 899 #endif 900 901 #if defined(WLAN_FEATURE_TSF_UPLINK_DELAY) || defined(CONFIG_SAWF) 902 void (*txrx_set_delta_tsf)(struct cdp_soc_t *soc, uint8_t vdev_id, 903 uint32_t delta_tsf); 904 #endif 905 #ifdef WLAN_FEATURE_TSF_UPLINK_DELAY 906 QDF_STATUS (*txrx_set_tsf_ul_delay_report)(struct cdp_soc_t *soc, 907 uint8_t vdev_id, 908 bool enable); 909 QDF_STATUS (*txrx_get_uplink_delay)(struct cdp_soc_t *soc, 910 uint8_t vdev_id, 911 uint32_t *val); 912 #endif 913 #ifdef QCA_UNDECODED_METADATA_SUPPORT 914 QDF_STATUS (*txrx_set_pdev_phyrx_error_mask)(struct cdp_soc_t *soc, 915 uint8_t pdev_id, 916 uint32_t mask, 917 uint32_t mask_cont); 918 QDF_STATUS (*txrx_get_pdev_phyrx_error_mask)(struct cdp_soc_t *soc, 919 uint8_t pdev_id, 920 uint32_t *mask, 921 uint32_t *mask_cont); 922 #endif 923 }; 924 925 struct cdp_me_ops { 926 927 void (*tx_me_alloc_descriptor)(struct cdp_soc_t *soc, 928 uint8_t pdev_id); 929 930 void (*tx_me_free_descriptor)(struct cdp_soc_t *soc, uint8_t pdev_id); 931 932 uint16_t (*tx_me_convert_ucast)(struct cdp_soc_t *soc, uint8_t vdev_id, 933 qdf_nbuf_t wbuf, u_int8_t newmac[][6], 934 uint8_t newmaccnt, uint8_t tid, 935 bool is_igmp, bool is_dms_pkt); 936 }; 937 938 /** 939 * struct cdp_mon_ops - host mon ops 940 * @txrx_reset_monitor_mode: Handler to reset monitor mode 941 * @txrx_deliver_tx_mgmt: deliver mgmt tx frame 942 * @txrx_set_advance_monitor_filter: set advanced monitor mode 943 * @config_full_mon_mode: configure full monitor mode 944 * @txrx_enable_mon_reap_timer: Enable/Disable reap timer of monitor status ring 945 */ 946 struct cdp_mon_ops { 947 948 QDF_STATUS (*txrx_reset_monitor_mode) 949 (ol_txrx_soc_handle soc, uint8_t pdev_id, u_int8_t smart_monitor); 950 951 QDF_STATUS (*txrx_deliver_tx_mgmt) 952 (struct cdp_soc_t *cdp_soc, uint8_t pdev_id, qdf_nbuf_t nbuf); 953 954 /* HK advance monitor filter support */ 955 QDF_STATUS (*txrx_set_advance_monitor_filter) 956 (struct cdp_soc_t *soc_hdl, uint8_t pdev_id, 957 struct cdp_monitor_filter *filter_val); 958 959 /* Configure full monitor mode */ 960 QDF_STATUS 961 (*config_full_mon_mode)(struct cdp_soc_t *soc, uint8_t val); 962 QDF_STATUS (*soc_config_full_mon_mode)(struct cdp_pdev *cdp_pdev, 963 uint8_t val); 964 965 /* Get monitor mode pdev stats */ 966 QDF_STATUS 967 (*get_mon_pdev_rx_stats)(struct cdp_soc_t *soc, uint8_t pdev_id, 968 struct cdp_pdev_mon_stats *stats); 969 970 /* Configure monitor status srng reap timer */ 971 bool (*txrx_enable_mon_reap_timer)(struct cdp_soc_t *soc_hdl, 972 enum cdp_mon_reap_source source, 973 bool enable); 974 975 #ifdef QCA_SUPPORT_LITE_MONITOR 976 /* set lite monitor config */ 977 QDF_STATUS 978 (*txrx_set_lite_mon_config)( 979 struct cdp_soc_t *soc, 980 struct cdp_lite_mon_filter_config *mon_config, 981 uint8_t pdev_id); 982 983 /* get lite monitor config */ 984 QDF_STATUS 985 (*txrx_get_lite_mon_config)( 986 struct cdp_soc_t *soc, 987 struct cdp_lite_mon_filter_config *mon_config, 988 uint8_t pdev_id); 989 990 /* set lite monitor peer config */ 991 QDF_STATUS 992 (*txrx_set_lite_mon_peer_config)( 993 struct cdp_soc_t *soc, 994 struct cdp_lite_mon_peer_config *peer_config, 995 uint8_t pdev_id); 996 997 /* get lite monitor peer list */ 998 QDF_STATUS 999 (*txrx_get_lite_mon_peer_config)( 1000 struct cdp_soc_t *soc, 1001 struct cdp_lite_mon_peer_info *info, 1002 uint8_t pdev_id); 1003 1004 /* get lite monitor enable/disable status */ 1005 int 1006 (*txrx_is_lite_mon_enabled)(struct cdp_soc_t *soc, 1007 uint8_t pdev_id, 1008 uint8_t direction); 1009 #endif 1010 /*To set RSSI dbm converstion params in monitor pdev */ 1011 QDF_STATUS (*txrx_set_mon_pdev_params_rssi_dbm_conv) 1012 (struct cdp_soc_t *soc, 1013 struct cdp_rssi_db2dbm_param_dp *params); 1014 }; 1015 1016 struct cdp_host_stats_ops { 1017 int (*txrx_host_stats_get)(struct cdp_soc_t *soc, uint8_t vdev_id, 1018 struct ol_txrx_stats_req *req); 1019 1020 QDF_STATUS (*txrx_host_stats_clr)(struct cdp_soc_t *soc, 1021 uint8_t vdev_id); 1022 1023 QDF_STATUS 1024 (*txrx_host_ce_stats)(struct cdp_soc_t *soc, uint8_t vdev_id); 1025 1026 int (*txrx_stats_publish)(struct cdp_soc_t *soc, uint8_t pdev_id, 1027 struct cdp_stats_extd *buf); 1028 /** 1029 * @brief Enable enhanced stats functionality. 1030 * 1031 * @param soc - the soc handle 1032 * @param pdev_id - pdev_id of pdev 1033 * @return - QDF_STATUS 1034 */ 1035 QDF_STATUS (*txrx_enable_enhanced_stats)(struct cdp_soc_t *soc, 1036 uint8_t pdev_id); 1037 1038 /** 1039 * @brief Disable enhanced stats functionality. 1040 * 1041 * @param soc - the soc handle 1042 * @param pdev_id - pdev_id of pdev 1043 * @return - QDF_STATUS 1044 */ 1045 QDF_STATUS (*txrx_disable_enhanced_stats)(struct cdp_soc_t *soc, 1046 uint8_t pdev_id); 1047 1048 QDF_STATUS 1049 (*tx_print_tso_stats)(struct cdp_soc_t *soc, uint8_t vdev_id); 1050 1051 QDF_STATUS 1052 (*tx_rst_tso_stats)(struct cdp_soc_t *soc, uint8_t vdev_id); 1053 1054 QDF_STATUS 1055 (*tx_print_sg_stats)(struct cdp_soc_t *soc, uint8_t vdev_id); 1056 1057 QDF_STATUS 1058 (*tx_rst_sg_stats)(struct cdp_soc_t *soc, uint8_t vdev_id); 1059 1060 QDF_STATUS 1061 (*print_rx_cksum_stats)(struct cdp_soc_t *soc, uint8_t vdev_id); 1062 1063 QDF_STATUS 1064 (*rst_rx_cksum_stats)(struct cdp_soc_t *soc, uint8_t vdev_id); 1065 1066 QDF_STATUS 1067 (*txrx_host_me_stats)(struct cdp_soc_t *soc, uint8_t vdev_id); 1068 1069 QDF_STATUS 1070 (*txrx_per_peer_stats)(struct cdp_soc_t *soc, uint8_t *addr); 1071 1072 int (*txrx_host_msdu_ttl_stats)(struct cdp_soc_t *soc, uint8_t vdev_id, 1073 struct ol_txrx_stats_req *req); 1074 1075 int (*ol_txrx_update_peer_stats)(struct cdp_soc_t *soc, 1076 uint8_t pdev_id, 1077 uint8_t *addr, void *stats, 1078 uint32_t last_tx_rate_mcs, 1079 uint32_t stats_id); 1080 1081 QDF_STATUS 1082 (*get_fw_peer_stats)(struct cdp_soc_t *soc, uint8_t pdev_id, 1083 uint8_t *addr, 1084 uint32_t cap, uint32_t copy_stats); 1085 1086 QDF_STATUS 1087 (*get_htt_stats)(struct cdp_soc_t *soc, uint8_t pdev_id, 1088 void *data, 1089 uint32_t data_len); 1090 QDF_STATUS 1091 (*txrx_update_pdev_stats)(struct cdp_soc_t *soc, 1092 uint8_t pdev_id, void *data, 1093 uint16_t stats_id); 1094 QDF_STATUS 1095 (*txrx_get_peer_stats_param)(struct cdp_soc_t *soc, 1096 uint8_t vdev_id, 1097 uint8_t *peer_mac, 1098 enum cdp_peer_stats_type type, 1099 cdp_peer_stats_param_t *buf); 1100 QDF_STATUS 1101 (*txrx_get_peer_stats)(struct cdp_soc_t *soc, uint8_t vdev_id, 1102 uint8_t *peer_mac, 1103 struct cdp_peer_stats *peer_stats); 1104 QDF_STATUS 1105 (*txrx_get_soc_stats)(struct cdp_soc_t *soc, 1106 struct cdp_soc_stats *soc_stats); 1107 QDF_STATUS 1108 (*txrx_reset_peer_ald_stats)(struct cdp_soc_t *soc, 1109 uint8_t vdev_id, 1110 uint8_t *peer_mac); 1111 QDF_STATUS 1112 (*txrx_reset_peer_stats)(struct cdp_soc_t *soc, 1113 uint8_t vdev_id, uint8_t *peer_mac); 1114 int 1115 (*txrx_get_vdev_stats)(struct cdp_soc_t *soc, uint8_t vdev_id, 1116 void *buf, bool is_aggregate); 1117 int 1118 (*txrx_process_wmi_host_vdev_stats)(ol_txrx_soc_handle soc, 1119 void *data, uint32_t len, 1120 uint32_t stats_id); 1121 int 1122 (*txrx_get_vdev_extd_stats)(struct cdp_soc_t *soc, 1123 uint8_t vdev_id, 1124 wmi_host_vdev_extd_stats *buffer); 1125 QDF_STATUS 1126 (*txrx_update_vdev_stats)(struct cdp_soc_t *soc, 1127 uint8_t vdev_id, void *buf, 1128 uint16_t stats_id); 1129 int 1130 (*txrx_get_radio_stats)(struct cdp_soc_t *soc, uint8_t pdev_id, 1131 void *buf); 1132 QDF_STATUS 1133 (*txrx_get_pdev_stats)(struct cdp_soc_t *soc, uint8_t pdev_id, 1134 struct cdp_pdev_stats *buf); 1135 int 1136 (*txrx_get_ratekbps)(int preamb, int mcs, 1137 int htflag, int gintval); 1138 1139 QDF_STATUS 1140 (*txrx_update_peer_stats)(struct cdp_soc_t *soc, uint8_t vdev_id, 1141 uint8_t *peer_mac, void *stats, 1142 uint32_t last_tx_rate_mcs, 1143 uint32_t stats_id); 1144 1145 #ifdef QCA_SUPPORT_SCAN_SPCL_VAP_STATS 1146 QDF_STATUS 1147 (*txrx_get_scan_spcl_vap_stats)(struct cdp_soc_t *soc, uint8_t vdev_id, 1148 struct cdp_scan_spcl_vap_stats *stats); 1149 #endif 1150 1151 QDF_STATUS 1152 (*txrx_get_peer_delay_stats)(struct cdp_soc_t *soc, uint8_t vdev_id, 1153 uint8_t *peer_mac, 1154 struct cdp_delay_tid_stats *delay_stats); 1155 1156 QDF_STATUS 1157 (*txrx_get_peer_jitter_stats)(struct cdp_soc_t *soc, uint8_t pdev_id, 1158 uint8_t vdev_id, uint8_t *peer_mac, 1159 struct cdp_peer_tid_stats *tid_stats); 1160 1161 QDF_STATUS 1162 (*txrx_alloc_vdev_stats_id)(struct cdp_soc_t *soc, 1163 uint8_t *vdev_stats_id); 1164 1165 void (*txrx_reset_vdev_stats_id)(struct cdp_soc_t *soc, 1166 uint8_t vdev_stats_id); 1167 1168 #ifdef WLAN_TX_PKT_CAPTURE_ENH 1169 QDF_STATUS 1170 (*get_peer_tx_capture_stats)(struct cdp_soc_t *soc, uint8_t vdev_id, 1171 uint8_t *peer_mac, 1172 struct cdp_peer_tx_capture_stats *stats); 1173 1174 QDF_STATUS 1175 (*get_pdev_tx_capture_stats)(struct cdp_soc_t *soc, uint8_t pdev_id, 1176 struct cdp_pdev_tx_capture_stats *stats); 1177 #endif /* WLAN_TX_PKT_CAPTURE_ENH */ 1178 #ifdef HW_TX_DELAY_STATS_ENABLE 1179 void 1180 (*enable_disable_vdev_tx_delay_stats)(struct cdp_soc_t *soc, 1181 uint8_t vdev_id, 1182 uint8_t value); 1183 uint8_t (*is_tx_delay_stats_enabled)(struct cdp_soc_t *soc_hdl, 1184 uint8_t vdev_id); 1185 #endif 1186 QDF_STATUS 1187 (*txrx_get_pdev_tid_stats)(struct cdp_soc_t *soc, uint8_t pdev_id, 1188 struct cdp_tid_stats_intf *tid_stats); 1189 #ifdef WLAN_TELEMETRY_STATS_SUPPORT 1190 QDF_STATUS 1191 (*txrx_pdev_telemetry_stats)( 1192 struct cdp_soc_t *soc, 1193 uint8_t pdev_id, 1194 struct cdp_pdev_telemetry_stats *stats); 1195 QDF_STATUS 1196 (*txrx_peer_telemetry_stats)( 1197 struct cdp_soc_t *soc, 1198 uint8_t *addr, 1199 struct cdp_peer_telemetry_stats *stats); 1200 #endif 1201 }; 1202 1203 struct cdp_wds_ops { 1204 QDF_STATUS 1205 (*txrx_set_wds_rx_policy)(struct cdp_soc_t *soc, uint8_t vdev_id, 1206 u_int32_t val); 1207 QDF_STATUS 1208 (*txrx_wds_peer_tx_policy_update)(struct cdp_soc_t *soc, 1209 uint8_t vdev_id, uint8_t *peer_mac, 1210 int wds_tx_ucast, int wds_tx_mcast); 1211 int (*vdev_set_wds)(struct cdp_soc_t *soc, uint8_t vdev_id, 1212 uint32_t val); 1213 }; 1214 1215 struct cdp_raw_ops { 1216 QDF_STATUS 1217 (*rsim_get_astentry)(struct cdp_soc_t *soc, uint8_t vdev_id, 1218 qdf_nbuf_t *pnbuf, struct cdp_raw_ast *raw_ast); 1219 }; 1220 1221 #ifdef PEER_FLOW_CONTROL 1222 struct cdp_pflow_ops { 1223 uint32_t (*pflow_update_pdev_params)(struct cdp_soc_t *soc, 1224 uint8_t pdev_id, 1225 enum _dp_param_t, 1226 uint32_t, void *); 1227 }; 1228 #endif /* PEER_FLOW_CONTROL */ 1229 1230 #define LRO_IPV4_SEED_ARR_SZ 5 1231 #define LRO_IPV6_SEED_ARR_SZ 11 1232 1233 /** 1234 * struct cdp_lro_hash_config - set rx_offld(LRO/GRO) init parameters 1235 * @lro_enable: indicates whether rx_offld is enabled 1236 * @tcp_flag: If the TCP flags from the packet do not match 1237 * the values in this field after masking with TCP flags mask 1238 * below, packet is not rx_offld eligible 1239 * @tcp_flag_mask: field for comparing the TCP values provided 1240 * above with the TCP flags field in the received packet 1241 * @toeplitz_hash_ipv4: contains seed needed to compute the flow id 1242 * 5-tuple toeplitz hash for ipv4 packets 1243 * @toeplitz_hash_ipv6: contains seed needed to compute the flow id 1244 * 5-tuple toeplitz hash for ipv6 packets 1245 */ 1246 struct cdp_lro_hash_config { 1247 uint32_t lro_enable; 1248 uint32_t tcp_flag:9, 1249 tcp_flag_mask:9; 1250 uint32_t toeplitz_hash_ipv4[LRO_IPV4_SEED_ARR_SZ]; 1251 uint32_t toeplitz_hash_ipv6[LRO_IPV6_SEED_ARR_SZ]; 1252 }; 1253 1254 struct ol_if_ops { 1255 void 1256 (*peer_set_default_routing)(struct cdp_ctrl_objmgr_psoc *ctrl_psoc, 1257 uint8_t pdev_id, uint8_t *peer_macaddr, 1258 uint8_t vdev_id, 1259 bool hash_based, uint8_t ring_num, 1260 uint8_t lmac_peer_id_msb); 1261 QDF_STATUS 1262 (*peer_rx_reorder_queue_setup)(struct cdp_ctrl_objmgr_psoc *ctrl_psoc, 1263 uint8_t pdev_id, 1264 uint8_t vdev_id, uint8_t *peer_mac, 1265 qdf_dma_addr_t hw_qdesc, int tid, 1266 uint16_t queue_num, 1267 uint8_t ba_window_size_valid, 1268 uint16_t ba_window_size); 1269 QDF_STATUS 1270 (*peer_rx_reorder_queue_remove)(struct cdp_ctrl_objmgr_psoc *ctrl_psoc, 1271 uint8_t pdev_id, 1272 uint8_t vdev_id, uint8_t *peer_macaddr, 1273 uint32_t tid_mask); 1274 int (*peer_unref_delete)(struct cdp_ctrl_objmgr_psoc *psoc, 1275 uint8_t pdev_id, 1276 uint8_t *peer_mac, 1277 uint8_t *vdev_mac, enum wlan_op_mode opmode); 1278 bool (*is_hw_dbs_capable)(struct wlan_objmgr_psoc *psoc); 1279 int (*peer_add_wds_entry)(struct cdp_ctrl_objmgr_psoc *soc, 1280 uint8_t vdev_id, 1281 uint8_t *peer_macaddr, 1282 uint16_t peer_id, 1283 const uint8_t *dest_macaddr, 1284 uint8_t *next_node_mac, 1285 uint32_t flags, 1286 uint8_t type); 1287 int (*peer_update_wds_entry)(struct cdp_ctrl_objmgr_psoc *soc, 1288 uint8_t vdev_id, 1289 uint8_t *dest_macaddr, 1290 uint8_t *peer_macaddr, 1291 uint32_t flags); 1292 void (*peer_del_wds_entry)(struct cdp_ctrl_objmgr_psoc *soc, 1293 uint8_t vdev_id, 1294 uint8_t *wds_macaddr, 1295 uint8_t type, 1296 uint8_t delete_in_fw); 1297 #ifdef WLAN_FEATURE_MULTI_AST_DEL 1298 void (*peer_del_multi_wds_entry)( 1299 struct cdp_ctrl_objmgr_psoc *soc, 1300 uint8_t vdev_id, 1301 struct peer_del_multi_wds_entries *wds_list); 1302 #endif 1303 QDF_STATUS 1304 (*lro_hash_config)(struct cdp_ctrl_objmgr_psoc *psoc, uint8_t pdev_id, 1305 struct cdp_lro_hash_config *rx_offld_hash); 1306 1307 void (*update_dp_stats)(void *soc, void *stats, uint16_t id, 1308 uint8_t type); 1309 #ifdef FEATURE_NAC_RSSI 1310 uint8_t (*rx_invalid_peer)(struct cdp_ctrl_objmgr_psoc *soc, 1311 uint8_t pdev_id, void *msg); 1312 #else 1313 uint8_t (*rx_invalid_peer)(uint8_t vdev_id, void *wh); 1314 #endif 1315 1316 int (*peer_map_event)(struct cdp_ctrl_objmgr_psoc *psoc, 1317 uint16_t peer_id, uint16_t hw_peer_id, 1318 uint8_t vdev_id, uint8_t *peer_mac_addr, 1319 enum cdp_txrx_ast_entry_type peer_type, 1320 uint32_t tx_ast_hashidx); 1321 1322 int (*peer_unmap_event)(struct cdp_ctrl_objmgr_psoc *psoc, 1323 uint16_t peer_id, 1324 uint8_t vdev_id, uint8_t *mac_addr); 1325 1326 int (*get_dp_cfg_param)(struct cdp_ctrl_objmgr_psoc *psoc, 1327 enum cdp_cfg_param_type param_num); 1328 1329 void (*rx_mic_error)(struct cdp_ctrl_objmgr_psoc *psoc, 1330 uint8_t pdev_id, 1331 struct cdp_rx_mic_err_info *info); 1332 1333 bool (*rx_frag_tkip_demic)(struct cdp_ctrl_objmgr_psoc *psoc, 1334 uint8_t vdev_id, uint8_t *peer_mac_addr, 1335 qdf_nbuf_t nbuf, 1336 uint16_t hdr_space); 1337 1338 uint8_t (*freq_to_channel)(struct cdp_ctrl_objmgr_psoc *psoc, 1339 uint8_t pdev_id, uint16_t freq); 1340 1341 uint8_t (*freq_to_band)(struct cdp_ctrl_objmgr_psoc *psoc, 1342 uint8_t pdev_id, uint16_t freq); 1343 1344 QDF_STATUS(*set_mec_timer)(struct cdp_ctrl_objmgr_psoc *psoc, 1345 uint8_t vdev_id, uint16_t mec_timer_val); 1346 1347 #ifdef ATH_SUPPORT_NAC_RSSI 1348 int (*config_fw_for_nac_rssi)(struct cdp_ctrl_objmgr_psoc *psoc, 1349 uint8_t pdev_id, 1350 u_int8_t vdev_id, 1351 enum cdp_nac_param_cmd cmd, char *bssid, 1352 char *client_macaddr, uint8_t chan_num); 1353 1354 int 1355 (*config_bssid_in_fw_for_nac_rssi)(struct cdp_ctrl_objmgr_psoc *psoc, 1356 uint8_t pdev_id, u_int8_t vdev_id, 1357 enum cdp_nac_param_cmd cmd, 1358 char *bssid, char *client_mac); 1359 #endif 1360 int (*peer_sta_kickout)(struct cdp_ctrl_objmgr_psoc *psoc, 1361 uint16_t pdev_id, uint8_t *peer_macaddr); 1362 1363 /** 1364 * send_delba() - Send delba to peer 1365 * @psoc: Objmgr soc handle 1366 * @vdev_id: dp vdev id 1367 * @peer_macaddr: Peer mac addr 1368 * @tid: Tid number 1369 * @reason_code: Reason code 1370 * @cdp_rcode: CDP reason code for sending DELBA 1371 * 1372 * Return: 0 for success, non-zero for failure 1373 */ 1374 int (*send_delba)(struct cdp_ctrl_objmgr_psoc *psoc, uint8_t vdev_id, 1375 uint8_t *peer_macaddr, uint8_t tid, 1376 uint8_t reason_code, uint8_t cdp_rcode); 1377 1378 int 1379 (*peer_delete_multiple_wds_entries)(struct cdp_ctrl_objmgr_psoc *psoc, 1380 uint8_t vdev_id, 1381 uint8_t *dest_macaddr, 1382 uint8_t *peer_macaddr, 1383 uint32_t flags); 1384 int 1385 (*pdev_update_lmac_n_target_pdev_id)(struct cdp_ctrl_objmgr_psoc *psoc, 1386 uint8_t *pdev_id, 1387 uint8_t *lmac_id, 1388 uint8_t *target_pdev_id); 1389 bool (*is_roam_inprogress)(uint32_t vdev_id); 1390 enum QDF_GLOBAL_MODE (*get_con_mode)(void); 1391 #ifdef QCA_PEER_MULTIQ_SUPPORT 1392 int (*peer_ast_flowid_map)(struct cdp_ctrl_objmgr_psoc *ol_soc_handle, 1393 uint16_t peer_id, uint8_t vdev_id, 1394 uint8_t *peer_mac_addr); 1395 #endif 1396 #ifdef DP_MEM_PRE_ALLOC 1397 void *(*dp_prealloc_get_context)(uint32_t ctxt_type, size_t ctxt_size); 1398 1399 QDF_STATUS(*dp_prealloc_put_context)(uint32_t ctxt_type, void *vaddr); 1400 void *(*dp_prealloc_get_consistent)(uint32_t *size, 1401 void **base_vaddr_unaligned, 1402 qdf_dma_addr_t *paddr_unaligned, 1403 qdf_dma_addr_t *paddr_aligned, 1404 uint32_t align, 1405 uint32_t ring_type); 1406 void (*dp_prealloc_put_consistent)(qdf_size_t size, 1407 void *vaddr_unligned, 1408 qdf_dma_addr_t paddr); 1409 void (*dp_get_multi_pages)(uint32_t desc_type, 1410 size_t element_size, 1411 uint16_t element_num, 1412 struct qdf_mem_multi_page_t *pages, 1413 bool cacheable); 1414 void (*dp_put_multi_pages)(uint32_t desc_type, 1415 struct qdf_mem_multi_page_t *pages); 1416 #endif 1417 int (*get_soc_nss_cfg)(struct cdp_ctrl_objmgr_psoc *ol_soc_handle); 1418 1419 char *(*get_device_name)(struct cdp_ctrl_objmgr_psoc *ctrl_psoc, 1420 uint8_t pdev_id); 1421 QDF_STATUS(*nss_stats_clr)(struct cdp_ctrl_objmgr_psoc *psoc, 1422 uint8_t vdev_id); 1423 int (*dp_rx_get_pending)(ol_txrx_soc_handle soc); 1424 void (*dp_rx_sched_refill_thread)(ol_txrx_soc_handle soc); 1425 /* TODO: Add any other control path calls required to OL_IF/WMA layer */ 1426 #ifdef QCA_SUPPORT_WDS_EXTENDED 1427 void (*rx_wds_ext_peer_learn)(struct cdp_ctrl_objmgr_psoc *ctrl_psoc, 1428 uint16_t peer_id, uint8_t vdev_id, 1429 uint8_t *peer_macaddr); 1430 #endif /* QCA_SUPPORT_WDS_EXTENDED */ 1431 #ifdef WLAN_SUPPORT_MESH_LATENCY 1432 QDF_STATUS(*peer_update_mesh_latency_params)( 1433 struct cdp_ctrl_objmgr_psoc *psoc, 1434 uint8_t vdev_id, uint8_t *peer_mac, uint8_t tid, 1435 uint32_t service_interval_dl, uint32_t burst_size_dl, 1436 uint32_t service_interval_ul, uint32_t burst_size_ul, 1437 uint8_t add_or_sub, uint8_t ac); 1438 #endif 1439 uint32_t (*dp_get_tx_inqueue)(ol_txrx_soc_handle soc); 1440 QDF_STATUS(*dp_send_unit_test_cmd)(uint32_t vdev_id, 1441 uint32_t module_id, 1442 uint32_t arg_count, uint32_t *arg); 1443 1444 #ifdef QCA_SUPPORT_LITE_MONITOR 1445 int (*config_lite_mon_peer)(struct cdp_ctrl_objmgr_psoc *psoc, 1446 uint8_t pdev_id, 1447 uint8_t vdev_id, 1448 enum cdp_nac_param_cmd cmd, 1449 uint8_t *peer_mac); 1450 int (*config_lite_mon_tx_peer)(struct cdp_ctrl_objmgr_psoc *psoc, 1451 uint8_t pdev_id, uint8_t vdev_id, 1452 enum cdp_tx_filter_action cmd, 1453 uint8_t *peer_mac); 1454 #endif 1455 #ifdef WLAN_SUPPORT_SCS 1456 bool (*peer_scs_rule_match)(struct cdp_ctrl_objmgr_psoc *psoc, 1457 uint8_t vdev_id, uint32_t rule_id, 1458 uint8_t *peer_mac); 1459 #endif 1460 }; 1461 1462 #ifdef DP_PEER_EXTENDED_API 1463 /** 1464 * struct cdp_misc_ops - mcl ops not classified 1465 * @set_ibss_vdev_heart_beat_timer: Update ibss vdev heart beat timer 1466 * @set_wmm_param: set wmm parameters 1467 * @bad_peer_txctl_set_setting: configure bad peer tx limit setting 1468 * @bad_peer_txctl_update_threshold: configure bad peer tx threshold limit 1469 * @hl_tdls_flag_reset: reset tdls flag for vdev 1470 * @tx_non_std: Allow the control-path SW to send data frames 1471 * @get_vdev_id: get vdev id 1472 * @set_wisa_mode: set wisa mode for a vdev 1473 * @txrx_data_stall_cb_register: register data stall callback 1474 * @txrx_data_stall_cb_deregister: deregister data stall callback 1475 * @txrx_post_data_stall_event: post data stall event 1476 * @runtime_suspend: ensure TXRX is ready to runtime suspend 1477 * @runtime_resume: ensure TXRX is ready to runtime resume 1478 * @get_opmode: get operation mode of vdev 1479 * @mark_first_wakeup_packet: set flag to indicate that fw is compatible for 1480 marking first packet after wow wakeup 1481 * @update_mac_id: update mac_id for vdev 1482 * @flush_rx_frames: flush rx frames on the queue 1483 * @get_intra_bss_fwd_pkts_count: to get the total tx and rx packets that 1484 has been forwarded from txrx layer 1485 without going to upper layers 1486 * @pkt_log_init: handler to initialize packet log 1487 * @pkt_log_con_service: handler to connect packet log service 1488 * @get_num_rx_contexts: handler to get number of RX contexts 1489 * @register_packetdump_cb: register callback for different pktlog 1490 * @unregister_packetdump_cb: unregister callback for different pktlog 1491 * @pdev_reset_driver_del_ack: reset driver delayed ack enabled flag 1492 * @vdev_set_driver_del_ack_enable: set driver delayed ack enabled flag 1493 * 1494 * @vdev_inform_ll_conn: inform DP to add/delete a latency critical connection 1495 * for this particular vdev. 1496 * @set_swlm_enable: Enable or Disable Software Latency Manager. 1497 * @is_swlm_enabled: Check if Software latency manager is enabled or not. 1498 * @display_txrx_hw_info: Dump the DP rings info 1499 * @set_tx_flush_pending: Configures the ac/tid to be flushed and policy 1500 * to flush. 1501 * 1502 * set_bus_vote_lvl_high: The bus lvl is set to high or low based on tput 1503 * get_bus_vote_lvl_high: Get bus lvl to determine whether or not get 1504 * rx rate stats 1505 * 1506 * Function pointers for miscellaneous soc/pdev/vdev related operations. 1507 */ 1508 struct cdp_misc_ops { 1509 uint16_t (*set_ibss_vdev_heart_beat_timer)(struct cdp_soc_t *soc_hdl, 1510 uint8_t vdev_id, 1511 uint16_t timer_value_sec); 1512 void (*set_wmm_param)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id, 1513 struct ol_tx_wmm_param_t wmm_param); 1514 void (*bad_peer_txctl_set_setting)(struct cdp_soc_t *soc_hdl, 1515 uint8_t pdev_id, int enable, 1516 int period, int txq_limit); 1517 void (*bad_peer_txctl_update_threshold)(struct cdp_soc_t *soc_hdl, 1518 uint8_t pdev_id, 1519 int level, int tput_thresh, 1520 int tx_limit); 1521 void (*hl_tdls_flag_reset)(struct cdp_soc_t *soc_hdl, 1522 uint8_t vdev_id, bool flag); 1523 qdf_nbuf_t (*tx_non_std)(struct cdp_soc_t *soc_hdl, uint8_t vdev_id, 1524 enum ol_tx_spec tx_spec, qdf_nbuf_t msdu_list); 1525 uint16_t (*get_vdev_id)(struct cdp_vdev *vdev); 1526 uint32_t (*get_tx_ack_stats)(struct cdp_soc_t *soc_hdl, 1527 uint8_t vdev_id); 1528 QDF_STATUS (*set_wisa_mode)(struct cdp_soc_t *soc_hdl, 1529 uint8_t vdev_id, bool enable); 1530 QDF_STATUS (*txrx_data_stall_cb_register)(struct cdp_soc_t *soc_hdl, 1531 uint8_t pdev_id, 1532 data_stall_detect_cb cb); 1533 QDF_STATUS (*txrx_data_stall_cb_deregister)(struct cdp_soc_t *soc_hdl, 1534 uint8_t pdev_id, 1535 data_stall_detect_cb cb); 1536 void (*txrx_post_data_stall_event)( 1537 struct cdp_soc_t *soc_hdl, 1538 enum data_stall_log_event_indicator indicator, 1539 enum data_stall_log_event_type data_stall_type, 1540 uint32_t pdev_id, uint32_t vdev_id_bitmap, 1541 enum data_stall_log_recovery_type recovery_type); 1542 QDF_STATUS (*runtime_suspend)(struct cdp_soc_t *soc_hdl, 1543 uint8_t pdev_id); 1544 QDF_STATUS (*runtime_resume)(struct cdp_soc_t *soc_hdl, 1545 uint8_t pdev_id); 1546 int (*get_opmode)(struct cdp_soc_t *soc_hdl, uint8_t vdev_id); 1547 void (*mark_first_wakeup_packet)(struct cdp_soc_t *soc_hdl, 1548 uint8_t pdev_id, uint8_t value); 1549 void (*update_mac_id)(struct cdp_soc_t *soc_hdl, uint8_t vdev_id, 1550 uint8_t mac_id); 1551 void (*flush_rx_frames)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id, 1552 void *peer, bool drop); 1553 A_STATUS(*get_intra_bss_fwd_pkts_count)(struct cdp_soc_t *soc_hdl, 1554 uint8_t vdev_id, 1555 uint64_t *fwd_tx_packets, 1556 uint64_t *fwd_rx_packets); 1557 void (*pkt_log_init)(struct cdp_soc_t *soc_hdl, uint8_t pdev, 1558 void *scn); 1559 void (*pkt_log_con_service)(struct cdp_soc_t *soc_hdl, 1560 uint8_t pdev_id, void *scn); 1561 void (*pkt_log_exit)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id); 1562 int (*get_num_rx_contexts)(struct cdp_soc_t *soc_hdl); 1563 void (*register_pktdump_cb)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id, 1564 ol_txrx_pktdump_cb tx_cb, 1565 ol_txrx_pktdump_cb rx_cb); 1566 void (*unregister_pktdump_cb)(struct cdp_soc_t *soc_hdl, 1567 uint8_t pdev_id); 1568 void (*pdev_reset_driver_del_ack)(struct cdp_soc_t *soc_hdl, 1569 uint8_t pdev_id); 1570 void (*vdev_set_driver_del_ack_enable)(struct cdp_soc_t *soc_hdl, 1571 uint8_t vdev_id, 1572 unsigned long rx_packets, 1573 uint32_t time_in_ms, 1574 uint32_t high_th, 1575 uint32_t low_th); 1576 void (*vdev_set_bundle_require_flag)(uint8_t vdev_id, 1577 unsigned long tx_bytes, 1578 uint32_t time_in_ms, 1579 uint32_t high_th, 1580 uint32_t low_th); 1581 void (*pdev_reset_bundle_require_flag)(struct cdp_soc_t *soc_hdl, 1582 uint8_t pdev_id); 1583 QDF_STATUS (*txrx_ext_stats_request)(struct cdp_soc_t *soc_hdl, 1584 uint8_t pdev_id, 1585 struct cdp_txrx_ext_stats *req); 1586 QDF_STATUS (*request_rx_hw_stats)(struct cdp_soc_t *soc_hdl, 1587 uint8_t vdev_id); 1588 void (*reset_rx_hw_ext_stats)(struct cdp_soc_t *soc_hdl); 1589 QDF_STATUS (*vdev_inform_ll_conn)(struct cdp_soc_t *soc_hdl, 1590 uint8_t vdev_id, 1591 enum vdev_ll_conn_actions action); 1592 QDF_STATUS (*set_swlm_enable)(struct cdp_soc_t *soc_hdl, 1593 uint8_t val); 1594 uint8_t (*is_swlm_enabled)(struct cdp_soc_t *soc_hdl); 1595 void (*display_txrx_hw_info)(struct cdp_soc_t *soc_hdl); 1596 uint32_t (*get_tx_rings_grp_bitmap)(struct cdp_soc_t *soc_hdl); 1597 #ifdef WLAN_FEATURE_PEER_TXQ_FLUSH_CONF 1598 int (*set_peer_txq_flush_config)(struct cdp_soc_t *soc_hdl, 1599 uint8_t vdev_id, uint8_t *addr, 1600 uint8_t ac, uint32_t tid, 1601 enum cdp_peer_txq_flush_policy policy); 1602 #endif 1603 #ifdef FEATURE_RX_LINKSPEED_ROAM_TRIGGER 1604 void (*set_bus_vote_lvl_high)(struct cdp_soc_t *soc_hdl, bool high); 1605 bool (*get_bus_vote_lvl_high)(struct cdp_soc_t *soc_hdl); 1606 #endif 1607 }; 1608 1609 /** 1610 * struct cdp_ocb_ops - mcl ocb ops 1611 * @set_ocb_chan_info: set OCB channel info 1612 * @get_ocb_chan_info: get OCB channel info 1613 * 1614 * Function pointers for operations related to OCB. 1615 */ 1616 struct cdp_ocb_ops { 1617 void (*set_ocb_chan_info)(struct cdp_soc_t *soc_hdl, uint8_t vdev_id, 1618 struct ol_txrx_ocb_set_chan ocb_set_chan); 1619 struct ol_txrx_ocb_chan_info *(*get_ocb_chan_info)( 1620 struct cdp_soc_t *soc_hdl, uint8_t vdev_id); 1621 }; 1622 1623 /** 1624 * struct cdp_peer_ops - mcl peer related ops 1625 * @register_peer: 1626 * @clear_peer: 1627 * @find_peer_exist 1628 * @find_peer_exist_on_vdev 1629 * @find_peer_exist_on_other_vdev 1630 * @peer_state_update: 1631 * @get_vdevid: 1632 * @register_ocb_peer: 1633 * @peer_get_peer_mac_addr: 1634 * @get_peer_state: 1635 * @update_ibss_add_peer_num_of_vdev: 1636 * @copy_mac_addr_raw: 1637 * @add_last_real_peer: 1638 * @is_vdev_restore_last_peer: 1639 * @update_last_real_peer: 1640 */ 1641 struct cdp_peer_ops { 1642 QDF_STATUS (*register_peer)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id, 1643 struct ol_txrx_desc_type *sta_desc); 1644 QDF_STATUS (*clear_peer)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id, 1645 struct qdf_mac_addr peer_addr); 1646 bool (*find_peer_exist)(struct cdp_soc_t *soc, uint8_t pdev_id, 1647 uint8_t *peer_addr); 1648 bool (*find_peer_exist_on_vdev)(struct cdp_soc_t *soc, uint8_t vdev_id, 1649 uint8_t *peer_addr); 1650 bool (*find_peer_exist_on_other_vdev)(struct cdp_soc_t *soc, 1651 uint8_t vdev_id, 1652 uint8_t *peer_addr, 1653 uint16_t max_bssid); 1654 QDF_STATUS (*peer_state_update)(struct cdp_soc_t *soc, 1655 uint8_t *peer_addr, 1656 enum ol_txrx_peer_state state); 1657 QDF_STATUS (*get_vdevid)(struct cdp_soc_t *soc_hdl, uint8_t *peer_mac, 1658 uint8_t *vdev_id); 1659 struct cdp_vdev * (*get_vdev_by_peer_addr)(struct cdp_pdev *pdev, 1660 struct qdf_mac_addr peer_addr); 1661 QDF_STATUS (*register_ocb_peer)(uint8_t *mac_addr); 1662 uint8_t * (*peer_get_peer_mac_addr)(void *peer); 1663 int (*get_peer_state)(struct cdp_soc_t *soc, uint8_t vdev_id, 1664 uint8_t *peer_mac); 1665 struct cdp_vdev * (*get_vdev_for_peer)(void *peer); 1666 int16_t (*update_ibss_add_peer_num_of_vdev)(struct cdp_soc_t *soc, 1667 uint8_t vdev_id, 1668 int16_t peer_num_delta); 1669 void (*remove_peers_for_vdev)(struct cdp_vdev *vdev, 1670 ol_txrx_vdev_peer_remove_cb callback, 1671 void *callback_context, bool remove_last_peer); 1672 void (*remove_peers_for_vdev_no_lock)(struct cdp_vdev *vdev, 1673 ol_txrx_vdev_peer_remove_cb callback, 1674 void *callback_context); 1675 void (*copy_mac_addr_raw)(struct cdp_soc_t *soc, uint8_t vdev_id, 1676 uint8_t *bss_addr); 1677 void (*add_last_real_peer)(struct cdp_soc_t *soc, uint8_t pdev_id, 1678 uint8_t vdev_id); 1679 bool (*is_vdev_restore_last_peer)(struct cdp_soc_t *soc, 1680 uint8_t vdev_id, 1681 uint8_t *peer_mac); 1682 void (*update_last_real_peer)(struct cdp_soc_t *soc, uint8_t pdev_id, 1683 uint8_t vdev_id, bool restore_last_peer); 1684 void (*peer_detach_force_delete)(struct cdp_soc_t *soc_hdl, 1685 uint8_t vdev_id, uint8_t *peer_addr); 1686 void (*set_tdls_offchan_enabled)(struct cdp_soc_t *soc, uint8_t vdev_id, 1687 uint8_t *peer_mac, bool val); 1688 void (*set_peer_as_tdls_peer)(struct cdp_soc_t *soc, uint8_t vdev_id, 1689 uint8_t *peer_mac, bool val); 1690 void (*peer_flush_frags)(struct cdp_soc_t *soc_hdl, 1691 uint8_t vdev_id, uint8_t *peer_mac); 1692 }; 1693 1694 /** 1695 * struct cdp_mob_stats_ops - mcl mob stats ops 1696 * @clear_stats: handler to clear ol txrx stats 1697 * @stats: handler to update ol txrx stats 1698 */ 1699 struct cdp_mob_stats_ops { 1700 QDF_STATUS(*clear_stats)(struct cdp_soc_t *soc_hdl, 1701 uint8_t pdev_id, uint8_t bitmap); 1702 int (*stats)(uint8_t vdev_id, char *buffer, unsigned buf_len); 1703 }; 1704 1705 /** 1706 * struct cdp_pmf_ops - mcl protected management frame ops 1707 * @get_pn_info: handler to get pn info from peer 1708 * 1709 * Function pointers for pmf related operations. 1710 */ 1711 struct cdp_pmf_ops { 1712 void (*get_pn_info)(struct cdp_soc_t *soc, uint8_t *peer_mac, 1713 uint8_t vdev_id, uint8_t **last_pn_valid, 1714 uint64_t **last_pn, uint32_t **rmf_pn_replays); 1715 }; 1716 #endif 1717 1718 1719 #ifdef DP_FLOW_CTL 1720 /** 1721 * struct cdp_cfg_ops - mcl configuration ops 1722 * @set_cfg_rx_fwd_disabled: set rx_fwd_disabled flag 1723 * @set_cfg_packet_log_enabled: set is_packet_log_enabled flag 1724 * @cfg_attach: hardcode the configuration parameters 1725 * @vdev_rx_set_intrabss_fwd: set disable_intrabss_fwd flag 1726 * @is_rx_fwd_disabled: get the rx_fwd_disabled flag, 1727 * 1 enabled, 0 disabled. 1728 * @tx_set_is_mgmt_over_wmi_enabled: set is_mgmt_over_wmi_enabled flag to 1729 * indicate that mgmt over wmi is enabled 1730 * or not, 1731 * 1 for enabled, 0 for disable 1732 * @is_high_latency: get device is high or low latency device, 1733 * 1 high latency bus, 0 low latency bus 1734 * @set_flow_control_parameters: set flow control parameters 1735 * @set_flow_steering: set flow_steering_enabled flag 1736 * @set_ptp_rx_opt_enabled: set is_ptp_rx_opt_enabled flag 1737 * @set_new_htt_msg_format: set new_htt_msg_format flag 1738 * @set_peer_unmap_conf_support: set enable_peer_unmap_conf_support flag 1739 * @get_peer_unmap_conf_support: get enable_peer_unmap_conf_support flag 1740 * @set_tx_compl_tsf64: set enable_tx_compl_tsf64 flag, 1741 * 1 enabled, 0 disabled. 1742 * @get_tx_compl_tsf64: get enable_tx_compl_tsf64 flag, 1743 * 1 enabled, 0 disabled. 1744 */ 1745 struct cdp_cfg_ops { 1746 void (*set_cfg_rx_fwd_disabled)(struct cdp_cfg *cfg_pdev, 1747 uint8_t disable_rx_fwd); 1748 void (*set_cfg_packet_log_enabled)(struct cdp_cfg *cfg_pdev, 1749 uint8_t val); 1750 struct cdp_cfg * (*cfg_attach)(qdf_device_t osdev, void *cfg_param); 1751 void (*vdev_rx_set_intrabss_fwd)(struct cdp_soc_t *soc_hdl, 1752 uint8_t vdev_id, bool val); 1753 uint8_t (*is_rx_fwd_disabled)(struct cdp_vdev *vdev); 1754 void (*tx_set_is_mgmt_over_wmi_enabled)(uint8_t value); 1755 int (*is_high_latency)(struct cdp_cfg *cfg_pdev); 1756 void (*set_flow_control_parameters)(struct cdp_cfg *cfg_pdev, 1757 void *param); 1758 void (*set_flow_steering)(struct cdp_cfg *cfg_pdev, uint8_t val); 1759 void (*set_ptp_rx_opt_enabled)(struct cdp_cfg *cfg_pdev, uint8_t val); 1760 void (*set_new_htt_msg_format)(uint8_t val); 1761 void (*set_peer_unmap_conf_support)(bool val); 1762 bool (*get_peer_unmap_conf_support)(void); 1763 void (*set_tx_compl_tsf64)(bool val); 1764 bool (*get_tx_compl_tsf64)(void); 1765 }; 1766 1767 /** 1768 * struct cdp_flowctl_ops - mcl flow control 1769 * @flow_pool_map_handler: handler to map flow_id and pool descriptors 1770 * @flow_pool_unmap_handler: handler to unmap flow_id and pool descriptors 1771 * @register_pause_cb: handler to register tx pause callback 1772 * @set_desc_global_pool_size: handler to set global pool size 1773 * @dump_flow_pool_info: handler to dump global and flow pool info 1774 * @tx_desc_thresh_reached: handler to set tx desc threshold 1775 * 1776 * Function pointers for operations related to flow control 1777 */ 1778 struct cdp_flowctl_ops { 1779 QDF_STATUS (*flow_pool_map_handler)(struct cdp_soc_t *soc, 1780 uint8_t pdev_id, 1781 uint8_t vdev_id); 1782 void (*flow_pool_unmap_handler)(struct cdp_soc_t *soc, 1783 uint8_t pdev_id, 1784 uint8_t vdev_id); 1785 QDF_STATUS (*register_pause_cb)(struct cdp_soc_t *soc, 1786 tx_pause_callback); 1787 void (*set_desc_global_pool_size)(uint32_t num_msdu_desc); 1788 1789 void (*dump_flow_pool_info)(struct cdp_soc_t *soc_hdl); 1790 1791 bool (*tx_desc_thresh_reached)(struct cdp_soc_t *soc_hdl, 1792 uint8_t vdev_id); 1793 }; 1794 1795 /** 1796 * struct cdp_lflowctl_ops - mcl legacy flow control ops 1797 * @register_tx_flow_control: Register tx flow control callback 1798 * @set_vdev_tx_desc_limit: Set tx descriptor limit for a vdev 1799 * @set_vdev_os_queue_status: Set vdev queue status 1800 * @deregister_tx_flow_control_cb: Deregister tx flow control callback 1801 * @flow_control_cb: Call osif flow control callback 1802 * @get_tx_resource: Get tx resources and comapre with watermark 1803 * @ll_set_tx_pause_q_depth: set pause queue depth 1804 * @vdev_flush: Flush all packets on a particular vdev 1805 * @vdev_pause: Pause a particular vdev 1806 * @vdev_unpause: Unpause a particular vdev 1807 * 1808 * Function pointers for operations related to flow control 1809 */ 1810 struct cdp_lflowctl_ops { 1811 #ifdef QCA_HL_NETDEV_FLOW_CONTROL 1812 int (*register_tx_flow_control)(struct cdp_soc_t *soc_hdl, 1813 uint8_t pdev_id, 1814 tx_pause_callback flowcontrol); 1815 int (*set_vdev_tx_desc_limit)(struct cdp_soc_t *soc_hdl, 1816 uint8_t vdev_id, uint32_t chan_freq); 1817 int (*set_vdev_os_queue_status)(struct cdp_soc_t *soc_hdl, 1818 uint8_t vdev_id, 1819 enum netif_action_type action); 1820 #else 1821 int (*register_tx_flow_control)( 1822 struct cdp_soc_t *soc_hdl, 1823 uint8_t vdev_id, 1824 ol_txrx_tx_flow_control_fp flowControl, void *osif_fc_ctx, 1825 ol_txrx_tx_flow_control_is_pause_fp flow_control_is_pause); 1826 #endif /* QCA_HL_NETDEV_FLOW_CONTROL */ 1827 int (*deregister_tx_flow_control_cb)(struct cdp_soc_t *soc_hdl, 1828 uint8_t vdev_id); 1829 void (*flow_control_cb)(struct cdp_soc_t *soc_hdl, uint8_t vdev_id, 1830 bool tx_resume); 1831 bool (*get_tx_resource)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id, 1832 struct qdf_mac_addr peer_addr, 1833 unsigned int low_watermark, 1834 unsigned int high_watermark_offset); 1835 int (*ll_set_tx_pause_q_depth)(struct cdp_soc_t *soc, uint8_t vdev_id, 1836 int pause_q_depth); 1837 void (*vdev_flush)(struct cdp_soc_t *soc_hdl, uint8_t vdev_id); 1838 void (*vdev_pause)(struct cdp_soc_t *soc_hdl, uint8_t vdev_id, 1839 uint32_t reason, uint32_t pause_type); 1840 void (*vdev_unpause)(struct cdp_soc_t *soc_hdl, uint8_t vdev_id, 1841 uint32_t reason, uint32_t pause_type); 1842 }; 1843 1844 /** 1845 * struct cdp_throttle_ops - mcl throttle ops 1846 * @throttle_init_period: handler to initialize tx throttle time 1847 * @throttle_set_level: handler to set tx throttle level 1848 */ 1849 struct cdp_throttle_ops { 1850 void (*throttle_init_period)(struct cdp_soc_t *soc_hdl, 1851 uint8_t pdev_id, int period, 1852 uint8_t *dutycycle_level); 1853 void (*throttle_set_level)(struct cdp_soc_t *soc_hdl, 1854 uint8_t pdev_id, int level); 1855 }; 1856 #endif 1857 1858 #ifdef IPA_OFFLOAD 1859 /** 1860 * struct cdp_ipa_ops - mcl ipa data path ops 1861 * @ipa_get_resource: 1862 * @ipa_set_doorbell_paddr: 1863 * @ipa_iounmap_doorbell_vaddr: I/O unmap ipa doorbell vaddr 1864 * @ipa_set_active: 1865 * @ipa_op_response: 1866 * @ipa_register_op_cb: 1867 * @ipa_get_stat: 1868 * @ipa_tx_data_frame: 1869 * @ipa_tx_buf_smmu_mapping: Create SMMU mappings for Tx 1870 * @ipa_tx_buf_smmu_unmapping: Release SMMU mappings for Tx 1871 * buffers to IPA 1872 * @ipa_ast_create: Create/Update ast entry 1873 */ 1874 struct cdp_ipa_ops { 1875 QDF_STATUS (*ipa_get_resource)(struct cdp_soc_t *soc_hdl, 1876 uint8_t pdev_id); 1877 QDF_STATUS (*ipa_set_doorbell_paddr)(struct cdp_soc_t *soc_hdl, 1878 uint8_t pdev_id); 1879 QDF_STATUS (*ipa_iounmap_doorbell_vaddr)(struct cdp_soc_t *soc_hdl, 1880 uint8_t pdev_id); 1881 QDF_STATUS (*ipa_set_active)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id, 1882 bool uc_active, bool is_tx); 1883 QDF_STATUS (*ipa_op_response)(struct cdp_soc_t *soc_hdl, 1884 uint8_t pdev_id, uint8_t *op_msg); 1885 QDF_STATUS (*ipa_register_op_cb)(struct cdp_soc_t *soc_hdl, 1886 uint8_t pdev_id, 1887 void (*ipa_uc_op_cb_type) 1888 (uint8_t *op_msg, void *osif_ctxt), 1889 void *usr_ctxt); 1890 void (*ipa_deregister_op_cb)(struct cdp_soc_t *soc_hdl, 1891 uint8_t pdev_id); 1892 QDF_STATUS (*ipa_get_stat)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id); 1893 qdf_nbuf_t (*ipa_tx_data_frame)(struct cdp_soc_t *soc_hdl, 1894 uint8_t vdev_id, qdf_nbuf_t skb); 1895 void (*ipa_set_uc_tx_partition_base)(struct cdp_cfg *pdev, 1896 uint32_t value); 1897 #ifdef FEATURE_METERING 1898 QDF_STATUS (*ipa_uc_get_share_stats)(struct cdp_soc_t *soc_hdl, 1899 uint8_t pdev_id, 1900 uint8_t reset_stats); 1901 QDF_STATUS (*ipa_uc_set_quota)(struct cdp_soc_t *soc_hdl, 1902 uint8_t pdev_id, uint64_t quota_bytes); 1903 #endif 1904 QDF_STATUS (*ipa_enable_autonomy)(struct cdp_soc_t *soc_hdl, 1905 uint8_t pdev_id); 1906 QDF_STATUS (*ipa_disable_autonomy)(struct cdp_soc_t *soc_hdl, 1907 uint8_t pdev_id); 1908 1909 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 10, 0)) || \ 1910 defined(CONFIG_IPA_WDI_UNIFIED_API) 1911 QDF_STATUS (*ipa_setup)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id, 1912 void *ipa_i2w_cb, void *ipa_w2i_cb, 1913 void *ipa_wdi_meter_notifier_cb, 1914 uint32_t ipa_desc_size, void *ipa_priv, 1915 bool is_rm_enabled, uint32_t *tx_pipe_handle, 1916 uint32_t *rx_pipe_handle, bool is_smmu_enabled, 1917 qdf_ipa_sys_connect_params_t *sys_in, 1918 bool over_gsi, qdf_ipa_wdi_hdl_t hdl, 1919 qdf_ipa_wdi_hdl_t id, 1920 void *ipa_ast_notify_cb); 1921 #else /* CONFIG_IPA_WDI_UNIFIED_API */ 1922 QDF_STATUS (*ipa_setup)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id, 1923 void *ipa_i2w_cb, void *ipa_w2i_cb, 1924 void *ipa_wdi_meter_notifier_cb, 1925 uint32_t ipa_desc_size, void *ipa_priv, 1926 bool is_rm_enabled, uint32_t *tx_pipe_handle, 1927 uint32_t *rx_pipe_handle); 1928 #endif /* CONFIG_IPA_WDI_UNIFIED_API */ 1929 QDF_STATUS (*ipa_cleanup)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id, 1930 uint32_t tx_pipe_handle, 1931 uint32_t rx_pipe_handle, 1932 qdf_ipa_wdi_hdl_t hdl); 1933 QDF_STATUS (*ipa_setup_iface)(char *ifname, uint8_t *mac_addr, 1934 qdf_ipa_client_type_t prod_client, 1935 qdf_ipa_client_type_t cons_client, 1936 uint8_t session_id, bool is_ipv6_enabled, 1937 qdf_ipa_wdi_hdl_t hdl); 1938 QDF_STATUS (*ipa_cleanup_iface)(char *ifname, bool is_ipv6_enabled, 1939 qdf_ipa_wdi_hdl_t hdl); 1940 QDF_STATUS (*ipa_enable_pipes)(struct cdp_soc_t *soc_hdl, 1941 uint8_t pdev_id, qdf_ipa_wdi_hdl_t hdl); 1942 QDF_STATUS (*ipa_disable_pipes)(struct cdp_soc_t *soc_hdl, 1943 uint8_t pdev_id, qdf_ipa_wdi_hdl_t hdl); 1944 QDF_STATUS (*ipa_set_perf_level)(int client, 1945 uint32_t max_supported_bw_mbps, 1946 qdf_ipa_wdi_hdl_t hdl); 1947 bool (*ipa_rx_intrabss_fwd)(struct cdp_soc_t *soc_hdl, uint8_t vdev_id, 1948 qdf_nbuf_t nbuf, bool *fwd_success); 1949 QDF_STATUS (*ipa_tx_buf_smmu_mapping)(struct cdp_soc_t *soc_hdl, 1950 uint8_t pdev_id); 1951 QDF_STATUS (*ipa_tx_buf_smmu_unmapping)(struct cdp_soc_t *soc_hdl, 1952 uint8_t pdev_id); 1953 #ifdef IPA_WDS_EASYMESH_FEATURE 1954 QDF_STATUS (*ipa_ast_create)(struct cdp_soc_t *soc_hdl, 1955 qdf_ipa_ast_info_type_t *data); 1956 #endif 1957 }; 1958 #endif 1959 1960 #ifdef DP_POWER_SAVE 1961 /** 1962 * struct cdp_tx_delay_ops - mcl tx delay ops 1963 * @tx_delay: handler to get tx packet delay 1964 * @tx_delay_hist: handler to get tx packet delay histogram 1965 * @tx_packet_count: handler to get tx packet count 1966 * @tx_set_compute_interval: update compute interval period for TSM stats 1967 * 1968 * Function pointer for operations related to tx delay. 1969 */ 1970 struct cdp_tx_delay_ops { 1971 void (*tx_delay)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id, 1972 uint32_t *queue_delay_microsec, 1973 uint32_t *tx_delay_microsec, int category); 1974 void (*tx_delay_hist)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id, 1975 uint16_t *bin_values, int category); 1976 void (*tx_packet_count)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id, 1977 uint16_t *out_packet_count, 1978 uint16_t *out_packet_loss_count, int category); 1979 void (*tx_set_compute_interval)(struct cdp_soc_t *soc_hdl, 1980 uint8_t pdev_id, uint32_t interval); 1981 }; 1982 1983 /** 1984 * struct cdp_bus_ops - mcl bus suspend/resume ops 1985 * @bus_suspend: handler for bus suspend 1986 * @bus_resume: handler for bus resume 1987 * @process_wow_ack_rsp: handler for wow ack response 1988 * @process_target_suspend_req: handler for target suspend request 1989 */ 1990 struct cdp_bus_ops { 1991 QDF_STATUS (*bus_suspend)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id); 1992 QDF_STATUS (*bus_resume)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id); 1993 void (*process_wow_ack_rsp)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id); 1994 void (*process_target_suspend_req)(struct cdp_soc_t *soc_hdl, 1995 uint8_t pdev_id); 1996 }; 1997 #endif 1998 1999 #ifdef RECEIVE_OFFLOAD 2000 /** 2001 * struct cdp_rx_offld_ops - mcl host receive offload ops 2002 * @register_rx_offld_flush_cb: 2003 * @deregister_rx_offld_flush_cb: 2004 */ 2005 struct cdp_rx_offld_ops { 2006 void (*register_rx_offld_flush_cb)(void (rx_offld_flush_cb)(void *)); 2007 void (*deregister_rx_offld_flush_cb)(void); 2008 }; 2009 #endif 2010 2011 #if defined(WLAN_CFR_ENABLE) && defined(WLAN_ENH_CFR_ENABLE) 2012 /** 2013 * struct cdp_cfr_ops - host cfr ops 2014 * @txrx_cfr_filter: Handler to configure host rx monitor status ring 2015 * @txrx_get_cfr_rcc: Handler to get CFR mode 2016 * @txrx_set_cfr_rcc: Handler to enable/disable CFR mode 2017 * @txrx_get_cfr_dbg_stats: Handler to get debug statistics for CFR mode 2018 * @txrx_clear_cfr_dbg_stats: Handler to clear debug statistics for CFR mode 2019 */ 2020 struct cdp_cfr_ops { 2021 void (*txrx_cfr_filter)(struct cdp_soc_t *soc_hdl, 2022 uint8_t pdev_id, 2023 bool enable, 2024 struct cdp_monitor_filter *filter_val); 2025 bool (*txrx_get_cfr_rcc)(struct cdp_soc_t *soc_hdl, 2026 uint8_t pdev_id); 2027 void (*txrx_set_cfr_rcc)(struct cdp_soc_t *soc_hdl, 2028 uint8_t pdev_id, 2029 bool enable); 2030 void (*txrx_get_cfr_dbg_stats)(struct cdp_soc_t *soc_hdl, 2031 uint8_t pdev_id, 2032 struct cdp_cfr_rcc_stats *buf); 2033 void (*txrx_clear_cfr_dbg_stats)(struct cdp_soc_t *soc_hdl, 2034 uint8_t pdev_id); 2035 }; 2036 #endif 2037 2038 #ifdef WLAN_SUPPORT_MSCS 2039 /** 2040 * struct cdp_mscs_ops - data path ops for MSCS 2041 * @mscs_peer_lookup_n_get_priority: 2042 */ 2043 struct cdp_mscs_ops { 2044 int (*mscs_peer_lookup_n_get_priority)(struct cdp_soc_t *soc, 2045 uint8_t *src_mac, 2046 uint8_t *dst_mac, 2047 qdf_nbuf_t nbuf); 2048 }; 2049 #endif 2050 2051 #ifdef WLAN_SUPPORT_MESH_LATENCY 2052 /** 2053 * struct cdp_mesh_latency_ops - data path ops for Mesh latency 2054 * @mesh_latency_update_peer_parameter: 2055 */ 2056 struct cdp_mesh_latency_ops { 2057 QDF_STATUS (*mesh_latency_update_peer_parameter)( 2058 struct cdp_soc_t *soc, 2059 uint8_t *dest_mac, uint32_t service_interval_dl, 2060 uint32_t burst_size_dl, uint32_t service_interval_ul, 2061 uint32_t burst_size_ul, uint16_t priority, 2062 uint8_t add_or_sub); 2063 }; 2064 #endif 2065 2066 #ifdef WLAN_SUPPORT_SCS 2067 /** 2068 * struct cdp_scs_ops - data path ops for SCS 2069 * @scs_peer_lookup_n_rule_match : Handler for peer lookup and scs rule match 2070 */ 2071 struct cdp_scs_ops { 2072 bool (*scs_peer_lookup_n_rule_match)(struct cdp_soc_t *soc, 2073 uint32_t rule_id, 2074 uint8_t *dst_mac_addr); 2075 }; 2076 #endif 2077 2078 #ifdef CONFIG_SAWF_DEF_QUEUES 2079 struct cdp_sawf_ops { 2080 QDF_STATUS 2081 (*sawf_def_queues_map_req)(struct cdp_soc_t *soc, uint8_t *mac_addr, 2082 uint8_t svc_class_id); 2083 QDF_STATUS 2084 (*sawf_def_queues_unmap_req)(struct cdp_soc_t *soc, uint8_t *mac_addr, 2085 uint8_t svc_class_id); 2086 QDF_STATUS 2087 (*sawf_def_queues_get_map_report)(struct cdp_soc_t *soc, 2088 uint8_t *mac_addr); 2089 #ifdef CONFIG_SAWF 2090 QDF_STATUS 2091 (*txrx_get_peer_sawf_delay_stats)(struct cdp_soc_t *soc, 2092 uint32_t svc_id, uint8_t *mac, 2093 void *data); 2094 QDF_STATUS 2095 (*txrx_get_peer_sawf_tx_stats)(struct cdp_soc_t *soc, 2096 uint32_t svc_id, uint8_t *mac, 2097 void *data); 2098 QDF_STATUS 2099 (*sawf_mpdu_stats_req)(struct cdp_soc_t *soc, uint8_t enable); 2100 QDF_STATUS 2101 (*sawf_mpdu_details_stats_req)(struct cdp_soc_t *soc, uint8_t enable); 2102 QDF_STATUS 2103 (*txrx_sawf_set_mov_avg_params)(uint32_t num_pkt, uint32_t num_win); 2104 QDF_STATUS 2105 (*txrx_sawf_set_sla_params)(uint32_t num_pkt, uint32_t time_secs); 2106 QDF_STATUS 2107 (*txrx_sawf_init_telemtery_params)(void); 2108 QDF_STATUS 2109 (*telemetry_get_throughput_stats)(void *arg, uint64_t *in_bytes, 2110 uint64_t *in_cnt, uint64_t *tx_bytes, 2111 uint64_t *tx_cnt, uint8_t tid, 2112 uint8_t msduq); 2113 QDF_STATUS 2114 (*telemetry_get_mpdu_stats)(void *arg, uint64_t *svc_int_pass, 2115 uint64_t *svc_int_fail, 2116 uint64_t *burst_pass, uint64_t *burst_fail, 2117 uint8_t tid, uint8_t msduq); 2118 QDF_STATUS 2119 (*telemetry_get_drop_stats)(void *arg, uint64_t *pass, uint64_t *drop, 2120 uint64_t *drop_ttl, uint8_t tid, 2121 uint8_t msduq); 2122 #endif 2123 }; 2124 #endif 2125 2126 struct cdp_ops { 2127 struct cdp_cmn_ops *cmn_drv_ops; 2128 struct cdp_ctrl_ops *ctrl_ops; 2129 struct cdp_me_ops *me_ops; 2130 struct cdp_mon_ops *mon_ops; 2131 struct cdp_host_stats_ops *host_stats_ops; 2132 struct cdp_wds_ops *wds_ops; 2133 struct cdp_raw_ops *raw_ops; 2134 struct cdp_pflow_ops *pflow_ops; 2135 #ifdef DP_PEER_EXTENDED_API 2136 struct cdp_misc_ops *misc_ops; 2137 struct cdp_peer_ops *peer_ops; 2138 struct cdp_ocb_ops *ocb_ops; 2139 struct cdp_mob_stats_ops *mob_stats_ops; 2140 struct cdp_pmf_ops *pmf_ops; 2141 #endif 2142 #ifdef DP_FLOW_CTL 2143 struct cdp_cfg_ops *cfg_ops; 2144 struct cdp_flowctl_ops *flowctl_ops; 2145 struct cdp_lflowctl_ops *l_flowctl_ops; 2146 struct cdp_throttle_ops *throttle_ops; 2147 #endif 2148 #ifdef DP_POWER_SAVE 2149 struct cdp_bus_ops *bus_ops; 2150 struct cdp_tx_delay_ops *delay_ops; 2151 #endif 2152 #ifdef IPA_OFFLOAD 2153 struct cdp_ipa_ops *ipa_ops; 2154 #endif 2155 #ifdef RECEIVE_OFFLOAD 2156 struct cdp_rx_offld_ops *rx_offld_ops; 2157 #endif 2158 #if defined(WLAN_CFR_ENABLE) && defined(WLAN_ENH_CFR_ENABLE) 2159 struct cdp_cfr_ops *cfr_ops; 2160 #endif 2161 #ifdef WLAN_SUPPORT_MSCS 2162 struct cdp_mscs_ops *mscs_ops; 2163 #endif 2164 #ifdef WLAN_SUPPORT_MESH_LATENCY 2165 struct cdp_mesh_latency_ops *mesh_latency_ops; 2166 #endif 2167 #if defined(WLAN_FEATURE_11BE_MLO) && defined(WLAN_MLO_MULTI_CHIP) 2168 struct cdp_mlo_ops *mlo_ops; 2169 #endif 2170 #ifdef CONFIG_SAWF_DEF_QUEUES 2171 struct cdp_sawf_ops *sawf_ops; 2172 #endif 2173 #ifdef WLAN_SUPPORT_SCS 2174 struct cdp_scs_ops *scs_ops; 2175 #endif 2176 }; 2177 #endif 2178