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