1 /* 2 * Copyright (c) 2017-2019 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 33 #ifdef IPA_OFFLOAD 34 #ifdef CONFIG_IPA_WDI_UNIFIED_API 35 #include <qdf_ipa_wdi3.h> 36 #else 37 #include <qdf_ipa.h> 38 #endif 39 #endif 40 41 /** 42 * bitmap values to indicate special handling of peer_delete 43 */ 44 #define CDP_PEER_DELETE_NO_SPECIAL 0 45 #define CDP_PEER_DO_NOT_START_UNMAP_TIMER 1 46 47 /* same as ieee80211_nac_param */ 48 enum cdp_nac_param_cmd { 49 /* IEEE80211_NAC_PARAM_ADD */ 50 CDP_NAC_PARAM_ADD = 1, 51 /* IEEE80211_NAC_PARAM_DEL */ 52 CDP_NAC_PARAM_DEL, 53 /* IEEE80211_NAC_PARAM_LIST */ 54 CDP_NAC_PARAM_LIST, 55 }; 56 /****************************************************************************** 57 * 58 * Control Interface (A Interface) 59 * 60 *****************************************************************************/ 61 62 struct cdp_cmn_ops { 63 64 QDF_STATUS (*txrx_soc_attach_target)(ol_txrx_soc_handle soc); 65 66 int (*txrx_pdev_attach_target)(struct cdp_pdev *pdev); 67 68 struct cdp_vdev *(*txrx_vdev_attach) 69 (struct cdp_pdev *pdev, uint8_t *vdev_mac_addr, 70 uint8_t vdev_id, enum wlan_op_mode op_mode); 71 72 void (*txrx_vdev_detach) 73 (struct cdp_vdev *vdev, ol_txrx_vdev_delete_cb callback, 74 void *cb_context); 75 76 struct cdp_pdev *(*txrx_pdev_attach) 77 (ol_txrx_soc_handle soc, struct cdp_ctrl_objmgr_pdev *ctrl_pdev, 78 HTC_HANDLE htc_pdev, qdf_device_t osdev, uint8_t pdev_id); 79 80 int (*txrx_pdev_post_attach)(struct cdp_pdev *pdev); 81 82 void (*txrx_pdev_pre_detach)(struct cdp_pdev *pdev, int force); 83 84 void (*txrx_pdev_detach)(struct cdp_pdev *pdev, int force); 85 86 /** 87 * txrx_pdev_deinit() - Deinitialize pdev and dp ring memory 88 * @pdev: Dp pdev handle 89 * @force: Force deinit or not 90 * 91 * Return: None 92 */ 93 void (*txrx_pdev_deinit)(struct cdp_pdev *pdev, int force); 94 95 void *(*txrx_peer_create) 96 (struct cdp_vdev *vdev, uint8_t *peer_mac_addr, 97 struct cdp_ctrl_objmgr_peer *ctrl_peer); 98 99 void (*txrx_peer_setup) 100 (struct cdp_vdev *vdev_hdl, void *peer_hdl); 101 102 void (*txrx_peer_teardown) 103 (struct cdp_vdev *vdev_hdl, void *peer_hdl); 104 105 int (*txrx_peer_add_ast) 106 (ol_txrx_soc_handle soc, struct cdp_peer *peer_hdl, 107 uint8_t *mac_addr, enum cdp_txrx_ast_entry_type type, 108 uint32_t flags); 109 110 int (*txrx_peer_update_ast) 111 (ol_txrx_soc_handle soc, struct cdp_peer *peer_hdl, 112 uint8_t *mac_addr, uint32_t flags); 113 114 bool (*txrx_peer_get_ast_info_by_soc) 115 (ol_txrx_soc_handle soc, uint8_t *ast_mac_addr, 116 struct cdp_ast_entry_info *ast_entry_info); 117 118 bool (*txrx_peer_get_ast_info_by_pdev) 119 (ol_txrx_soc_handle soc, uint8_t *ast_mac_addr, 120 uint8_t pdev_id, 121 struct cdp_ast_entry_info *ast_entry_info); 122 123 QDF_STATUS (*txrx_peer_ast_delete_by_soc) 124 (ol_txrx_soc_handle soc, uint8_t *ast_mac_addr, 125 txrx_ast_free_cb callback, 126 void *cookie); 127 128 QDF_STATUS (*txrx_peer_ast_delete_by_pdev) 129 (ol_txrx_soc_handle soc, uint8_t *ast_mac_addr, 130 uint8_t pdev_id, 131 txrx_ast_free_cb callback, 132 void *cookie); 133 134 void (*txrx_peer_delete)(void *peer, uint32_t bitmap); 135 136 void (*txrx_vdev_flush_peers)(struct cdp_vdev *vdev, bool unmap_only); 137 138 QDF_STATUS (*txrx_set_monitor_mode)(struct cdp_vdev *vdev, 139 uint8_t smart_monitor); 140 void (*txrx_peer_delete_sync)(void *peer, 141 QDF_STATUS(*delete_cb)( 142 uint8_t vdev_id, 143 uint32_t peerid_cnt, 144 uint16_t *peerid_list), 145 uint32_t bitmap); 146 147 void (*txrx_peer_unmap_sync_cb_set)(struct cdp_pdev *pdev, 148 QDF_STATUS(*unmap_resp_cb)( 149 uint8_t vdev_id, 150 uint32_t peerid_cnt, 151 uint16_t *peerid_list)); 152 153 uint8_t (*txrx_get_pdev_id_frm_pdev)(struct cdp_pdev *pdev); 154 bool (*txrx_get_vow_config_frm_pdev)(struct cdp_pdev *pdev); 155 156 void (*txrx_pdev_set_chan_noise_floor)(struct cdp_pdev *pdev, 157 int16_t chan_noise_floor); 158 159 void (*txrx_set_nac)(struct cdp_peer *peer); 160 161 /** 162 * txrx_set_pdev_tx_capture() - callback to set pdev tx_capture 163 * @soc: opaque soc handle 164 * @pdev: data path pdev handle 165 * @val: value of pdev_tx_capture 166 * 167 * Return: status: 0 - Success, non-zero: Failure 168 */ 169 QDF_STATUS (*txrx_set_pdev_tx_capture)(struct cdp_pdev *pdev, int val); 170 171 void (*txrx_get_peer_mac_from_peer_id) 172 (struct cdp_pdev *pdev_handle, 173 uint32_t peer_id, uint8_t *peer_mac); 174 175 void (*txrx_vdev_tx_lock)(struct cdp_vdev *vdev); 176 177 void (*txrx_vdev_tx_unlock)(struct cdp_vdev *vdev); 178 179 void (*txrx_ath_getstats)(void *pdev, 180 struct cdp_dev_stats *stats, uint8_t type); 181 182 void (*txrx_set_gid_flag)(struct cdp_pdev *pdev, u_int8_t *mem_status, 183 u_int8_t *user_position); 184 185 uint32_t (*txrx_fw_supported_enh_stats_version)(struct cdp_pdev *pdev); 186 187 void (*txrx_if_mgmt_drain)(void *ni, int force); 188 189 void (*txrx_set_curchan)(struct cdp_pdev *pdev, uint32_t chan_mhz); 190 191 void (*txrx_set_privacy_filters) 192 (struct cdp_vdev *vdev, void *filter, uint32_t num); 193 194 uint32_t (*txrx_get_cfg)(void *soc, enum cdp_dp_cfg cfg); 195 196 /******************************************************************** 197 * Data Interface (B Interface) 198 ********************************************************************/ 199 200 void (*txrx_vdev_register)(struct cdp_vdev *vdev, 201 void *osif_vdev, struct cdp_ctrl_objmgr_vdev *ctrl_vdev, 202 struct ol_txrx_ops *txrx_ops); 203 204 int (*txrx_mgmt_send)(struct cdp_vdev *vdev, 205 qdf_nbuf_t tx_mgmt_frm, uint8_t type); 206 207 int (*txrx_mgmt_send_ext)(struct cdp_vdev *vdev, 208 qdf_nbuf_t tx_mgmt_frm, uint8_t type, uint8_t use_6mbps, 209 uint16_t chanfreq); 210 211 /** 212 * ol_txrx_mgmt_tx_cb - tx management delivery notification 213 * callback function 214 */ 215 216 void (*txrx_mgmt_tx_cb_set)(struct cdp_pdev *pdev, uint8_t type, 217 ol_txrx_mgmt_tx_cb download_cb, 218 ol_txrx_mgmt_tx_cb ota_ack_cb, 219 void *ctxt); 220 221 int (*txrx_get_tx_pending)(struct cdp_pdev *pdev); 222 223 /** 224 * ol_txrx_data_tx_cb - Function registered with the data path 225 * that is called when tx frames marked as "no free" are 226 * done being transmitted 227 */ 228 229 void (*txrx_data_tx_cb_set)(struct cdp_vdev *data_vdev, 230 ol_txrx_data_tx_cb callback, void *ctxt); 231 232 /******************************************************************* 233 * Statistics and Debugging Interface (C Interface) 234 ********************************************************************/ 235 236 int (*txrx_aggr_cfg)(struct cdp_vdev *vdev, int max_subfrms_ampdu, 237 int max_subfrms_amsdu); 238 239 A_STATUS (*txrx_fw_stats_get)(struct cdp_vdev *vdev, 240 struct ol_txrx_stats_req *req, 241 bool per_vdev, bool response_expected); 242 243 int (*txrx_debug)(struct cdp_vdev *vdev, int debug_specs); 244 245 void (*txrx_fw_stats_cfg)(struct cdp_vdev *vdev, 246 uint8_t cfg_stats_type, uint32_t cfg_val); 247 248 void (*txrx_print_level_set)(unsigned level); 249 250 /** 251 * ol_txrx_get_vdev_mac_addr() - Return mac addr of vdev 252 * @vdev: vdev handle 253 * 254 * Return: vdev mac address 255 */ 256 uint8_t * (*txrx_get_vdev_mac_addr)(struct cdp_vdev *vdev); 257 258 /** 259 * ol_txrx_get_vdev_struct_mac_addr() - Return handle to struct qdf_mac_addr of 260 * vdev 261 * @vdev: vdev handle 262 * 263 * Return: Handle to struct qdf_mac_addr 264 */ 265 struct qdf_mac_addr * 266 (*txrx_get_vdev_struct_mac_addr)(struct cdp_vdev *vdev); 267 268 /** 269 * ol_txrx_get_pdev_from_vdev() - Return handle to pdev of vdev 270 * @vdev: vdev handle 271 * 272 * Return: Handle to pdev 273 */ 274 struct cdp_pdev *(*txrx_get_pdev_from_vdev) 275 (struct cdp_vdev *vdev); 276 277 /** 278 * ol_txrx_get_ctrl_pdev_from_vdev() - Return control pdev of vdev 279 * @vdev: vdev handle 280 * 281 * Return: Handle to control pdev 282 */ 283 struct cdp_cfg * 284 (*txrx_get_ctrl_pdev_from_vdev)(struct cdp_vdev *vdev); 285 286 /** 287 * txrx_get_mon_vdev_from_pdev() - Return monitor mode vdev 288 * @pdev: pdev handle 289 * 290 * Return: Handle to vdev 291 */ 292 struct cdp_vdev * 293 (*txrx_get_mon_vdev_from_pdev)(struct cdp_pdev *pdev); 294 295 struct cdp_vdev * 296 (*txrx_get_vdev_from_vdev_id)(struct cdp_pdev *pdev, 297 uint8_t vdev_id); 298 299 void (*txrx_soc_detach)(void *soc); 300 301 /** 302 * txrx_soc_deinit() - Deinitialize dp soc and dp ring memory 303 * @soc: Opaque Dp handle 304 * 305 * Return: None 306 */ 307 void (*txrx_soc_deinit)(void *soc); 308 309 /** 310 * txrx_soc_init() - Initialize dp soc and dp ring memory 311 * @soc: Opaque Dp handle 312 * @htchdl: Opaque htc handle 313 * @hifhdl: Opaque hif handle 314 * 315 * Return: None 316 */ 317 void *(*txrx_soc_init)(void *soc, void *ctrl_psoc, void *hif_handle, 318 HTC_HANDLE htc_handle, qdf_device_t qdf_osdev, 319 struct ol_if_ops *ol_ops, uint16_t device_id); 320 321 /** 322 * txrx_tso_soc_attach() - TSO attach handler triggered during 323 * dynamic tso activation 324 * @soc: Opaque Dp handle 325 * 326 * Return: QDF status 327 */ 328 QDF_STATUS (*txrx_tso_soc_attach)(void *soc); 329 330 /** 331 * txrx_tso_soc_detach() - TSO detach handler triggered during 332 * dynamic tso de-activation 333 * @soc: Opaque Dp handle 334 * 335 * Return: QDF status 336 */ 337 QDF_STATUS (*txrx_tso_soc_detach)(void *soc); 338 int (*addba_resp_tx_completion)(void *peer_handle, uint8_t tid, 339 int status); 340 341 int (*addba_requestprocess)(void *peer_handle, uint8_t dialogtoken, 342 uint16_t tid, uint16_t batimeout, 343 uint16_t buffersize, 344 uint16_t startseqnum); 345 346 void (*addba_responsesetup)(void *peer_handle, uint8_t tid, 347 uint8_t *dialogtoken, uint16_t *statuscode, 348 uint16_t *buffersize, uint16_t *batimeout); 349 350 int (*delba_process)(void *peer_handle, 351 int tid, uint16_t reasoncode); 352 353 /** 354 * delba_tx_completion() - Indicate delba tx status 355 * @peer_handle: Peer handle 356 * @tid: Tid number 357 * @status: Tx completion status 358 * 359 * Return: 0 on Success, 1 on failure 360 */ 361 int (*delba_tx_completion)(void *peer_handle, 362 uint8_t tid, int status); 363 364 void (*set_addba_response)(void *peer_handle, 365 uint8_t tid, uint16_t statuscode); 366 367 uint8_t (*get_peer_mac_addr_frm_id)(struct cdp_soc_t *soc_handle, 368 uint16_t peer_id, uint8_t *mac_addr); 369 370 void (*set_vdev_dscp_tid_map)(struct cdp_vdev *vdev_handle, 371 uint8_t map_id); 372 int (*txrx_get_total_per)(struct cdp_pdev *pdev_handle); 373 374 void (*flush_cache_rx_queue)(void); 375 void (*set_pdev_dscp_tid_map)(struct cdp_pdev *pdev, uint8_t map_id, 376 uint8_t tos, uint8_t tid); 377 void (*hmmc_tid_override_en)(struct cdp_pdev *pdev, bool val); 378 void (*set_hmmc_tid_val)(struct cdp_pdev *pdev, uint8_t tid); 379 380 QDF_STATUS (*txrx_stats_request)(struct cdp_vdev *vdev, 381 struct cdp_txrx_stats_req *req); 382 383 QDF_STATUS (*display_stats)(void *psoc, uint16_t value, 384 enum qdf_stats_verbosity_level level); 385 void (*txrx_soc_set_nss_cfg)(ol_txrx_soc_handle soc, int config); 386 387 int(*txrx_soc_get_nss_cfg)(ol_txrx_soc_handle soc); 388 QDF_STATUS (*txrx_intr_attach)(void *soc); 389 void (*txrx_intr_detach)(void *soc); 390 void (*set_pn_check)(struct cdp_vdev *vdev, 391 struct cdp_peer *peer_handle, enum cdp_sec_type sec_type, 392 uint32_t *rx_pn); 393 QDF_STATUS (*update_config_parameters)(struct cdp_soc *psoc, 394 struct cdp_config_params *params); 395 396 void *(*get_dp_txrx_handle)(struct cdp_pdev *pdev_hdl); 397 void (*set_dp_txrx_handle)(struct cdp_pdev *pdev_hdl, 398 void *dp_txrx_hdl); 399 400 void *(*get_soc_dp_txrx_handle)(struct cdp_soc *soc_handle); 401 void (*set_soc_dp_txrx_handle)(struct cdp_soc *soc_handle, 402 void *dp_txrx_handle); 403 404 void (*txrx_peer_reset_ast) 405 (ol_txrx_soc_handle soc, uint8_t *ast_macaddr, void *vdev_hdl); 406 407 void (*txrx_peer_reset_ast_table)(ol_txrx_soc_handle soc, 408 void *vdev_hdl); 409 410 void (*txrx_peer_flush_ast_table)(ol_txrx_soc_handle soc); 411 void (*txrx_set_ba_aging_timeout)(struct cdp_soc_t *soc_handle, 412 uint8_t ac, uint32_t value); 413 void (*txrx_get_ba_aging_timeout)(struct cdp_soc_t *soc_handle, 414 uint8_t ac, uint32_t *value); 415 416 QDF_STATUS (*txrx_peer_map_attach)(ol_txrx_soc_handle soc, 417 uint32_t num_peers, 418 uint32_t max_ast_index, 419 bool peer_map_unmap_v2); 420 421 void (*txrx_pdev_set_ctrl_pdev)(struct cdp_pdev *pdev_hdl, 422 struct cdp_ctrl_objmgr_pdev *ctrl_pdev); 423 424 ol_txrx_tx_fp tx_send; 425 /** 426 * txrx_get_os_rx_handles_from_vdev() - Return function, osif vdev 427 * to deliver pkt to stack. 428 * @vdev: vdev handle 429 * @stack_fn: pointer to - function pointer to deliver RX pkt to stack 430 * @osif_vdev: pointer to - osif vdev to deliver RX packet to. 431 */ 432 void (*txrx_get_os_rx_handles_from_vdev) 433 (struct cdp_vdev *vdev, 434 ol_txrx_rx_fp *stack_fn, 435 ol_osif_vdev_handle *osif_vdev); 436 int (*txrx_classify_update) 437 (struct cdp_vdev *vdev, qdf_nbuf_t skb, 438 enum txrx_direction, struct ol_txrx_nbuf_classify *nbuf_class); 439 440 bool (*get_dp_capabilities)(struct cdp_soc_t *soc, 441 enum cdp_capabilities dp_caps); 442 }; 443 444 struct cdp_ctrl_ops { 445 446 int 447 (*txrx_mempools_attach)(void *ctrl_pdev); 448 int 449 (*txrx_set_filter_neighbour_peers)( 450 struct cdp_pdev *pdev, 451 uint32_t val); 452 int 453 (*txrx_update_filter_neighbour_peers)( 454 struct cdp_vdev *vdev, 455 uint32_t cmd, uint8_t *macaddr); 456 /** 457 * @brief set the safemode of the device 458 * @details 459 * This flag is used to bypass the encrypt and decrypt processes when 460 * send and receive packets. It works like open AUTH mode, HW will 461 * ctreate all packets as non-encrypt frames because no key installed. 462 * For rx fragmented frames,it bypasses all the rx defragmentaion. 463 * 464 * @param vdev - the data virtual device object 465 * @param val - the safemode state 466 * @return - void 467 */ 468 469 void 470 (*txrx_set_safemode)( 471 struct cdp_vdev *vdev, 472 u_int32_t val); 473 /** 474 * @brief configure the drop unencrypted frame flag 475 * @details 476 * Rx related. When set this flag, all the unencrypted frames 477 * received over a secure connection will be discarded 478 * 479 * @param vdev - the data virtual device object 480 * @param val - flag 481 * @return - void 482 */ 483 void 484 (*txrx_set_drop_unenc)( 485 struct cdp_vdev *vdev, 486 u_int32_t val); 487 488 489 /** 490 * @brief set the Tx encapsulation type of the VDEV 491 * @details 492 * This will be used to populate the HTT desc packet type field 493 * during Tx 494 * @param vdev - the data virtual device object 495 * @param val - the Tx encap type 496 * @return - void 497 */ 498 void 499 (*txrx_set_tx_encap_type)( 500 struct cdp_vdev *vdev, 501 enum htt_cmn_pkt_type val); 502 /** 503 * @brief set the Rx decapsulation type of the VDEV 504 * @details 505 * This will be used to configure into firmware and hardware 506 * which format to decap all Rx packets into, for all peers under 507 * the VDEV. 508 * @param vdev - the data virtual device object 509 * @param val - the Rx decap mode 510 * @return - void 511 */ 512 void 513 (*txrx_set_vdev_rx_decap_type)( 514 struct cdp_vdev *vdev, 515 enum htt_cmn_pkt_type val); 516 517 /** 518 * @brief get the Rx decapsulation type of the VDEV 519 * 520 * @param vdev - the data virtual device object 521 * @return - the Rx decap type 522 */ 523 enum htt_cmn_pkt_type 524 (*txrx_get_vdev_rx_decap_type)(struct cdp_vdev *vdev); 525 526 /* Is this similar to ol_txrx_peer_state_update() in MCL */ 527 /** 528 * @brief Update the authorize peer object at association time 529 * @details 530 * For the host-based implementation of rate-control, it 531 * updates the peer/node-related parameters within rate-control 532 * context of the peer at association. 533 * 534 * @param peer - pointer to the node's object 535 * @authorize - either to authorize or unauthorize peer 536 * 537 * @return none 538 */ 539 void 540 (*txrx_peer_authorize)(struct cdp_peer *peer, 541 u_int32_t authorize); 542 543 /* Should be ol_txrx_ctrl_api.h */ 544 void (*txrx_set_mesh_mode)(struct cdp_vdev *vdev, u_int32_t val); 545 546 /** 547 * @brief setting mesh rx filter 548 * @details 549 * based on the bits enabled in the filter packets has to be dropped. 550 * 551 * @param vdev - the data virtual device object 552 * @param val - value to set 553 */ 554 void (*txrx_set_mesh_rx_filter)(struct cdp_vdev *vdev, uint32_t val); 555 556 void (*tx_flush_buffers)(struct cdp_vdev *vdev); 557 558 int (*txrx_is_target_ar900b)(struct cdp_vdev *vdev); 559 560 void (*txrx_set_vdev_param)(struct cdp_vdev *vdev, 561 enum cdp_vdev_param_type param, uint32_t val); 562 563 void (*txrx_peer_set_nawds)(struct cdp_peer *peer, uint8_t value); 564 /** 565 * @brief Set the reo dest ring num of the radio 566 * @details 567 * Set the reo destination ring no on which we will receive 568 * pkts for this radio. 569 * 570 * @param pdev - the data physical device object 571 * @param reo_dest_ring_num - value ranges between 1 - 4 572 */ 573 void (*txrx_set_pdev_reo_dest)( 574 struct cdp_pdev *pdev, 575 enum cdp_host_reo_dest_ring reo_dest_ring_num); 576 577 /** 578 * @brief Get the reo dest ring num of the radio 579 * @details 580 * Get the reo destination ring no on which we will receive 581 * pkts for this radio. 582 * 583 * @param pdev - the data physical device object 584 * @return the reo destination ring number 585 */ 586 enum cdp_host_reo_dest_ring (*txrx_get_pdev_reo_dest)( 587 struct cdp_pdev *pdev); 588 589 int (*txrx_wdi_event_sub)(struct cdp_pdev *pdev, void *event_cb_sub, 590 uint32_t event); 591 592 int (*txrx_wdi_event_unsub)(struct cdp_pdev *pdev, void *event_cb_sub, 593 uint32_t event); 594 int (*txrx_get_sec_type)(struct cdp_peer *peer, uint8_t sec_idx); 595 596 void (*txrx_update_mgmt_txpow_vdev)(struct cdp_vdev *vdev, 597 uint8_t subtype, uint8_t tx_power); 598 599 /** 600 * txrx_set_pdev_param() - callback to set pdev parameter 601 * @soc: opaque soc handle 602 * @pdev: data path pdev handle 603 * @val: value of pdev_tx_capture 604 * 605 * Return: status: 0 - Success, non-zero: Failure 606 */ 607 QDF_STATUS (*txrx_set_pdev_param)(struct cdp_pdev *pdev, 608 enum cdp_pdev_param_type type, 609 uint8_t val); 610 void * (*txrx_get_pldev)(struct cdp_pdev *pdev); 611 612 #ifdef ATH_SUPPORT_NAC_RSSI 613 QDF_STATUS (*txrx_vdev_config_for_nac_rssi)(struct cdp_vdev *vdev, 614 enum cdp_nac_param_cmd cmd, char *bssid, char *client_macaddr, 615 uint8_t chan_num); 616 QDF_STATUS (*txrx_vdev_get_neighbour_rssi)(struct cdp_vdev *vdev, 617 char *macaddr, 618 uint8_t *rssi); 619 #endif 620 void (*set_key)(struct cdp_peer *peer_handle, 621 bool is_unicast, uint32_t *key); 622 623 uint32_t (*txrx_get_vdev_param)(struct cdp_vdev *vdev, 624 enum cdp_vdev_param_type param); 625 int (*enable_peer_based_pktlog)(struct cdp_pdev 626 *txrx_pdev_handle, char *macaddr, uint8_t enb_dsb); 627 628 }; 629 630 struct cdp_me_ops { 631 632 u_int16_t (*tx_desc_alloc_and_mark_for_mcast_clone) 633 (struct cdp_pdev *pdev, u_int16_t buf_count); 634 635 u_int16_t (*tx_desc_free_and_unmark_for_mcast_clone)( 636 struct cdp_pdev *pdev, 637 u_int16_t buf_count); 638 639 u_int16_t 640 (*tx_get_mcast_buf_allocated_marked) 641 (struct cdp_pdev *pdev); 642 void 643 (*tx_me_alloc_descriptor)(struct cdp_pdev *pdev); 644 645 void 646 (*tx_me_free_descriptor)(struct cdp_pdev *pdev); 647 648 uint16_t 649 (*tx_me_convert_ucast)(struct cdp_vdev *vdev, 650 qdf_nbuf_t wbuf, u_int8_t newmac[][6], 651 uint8_t newmaccnt); 652 /* Should be a function pointer in ol_txrx_osif_ops{} */ 653 /** 654 * @brief notify mcast frame indication from FW. 655 * @details 656 * This notification will be used to convert 657 * multicast frame to unicast. 658 * 659 * @param pdev - handle to the ctrl SW's physical device object 660 * @param vdev_id - ID of the virtual device received the special data 661 * @param msdu - the multicast msdu returned by FW for host inspect 662 */ 663 664 int (*mcast_notify)(struct cdp_pdev *pdev, 665 u_int8_t vdev_id, qdf_nbuf_t msdu); 666 }; 667 668 struct cdp_mon_ops { 669 670 void (*txrx_monitor_set_filter_ucast_data) 671 (struct cdp_pdev *, u_int8_t val); 672 void (*txrx_monitor_set_filter_mcast_data) 673 (struct cdp_pdev *, u_int8_t val); 674 void (*txrx_monitor_set_filter_non_data) 675 (struct cdp_pdev *, u_int8_t val); 676 677 bool (*txrx_monitor_get_filter_ucast_data) 678 (struct cdp_vdev *vdev_txrx_handle); 679 bool (*txrx_monitor_get_filter_mcast_data) 680 (struct cdp_vdev *vdev_txrx_handle); 681 bool (*txrx_monitor_get_filter_non_data) 682 (struct cdp_vdev *vdev_txrx_handle); 683 QDF_STATUS (*txrx_reset_monitor_mode)(struct cdp_pdev *pdev); 684 685 /* HK advance monitor filter support */ 686 QDF_STATUS (*txrx_set_advance_monitor_filter) 687 (struct cdp_pdev *pdev, struct cdp_monitor_filter *filter_val); 688 }; 689 690 struct cdp_host_stats_ops { 691 int (*txrx_host_stats_get)(struct cdp_vdev *vdev, 692 struct ol_txrx_stats_req *req); 693 694 void (*txrx_host_stats_clr)(struct cdp_vdev *vdev); 695 696 void (*txrx_host_ce_stats)(struct cdp_vdev *vdev); 697 698 int (*txrx_stats_publish)(struct cdp_pdev *pdev, 699 void *buf); 700 /** 701 * @brief Enable enhanced stats functionality. 702 * 703 * @param pdev - the physical device object 704 * @return - void 705 */ 706 void (*txrx_enable_enhanced_stats)(struct cdp_pdev *pdev); 707 708 /** 709 * @brief Disable enhanced stats functionality. 710 * 711 * @param pdev - the physical device object 712 * @return - void 713 */ 714 void (*txrx_disable_enhanced_stats)(struct cdp_pdev *pdev); 715 716 /** 717 * @brief Get the desired stats from the message. 718 * 719 * @param pdev - the physical device object 720 * @param stats_base - stats buffer received from FW 721 * @param type - stats type. 722 * @return - pointer to requested stat identified by type 723 */ 724 uint32_t * (*txrx_get_stats_base)(struct cdp_pdev *pdev, 725 uint32_t *stats_base, uint32_t msg_len, uint8_t type); 726 void 727 (*tx_print_tso_stats)(struct cdp_vdev *vdev); 728 729 void 730 (*tx_rst_tso_stats)(struct cdp_vdev *vdev); 731 732 void 733 (*tx_print_sg_stats)(struct cdp_vdev *vdev); 734 735 void 736 (*tx_rst_sg_stats)(struct cdp_vdev *vdev); 737 738 void 739 (*print_rx_cksum_stats)(struct cdp_vdev *vdev); 740 741 void 742 (*rst_rx_cksum_stats)(struct cdp_vdev *vdev); 743 744 A_STATUS 745 (*txrx_host_me_stats)(struct cdp_vdev *vdev); 746 747 void 748 (*txrx_per_peer_stats)(struct cdp_pdev *pdev, char *addr); 749 750 int (*txrx_host_msdu_ttl_stats)(struct cdp_vdev *vdev, 751 struct ol_txrx_stats_req *req); 752 753 void 754 (*print_lro_stats)(struct cdp_vdev *vdev); 755 756 void 757 (*reset_lro_stats)(struct cdp_vdev *vdev); 758 759 void 760 (*get_fw_peer_stats)(struct cdp_pdev *pdev, uint8_t *addr, 761 uint32_t cap, uint32_t copy_stats); 762 void 763 (*get_htt_stats)(struct cdp_pdev *pdev, void *data, 764 uint32_t data_len); 765 void 766 (*txrx_update_pdev_stats)(struct cdp_pdev *pdev, void *data, 767 uint16_t stats_id); 768 struct cdp_peer_stats* 769 (*txrx_get_peer_stats)(struct cdp_peer *peer); 770 void 771 (*txrx_reset_peer_ald_stats)(struct cdp_peer *peer); 772 void 773 (*txrx_reset_peer_stats)(struct cdp_peer *peer); 774 int 775 (*txrx_get_vdev_stats)(struct cdp_vdev *vdev, void *buf, 776 bool is_aggregate); 777 int 778 (*txrx_process_wmi_host_vdev_stats)(ol_txrx_soc_handle soc, 779 void *data, uint32_t len, 780 uint32_t stats_id); 781 int 782 (*txrx_get_vdev_extd_stats)(struct cdp_vdev *vdev_handle, 783 void *buffer); 784 void 785 (*txrx_update_vdev_stats)(struct cdp_vdev *vdev, void *buf, 786 uint16_t stats_id); 787 int 788 (*txrx_get_radio_stats)(struct cdp_pdev *pdev, 789 void *buf); 790 struct cdp_pdev_stats* 791 (*txrx_get_pdev_stats)(struct cdp_pdev *pdev); 792 int 793 (*txrx_get_ratekbps)(int preamb, int mcs, 794 int htflag, int gintval); 795 }; 796 797 struct cdp_wds_ops { 798 void 799 (*txrx_set_wds_rx_policy)(struct cdp_vdev *vdev, 800 u_int32_t val); 801 void 802 (*txrx_wds_peer_tx_policy_update)(struct cdp_peer *peer, 803 int wds_tx_ucast, int wds_tx_mcast); 804 int (*vdev_set_wds)(void *vdev, uint32_t val); 805 }; 806 807 struct cdp_raw_ops { 808 int (*txrx_get_nwifi_mode)(struct cdp_vdev *vdev); 809 810 void (*rsim_get_astentry)(struct cdp_vdev *vdev, 811 qdf_nbuf_t *pnbuf, 812 struct cdp_raw_ast *raw_ast); 813 }; 814 815 #ifdef CONFIG_WIN 816 struct cdp_pflow_ops { 817 uint32_t(*pflow_update_pdev_params)(void *, 818 enum _ol_ath_param_t, uint32_t, void *); 819 }; 820 #endif /* CONFIG_WIN */ 821 822 #define LRO_IPV4_SEED_ARR_SZ 5 823 #define LRO_IPV6_SEED_ARR_SZ 11 824 825 /** 826 * struct cdp_lro_hash_config - set rx_offld(LRO/GRO) init parameters 827 * @lro_enable: indicates whether rx_offld is enabled 828 * @tcp_flag: If the TCP flags from the packet do not match 829 * the values in this field after masking with TCP flags mask 830 * below, packet is not rx_offld eligible 831 * @tcp_flag_mask: field for comparing the TCP values provided 832 * above with the TCP flags field in the received packet 833 * @toeplitz_hash_ipv4: contains seed needed to compute the flow id 834 * 5-tuple toeplitz hash for ipv4 packets 835 * @toeplitz_hash_ipv6: contains seed needed to compute the flow id 836 * 5-tuple toeplitz hash for ipv6 packets 837 */ 838 struct cdp_lro_hash_config { 839 uint32_t lro_enable; 840 uint32_t tcp_flag:9, 841 tcp_flag_mask:9; 842 uint32_t toeplitz_hash_ipv4[LRO_IPV4_SEED_ARR_SZ]; 843 uint32_t toeplitz_hash_ipv6[LRO_IPV6_SEED_ARR_SZ]; 844 }; 845 846 struct ol_if_ops { 847 void 848 (*peer_set_default_routing)(struct cdp_ctrl_objmgr_pdev *ctrl_pdev, 849 uint8_t *peer_macaddr, uint8_t vdev_id, 850 bool hash_based, uint8_t ring_num); 851 QDF_STATUS 852 (*peer_rx_reorder_queue_setup)(struct cdp_ctrl_objmgr_pdev *ctrl_pdev, 853 uint8_t vdev_id, uint8_t *peer_mac, 854 qdf_dma_addr_t hw_qdesc, int tid, 855 uint16_t queue_num, 856 uint8_t ba_window_size_valid, 857 uint16_t ba_window_size); 858 QDF_STATUS 859 (*peer_rx_reorder_queue_remove)(struct cdp_ctrl_objmgr_pdev *ctrl_pdev, 860 uint8_t vdev_id, uint8_t *peer_macaddr, 861 uint32_t tid_mask); 862 int (*peer_unref_delete)(void *scn_handle, uint8_t *peer_mac, 863 uint8_t *vdev_mac, enum wlan_op_mode opmode, 864 void *old_peer, void *new_peer); 865 bool (*is_hw_dbs_2x2_capable)(struct wlan_objmgr_psoc *psoc); 866 int (*peer_add_wds_entry)(void *vdev_handle, 867 struct cdp_peer *peer_handle, 868 const uint8_t *dest_macaddr, 869 uint8_t *next_node_mac, 870 uint32_t flags); 871 int (*peer_update_wds_entry)(void *ol_soc_handle, 872 uint8_t *dest_macaddr, uint8_t *peer_macaddr, 873 uint32_t flags); 874 void (*peer_del_wds_entry)(void *ol_soc_handle, 875 uint8_t *wds_macaddr); 876 QDF_STATUS 877 (*lro_hash_config)(struct cdp_ctrl_objmgr_pdev *ctrl_pdev, 878 struct cdp_lro_hash_config *rx_offld_hash); 879 void (*update_dp_stats)(void *soc, void *stats, uint16_t id, 880 uint8_t type); 881 #ifdef CONFIG_WIN 882 uint8_t (*rx_invalid_peer)(void *ctrl_pdev, void *msg); 883 #else 884 uint8_t (*rx_invalid_peer)(uint8_t vdev_id, void *wh); 885 #endif 886 int (*peer_map_event)(void *ol_soc_handle, uint16_t peer_id, uint16_t hw_peer_id, 887 uint8_t vdev_id, uint8_t *peer_mac_addr, 888 enum cdp_txrx_ast_entry_type peer_type, 889 uint32_t tx_ast_hashidx); 890 int (*peer_unmap_event)(void *ol_soc_handle, uint16_t peer_id); 891 892 int (*get_dp_cfg_param)(void *ol_soc_handle, enum cdp_cfg_param_type param_num); 893 894 void (*rx_mic_error)(void *ol_soc_handle, 895 uint16_t vdev_id, void *wh); 896 bool (*rx_frag_tkip_demic)(struct wlan_objmgr_peer *ctrl_peer, 897 qdf_nbuf_t nbuf, 898 uint16_t hdr_space); 899 uint8_t (*freq_to_channel)(void *ol_soc_handle, uint16_t vdev_id); 900 901 void (*record_act_change)(struct wlan_objmgr_pdev *pdev, 902 u_int8_t *dstmac, bool active); 903 #ifdef ATH_SUPPORT_NAC_RSSI 904 int (*config_fw_for_nac_rssi)(struct wlan_objmgr_pdev *pdev, 905 u_int8_t vdev_id, enum cdp_nac_param_cmd cmd, char *bssid, 906 char *client_macaddr, uint8_t chan_num); 907 int (*config_bssid_in_fw_for_nac_rssi)(struct wlan_objmgr_pdev *pdev, 908 u_int8_t vdev_id, enum cdp_nac_param_cmd cmd, char *bssid); 909 #endif 910 int (*peer_sta_kickout)(void *ctrl_pdev, uint8_t *peer_macaddr); 911 912 /** 913 * send_delba() - Send delba to peer 914 * @pdev_handle: Dp pdev handle 915 * @ctrl_peer: Peer handle 916 * @peer_macaddr: Peer mac addr 917 * @tid: Tid number 918 * 919 * Return: 0 for success, non-zero for failure 920 */ 921 int (*send_delba)(void *pdev_handle, void *ctrl_peer, 922 uint8_t *peer_macaddr, uint8_t tid, void *vdev_handle, 923 uint8_t reason_code); 924 /* TODO: Add any other control path calls required to OL_IF/WMA layer */ 925 }; 926 927 #ifndef CONFIG_WIN 928 /* From here MCL specific OPs */ 929 /** 930 * struct cdp_misc_ops - mcl ops not classified 931 * @set_ibss_vdev_heart_beat_timer: 932 * @bad_peer_txctl_set_setting: 933 * @bad_peer_txctl_update_threshold: 934 * @hl_tdls_flag_reset: 935 * @tx_non_std: 936 * @get_vdev_id: 937 * @set_wisa_mode: 938 * @txrx_data_stall_cb_register: 939 * @txrx_data_stall_cb_deregister: 940 * @txrx_post_data_stall_event 941 * @runtime_suspend: 942 * @runtime_resume: 943 * @register_packetdump_cb: 944 * @unregister_packetdump_cb: 945 */ 946 struct cdp_misc_ops { 947 uint16_t (*set_ibss_vdev_heart_beat_timer)(struct cdp_vdev *vdev, 948 uint16_t timer_value_sec); 949 void (*set_wmm_param)(struct cdp_pdev *cfg_pdev, 950 struct ol_tx_wmm_param_t wmm_param); 951 void (*bad_peer_txctl_set_setting)(struct cdp_pdev *pdev, int enable, 952 int period, int txq_limit); 953 void (*bad_peer_txctl_update_threshold)(struct cdp_pdev *pdev, 954 int level, int tput_thresh, int tx_limit); 955 void (*hl_tdls_flag_reset)(struct cdp_vdev *vdev, bool flag); 956 qdf_nbuf_t (*tx_non_std)(struct cdp_vdev *vdev, 957 enum ol_tx_spec tx_spec, qdf_nbuf_t msdu_list); 958 uint16_t (*get_vdev_id)(struct cdp_vdev *vdev); 959 uint32_t (*get_tx_ack_stats)(uint8_t vdev_id); 960 QDF_STATUS (*set_wisa_mode)(struct cdp_vdev *vdev, bool enable); 961 QDF_STATUS (*txrx_data_stall_cb_register)(data_stall_detect_cb cb); 962 QDF_STATUS (*txrx_data_stall_cb_deregister)(data_stall_detect_cb cb); 963 void (*txrx_post_data_stall_event)( 964 enum data_stall_log_event_indicator indicator, 965 enum data_stall_log_event_type data_stall_type, 966 uint32_t pdev_id, uint32_t vdev_id_bitmap, 967 enum data_stall_log_recovery_type recovery_type); 968 QDF_STATUS (*runtime_suspend)(struct cdp_pdev *pdev); 969 QDF_STATUS (*runtime_resume)(struct cdp_pdev *pdev); 970 int (*get_opmode)(struct cdp_vdev *vdev); 971 void (*mark_first_wakeup_packet)(uint8_t value); 972 void (*update_mac_id)(uint8_t vdev_id, uint8_t mac_id); 973 void (*flush_rx_frames)(void *peer, bool drop); 974 A_STATUS (*get_intra_bss_fwd_pkts_count)(uint8_t vdev_id, 975 uint64_t *fwd_tx_packets, uint64_t *fwd_rx_packets); 976 void (*pkt_log_init)(struct cdp_pdev *handle, void *scn); 977 void (*pkt_log_con_service)(struct cdp_pdev *pdev, void *scn); 978 int (*get_num_rx_contexts)(struct cdp_soc_t *soc); 979 void (*register_pktdump_cb)(ol_txrx_pktdump_cb tx_cb, 980 ol_txrx_pktdump_cb rx_cb); 981 void (*unregister_pktdump_cb)(void); 982 }; 983 984 /** 985 * struct cdp_tx_delay_ops - mcl tx delay ops 986 * @tx_delay: 987 * @tx_delay_hist: 988 * @tx_packet_count: 989 * @tx_set_compute_interval: 990 */ 991 struct cdp_tx_delay_ops { 992 void (*tx_delay)(struct cdp_pdev *pdev, uint32_t *queue_delay_microsec, 993 uint32_t *tx_delay_microsec, int category); 994 void (*tx_delay_hist)(struct cdp_pdev *pdev, 995 uint16_t *bin_values, int category); 996 void (*tx_packet_count)(struct cdp_pdev *pdev, 997 uint16_t *out_packet_count, 998 uint16_t *out_packet_loss_count, int category); 999 void (*tx_set_compute_interval)(struct cdp_pdev *pdev, 1000 uint32_t interval); 1001 }; 1002 1003 /** 1004 * struct cdp_pmf_ops - mcl protected management frame ops 1005 * @get_pn_info: 1006 */ 1007 struct cdp_pmf_ops { 1008 void (*get_pn_info)(void *peer, uint8_t **last_pn_valid, 1009 uint64_t **last_pn, uint32_t **rmf_pn_replays); 1010 }; 1011 1012 /** 1013 * struct cdp_cfg_ops - mcl configuration ops 1014 * @set_cfg_rx_fwd_disabled: 1015 * @set_cfg_packet_log_enabled: 1016 * @cfg_attach: 1017 * @vdev_rx_set_intrabss_fwd: 1018 * @is_rx_fwd_disabled: 1019 * @tx_set_is_mgmt_over_wmi_enabled: 1020 * @is_high_latency: 1021 * @set_flow_control_parameters: 1022 * @set_flow_steering: 1023 * @set_ptp_rx_opt_enabled: 1024 * @set_new_htt_msg_format: 1025 * @set_peer_unmap_conf_support: 1026 * @get_peer_unmap_conf_support: 1027 */ 1028 struct cdp_cfg_ops { 1029 void (*set_cfg_rx_fwd_disabled)(struct cdp_cfg *cfg_pdev, 1030 uint8_t disable_rx_fwd); 1031 void (*set_cfg_packet_log_enabled)(struct cdp_cfg *cfg_pdev, 1032 uint8_t val); 1033 struct cdp_cfg * (*cfg_attach)(qdf_device_t osdev, void *cfg_param); 1034 void (*vdev_rx_set_intrabss_fwd)(struct cdp_vdev *vdev, bool val); 1035 uint8_t (*is_rx_fwd_disabled)(struct cdp_vdev *vdev); 1036 void (*tx_set_is_mgmt_over_wmi_enabled)(uint8_t value); 1037 int (*is_high_latency)(struct cdp_cfg *cfg_pdev); 1038 void (*set_flow_control_parameters)(struct cdp_cfg *cfg_pdev, 1039 void *param); 1040 void (*set_flow_steering)(struct cdp_cfg *cfg_pdev, uint8_t val); 1041 void (*set_ptp_rx_opt_enabled)(struct cdp_cfg *cfg_pdev, uint8_t val); 1042 void (*set_new_htt_msg_format)(uint8_t val); 1043 void (*set_peer_unmap_conf_support)(bool val); 1044 bool (*get_peer_unmap_conf_support)(void); 1045 }; 1046 1047 /** 1048 * struct cdp_flowctl_ops - mcl flow control 1049 * @register_pause_cb: 1050 * @set_desc_global_pool_size: 1051 * @dump_flow_pool_info: 1052 */ 1053 struct cdp_flowctl_ops { 1054 QDF_STATUS (*flow_pool_map_handler)(struct cdp_soc_t *soc, 1055 struct cdp_pdev *pdev, 1056 uint8_t vdev_id); 1057 void (*flow_pool_unmap_handler)(struct cdp_soc_t *soc, 1058 struct cdp_pdev *pdev, 1059 uint8_t vdev_id); 1060 QDF_STATUS (*register_pause_cb)(struct cdp_soc_t *soc, 1061 tx_pause_callback); 1062 void (*set_desc_global_pool_size)(uint32_t num_msdu_desc); 1063 1064 void (*dump_flow_pool_info)(void *); 1065 1066 bool (*tx_desc_thresh_reached)(struct cdp_vdev *vdev); 1067 }; 1068 1069 /** 1070 * struct cdp_lflowctl_ops - mcl legacy flow control ops 1071 * @register_tx_flow_control: 1072 * @deregister_tx_flow_control_cb: 1073 * @flow_control_cb: 1074 * @get_tx_resource: 1075 * @ll_set_tx_pause_q_depth: 1076 * @vdev_flush: 1077 * @vdev_pause: 1078 * @vdev_unpause: 1079 */ 1080 struct cdp_lflowctl_ops { 1081 #ifdef QCA_HL_NETDEV_FLOW_CONTROL 1082 int (*register_tx_flow_control)(struct cdp_soc_t *soc, 1083 tx_pause_callback flowcontrol); 1084 int (*set_vdev_tx_desc_limit)(uint8_t vdev_id, uint8_t chan); 1085 int (*set_vdev_os_queue_status)(uint8_t vdev_id, 1086 enum netif_action_type action); 1087 #else 1088 int (*register_tx_flow_control)(uint8_t vdev_id, 1089 ol_txrx_tx_flow_control_fp flowControl, void *osif_fc_ctx, 1090 ol_txrx_tx_flow_control_is_pause_fp flow_control_is_pause); 1091 #endif /* QCA_HL_NETDEV_FLOW_CONTROL */ 1092 int (*deregister_tx_flow_control_cb)(uint8_t vdev_id); 1093 void (*flow_control_cb)(struct cdp_vdev *vdev, bool tx_resume); 1094 bool (*get_tx_resource)(uint8_t sta_id, 1095 unsigned int low_watermark, 1096 unsigned int high_watermark_offset); 1097 int (*ll_set_tx_pause_q_depth)(uint8_t vdev_id, int pause_q_depth); 1098 void (*vdev_flush)(struct cdp_vdev *vdev); 1099 void (*vdev_pause)(struct cdp_vdev *vdev, uint32_t reason); 1100 void (*vdev_unpause)(struct cdp_vdev *vdev, uint32_t reason); 1101 }; 1102 1103 #ifdef IPA_OFFLOAD 1104 /** 1105 * struct cdp_ipa_ops - mcl ipa data path ops 1106 * @ipa_get_resource: 1107 * @ipa_set_doorbell_paddr: 1108 * @ipa_set_active: 1109 * @ipa_op_response: 1110 * @ipa_register_op_cb: 1111 * @ipa_get_stat: 1112 * @ipa_tx_data_frame: 1113 */ 1114 struct cdp_ipa_ops { 1115 QDF_STATUS (*ipa_get_resource)(struct cdp_pdev *pdev); 1116 QDF_STATUS (*ipa_set_doorbell_paddr)(struct cdp_pdev *pdev); 1117 QDF_STATUS (*ipa_set_active)(struct cdp_pdev *pdev, bool uc_active, 1118 bool is_tx); 1119 QDF_STATUS (*ipa_op_response)(struct cdp_pdev *pdev, uint8_t *op_msg); 1120 QDF_STATUS (*ipa_register_op_cb)(struct cdp_pdev *pdev, 1121 void (*ipa_uc_op_cb_type)(uint8_t *op_msg, void *osif_ctxt), 1122 void *usr_ctxt); 1123 QDF_STATUS (*ipa_get_stat)(struct cdp_pdev *pdev); 1124 qdf_nbuf_t (*ipa_tx_data_frame)(struct cdp_vdev *vdev, qdf_nbuf_t skb); 1125 void (*ipa_set_uc_tx_partition_base)(struct cdp_cfg *pdev, 1126 uint32_t value); 1127 #ifdef FEATURE_METERING 1128 QDF_STATUS (*ipa_uc_get_share_stats)(struct cdp_pdev *pdev, 1129 uint8_t reset_stats); 1130 QDF_STATUS (*ipa_uc_set_quota)(struct cdp_pdev *pdev, 1131 uint64_t quota_bytes); 1132 #endif 1133 QDF_STATUS (*ipa_enable_autonomy)(struct cdp_pdev *pdev); 1134 QDF_STATUS (*ipa_disable_autonomy)(struct cdp_pdev *pdev); 1135 #ifdef CONFIG_IPA_WDI_UNIFIED_API 1136 QDF_STATUS (*ipa_setup)(struct cdp_pdev *pdev, void *ipa_i2w_cb, 1137 void *ipa_w2i_cb, void *ipa_wdi_meter_notifier_cb, 1138 uint32_t ipa_desc_size, void *ipa_priv, bool is_rm_enabled, 1139 uint32_t *tx_pipe_handle, uint32_t *rx_pipe_handle, 1140 bool is_smmu_enabled, qdf_ipa_sys_connect_params_t *sys_in); 1141 #else /* CONFIG_IPA_WDI_UNIFIED_API */ 1142 QDF_STATUS (*ipa_setup)(struct cdp_pdev *pdev, void *ipa_i2w_cb, 1143 void *ipa_w2i_cb, void *ipa_wdi_meter_notifier_cb, 1144 uint32_t ipa_desc_size, void *ipa_priv, bool is_rm_enabled, 1145 uint32_t *tx_pipe_handle, uint32_t *rx_pipe_handle); 1146 #endif /* CONFIG_IPA_WDI_UNIFIED_API */ 1147 QDF_STATUS (*ipa_cleanup)(uint32_t tx_pipe_handle, 1148 uint32_t rx_pipe_handle); 1149 QDF_STATUS (*ipa_setup_iface)(char *ifname, uint8_t *mac_addr, 1150 qdf_ipa_client_type_t prod_client, 1151 qdf_ipa_client_type_t cons_client, 1152 uint8_t session_id, bool is_ipv6_enabled); 1153 QDF_STATUS (*ipa_cleanup_iface)(char *ifname, bool is_ipv6_enabled); 1154 QDF_STATUS (*ipa_enable_pipes)(struct cdp_pdev *pdev); 1155 QDF_STATUS (*ipa_disable_pipes)(struct cdp_pdev *pdev); 1156 QDF_STATUS (*ipa_set_perf_level)(int client, 1157 uint32_t max_supported_bw_mbps); 1158 }; 1159 #endif 1160 1161 /** 1162 * struct cdp_bus_ops - mcl bus suspend/resume ops 1163 * @bus_suspend: 1164 * @bus_resume: 1165 */ 1166 struct cdp_bus_ops { 1167 QDF_STATUS (*bus_suspend)(struct cdp_pdev *opaque_pdev); 1168 QDF_STATUS (*bus_resume)(struct cdp_pdev *opaque_pdev); 1169 }; 1170 1171 /** 1172 * struct cdp_ocb_ops - mcl ocb ops 1173 * @set_ocb_chan_info: 1174 * @get_ocb_chan_info: 1175 */ 1176 struct cdp_ocb_ops { 1177 void (*set_ocb_chan_info)(struct cdp_vdev *vdev, 1178 struct ol_txrx_ocb_set_chan ocb_set_chan); 1179 struct ol_txrx_ocb_chan_info * 1180 (*get_ocb_chan_info)(struct cdp_vdev *vdev); 1181 }; 1182 1183 /** 1184 * struct cdp_peer_ops - mcl peer related ops 1185 * @register_peer: 1186 * @clear_peer: 1187 * @cfg_attach: 1188 * @find_peer_by_addr: 1189 * @find_peer_by_addr_and_vdev: 1190 * @local_peer_id: 1191 * @peer_find_by_local_id: 1192 * @peer_state_update: 1193 * @get_vdevid: 1194 * @get_vdev_by_sta_id: 1195 * @register_ocb_peer: 1196 * @peer_get_peer_mac_addr: 1197 * @get_peer_state: 1198 * @get_vdev_for_peer: 1199 * @update_ibss_add_peer_num_of_vdev: 1200 * @remove_peers_for_vdev: 1201 * @remove_peers_for_vdev_no_lock: 1202 * @copy_mac_addr_raw: 1203 * @add_last_real_peer: 1204 * @is_vdev_restore_last_peer: 1205 * @update_last_real_peer: 1206 */ 1207 struct cdp_peer_ops { 1208 QDF_STATUS (*register_peer)(struct cdp_pdev *pdev, 1209 struct ol_txrx_desc_type *sta_desc); 1210 QDF_STATUS (*clear_peer)(struct cdp_pdev *pdev, uint8_t sta_id); 1211 QDF_STATUS (*change_peer_state)(uint8_t sta_id, 1212 enum ol_txrx_peer_state sta_state, 1213 bool roam_synch_in_progress); 1214 void * (*peer_get_ref_by_addr)(struct cdp_pdev *pdev, 1215 uint8_t *peer_addr, uint8_t *peer_id, 1216 enum peer_debug_id_type debug_id); 1217 void (*peer_release_ref)(void *peer, enum peer_debug_id_type debug_id); 1218 void * (*find_peer_by_addr)(struct cdp_pdev *pdev, 1219 uint8_t *peer_addr, uint8_t *peer_id); 1220 void * (*find_peer_by_addr_and_vdev)(struct cdp_pdev *pdev, 1221 struct cdp_vdev *vdev, 1222 uint8_t *peer_addr, uint8_t *peer_id); 1223 uint16_t (*local_peer_id)(void *peer); 1224 void * (*peer_find_by_local_id)(struct cdp_pdev *pdev, 1225 uint8_t local_peer_id); 1226 QDF_STATUS (*peer_state_update)(struct cdp_pdev *pdev, 1227 uint8_t *peer_addr, 1228 enum ol_txrx_peer_state state); 1229 QDF_STATUS (*get_vdevid)(void *peer, uint8_t *vdev_id); 1230 struct cdp_vdev * (*get_vdev_by_sta_id)(struct cdp_pdev *pdev, 1231 uint8_t sta_id); 1232 QDF_STATUS (*register_ocb_peer)(uint8_t *mac_addr, uint8_t *peer_id); 1233 uint8_t * (*peer_get_peer_mac_addr)(void *peer); 1234 int (*get_peer_state)(void *peer); 1235 struct cdp_vdev * (*get_vdev_for_peer)(void *peer); 1236 int16_t (*update_ibss_add_peer_num_of_vdev)(struct cdp_vdev *vdev, 1237 int16_t peer_num_delta); 1238 void (*remove_peers_for_vdev)(struct cdp_vdev *vdev, 1239 ol_txrx_vdev_peer_remove_cb callback, 1240 void *callback_context, bool remove_last_peer); 1241 void (*remove_peers_for_vdev_no_lock)(struct cdp_vdev *vdev, 1242 ol_txrx_vdev_peer_remove_cb callback, 1243 void *callback_context); 1244 void (*copy_mac_addr_raw)(struct cdp_vdev *vdev, uint8_t *bss_addr); 1245 void (*add_last_real_peer)(struct cdp_pdev *pdev, 1246 struct cdp_vdev *vdev, uint8_t *peer_id); 1247 bool (*is_vdev_restore_last_peer)(void *peer); 1248 void (*update_last_real_peer)(struct cdp_pdev *pdev, void *peer, 1249 uint8_t *peer_id, bool restore_last_peer); 1250 void (*peer_detach_force_delete)(void *peer); 1251 }; 1252 1253 /** 1254 * struct cdp_ocb_ops - mcl ocb ops 1255 * @throttle_init_period: 1256 * @throttle_set_level: 1257 */ 1258 struct cdp_throttle_ops { 1259 void (*throttle_init_period)(struct cdp_pdev *pdev, int period, 1260 uint8_t *dutycycle_level); 1261 void (*throttle_set_level)(struct cdp_pdev *pdev, int level); 1262 }; 1263 1264 /** 1265 * struct cdp_ocb_ops - mcl ocb ops 1266 * @clear_stats: 1267 * @stats: 1268 */ 1269 struct cdp_mob_stats_ops { 1270 void (*clear_stats)(uint16_t bitmap); 1271 int (*stats)(uint8_t vdev_id, char *buffer, unsigned buf_len); 1272 }; 1273 #endif /* CONFIG_WIN */ 1274 1275 #ifdef RECEIVE_OFFLOAD 1276 /** 1277 * struct cdp_rx_offld_ops - mcl host receive offload ops 1278 * @register_rx_offld_flush_cb: 1279 * @deregister_rx_offld_flush_cb: 1280 */ 1281 struct cdp_rx_offld_ops { 1282 void (*register_rx_offld_flush_cb)(void (rx_offld_flush_cb)(void *)); 1283 void (*deregister_rx_offld_flush_cb)(void); 1284 }; 1285 #endif 1286 1287 struct cdp_ops { 1288 struct cdp_cmn_ops *cmn_drv_ops; 1289 struct cdp_ctrl_ops *ctrl_ops; 1290 struct cdp_me_ops *me_ops; 1291 struct cdp_mon_ops *mon_ops; 1292 struct cdp_host_stats_ops *host_stats_ops; 1293 struct cdp_wds_ops *wds_ops; 1294 struct cdp_raw_ops *raw_ops; 1295 struct cdp_pflow_ops *pflow_ops; 1296 #ifndef CONFIG_WIN 1297 struct cdp_misc_ops *misc_ops; 1298 struct cdp_cfg_ops *cfg_ops; 1299 struct cdp_flowctl_ops *flowctl_ops; 1300 struct cdp_lflowctl_ops *l_flowctl_ops; 1301 #ifdef IPA_OFFLOAD 1302 struct cdp_ipa_ops *ipa_ops; 1303 #endif 1304 #ifdef RECEIVE_OFFLOAD 1305 struct cdp_rx_offld_ops *rx_offld_ops; 1306 #endif 1307 struct cdp_bus_ops *bus_ops; 1308 struct cdp_ocb_ops *ocb_ops; 1309 struct cdp_peer_ops *peer_ops; 1310 struct cdp_throttle_ops *throttle_ops; 1311 struct cdp_mob_stats_ops *mob_stats_ops; 1312 struct cdp_tx_delay_ops *delay_ops; 1313 struct cdp_pmf_ops *pmf_ops; 1314 #endif /* CONFIG_WIN */ 1315 }; 1316 #endif 1317