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