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