1 /* 2 * Copyright (c) 2016-2018 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 #ifndef _WLAN_LMAC_IF_DEF_H_ 21 #define _WLAN_LMAC_IF_DEF_H_ 22 23 #include <qdf_time.h> 24 #include "qdf_status.h" 25 #include "wlan_objmgr_cmn.h" 26 #ifdef DFS_COMPONENT_ENABLE 27 #include <wlan_dfs_public_struct.h> 28 #endif 29 #include "wlan_mgmt_txrx_utils_api.h" 30 #include "wlan_scan_public_structs.h" 31 32 #ifdef WLAN_ATF_ENABLE 33 #include "wlan_atf_utils_defs.h" 34 #endif 35 #ifdef QCA_SUPPORT_SON 36 #include <wlan_son_tgt_api.h> 37 #endif 38 #ifdef WLAN_SA_API_ENABLE 39 #include "wlan_sa_api_utils_defs.h" 40 #endif 41 #ifdef WLAN_CONV_SPECTRAL_ENABLE 42 #include "wlan_spectral_public_structs.h" 43 #endif 44 #include <reg_services_public_struct.h> 45 46 #ifdef WLAN_CONV_CRYPTO_SUPPORTED 47 #include "wlan_crypto_global_def.h" 48 #endif 49 50 #include <wlan_dfs_tgt_api.h> 51 #include <wlan_dfs_ioctl.h> 52 53 /* Number of dev type: Direct attach and Offload */ 54 #define MAX_DEV_TYPE 2 55 56 #ifdef WIFI_POS_CONVERGED 57 /* forward declarations */ 58 struct oem_data_req; 59 struct oem_data_rsp; 60 #endif /* WIFI_POS_CONVERGED */ 61 62 #ifdef DIRECT_BUF_RX_ENABLE 63 /* forward declarations for direct buf rx */ 64 struct direct_buf_rx_data; 65 #endif 66 67 #ifdef WLAN_FEATURE_NAN_CONVERGENCE 68 struct scheduler_msg; 69 #endif 70 71 #ifdef CONVERGED_TDLS_ENABLE 72 #include "wlan_tdls_public_structs.h" 73 #endif 74 75 #ifdef QCA_SUPPORT_CP_STATS 76 #include <wlan_cp_stats_tgt_api.h> 77 #include <wlan_cp_stats_mc_defs.h> 78 #endif /* QCA_SUPPORT_CP_STATS */ 79 80 #ifdef QCA_SUPPORT_CP_STATS 81 /** 82 * struct wlan_lmac_if_cp_stats_tx_ops - defines southbound tx callbacks for 83 * control plane statistics component 84 * @cp_stats_attach: function pointer to register events from FW 85 * @cp_stats_detach: function pointer to unregister events from FW 86 */ 87 struct wlan_lmac_if_cp_stats_tx_ops { 88 QDF_STATUS (*cp_stats_attach)(struct wlan_objmgr_psoc *psoc); 89 QDF_STATUS (*cp_stats_detach)(struct wlan_objmgr_psoc *posc); 90 #ifdef CONFIG_MCL 91 void (*inc_wake_lock_stats)(uint32_t reason, 92 struct wake_lock_stats *stats, 93 uint32_t *unspecified_wake_count); 94 QDF_STATUS (*send_req_stats)(struct wlan_objmgr_psoc *psoc, 95 enum stats_req_type type, 96 struct request_info *req); 97 #endif 98 }; 99 100 /** 101 * struct wlan_lmac_if_cp_stats_rx_ops - defines southbound rx callbacks for 102 * control plane statistics component 103 * @cp_stats_rx_event_handler: function pointer to rx FW events 104 */ 105 struct wlan_lmac_if_cp_stats_rx_ops { 106 QDF_STATUS (*cp_stats_rx_event_handler)(struct wlan_objmgr_vdev *vdev); 107 #ifdef CONFIG_MCL 108 QDF_STATUS (*process_stats_event)(struct wlan_objmgr_psoc *psoc, 109 struct stats_event *ev); 110 #endif 111 }; 112 #endif 113 114 /** 115 * struct wlan_lmac_if_mgmt_txrx_tx_ops - structure of tx function 116 * pointers for mgmt txrx component 117 * @mgmt_tx_send: function pointer to transmit mgmt tx frame 118 * @beacon_send: function pointer to transmit beacon frame 119 * @fd_action_frame_send: function pointer to transmit FD action frame 120 */ 121 struct wlan_lmac_if_mgmt_txrx_tx_ops { 122 QDF_STATUS (*mgmt_tx_send)(struct wlan_objmgr_vdev *vdev, 123 qdf_nbuf_t nbuf, u_int32_t desc_id, 124 void *mgmt_tx_params); 125 QDF_STATUS (*beacon_send)(struct wlan_objmgr_vdev *vdev, 126 qdf_nbuf_t nbuf); 127 QDF_STATUS (*fd_action_frame_send)(struct wlan_objmgr_vdev *vdev, 128 qdf_nbuf_t nbuf); 129 }; 130 131 /** 132 * struct wlan_lmac_if_scan_tx_ops - south bound tx function pointers for scan 133 * @scan_start: function to start scan 134 * @scan_cancel: function to cancel scan 135 * @pno_start: start pno scan 136 * @pno_stop: stop pno scan 137 * @scan_reg_ev_handler: function to register for scan events 138 * @scan_unreg_ev_handler: function to unregister for scan events 139 * 140 * scan module uses these functions to avail ol/da lmac services 141 */ 142 struct wlan_lmac_if_scan_tx_ops { 143 QDF_STATUS (*scan_start)(struct wlan_objmgr_pdev *pdev, 144 struct scan_start_request *req); 145 QDF_STATUS (*scan_cancel)(struct wlan_objmgr_pdev *pdev, 146 struct scan_cancel_param *req); 147 QDF_STATUS (*pno_start)(struct wlan_objmgr_psoc *psoc, 148 struct pno_scan_req_params *req); 149 QDF_STATUS (*pno_stop)(struct wlan_objmgr_psoc *psoc, 150 uint8_t vdev_id); 151 QDF_STATUS (*scan_reg_ev_handler)(struct wlan_objmgr_psoc *psoc, 152 void *arg); 153 QDF_STATUS (*scan_unreg_ev_handler)(struct wlan_objmgr_psoc *psoc, 154 void *arg); 155 QDF_STATUS (*set_chan_list)(struct wlan_objmgr_pdev *pdev, void *arg); 156 }; 157 158 /** 159 * struct wlan_lmac_if_ftm_tx_ops - south bound tx function pointers for ftm 160 * @ftm_attach: function to register event handlers with FW 161 * @ftm_detach: function to de-register event handlers with FW 162 * @ftm_cmd_send: function to send FTM commands to FW 163 * 164 * ftm module uses these functions to avail ol/da lmac services 165 */ 166 struct wlan_lmac_if_ftm_tx_ops { 167 QDF_STATUS (*ftm_attach)(struct wlan_objmgr_psoc *psoc); 168 QDF_STATUS (*ftm_detach)(struct wlan_objmgr_psoc *psoc); 169 QDF_STATUS (*ftm_cmd_send)(struct wlan_objmgr_pdev *pdev, 170 uint8_t *buf, uint32_t len, uint8_t mac_id); 171 }; 172 173 174 struct wlan_lmac_if_mlme_tx_ops { 175 void (*scan_sta_power_events)(struct wlan_objmgr_pdev *pdev, 176 int event_type, int event_status); 177 void (*scan_connection_lost)(struct wlan_objmgr_pdev *pdev); 178 void (*scan_end)(struct wlan_objmgr_pdev *pdev); 179 uint32_t (*get_wifi_iface_id) (struct wlan_objmgr_pdev *pdev); 180 }; 181 182 /** 183 * struct wlan_lmac_if_scan_rx_ops - south bound rx function pointers for scan 184 * @scan_ev_handler: scan event handler 185 * @scan_set_max_active_scans: set max active scans allowed 186 * 187 * lmac modules uses this API to post scan events to scan module 188 */ 189 struct wlan_lmac_if_scan_rx_ops { 190 QDF_STATUS (*scan_ev_handler)(struct wlan_objmgr_psoc *psoc, 191 struct scan_event_info *event_info); 192 QDF_STATUS (*scan_set_max_active_scans)(struct wlan_objmgr_psoc *psoc, 193 uint32_t max_active_scans); 194 }; 195 196 #ifdef CONVERGED_P2P_ENABLE 197 198 /* forward declarations for p2p tx ops */ 199 struct p2p_ps_config; 200 struct p2p_lo_start; 201 202 /** 203 * struct wlan_lmac_if_p2p_tx_ops - structure of tx function pointers 204 * for P2P component 205 * @set_ps: function pointer to set power save 206 * @lo_start: function pointer to start listen offload 207 * @lo_stop: function pointer to stop listen offload 208 * @set_noa: function pointer to disable/enable NOA 209 * @reg_lo_ev_handler: function pointer to register lo event handler 210 * @reg_noa_ev_handler: function pointer to register noa event handler 211 * @unreg_lo_ev_handler: function pointer to unregister lo event handler 212 * @unreg_noa_ev_handler:function pointer to unregister noa event handler 213 */ 214 struct wlan_lmac_if_p2p_tx_ops { 215 QDF_STATUS (*set_ps)(struct wlan_objmgr_psoc *psoc, 216 struct p2p_ps_config *ps_config); 217 QDF_STATUS (*lo_start)(struct wlan_objmgr_psoc *psoc, 218 struct p2p_lo_start *lo_start); 219 QDF_STATUS (*lo_stop)(struct wlan_objmgr_psoc *psoc, 220 uint32_t vdev_id); 221 QDF_STATUS (*set_noa)(struct wlan_objmgr_psoc *psoc, 222 uint32_t vdev_id, bool disable_noa); 223 QDF_STATUS (*reg_lo_ev_handler)(struct wlan_objmgr_psoc *psoc, 224 void *arg); 225 QDF_STATUS (*reg_noa_ev_handler)(struct wlan_objmgr_psoc *psoc, 226 void *arg); 227 QDF_STATUS (*unreg_lo_ev_handler)(struct wlan_objmgr_psoc *psoc, 228 void *arg); 229 QDF_STATUS (*unreg_noa_ev_handler)(struct wlan_objmgr_psoc *psoc, 230 void *arg); 231 }; 232 #endif 233 234 #ifdef WLAN_ATF_ENABLE 235 236 /** 237 * struct wlan_lmac_if_atf_tx_ops - ATF specific tx function pointers 238 * @atf_update_peer_txtoken: Update peer Tx token 239 * @atf_set_enable_disable: Set atf enable/disable 240 * @atf_tokens_used: Get used atf tokens 241 * @atf_get_unused_txtoken: Get unused atf tokens 242 * @atf_peer_resume: Resume peer 243 * @atf_tokens_unassigned: Set unassigned atf tockens 244 * @atf_capable_peer: Set atf state change 245 * @atf_airtime_estimate: Get estimated airtime 246 * @atf_debug_peerstate: Get peer state 247 * @atf_enable_disable: Set atf peer stats enable/disable 248 * @atf_ssid_sched_policy: Set ssid schedule policy 249 * @atf_set: Set atf 250 * @atf_set_grouping: Set atf grouping 251 * @atf_send_peer_request: Send peer requests 252 * @atf_set_bwf: Set bandwidth fairness 253 * @atf_peer_buf_held: Get buffer held 254 * @atf_get_peer_airtime: Get peer airtime 255 * @atf_get_chbusyper: Get channel busy 256 * @atf_open: ATF open 257 * @atf_register_event_handler ATF register wmi event handlers 258 * @atf_unregister_event_handler ATF unregister wmi event handlers 259 */ 260 struct wlan_lmac_if_atf_tx_ops { 261 void (*atf_update_peer_txtoken)(struct wlan_objmgr_pdev *pdev, 262 struct wlan_objmgr_peer *peer, 263 struct atf_stats *stats); 264 void (*atf_set_enable_disable)(struct wlan_objmgr_pdev *pdev, 265 uint8_t value); 266 uint8_t (*atf_tokens_used)(struct wlan_objmgr_pdev *pdev, 267 struct wlan_objmgr_peer *peer); 268 void (*atf_get_unused_txtoken)(struct wlan_objmgr_pdev *pdev, 269 struct wlan_objmgr_peer *peer, 270 int *unused_token); 271 void (*atf_peer_resume)(struct wlan_objmgr_pdev *pdev, 272 struct wlan_objmgr_peer *peer); 273 void (*atf_tokens_unassigned)(struct wlan_objmgr_pdev *pdev, 274 uint32_t tokens_unassigned); 275 void (*atf_capable_peer)(struct wlan_objmgr_pdev *pdev, 276 struct wlan_objmgr_peer *peer, 277 uint8_t val, uint8_t atfstate_change); 278 uint32_t (*atf_airtime_estimate)(struct wlan_objmgr_pdev *pdev, 279 struct wlan_objmgr_peer *peer, 280 uint32_t tput, 281 uint32_t *possible_tput); 282 uint32_t (*atf_debug_peerstate)(struct wlan_objmgr_pdev *pdev, 283 struct wlan_objmgr_peer *peer); 284 285 int32_t (*atf_enable_disable)(struct wlan_objmgr_vdev *vdev, 286 uint8_t value); 287 int32_t (*atf_ssid_sched_policy)(struct wlan_objmgr_vdev *vdev, 288 uint8_t value); 289 int32_t (*atf_set)(struct wlan_objmgr_pdev *pdev, 290 struct pdev_atf_req *atf_req, 291 uint8_t atf_tput_based); 292 int32_t (*atf_set_grouping)(struct wlan_objmgr_pdev *pdev, 293 struct pdev_atf_ssid_group_req *atf_grp_req, 294 uint8_t atf_tput_based); 295 int32_t (*atf_send_peer_request)(struct wlan_objmgr_pdev *pdev, 296 struct pdev_atf_peer_ext_request *atfr, 297 uint8_t atf_tput_based); 298 int32_t (*atf_set_bwf)(struct wlan_objmgr_pdev *pdev, 299 struct pdev_bwf_req *bwf_req); 300 uint32_t (*atf_peer_buf_held)(struct wlan_objmgr_peer *peer); 301 uint32_t (*atf_get_peer_airtime)(struct wlan_objmgr_peer *peer); 302 uint32_t (*atf_get_chbusyper)(struct wlan_objmgr_pdev *pdev); 303 void (*atf_open)(struct wlan_objmgr_psoc *psoc); 304 void (*atf_register_event_handler)(struct wlan_objmgr_psoc *psoc); 305 void (*atf_unregister_event_handler)(struct wlan_objmgr_psoc *psoc); 306 }; 307 #endif 308 309 #ifdef WLAN_SUPPORT_FILS 310 /** 311 * struct wlan_lmac_if_fd_tx_ops - FILS Discovery specific Tx function pointers 312 * @fd_vdev_config_fils: Enable and configure FILS Discovery 313 * @fd_register_event_handler: Register swfda WMI event handler 314 * @fd_unregister_event_handler: Un-register swfda WMI event handler 315 */ 316 struct wlan_lmac_if_fd_tx_ops { 317 QDF_STATUS (*fd_vdev_config_fils)(struct wlan_objmgr_vdev *vdev, 318 uint32_t fd_period); 319 void (*fd_register_event_handler)(struct wlan_objmgr_psoc *psoc); 320 void (*fd_unregister_event_handler)(struct wlan_objmgr_psoc *psoc); 321 }; 322 #endif 323 324 #ifdef WLAN_SA_API_ENABLE 325 326 /** 327 * struct wlan_lmac_if_sa_api_tx_ops - SA API specific tx function pointers 328 */ 329 330 struct wlan_lmac_if_sa_api_tx_ops { 331 void (*sa_api_register_event_handler)(struct wlan_objmgr_psoc *psoc); 332 void (*sa_api_unregister_event_handler)(struct wlan_objmgr_psoc *posc); 333 void (*sa_api_enable_sa) (struct wlan_objmgr_pdev *pdev, 334 uint32_t enable, uint32_t mode, uint32_t rx_antenna); 335 void (*sa_api_set_rx_antenna) (struct wlan_objmgr_pdev *pdev, 336 uint32_t antenna); 337 void (*sa_api_set_tx_antenna) (struct wlan_objmgr_peer *peer, 338 uint32_t *antenna_array); 339 void (*sa_api_set_tx_default_antenna) (struct wlan_objmgr_pdev *pdev, 340 u_int32_t antenna); 341 void (*sa_api_set_training_info) (struct wlan_objmgr_peer *peer, 342 uint32_t *rate_array, 343 uint32_t *antenna_array, 344 uint32_t numpkts); 345 void (*sa_api_prepare_rateset)(struct wlan_objmgr_pdev *pdev, 346 struct wlan_objmgr_peer *peer, 347 struct sa_rate_info *rate_info); 348 void (*sa_api_set_node_config_ops) (struct wlan_objmgr_peer *peer, 349 uint32_t cmd_id, uint16_t args_count, 350 u_int32_t args_arr[]); 351 }; 352 353 #endif 354 355 #ifdef WLAN_CONV_SPECTRAL_ENABLE 356 struct wmi_spectral_cmd_ops; 357 /** 358 * struct wlan_lmac_if_sptrl_tx_ops - Spectral south bound Tx operations 359 * @sptrlto_spectral_init: Initialize LMAC/target_if Spectral 360 * @sptrlto_spectral_deinit: De-initialize LMAC/target_if Spectral 361 * @sptrlto_set_spectral_config: Set Spectral configuration 362 * @sptrlto_get_spectral_config: Get Spectral configuration 363 * @sptrlto_start_spectral_scan: Start Spectral Scan 364 * @sptrlto_stop_spectral_scan: Stop Spectral Scan 365 * @sptrlto_is_spectral_active: Get whether Spectral is active 366 * @sptrlto_is_spectral_enabled: Get whether Spectral is enabled 367 * @sptrlto_set_icm_active: Set whether ICM is active or inactive 368 * @sptrlto_get_icm_active: Get whether ICM is active or inactive 369 * @sptrlto_get_nominal_nf: Get Nominal Noise Floor for the current 370 * frequency band 371 * @sptrlto_set_debug_level: Set Spectral debug level 372 * @sptrlto_get_debug_level: Get Spectral debug level 373 * @sptrlto_get_chaninfo: Get channel information 374 * @sptrlto_clear_chaninfo: Clear channel information 375 * @sptrlto_get_spectral_capinfo: Get Spectral capability information 376 * @sptrlto_get_spectral_diagstats: Get Spectral diagnostic statistics 377 * @sptrlto_register_netlink_cb: Register Spectral Netlink callbacks 378 * @sptrlto_use_nl_bcast: Get whether to use Netlink broadcast/unicast 379 * @sptrlto_deregister_netlink_cb: De-register Spectral Netlink callbacks 380 * @sptrlto_process_spectral_report: Process spectral report 381 **/ 382 struct wlan_lmac_if_sptrl_tx_ops { 383 void *(*sptrlto_pdev_spectral_init)(struct wlan_objmgr_pdev *pdev); 384 void (*sptrlto_pdev_spectral_deinit)(struct wlan_objmgr_pdev *pdev); 385 int (*sptrlto_set_spectral_config)(struct wlan_objmgr_pdev *pdev, 386 const u_int32_t threshtype, 387 const u_int32_t value); 388 void (*sptrlto_get_spectral_config)(struct wlan_objmgr_pdev *pdev, 389 struct spectral_config *sptrl_config 390 ); 391 int (*sptrlto_start_spectral_scan)(struct wlan_objmgr_pdev *pdev); 392 void (*sptrlto_stop_spectral_scan)(struct wlan_objmgr_pdev *pdev); 393 bool (*sptrlto_is_spectral_active)(struct wlan_objmgr_pdev *pdev); 394 bool (*sptrlto_is_spectral_enabled)(struct wlan_objmgr_pdev *pdev); 395 int (*sptrlto_set_debug_level)(struct wlan_objmgr_pdev *pdev, 396 u_int32_t debug_level); 397 u_int32_t (*sptrlto_get_debug_level)(struct wlan_objmgr_pdev *pdev); 398 void (*sptrlto_get_spectral_capinfo)(struct wlan_objmgr_pdev *pdev, 399 void *outdata); 400 void (*sptrlto_get_spectral_diagstats)(struct wlan_objmgr_pdev *pdev, 401 void *outdata); 402 void (*sptrlto_register_wmi_spectral_cmd_ops)( 403 struct wlan_objmgr_pdev *pdev, 404 struct wmi_spectral_cmd_ops *cmd_ops); 405 void (*sptrlto_register_netlink_cb)( 406 struct wlan_objmgr_pdev *pdev, 407 struct spectral_nl_cb *nl_cb); 408 bool (*sptrlto_use_nl_bcast)(struct wlan_objmgr_pdev *pdev); 409 void (*sptrlto_deregister_netlink_cb)(struct wlan_objmgr_pdev *pdev); 410 int (*sptrlto_process_spectral_report)( 411 struct wlan_objmgr_pdev *pdev, 412 void *payload); 413 }; 414 #endif /* WLAN_CONV_SPECTRAL_ENABLE */ 415 416 #ifdef WIFI_POS_CONVERGED 417 /* 418 * struct wlan_lmac_if_wifi_pos_tx_ops - structure of firmware tx function 419 * pointers for wifi_pos component 420 * @data_req_tx: function pointer to send wifi_pos req to firmware 421 */ 422 struct wlan_lmac_if_wifi_pos_tx_ops { 423 QDF_STATUS (*data_req_tx)(struct wlan_objmgr_psoc *psoc, 424 struct oem_data_req *req); 425 }; 426 #endif 427 428 #ifdef DIRECT_BUF_RX_ENABLE 429 /** 430 * struct wlan_lmac_if_direct_buf_rx_tx_ops - structire of direct buf rx txops 431 * @direct_buf_rx_module_register: Registration API callback for modules 432 * to register with direct buf rx framework 433 * @direct_buf_rx_register_events: Registration of WMI events for direct 434 * buffer rx framework 435 * @direct_buf_rx_unregister_events: Unregistraton of WMI events for direct 436 * buffer rx framework 437 */ 438 struct wlan_lmac_if_direct_buf_rx_tx_ops { 439 QDF_STATUS (*direct_buf_rx_module_register)( 440 struct wlan_objmgr_pdev *pdev, uint8_t mod_id, 441 int (*dbr_rsp_handler)(struct wlan_objmgr_pdev *pdev, 442 struct direct_buf_rx_data *dbr_data)); 443 QDF_STATUS (*direct_buf_rx_register_events)( 444 struct wlan_objmgr_psoc *psoc); 445 QDF_STATUS (*direct_buf_rx_unregister_events)( 446 struct wlan_objmgr_psoc *psoc); 447 }; 448 #endif 449 450 #ifdef CONVERGED_TDLS_ENABLE 451 /* fwd declarations for tdls tx ops */ 452 struct tdls_info; 453 struct tdls_peer_update_state; 454 struct tdls_channel_switch_params; 455 struct sta_uapsd_trig_params; 456 /** 457 * struct wlan_lmac_if_tdls_tx_ops - south bound tx function pointers for tdls 458 * @update_fw_state: function to update tdls firmware state 459 * @update_peer_state: function to update tdls peer state 460 * @set_offchan_mode: function to set tdls offchannel mode 461 * @tdls_reg_ev_handler: function to register for tdls events 462 * @tdls_unreg_ev_handler: function to unregister for tdls events 463 * @tdls_set_uapsd: function to set upasdt trigger command 464 * 465 * tdls module uses these functions to avail ol/da lmac services 466 */ 467 struct wlan_lmac_if_tdls_tx_ops { 468 QDF_STATUS (*update_fw_state)(struct wlan_objmgr_psoc *psoc, 469 struct tdls_info *req); 470 QDF_STATUS (*update_peer_state)(struct wlan_objmgr_psoc *psoc, 471 struct tdls_peer_update_state *param); 472 QDF_STATUS (*set_offchan_mode)(struct wlan_objmgr_psoc *psoc, 473 struct tdls_channel_switch_params *param); 474 QDF_STATUS (*tdls_reg_ev_handler)(struct wlan_objmgr_psoc *psoc, 475 void *arg); 476 QDF_STATUS (*tdls_unreg_ev_handler) (struct wlan_objmgr_psoc *psoc, 477 void *arg); 478 QDF_STATUS (*tdls_set_uapsd)(struct wlan_objmgr_psoc *psoc, 479 struct sta_uapsd_trig_params *params); 480 }; 481 482 /* fwd declarations for tdls rx ops */ 483 struct tdls_event_info; 484 /** 485 * struct wlan_lmac_if_tdls_rx_ops - south bound rx function pointers for tdls 486 * @tdls_ev_handler: function to handler tdls event 487 * 488 * lmac modules uses this API to post scan events to tdls module 489 */ 490 struct wlan_lmac_if_tdls_rx_ops { 491 QDF_STATUS (*tdls_ev_handler)(struct wlan_objmgr_psoc *psoc, 492 struct tdls_event_info *info); 493 }; 494 #endif 495 496 #ifdef WLAN_FEATURE_NAN_CONVERGENCE 497 /** 498 * struct wlan_lmac_if_nan_tx_ops - structure of firwware tx function 499 * pointers for nan component 500 * @data_req_tx: function pointer to send nan req to firmware 501 */ 502 struct wlan_lmac_if_nan_tx_ops { 503 QDF_STATUS (*nan_req_tx)(void *req, uint32_t req_id); 504 }; 505 #endif 506 507 /** 508 * struct wlan_lmac_if_ftm_rx_ops - south bound rx function pointers for FTM 509 * @ftm_ev_handler: function to handle FTM event 510 * 511 * lmac modules uses this API to post FTM events to FTM module 512 */ 513 struct wlan_lmac_if_ftm_rx_ops { 514 QDF_STATUS (*ftm_ev_handler)(struct wlan_objmgr_pdev *pdev, 515 uint8_t *event_buf, uint32_t len); 516 }; 517 518 /** 519 * struct wlan_lmac_reg_if_tx_ops - structure of tx function 520 * pointers for regulatory component 521 * @register_master_handler: pointer to register event handler 522 * @unregister_master_handler: pointer to unregister event handler 523 * @register_11d_new_cc_handler: pointer to register 11d cc event handler 524 * @unregister_11d_new_cc_handler: pointer to unregister 11d cc event handler 525 */ 526 struct wlan_lmac_if_reg_tx_ops { 527 QDF_STATUS (*register_master_handler)(struct wlan_objmgr_psoc *psoc, 528 void *arg); 529 QDF_STATUS (*unregister_master_handler)(struct wlan_objmgr_psoc *psoc, 530 void *arg); 531 532 QDF_STATUS (*set_country_code)(struct wlan_objmgr_psoc *psoc, 533 void *arg); 534 QDF_STATUS (*fill_umac_legacy_chanlist)(struct wlan_objmgr_pdev *pdev, 535 struct regulatory_channel *cur_chan_list); 536 QDF_STATUS (*register_11d_new_cc_handler)( 537 struct wlan_objmgr_psoc *psoc, void *arg); 538 QDF_STATUS (*unregister_11d_new_cc_handler)( 539 struct wlan_objmgr_psoc *psoc, void *arg); 540 QDF_STATUS (*start_11d_scan)(struct wlan_objmgr_psoc *psoc, 541 struct reg_start_11d_scan_req *reg_start_11d_scan_req); 542 QDF_STATUS (*stop_11d_scan)(struct wlan_objmgr_psoc *psoc, 543 struct reg_stop_11d_scan_req *reg_stop_11d_scan_req); 544 bool (*is_there_serv_ready_extn)(struct wlan_objmgr_psoc *psoc); 545 QDF_STATUS (*set_user_country_code)(struct wlan_objmgr_psoc *psoc, 546 uint8_t pdev_id, 547 struct cc_regdmn_s *rd); 548 QDF_STATUS (*set_country_failed)(struct wlan_objmgr_pdev *pdev); 549 QDF_STATUS (*register_ch_avoid_event_handler)( 550 struct wlan_objmgr_psoc *psoc, void *arg); 551 QDF_STATUS (*unregister_ch_avoid_event_handler)( 552 struct wlan_objmgr_psoc *psoc, void *arg); 553 }; 554 555 /** 556 * struct wlan_lmac_if_dfs_tx_ops - Function pointer to call offload/lmac 557 * functions from DFS module. 558 * @dfs_enable: Enable DFS. 559 * @dfs_get_caps: Get DFS capabilities. 560 * @dfs_disable: Disable DFS 561 * @dfs_gettsf64: Get tsf64 value. 562 * @dfs_set_use_cac_prssi: Set use_cac_prssi value. 563 * @dfs_get_dfsdomain: Get DFS domain. 564 * @dfs_is_countryCode_CHINA: Check is country code CHINA. 565 * @dfs_get_thresholds: Get thresholds. 566 * @dfs_get_ext_busy: Get ext_busy. 567 * @dfs_get_target_type: Get target type. 568 * @dfs_is_countryCode_KOREA_ROC3: Check is county code Korea. 569 * @dfs_is_mode_offload: Check the radio for offload. 570 * @dfs_get_ah_devid: Get ah devid. 571 * @dfs_get_phymode_info: Get phymode info. 572 * @dfs_reg_ev_handler: Register dfs event handler. 573 * @dfs_process_emulate_bang_radar_cmd: Process emulate bang radar test command. 574 * @dfs_is_pdev_5ghz: Check if the given pdev is 5GHz. 575 * @dfs_set_phyerr_filter_offload: Config phyerr filter offload. 576 * @dfs_send_offload_enable_cmd: Send dfs offload enable command to fw. 577 */ 578 579 struct wlan_lmac_if_dfs_tx_ops { 580 QDF_STATUS (*dfs_enable)(struct wlan_objmgr_pdev *pdev, 581 int *is_fastclk, 582 struct wlan_dfs_phyerr_param *param, 583 uint32_t dfsdomain); 584 QDF_STATUS (*dfs_get_caps)(struct wlan_objmgr_pdev *pdev, 585 struct wlan_dfs_caps *dfs_caps); 586 QDF_STATUS (*dfs_disable)(struct wlan_objmgr_pdev *pdev, 587 int no_cac); 588 QDF_STATUS (*dfs_gettsf64)(struct wlan_objmgr_pdev *pdev, 589 uint64_t *tsf64); 590 QDF_STATUS (*dfs_set_use_cac_prssi)(struct wlan_objmgr_pdev *pdev); 591 QDF_STATUS (*dfs_get_thresholds)(struct wlan_objmgr_pdev *pdev, 592 struct wlan_dfs_phyerr_param *param); 593 QDF_STATUS (*dfs_get_ext_busy)(struct wlan_objmgr_pdev *pdev, 594 int *dfs_ext_chan_busy); 595 QDF_STATUS (*dfs_get_target_type)(struct wlan_objmgr_pdev *pdev, 596 uint32_t *target_type); 597 QDF_STATUS (*dfs_is_mode_offload)(struct wlan_objmgr_pdev *pdev, 598 bool *is_offload); 599 QDF_STATUS (*dfs_get_ah_devid)(struct wlan_objmgr_pdev *pdev, 600 uint16_t *devid); 601 QDF_STATUS (*dfs_get_phymode_info)(struct wlan_objmgr_pdev *pdev, 602 uint32_t chan_mode, 603 uint32_t *mode_info, 604 bool is_2gvht_en); 605 QDF_STATUS (*dfs_reg_ev_handler)(struct wlan_objmgr_psoc *psoc, 606 bool dfs_offload); 607 QDF_STATUS (*dfs_process_emulate_bang_radar_cmd)( 608 struct wlan_objmgr_pdev *pdev, 609 struct dfs_emulate_bang_radar_test_cmd *dfs_unit_test); 610 QDF_STATUS (*dfs_is_pdev_5ghz)(struct wlan_objmgr_pdev *pdev, 611 bool *is_5ghz); 612 QDF_STATUS (*dfs_set_phyerr_filter_offload)( 613 struct wlan_objmgr_pdev *pdev, 614 bool dfs_phyerr_filter_offload); 615 QDF_STATUS (*dfs_is_tgt_offload)(struct wlan_objmgr_psoc *psoc, 616 bool *is_tgt_offload); 617 QDF_STATUS (*dfs_send_offload_enable_cmd)( 618 struct wlan_objmgr_pdev *pdev, 619 bool enable); 620 }; 621 622 /** 623 * struct wlan_lmac_if_target_tx_ops - Function pointers to call target 624 * functions from other modules. 625 * @tgt_is_tgt_type_ar900b: To check AR900B target type. 626 * @tgt_is_tgt_type_ipq4019: To check IPQ4019 target type. 627 * @tgt_is_tgt_type_qca9984: To check QCA9984 target type. 628 * @tgt_is_tgt_type_qca9888: To check QCA9888 target type. 629 * @tgt_get_tgt_type: Get target type 630 * @tgt_get_tgt_version: Get target version 631 * @tgt_get_tgt_revision: Get target revision 632 */ 633 struct wlan_lmac_if_target_tx_ops { 634 bool (*tgt_is_tgt_type_ar900b)(uint32_t); 635 bool (*tgt_is_tgt_type_ipq4019)(uint32_t); 636 bool (*tgt_is_tgt_type_qca9984)(uint32_t); 637 bool (*tgt_is_tgt_type_qca9888)(uint32_t); 638 uint32_t (*tgt_get_tgt_type)(struct wlan_objmgr_psoc *psoc); 639 uint32_t (*tgt_get_tgt_version)(struct wlan_objmgr_psoc *psoc); 640 uint32_t (*tgt_get_tgt_revision)(struct wlan_objmgr_psoc *psoc); 641 }; 642 643 #ifdef WLAN_OFFCHAN_TXRX_ENABLE 644 /** 645 * struct wlan_lmac_if_offchan_txrx_ops - Function pointers to check target 646 * capabilities related to offchan txrx. 647 * @offchan_data_tid_support: To check if target supports seperate tid for 648 * offchan data tx. 649 */ 650 struct wlan_lmac_if_offchan_txrx_ops { 651 bool (*offchan_data_tid_support)(struct wlan_objmgr_pdev *pdev); 652 }; 653 #endif 654 655 #ifdef WLAN_SUPPORT_GREEN_AP 656 struct wlan_green_ap_egap_params; 657 /** 658 * struct wlan_lmac_if_green_ap_tx_ops - structure of tx function 659 * pointers for green ap component 660 * @enable_egap: function pointer to send enable egap indication to fw 661 * @ps_on_off_send: function pointer to send enable/disable green ap ps to fw 662 */ 663 struct wlan_lmac_if_green_ap_tx_ops { 664 QDF_STATUS (*enable_egap)(struct wlan_objmgr_pdev *pdev, 665 struct wlan_green_ap_egap_params *egap_params); 666 QDF_STATUS (*ps_on_off_send)(struct wlan_objmgr_pdev *pdev, 667 bool value, uint8_t pdev_id); 668 QDF_STATUS (*reset_dev)(struct wlan_objmgr_pdev *pdev); 669 uint16_t (*get_current_channel)(struct wlan_objmgr_pdev *pdev); 670 uint64_t (*get_current_channel_flags)(struct wlan_objmgr_pdev *pdev); 671 QDF_STATUS (*get_capab)(struct wlan_objmgr_pdev *pdev); 672 }; 673 #endif 674 675 /** 676 * struct wlan_lmac_if_tx_ops - south bound tx function pointers 677 * @mgmt_txrx_tx_ops: mgmt txrx tx ops 678 * @scan: scan tx ops 679 * @dfs_tx_ops: dfs tx ops. 680 * @green_ap_tx_ops: green_ap tx_ops 681 * @cp_stats_tx_ops: cp stats tx_ops 682 * 683 * Callback function tabled to be registered with umac. 684 * umac will use the functional table to send events/frames to lmac/wmi 685 */ 686 687 struct wlan_lmac_if_tx_ops { 688 /* Components to declare function pointers required by the module 689 * in component specific structure. 690 * The component specific ops structure can be declared in this file 691 * only 692 */ 693 struct wlan_lmac_if_mgmt_txrx_tx_ops mgmt_txrx_tx_ops; 694 struct wlan_lmac_if_scan_tx_ops scan; 695 #ifdef CONVERGED_P2P_ENABLE 696 struct wlan_lmac_if_p2p_tx_ops p2p; 697 #endif 698 #ifdef QCA_SUPPORT_SON 699 struct wlan_lmac_if_son_tx_ops son_tx_ops; 700 #endif 701 702 #ifdef WLAN_ATF_ENABLE 703 struct wlan_lmac_if_atf_tx_ops atf_tx_ops; 704 #endif 705 #ifdef QCA_SUPPORT_CP_STATS 706 struct wlan_lmac_if_cp_stats_tx_ops cp_stats_tx_ops; 707 #endif 708 #ifdef WLAN_SA_API_ENABLE 709 struct wlan_lmac_if_sa_api_tx_ops sa_api_tx_ops; 710 #endif 711 712 #ifdef WLAN_CONV_SPECTRAL_ENABLE 713 struct wlan_lmac_if_sptrl_tx_ops sptrl_tx_ops; 714 #endif 715 716 #ifdef WLAN_CONV_CRYPTO_SUPPORTED 717 struct wlan_lmac_if_crypto_tx_ops crypto_tx_ops; 718 #endif 719 720 #ifdef WIFI_POS_CONVERGED 721 struct wlan_lmac_if_wifi_pos_tx_ops wifi_pos_tx_ops; 722 #endif 723 #ifdef WLAN_FEATURE_NAN_CONVERGENCE 724 struct wlan_lmac_if_nan_tx_ops nan_tx_ops; 725 #endif 726 struct wlan_lmac_if_reg_tx_ops reg_ops; 727 struct wlan_lmac_if_dfs_tx_ops dfs_tx_ops; 728 729 #ifdef CONVERGED_TDLS_ENABLE 730 struct wlan_lmac_if_tdls_tx_ops tdls_tx_ops; 731 #endif 732 733 #ifdef WLAN_SUPPORT_FILS 734 struct wlan_lmac_if_fd_tx_ops fd_tx_ops; 735 #endif 736 struct wlan_lmac_if_mlme_tx_ops mops; 737 struct wlan_lmac_if_target_tx_ops target_tx_ops; 738 739 #ifdef WLAN_OFFCHAN_TXRX_ENABLE 740 struct wlan_lmac_if_offchan_txrx_ops offchan_txrx_ops; 741 #endif 742 743 #ifdef DIRECT_BUF_RX_ENABLE 744 struct wlan_lmac_if_direct_buf_rx_tx_ops dbr_tx_ops; 745 #endif 746 747 #ifdef WLAN_SUPPORT_GREEN_AP 748 struct wlan_lmac_if_green_ap_tx_ops green_ap_tx_ops; 749 #endif 750 751 struct wlan_lmac_if_ftm_tx_ops ftm_tx_ops; 752 }; 753 754 /** 755 * struct wlan_lmac_if_mgmt_txrx_rx_ops - structure of rx function 756 * pointers for mgmt txrx component 757 * @mgmt_tx_completion_handler: function pointer to give tx completions 758 * to mgmt txrx comp. 759 * @mgmt_rx_frame_handler: function pointer to give rx frame to mgmt txrx comp. 760 * @mgmt_txrx_get_nbuf_from_desc_id: function pointer to get nbuf from desc id 761 * @mgmt_txrx_get_peer_from_desc_id: function pointer to get peer from desc id 762 * @mgmt_txrx_get_vdev_id_from_desc_id: function pointer to get vdev id from 763 * desc id 764 */ 765 struct wlan_lmac_if_mgmt_txrx_rx_ops { 766 QDF_STATUS (*mgmt_tx_completion_handler)( 767 struct wlan_objmgr_pdev *pdev, 768 uint32_t desc_id, uint32_t status, 769 void *tx_compl_params); 770 QDF_STATUS (*mgmt_rx_frame_handler)( 771 struct wlan_objmgr_psoc *psoc, 772 qdf_nbuf_t buf, 773 struct mgmt_rx_event_params *mgmt_rx_params); 774 qdf_nbuf_t (*mgmt_txrx_get_nbuf_from_desc_id)( 775 struct wlan_objmgr_pdev *pdev, 776 uint32_t desc_id); 777 struct wlan_objmgr_peer * (*mgmt_txrx_get_peer_from_desc_id)( 778 struct wlan_objmgr_pdev *pdev, uint32_t desc_id); 779 uint8_t (*mgmt_txrx_get_vdev_id_from_desc_id)( 780 struct wlan_objmgr_pdev *pdev, 781 uint32_t desc_id); 782 uint32_t (*mgmt_txrx_get_free_desc_pool_count)( 783 struct wlan_objmgr_pdev *pdev); 784 }; 785 786 struct wlan_lmac_if_reg_rx_ops { 787 QDF_STATUS (*master_list_handler)(struct cur_regulatory_info 788 *reg_info); 789 QDF_STATUS (*reg_11d_new_cc_handler)(struct wlan_objmgr_psoc *psoc, 790 struct reg_11d_new_country *reg_11d_new_cc); 791 QDF_STATUS (*reg_set_regdb_offloaded)(struct wlan_objmgr_psoc *psoc, 792 bool val); 793 QDF_STATUS (*reg_set_11d_offloaded)(struct wlan_objmgr_psoc *psoc, 794 bool val); 795 QDF_STATUS (*get_dfs_region)(struct wlan_objmgr_pdev *pdev, 796 enum dfs_reg *dfs_reg); 797 QDF_STATUS (*reg_ch_avoid_event_handler)(struct wlan_objmgr_psoc *psoc, 798 struct ch_avoid_ind_type *ch_avoid_ind); 799 uint32_t (*reg_freq_to_chan)(struct wlan_objmgr_pdev *pdev, 800 uint32_t freq); 801 QDF_STATUS (*reg_set_chan_144)(struct wlan_objmgr_pdev *pdev, 802 bool enable_ch_144); 803 bool (*reg_get_chan_144)(struct wlan_objmgr_pdev *pdev); 804 QDF_STATUS (*reg_program_default_cc)(struct wlan_objmgr_pdev *pdev, 805 uint16_t regdmn); 806 QDF_STATUS (*reg_get_current_regdomain)(struct wlan_objmgr_pdev *pdev, 807 struct cur_regdmn_info *cur_regdmn); 808 }; 809 810 #ifdef CONVERGED_P2P_ENABLE 811 812 /* forward declarations for p2p rx ops */ 813 struct p2p_noa_info; 814 struct p2p_lo_event; 815 816 /** 817 * struct wlan_lmac_if_p2p_rx_ops - structure of rx function pointers 818 * for P2P component 819 * @lo_ev_handler: function pointer to give listen offload event 820 * @noa_ev_handler: function pointer to give noa event 821 */ 822 struct wlan_lmac_if_p2p_rx_ops { 823 QDF_STATUS (*lo_ev_handler)(struct wlan_objmgr_psoc *psoc, 824 struct p2p_lo_event *event_info); 825 QDF_STATUS (*noa_ev_handler)(struct wlan_objmgr_psoc *psoc, 826 struct p2p_noa_info *event_info); 827 }; 828 #endif 829 830 #ifdef WLAN_ATF_ENABLE 831 832 /** 833 * struct wlan_lmac_if_atf_rx_ops - ATF south bound rx function pointers 834 * @atf_get_atf_commit: Get ATF commit state 835 * @atf_get_fmcap: Get firmware capability for ATF 836 * @atf_get_obss_scale: Get OBSS scale 837 * @atf_get_mode: Get mode of ATF 838 * @atf_get_msdu_desc: Get msdu desc for ATF 839 * @atf_get_max_vdevs: Get maximum vdevs for a Radio 840 * @atf_get_peers: Get number of peers for a radio 841 * @atf_get_tput_based: Get throughput based enabled/disabled 842 * @atf_get_logging: Get logging enabled/disabled 843 * @atf_get_txbuf_share: Get TxBuff share state 844 * @atf_get_txbuf_max: Get TxBuff MAX number 845 * @atf_get_txbuf_min: Get TxBuff MIN number 846 * @atf_get_ssidgroup: Get ssid group state 847 * @atf_get_tx_block_count: Get tx block count 848 * @atf_get_peer_blk_txtraffic: Get peer tx traffic block state 849 * @atf_get_vdev_blk_txtraffic: Get vdev tx traffic block state 850 * @atf_get_sched: Get ATF scheduled policy 851 * @atf_get_tx_tokens: Get Tx tokens 852 * @atf_get_shadow_tx_tokens: Get shadow tx tokens 853 * @atf_get_tx_tokens_common: Get common tx tokens 854 * @atf_get_shadow_alloted_tx_tokens: Get shadow alloted tx tokens 855 * @atf_get_peer_stats: Get atf peer stats 856 * @atf_get_token_allocated: Get atf token allocated 857 * @atf_get_token_utilized: Get atf token utilized 858 * @atf_set_sched: Set ATF schedule policy 859 * @atf_set_fmcap: Set firmware capability for ATF 860 * @atf_set_obss_scale: Set ATF obss scale 861 * @atf_set_mode: Set ATF mode 862 * @atf_set_msdu_desc: Set msdu desc 863 * @atf_set_max_vdevs: Set maximum vdevs number 864 * @atf_set_peers: Set peers number 865 * @atf_set_peer_stats: Set peer stats 866 * @atf_set_vdev_blk_txtraffic: Set Block/unblock vdev tx traffic 867 * @atf_set_peer_blk_txtraffic: Set Block/unblock peer tx traffic 868 * @atf_set_tx_block_count: Set tx block count 869 * @atf_set_token_allocated: Set atf token allocated 870 * @atf_set_token_utilized: Set atf token utilized 871 */ 872 struct wlan_lmac_if_atf_rx_ops { 873 uint8_t (*atf_get_atf_commit)(struct wlan_objmgr_pdev *pdev); 874 uint32_t (*atf_get_fmcap)(struct wlan_objmgr_psoc *psoc); 875 uint32_t (*atf_get_obss_scale)(struct wlan_objmgr_pdev *pdev); 876 uint32_t (*atf_get_mode)(struct wlan_objmgr_psoc *psoc); 877 uint32_t (*atf_get_msdu_desc)(struct wlan_objmgr_psoc *psoc); 878 uint32_t (*atf_get_max_vdevs)(struct wlan_objmgr_psoc *psoc); 879 uint32_t (*atf_get_peers)(struct wlan_objmgr_psoc *psoc); 880 uint32_t (*atf_get_tput_based)(struct wlan_objmgr_pdev *pdev); 881 uint32_t (*atf_get_logging)(struct wlan_objmgr_pdev *pdev); 882 uint8_t (*atf_get_txbuf_share)(struct wlan_objmgr_pdev *pdev); 883 uint16_t (*atf_get_txbuf_max)(struct wlan_objmgr_pdev *pdev); 884 uint16_t (*atf_get_txbuf_min)(struct wlan_objmgr_pdev *pdev); 885 uint32_t (*atf_get_ssidgroup)(struct wlan_objmgr_pdev *pdev); 886 uint32_t (*atf_get_tx_block_count)(struct wlan_objmgr_vdev *vdev); 887 uint8_t (*atf_get_peer_blk_txtraffic)(struct wlan_objmgr_peer *peer); 888 uint8_t (*atf_get_vdev_blk_txtraffic)(struct wlan_objmgr_vdev *vdev); 889 uint32_t (*atf_get_sched)(struct wlan_objmgr_pdev *pdev); 890 uint32_t (*atf_get_tx_tokens)(struct wlan_objmgr_peer *peer); 891 uint32_t (*atf_get_shadow_tx_tokens)(struct wlan_objmgr_peer *peer); 892 uint32_t (*atf_get_txtokens_common)(struct wlan_objmgr_pdev *pdev); 893 uint32_t (*atf_get_shadow_alloted_tx_tokens)( 894 struct wlan_objmgr_pdev *pdev); 895 void (*atf_get_peer_stats)(struct wlan_objmgr_peer *peer, 896 struct atf_stats *stats); 897 uint16_t (*atf_get_token_allocated)(struct wlan_objmgr_peer *peer); 898 uint16_t (*atf_get_token_utilized)(struct wlan_objmgr_peer *peer); 899 900 void (*atf_set_sched)(struct wlan_objmgr_pdev *pdev, uint32_t value); 901 void (*atf_set_fmcap)(struct wlan_objmgr_psoc *psoc, uint32_t value); 902 void (*atf_set_obss_scale)(struct wlan_objmgr_pdev *pdev, 903 uint32_t value); 904 void (*atf_set_mode)(struct wlan_objmgr_psoc *psoc, uint8_t value); 905 void (*atf_set_msdu_desc)(struct wlan_objmgr_psoc *psoc, 906 uint32_t value); 907 void (*atf_set_max_vdevs)(struct wlan_objmgr_psoc *psoc, 908 uint32_t value); 909 void (*atf_set_peers)(struct wlan_objmgr_psoc *psoc, uint32_t value); 910 void (*atf_set_peer_stats)(struct wlan_objmgr_peer *peer, 911 struct atf_stats *stats); 912 void (*atf_set_vdev_blk_txtraffic)(struct wlan_objmgr_vdev *vdev, 913 uint8_t value); 914 void (*atf_set_peer_blk_txtraffic)(struct wlan_objmgr_peer *peer, 915 uint8_t value); 916 void (*atf_set_tx_block_count)(struct wlan_objmgr_vdev *vdev, 917 uint32_t count); 918 void (*atf_set_token_allocated)(struct wlan_objmgr_peer *peer, 919 uint16_t value); 920 void (*atf_set_token_utilized)(struct wlan_objmgr_peer *peer, 921 uint16_t value); 922 }; 923 #endif 924 925 #ifdef WLAN_SUPPORT_FILS 926 /** 927 * struct wlan_lmac_if_fd_rx_ops - FILS Discovery specific Rx function pointers 928 * @fd_is_fils_enable: FILS enabled or not 929 * @fd_alloc: Allocate FD buffer 930 * @fd_stop: Stop and free deferred FD buffer 931 * @fd_free: Free FD frame buffer 932 * @fd_get_valid_fd_period: Get valid FD period 933 * @fd_swfda_handler: SWFDA event handler 934 */ 935 struct wlan_lmac_if_fd_rx_ops { 936 uint8_t (*fd_is_fils_enable)(struct wlan_objmgr_vdev *vdev); 937 void (*fd_alloc)(struct wlan_objmgr_vdev *vdev); 938 void (*fd_stop)(struct wlan_objmgr_vdev *vdev); 939 void (*fd_free)(struct wlan_objmgr_vdev *vdev); 940 uint32_t (*fd_get_valid_fd_period)(struct wlan_objmgr_vdev *vdev, 941 uint8_t *is_modified); 942 QDF_STATUS (*fd_swfda_handler)(struct wlan_objmgr_vdev *vdev); 943 }; 944 #endif 945 946 #ifdef WLAN_SA_API_ENABLE 947 948 /** 949 * struct wlan_lmac_if_sa_api_rx_ops - SA API south bound rx function pointers 950 */ 951 struct wlan_lmac_if_sa_api_rx_ops { 952 uint32_t (*sa_api_get_sa_supported)(struct wlan_objmgr_psoc *psoc); 953 uint32_t (*sa_api_get_validate_sw)(struct wlan_objmgr_psoc *psoc); 954 void (*sa_api_enable_sa)(struct wlan_objmgr_psoc *psoc, uint32_t value); 955 uint32_t (*sa_api_get_sa_enable)(struct wlan_objmgr_psoc *psoc); 956 void (*sa_api_peer_assoc_hanldler)(struct wlan_objmgr_pdev *pdev, 957 struct wlan_objmgr_peer *peer, struct sa_rate_cap *); 958 uint32_t (*sa_api_update_tx_feedback)(struct wlan_objmgr_pdev *pdev, 959 struct wlan_objmgr_peer *peer, 960 struct sa_tx_feedback *feedback); 961 uint32_t (*sa_api_update_rx_feedback)(struct wlan_objmgr_pdev *pdev, 962 struct wlan_objmgr_peer *peer, 963 struct sa_rx_feedback *feedback); 964 uint32_t (*sa_api_ucfg_set_param)(struct wlan_objmgr_pdev *pdev, 965 char *val); 966 uint32_t (*sa_api_ucfg_get_param)(struct wlan_objmgr_pdev *pdev, 967 char *val); 968 uint32_t (*sa_api_is_tx_feedback_enabled) 969 (struct wlan_objmgr_pdev *pdev); 970 uint32_t (*sa_api_is_rx_feedback_enabled) 971 (struct wlan_objmgr_pdev *pdev); 972 uint32_t (*sa_api_convert_rate_2g)(uint32_t rate); 973 uint32_t (*sa_api_convert_rate_5g)(uint32_t rate); 974 uint32_t (*sa_api_get_sa_mode)(struct wlan_objmgr_pdev *pdev); 975 uint32_t (*sa_api_get_beacon_txantenna)(struct wlan_objmgr_pdev *pdev); 976 uint32_t (*sa_api_cwm_action)(struct wlan_objmgr_pdev *pdev); 977 }; 978 #endif 979 980 #ifdef WLAN_CONV_SPECTRAL_ENABLE 981 /** 982 * struct wlan_lmac_if_sptrl_rx_ops - Spectral south bound Rx operations 983 * 984 * @sptrlro_get_target_handle: Get Spectral handle for target/LMAC private data 985 */ 986 struct wlan_lmac_if_sptrl_rx_ops { 987 void * (*sptrlro_get_target_handle)(struct wlan_objmgr_pdev *pdev); 988 int16_t (*sptrlro_vdev_get_chan_freq)(struct wlan_objmgr_vdev *vdev); 989 enum phy_ch_width (*sptrlro_vdev_get_ch_width)( 990 struct wlan_objmgr_vdev *vdev); 991 int (*sptrlro_vdev_get_sec20chan_freq_mhz)( 992 struct wlan_objmgr_vdev *vdev, 993 uint16_t *sec20chan_freq); 994 }; 995 #endif /* WLAN_CONV_SPECTRAL_ENABLE */ 996 997 #ifdef WIFI_POS_CONVERGED 998 /** 999 * struct wlan_lmac_if_wifi_pos_rx_ops - structure of rx function 1000 * pointers for wifi_pos component 1001 * @oem_rsp_event_rx: callback for WMI_OEM_RESPONSE_EVENTID 1002 */ 1003 struct wlan_lmac_if_wifi_pos_rx_ops { 1004 int (*oem_rsp_event_rx)(struct wlan_objmgr_psoc *psoc, 1005 struct oem_data_rsp *oem_rsp); 1006 }; 1007 #endif 1008 1009 #ifdef WLAN_FEATURE_NAN_CONVERGENCE 1010 /** 1011 * struct wlan_lmac_if_nan_rx_ops - structure of rx function 1012 * pointers for nan component 1013 * @oem_rsp_event_rx: callback for WMI_OEM_RESPONSE_EVENTID 1014 */ 1015 struct wlan_lmac_if_nan_rx_ops { 1016 QDF_STATUS (*nan_event_rx)(struct scheduler_msg *event); 1017 }; 1018 #endif 1019 1020 /** 1021 * struct wlan_lmac_if_dfs_rx_ops - Function pointers to call dfs functions 1022 * from lmac/offload. 1023 * @dfs_get_radars: Calls init radar table functions. 1024 * @dfs_process_phyerr: Process phyerr. 1025 * @dfs_destroy_object: Destroys the DFS object. 1026 * @dfs_radar_enable: Enables the radar. 1027 * @dfs_control: Used to process ioctls related to DFS. 1028 * @dfs_is_precac_timer_running: Check whether precac timer is running. 1029 * @dfs_find_vht80_chan_for_precac: Find VHT80 channel for precac. 1030 * @dfs_cancel_precac_timer: Cancel the precac timer. 1031 * @dfs_override_precac_timeout: Override the default precac timeout. 1032 * @dfs_set_precac_enable: Set precac enable flag. 1033 * @dfs_get_precac_enable: Get precac enable flag. 1034 * @dfs_get_override_precac_timeout: Get precac timeout. 1035 * @dfs_set_current_channel: Set DFS current channel. 1036 * @dfs_process_radar_ind: Process radar found indication. 1037 * @dfs_dfs_cac_complete_ind: Process cac complete indication. 1038 * @dfs_stop: Clear dfs timers. 1039 * @dfs_process_phyerr_filter_offload:Process radar event. 1040 * @dfs_is_phyerr_filter_offload: Check whether phyerr filter is offload. 1041 */ 1042 struct wlan_lmac_if_dfs_rx_ops { 1043 QDF_STATUS (*dfs_get_radars)(struct wlan_objmgr_pdev *pdev); 1044 QDF_STATUS (*dfs_process_phyerr)(struct wlan_objmgr_pdev *pdev, 1045 void *buf, 1046 uint16_t datalen, 1047 uint8_t r_rssi, 1048 uint8_t r_ext_rssi, 1049 uint32_t r_rs_tstamp, 1050 uint64_t r_fulltsf); 1051 QDF_STATUS (*dfs_destroy_object)(struct wlan_objmgr_pdev *pdev); 1052 QDF_STATUS (*dfs_radar_enable)(struct wlan_objmgr_pdev *pdev, 1053 int no_cac, 1054 uint32_t opmode); 1055 QDF_STATUS (*dfs_control)(struct wlan_objmgr_pdev *pdev, 1056 u_int id, 1057 void *indata, 1058 uint32_t insize, 1059 void *outdata, 1060 uint32_t *outsize, 1061 int *error); 1062 QDF_STATUS (*dfs_is_precac_timer_running)(struct wlan_objmgr_pdev *pdev, 1063 bool *is_precac_timer_running); 1064 QDF_STATUS (*dfs_find_vht80_chan_for_precac)( 1065 struct wlan_objmgr_pdev *pdev, 1066 uint32_t chan_mode, 1067 uint8_t ch_freq_seg1, 1068 uint32_t *cfreq1, 1069 uint32_t *cfreq2, 1070 uint32_t *phy_mode, 1071 bool *dfs_set_cfreq2, 1072 bool *set_agile); 1073 QDF_STATUS (*dfs_cancel_precac_timer)(struct wlan_objmgr_pdev *pdev); 1074 QDF_STATUS (*dfs_override_precac_timeout)( 1075 struct wlan_objmgr_pdev *pdev, 1076 int precac_timeout); 1077 QDF_STATUS (*dfs_set_precac_enable)(struct wlan_objmgr_pdev *pdev, 1078 uint32_t value); 1079 QDF_STATUS (*dfs_get_precac_enable)(struct wlan_objmgr_pdev *pdev, 1080 int *buff); 1081 QDF_STATUS (*dfs_get_override_precac_timeout)( 1082 struct wlan_objmgr_pdev *pdev, 1083 int *precac_timeout); 1084 QDF_STATUS (*dfs_set_current_channel)(struct wlan_objmgr_pdev *pdev, 1085 uint16_t ic_freq, 1086 uint64_t ic_flags, 1087 uint16_t ic_flagext, 1088 uint8_t ic_ieee, 1089 uint8_t ic_vhtop_ch_freq_seg1, 1090 uint8_t ic_vhtop_ch_freq_seg2); 1091 #ifdef DFS_COMPONENT_ENABLE 1092 QDF_STATUS (*dfs_process_radar_ind)(struct wlan_objmgr_pdev *pdev, 1093 struct radar_found_info *radar_found); 1094 QDF_STATUS (*dfs_dfs_cac_complete_ind)(struct wlan_objmgr_pdev *pdev, 1095 uint32_t vdev_id); 1096 #endif 1097 QDF_STATUS (*dfs_stop)(struct wlan_objmgr_pdev *pdev); 1098 QDF_STATUS (*dfs_process_phyerr_filter_offload)( 1099 struct wlan_objmgr_pdev *pdev, 1100 struct radar_event_info *wlan_radar_info); 1101 QDF_STATUS (*dfs_is_phyerr_filter_offload)( 1102 struct wlan_objmgr_psoc *psoc, 1103 bool *is_phyerr_filter_offload); 1104 }; 1105 1106 struct wlan_lmac_if_mlme_rx_ops { 1107 1108 void (*wlan_mlme_scan_start)(struct wlan_objmgr_pdev *pdev); 1109 void (*wlan_mlme_register_pm_event_handler)( 1110 struct wlan_objmgr_pdev *pdev, 1111 uint8_t vdev_id); 1112 void (*wlan_mlme_unregister_pm_event_handler)( 1113 struct wlan_objmgr_pdev *pdev, 1114 uint8_t vdev_id); 1115 QDF_STATUS (*wlan_mlme_register_vdev_event_handler)( 1116 struct wlan_objmgr_pdev *pdev, 1117 uint8_t vdev_id); 1118 QDF_STATUS (*wlan_mlme_unregister_vdev_event_handler)( 1119 struct wlan_objmgr_pdev *pdev, 1120 uint8_t vdev_id); 1121 int (*wlan_mlme_send_probe_request)(struct wlan_objmgr_pdev *pdev, 1122 uint8_t vdev_id, 1123 u_int8_t *destination, 1124 u_int8_t *bssid, 1125 u_int8_t *ssid, 1126 u_int32_t ssidlen, 1127 u_int8_t *ie, 1128 size_t len); 1129 int (*wlan_mlme_resmgr_request_bsschan)(struct wlan_objmgr_pdev *pdev); 1130 int (*wlan_mlme_resmgr_request_offchan)(struct wlan_objmgr_pdev *pdev, 1131 u_int32_t freq, 1132 u_int32_t flags, 1133 u_int32_t estimated_offchannel_time); 1134 int (*wlan_mlme_resmgr_active)(struct wlan_objmgr_pdev *pdev); 1135 int (*wlan_mlme_get_cw_inter_found)(struct wlan_objmgr_pdev *pdev); 1136 int (*wlan_mlme_set_home_channel)(struct wlan_objmgr_pdev *pdev, 1137 uint8_t vdev_id); 1138 int (*wlan_mlme_set_channel)(struct wlan_objmgr_pdev *pdev, 1139 u_int32_t freq, 1140 u_int32_t flags); 1141 void (*wlan_mlme_start_record_stats)(struct wlan_objmgr_pdev *pdev); 1142 void (*wlan_mlme_end_record_stats)(struct wlan_objmgr_pdev *pdev); 1143 int (*wlan_mlme_get_enh_rpt_ind)(struct wlan_objmgr_pdev *pdev); 1144 int (*wlan_mlme_pause)(struct wlan_objmgr_pdev *pdev); 1145 void (*wlan_mlme_unpause)(struct wlan_objmgr_pdev *pdev); 1146 int (*wlan_mlme_vdev_pause_control)(struct wlan_objmgr_pdev *pdev, 1147 uint8_t vdev_id); 1148 int (*wlan_mlme_sta_power_pause)( 1149 struct wlan_objmgr_pdev *pdev, 1150 uint8_t vdev_id, 1151 u_int32_t timeout); 1152 int (*wlan_mlme_sta_power_unpause)(struct wlan_objmgr_pdev *pdev, 1153 uint8_t vdev_id); 1154 int (*wlan_mlme_set_vdev_sleep)(struct wlan_objmgr_pdev *pdev, 1155 uint8_t vdev_id); 1156 int (*wlan_mlme_set_vdev_wakeup)(struct wlan_objmgr_pdev *pdev, 1157 uint8_t vdev_id); 1158 qdf_time_t (*wlan_mlme_get_traffic_indication_timestamp)( 1159 struct wlan_objmgr_pdev *pdev); 1160 int (*wlan_mlme_get_acs_in_progress)(struct wlan_objmgr_pdev *pdev, 1161 uint8_t vdev_id); 1162 void (*wlan_mlme_end_scan)(struct wlan_objmgr_pdev *pdev); 1163 }; 1164 1165 #ifdef WLAN_SUPPORT_GREEN_AP 1166 struct wlan_lmac_if_green_ap_rx_ops { 1167 bool (*is_ps_enabled)(struct wlan_objmgr_pdev *pdev); 1168 bool (*is_dbg_print_enabled)(struct wlan_objmgr_pdev *pdev); 1169 QDF_STATUS (*ps_get)(struct wlan_objmgr_pdev *pdev, uint8_t *value); 1170 QDF_STATUS (*ps_set)(struct wlan_objmgr_pdev *pdev, uint8_t value); 1171 void (*suspend_handle)(struct wlan_objmgr_pdev *pdev); 1172 }; 1173 #endif 1174 1175 /** 1176 * struct wlan_lmac_if_rx_ops - south bound rx function pointers 1177 * @mgmt_txrx_tx_ops: mgmt txrx rx ops 1178 * @scan: scan rx ops 1179 * @dfs_rx_ops: dfs rx ops. 1180 * @cp_stats_rx_ops: cp stats rx ops 1181 * 1182 * Callback function tabled to be registered with lmac/wmi. 1183 * lmac will use the functional table to send events/frames to umac 1184 */ 1185 struct wlan_lmac_if_rx_ops { 1186 /* Components to declare function pointers required by the module 1187 * in component specific structure. 1188 * The component specific ops structure can be declared in this file 1189 * only 1190 */ 1191 struct wlan_lmac_if_mgmt_txrx_rx_ops mgmt_txrx_rx_ops; 1192 struct wlan_lmac_if_scan_rx_ops scan; 1193 #ifdef CONVERGED_P2P_ENABLE 1194 struct wlan_lmac_if_p2p_rx_ops p2p; 1195 #endif 1196 1197 #ifdef WLAN_ATF_ENABLE 1198 struct wlan_lmac_if_atf_rx_ops atf_rx_ops; 1199 #endif 1200 #ifdef QCA_SUPPORT_CP_STATS 1201 struct wlan_lmac_if_cp_stats_rx_ops cp_stats_rx_ops; 1202 #endif 1203 #ifdef WLAN_SA_API_ENABLE 1204 struct wlan_lmac_if_sa_api_rx_ops sa_api_rx_ops; 1205 #endif 1206 1207 #ifdef WLAN_CONV_SPECTRAL_ENABLE 1208 struct wlan_lmac_if_sptrl_rx_ops sptrl_rx_ops; 1209 #endif 1210 1211 #ifdef WLAN_CONV_CRYPTO_SUPPORTED 1212 struct wlan_lmac_if_crypto_rx_ops crypto_rx_ops; 1213 #endif 1214 #ifdef WIFI_POS_CONVERGED 1215 struct wlan_lmac_if_wifi_pos_rx_ops wifi_pos_rx_ops; 1216 #endif 1217 #ifdef WLAN_FEATURE_NAN_CONVERGENCE 1218 struct wlan_lmac_if_nan_rx_ops nan_rx_ops; 1219 #endif 1220 struct wlan_lmac_if_reg_rx_ops reg_rx_ops; 1221 struct wlan_lmac_if_dfs_rx_ops dfs_rx_ops; 1222 #ifdef CONVERGED_TDLS_ENABLE 1223 struct wlan_lmac_if_tdls_rx_ops tdls_rx_ops; 1224 #endif 1225 1226 #ifdef WLAN_SUPPORT_FILS 1227 struct wlan_lmac_if_fd_rx_ops fd_rx_ops; 1228 #endif 1229 1230 struct wlan_lmac_if_mlme_rx_ops mops; 1231 1232 #ifdef WLAN_SUPPORT_GREEN_AP 1233 struct wlan_lmac_if_green_ap_rx_ops green_ap_rx_ops; 1234 #endif 1235 1236 struct wlan_lmac_if_ftm_rx_ops ftm_rx_ops; 1237 }; 1238 1239 /* Function pointer to call legacy tx_ops registration in OL/WMA. 1240 */ 1241 extern QDF_STATUS (*wlan_lmac_if_umac_tx_ops_register) 1242 (struct wlan_lmac_if_tx_ops *tx_ops); 1243 #endif /* _WLAN_LMAC_IF_DEF_H_ */ 1244