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