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