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