1 /* 2 * Copyright (c) 2016-2019 The Linux Foundation. All rights reserved. 3 * 4 * 5 * Permission to use, copy, modify, and/or distribute this software for 6 * any purpose with or without fee is hereby granted, provided that the 7 * above copyright notice and this permission notice appear in all 8 * copies. 9 * 10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL 11 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED 12 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE 13 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL 14 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR 15 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 16 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 17 * PERFORMANCE OF THIS SOFTWARE. 18 */ 19 20 #include "qdf_mem.h" 21 #include <qdf_module.h> 22 #include "wlan_lmac_if_def.h" 23 #include "wlan_lmac_if_api.h" 24 #include "wlan_mgmt_txrx_tgt_api.h" 25 #include "wlan_scan_tgt_api.h" 26 #include <wlan_reg_services_api.h> 27 #include <wlan_reg_ucfg_api.h> 28 #ifdef WLAN_ATF_ENABLE 29 #include "wlan_atf_tgt_api.h" 30 #endif 31 #ifdef WLAN_SA_API_ENABLE 32 #include "wlan_sa_api_tgt_api.h" 33 #endif 34 #ifdef WIFI_POS_CONVERGED 35 #include "target_if_wifi_pos.h" 36 #endif /* WIFI_POS_CONVERGED */ 37 #include "wlan_reg_tgt_api.h" 38 #ifdef CONVERGED_P2P_ENABLE 39 #include "wlan_p2p_tgt_api.h" 40 #endif 41 #ifdef FEATURE_WLAN_TDLS 42 #include "wlan_tdls_tgt_api.h" 43 #endif 44 45 #ifdef WLAN_CONV_CRYPTO_SUPPORTED 46 #include "wlan_crypto_global_api.h" 47 #endif 48 #ifdef DFS_COMPONENT_ENABLE 49 #include <wlan_dfs_tgt_api.h> 50 #include <wlan_objmgr_vdev_obj.h> 51 #include <wlan_dfs_utils_api.h> 52 #endif 53 54 #ifdef WLAN_SUPPORT_GREEN_AP 55 #include <wlan_green_ap_api.h> 56 #include <wlan_green_ap_ucfg_api.h> 57 #endif 58 #include <wlan_ftm_ucfg_api.h> 59 60 #ifdef WLAN_SUPPORT_FILS 61 #include <wlan_fd_tgt_api.h> 62 #endif 63 64 #ifdef QCA_SUPPORT_CP_STATS 65 #include <wlan_cp_stats_tgt_api.h> 66 #endif /* QCA_SUPPORT_CP_STATS */ 67 68 #ifdef CMN_VDEV_MGR_TGT_IF_ENABLE 69 #include <wlan_vdev_mgr_tgt_if_rx_api.h> 70 #endif 71 72 #ifdef WLAN_CFR_ENABLE 73 #include "wlan_cfr_tgt_api.h" 74 #endif 75 76 /* Function pointer for OL/WMA specific UMAC tx_ops 77 * registration. 78 */ 79 QDF_STATUS (*wlan_lmac_if_umac_tx_ops_register) 80 (struct wlan_lmac_if_tx_ops *tx_ops); 81 qdf_export_symbol(wlan_lmac_if_umac_tx_ops_register); 82 83 #ifdef CMN_VDEV_MGR_TGT_IF_ENABLE 84 static void 85 tgt_vdev_mgr_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops) 86 { 87 tgt_vdev_mgr_register_rx_ops(rx_ops); 88 } 89 #else 90 static void 91 tgt_vdev_mgr_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops) 92 { 93 } 94 #endif 95 96 #ifdef QCA_SUPPORT_CP_STATS 97 /** 98 * wlan_lmac_if_cp_stats_rx_ops_register() - API to register cp stats Rx Ops 99 * @rx_ops: pointer to lmac rx ops 100 * 101 * This API will be used to register function pointers for FW events 102 * 103 * Return: void 104 */ 105 static void 106 wlan_lmac_if_cp_stats_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops) 107 { 108 tgt_cp_stats_register_rx_ops(rx_ops); 109 } 110 #else 111 static void 112 wlan_lmac_if_cp_stats_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops) 113 { 114 } 115 #endif /* QCA_SUPPORT_CP_STATS */ 116 117 #ifdef WLAN_ATF_ENABLE 118 /** 119 * wlan_lmac_if_atf_rx_ops_register() - Function to register ATF RX ops. 120 */ 121 static void 122 wlan_lmac_if_atf_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops) 123 { 124 struct wlan_lmac_if_atf_rx_ops *atf_rx_ops = &rx_ops->atf_rx_ops; 125 126 /* ATF rx ops */ 127 atf_rx_ops->atf_get_atf_commit = tgt_atf_get_atf_commit; 128 atf_rx_ops->atf_get_fmcap = tgt_atf_get_fmcap; 129 atf_rx_ops->atf_get_obss_scale = tgt_atf_get_obss_scale; 130 atf_rx_ops->atf_get_mode = tgt_atf_get_mode; 131 atf_rx_ops->atf_get_msdu_desc = tgt_atf_get_msdu_desc; 132 atf_rx_ops->atf_get_max_vdevs = tgt_atf_get_max_vdevs; 133 atf_rx_ops->atf_get_peers = tgt_atf_get_peers; 134 atf_rx_ops->atf_get_tput_based = tgt_atf_get_tput_based; 135 atf_rx_ops->atf_get_logging = tgt_atf_get_logging; 136 atf_rx_ops->atf_update_buf_held = tgt_atf_update_buf_held; 137 atf_rx_ops->atf_get_ssidgroup = tgt_atf_get_ssidgroup; 138 atf_rx_ops->atf_get_vdev_ac_blk_cnt = tgt_atf_get_vdev_ac_blk_cnt; 139 atf_rx_ops->atf_get_peer_blk_txbitmap = tgt_atf_get_peer_blk_txbitmap; 140 atf_rx_ops->atf_get_vdev_blk_txtraffic = tgt_atf_get_vdev_blk_txtraffic; 141 atf_rx_ops->atf_get_sched = tgt_atf_get_sched; 142 atf_rx_ops->atf_get_tx_tokens = tgt_atf_get_tx_tokens; 143 atf_rx_ops->atf_account_subgroup_txtokens = 144 tgt_atf_account_subgroup_txtokens; 145 atf_rx_ops->atf_adjust_subgroup_txtokens = 146 tgt_atf_adjust_subgroup_txtokens; 147 atf_rx_ops->atf_get_subgroup_airtime = tgt_atf_get_subgroup_airtime; 148 atf_rx_ops->atf_subgroup_free_buf = tgt_atf_subgroup_free_buf; 149 atf_rx_ops->atf_update_subgroup_tidstate = 150 tgt_atf_update_subgroup_tidstate; 151 atf_rx_ops->atf_buf_distribute = tgt_atf_buf_distribute; 152 atf_rx_ops->atf_get_shadow_alloted_tx_tokens = 153 tgt_atf_get_shadow_alloted_tx_tokens; 154 atf_rx_ops->atf_get_txtokens_common = tgt_atf_get_txtokens_common; 155 atf_rx_ops->atf_get_peer_stats = tgt_atf_get_peer_stats; 156 atf_rx_ops->atf_get_token_allocated = tgt_atf_get_token_allocated; 157 atf_rx_ops->atf_get_token_utilized = tgt_atf_get_token_utilized; 158 159 atf_rx_ops->atf_set_sched = tgt_atf_set_sched; 160 atf_rx_ops->atf_set_fmcap = tgt_atf_set_fmcap; 161 atf_rx_ops->atf_set_obss_scale = tgt_atf_set_obss_scale; 162 atf_rx_ops->atf_set_msdu_desc = tgt_atf_set_msdu_desc; 163 atf_rx_ops->atf_set_max_vdevs = tgt_atf_set_max_vdevs; 164 atf_rx_ops->atf_set_peers = tgt_atf_set_peers; 165 atf_rx_ops->atf_set_peer_stats = tgt_atf_set_peer_stats; 166 atf_rx_ops->atf_set_vdev_blk_txtraffic = tgt_atf_set_vdev_blk_txtraffic; 167 atf_rx_ops->atf_peer_blk_txtraffic = tgt_atf_peer_blk_txtraffic; 168 atf_rx_ops->atf_peer_unblk_txtraffic = tgt_atf_peer_unblk_txtraffic; 169 atf_rx_ops->atf_set_token_allocated = tgt_atf_set_token_allocated; 170 atf_rx_ops->atf_set_token_utilized = tgt_atf_set_token_utilized; 171 } 172 #else 173 static void 174 wlan_lmac_if_atf_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops) 175 { 176 } 177 #endif 178 179 #ifdef WLAN_SUPPORT_FILS 180 static void 181 wlan_lmac_if_fd_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops) 182 { 183 struct wlan_lmac_if_fd_rx_ops *fd_rx_ops = &rx_ops->fd_rx_ops; 184 185 fd_rx_ops->fd_is_fils_enable = tgt_fd_is_fils_enable; 186 fd_rx_ops->fd_alloc = tgt_fd_alloc; 187 fd_rx_ops->fd_stop = tgt_fd_stop; 188 fd_rx_ops->fd_free = tgt_fd_free; 189 fd_rx_ops->fd_get_valid_fd_period = tgt_fd_get_valid_fd_period; 190 fd_rx_ops->fd_swfda_handler = tgt_fd_swfda_handler; 191 } 192 #else 193 static void 194 wlan_lmac_if_fd_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops) 195 { 196 } 197 #endif 198 199 #ifdef WLAN_SA_API_ENABLE 200 /** 201 * wlan_lmac_if_sa_api_rx_ops_register() - Function to register SA_API RX ops. 202 */ 203 static void 204 wlan_lmac_if_sa_api_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops) 205 { 206 struct wlan_lmac_if_sa_api_rx_ops *sa_api_rx_ops = &rx_ops->sa_api_rx_ops; 207 208 /* SA API rx ops */ 209 sa_api_rx_ops->sa_api_get_sa_supported = tgt_sa_api_get_sa_supported; 210 sa_api_rx_ops->sa_api_get_validate_sw = tgt_sa_api_get_validate_sw; 211 sa_api_rx_ops->sa_api_enable_sa = tgt_sa_api_enable_sa; 212 sa_api_rx_ops->sa_api_get_sa_enable = tgt_sa_api_get_sa_enable; 213 214 sa_api_rx_ops->sa_api_peer_assoc_hanldler = tgt_sa_api_peer_assoc_hanldler; 215 sa_api_rx_ops->sa_api_update_tx_feedback = tgt_sa_api_update_tx_feedback; 216 sa_api_rx_ops->sa_api_update_rx_feedback = tgt_sa_api_update_rx_feedback; 217 218 sa_api_rx_ops->sa_api_ucfg_set_param = tgt_sa_api_ucfg_set_param; 219 sa_api_rx_ops->sa_api_ucfg_get_param = tgt_sa_api_ucfg_get_param; 220 221 sa_api_rx_ops->sa_api_is_tx_feedback_enabled = tgt_sa_api_is_tx_feedback_enabled; 222 sa_api_rx_ops->sa_api_is_rx_feedback_enabled = tgt_sa_api_is_rx_feedback_enabled; 223 224 sa_api_rx_ops->sa_api_convert_rate_2g = tgt_sa_api_convert_rate_2g; 225 sa_api_rx_ops->sa_api_convert_rate_5g = tgt_sa_api_convert_rate_5g; 226 sa_api_rx_ops->sa_api_get_sa_mode = tgt_sa_api_get_sa_mode; 227 228 sa_api_rx_ops->sa_api_get_beacon_txantenna = tgt_sa_api_get_beacon_txantenna; 229 sa_api_rx_ops->sa_api_cwm_action = tgt_sa_api_cwm_action; 230 } 231 #else 232 static void 233 wlan_lmac_if_sa_api_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops) 234 { 235 } 236 #endif 237 238 #ifdef WLAN_CFR_ENABLE 239 /** 240 * wlan_lmac_if_cfr_rx_ops_register() - Function to register CFR RX ops 241 */ 242 static void 243 wlan_lmac_if_cfr_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops) 244 { 245 struct wlan_lmac_if_cfr_rx_ops *cfr_rx_ops = &rx_ops->cfr_rx_ops; 246 247 /* CFR rx ops */ 248 cfr_rx_ops->cfr_support_set = tgt_cfr_support_set; 249 cfr_rx_ops->cfr_info_send = tgt_cfr_info_send; 250 } 251 #else 252 static void 253 wlan_lmac_if_cfr_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops) 254 { 255 } 256 #endif 257 258 #ifdef WLAN_CONV_CRYPTO_SUPPORTED 259 static void 260 wlan_lmac_if_crypto_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops) 261 { 262 wlan_crypto_register_crypto_rx_ops(&rx_ops->crypto_rx_ops); 263 } 264 #else 265 static void 266 wlan_lmac_if_crypto_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops) 267 { 268 } 269 #endif 270 271 #ifdef WIFI_POS_CONVERGED 272 static void wlan_lmac_if_umac_rx_ops_register_wifi_pos( 273 struct wlan_lmac_if_rx_ops *rx_ops) 274 { 275 target_if_wifi_pos_register_rx_ops(rx_ops); 276 } 277 #else 278 static void wlan_lmac_if_umac_rx_ops_register_wifi_pos( 279 struct wlan_lmac_if_rx_ops *rx_ops) 280 { 281 } 282 #endif /* WIFI_POS_CONVERGED */ 283 284 static void wlan_lmac_if_umac_reg_rx_ops_register( 285 struct wlan_lmac_if_rx_ops *rx_ops) 286 { 287 rx_ops->reg_rx_ops.master_list_handler = 288 tgt_reg_process_master_chan_list; 289 290 rx_ops->reg_rx_ops.reg_11d_new_cc_handler = 291 tgt_reg_process_11d_new_country; 292 293 rx_ops->reg_rx_ops.reg_set_regdb_offloaded = 294 tgt_reg_set_regdb_offloaded; 295 296 rx_ops->reg_rx_ops.reg_set_11d_offloaded = 297 tgt_reg_set_11d_offloaded; 298 299 rx_ops->reg_rx_ops.get_dfs_region = 300 wlan_reg_get_dfs_region; 301 302 rx_ops->reg_rx_ops.reg_ch_avoid_event_handler = 303 tgt_reg_process_ch_avoid_event; 304 305 rx_ops->reg_rx_ops.reg_freq_to_chan = 306 wlan_reg_freq_to_chan; 307 308 rx_ops->reg_rx_ops.reg_set_chan_144 = 309 ucfg_reg_modify_chan_144; 310 311 rx_ops->reg_rx_ops.reg_get_chan_144 = 312 ucfg_reg_get_en_chan_144; 313 314 rx_ops->reg_rx_ops.reg_program_default_cc = 315 ucfg_reg_program_default_cc; 316 317 rx_ops->reg_rx_ops.reg_get_current_regdomain = 318 wlan_reg_get_curr_regdomain; 319 } 320 321 #ifdef CONVERGED_P2P_ENABLE 322 #ifdef FEATURE_P2P_LISTEN_OFFLOAD 323 static void wlan_lmac_if_umac_rx_ops_register_p2p( 324 struct wlan_lmac_if_rx_ops *rx_ops) 325 { 326 rx_ops->p2p.lo_ev_handler = tgt_p2p_lo_event_cb; 327 rx_ops->p2p.noa_ev_handler = tgt_p2p_noa_event_cb; 328 rx_ops->p2p.add_mac_addr_filter_evt_handler = 329 tgt_p2p_add_mac_addr_status_event_cb; 330 } 331 #else 332 static void wlan_lmac_if_umac_rx_ops_register_p2p( 333 struct wlan_lmac_if_rx_ops *rx_ops) 334 { 335 rx_ops->p2p.noa_ev_handler = tgt_p2p_noa_event_cb; 336 rx_ops->p2p.add_mac_addr_filter_evt_handler = 337 tgt_p2p_add_mac_addr_status_event_cb; 338 } 339 #endif 340 #else 341 static void wlan_lmac_if_umac_rx_ops_register_p2p( 342 struct wlan_lmac_if_rx_ops *rx_ops) 343 { 344 } 345 #endif 346 347 #ifdef DFS_COMPONENT_ENABLE 348 #ifdef WLAN_DFS_PRECAC_AUTO_CHAN_SUPPORT 349 static inline void 350 register_precac_auto_chan_rx_ops(struct wlan_lmac_if_dfs_rx_ops *rx_ops) 351 { 352 if (!rx_ops) 353 return; 354 rx_ops->dfs_set_precac_intermediate_chan = 355 ucfg_dfs_set_precac_intermediate_chan; 356 rx_ops->dfs_get_precac_intermediate_chan = 357 ucfg_dfs_get_precac_intermediate_chan; 358 rx_ops->dfs_get_precac_chan_state = ucfg_dfs_get_precac_chan_state; 359 } 360 #else 361 static inline void 362 register_precac_auto_chan_rx_ops(struct wlan_lmac_if_dfs_rx_ops *rx_ops) 363 { 364 } 365 #endif 366 367 static QDF_STATUS 368 wlan_lmac_if_umac_dfs_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops) 369 { 370 struct wlan_lmac_if_dfs_rx_ops *dfs_rx_ops; 371 372 dfs_rx_ops = &rx_ops->dfs_rx_ops; 373 374 dfs_rx_ops->dfs_get_radars = tgt_dfs_get_radars; 375 dfs_rx_ops->dfs_process_phyerr = tgt_dfs_process_phyerr; 376 dfs_rx_ops->dfs_destroy_object = tgt_dfs_destroy_object; 377 dfs_rx_ops->dfs_radar_enable = tgt_dfs_radar_enable; 378 dfs_rx_ops->dfs_is_radar_enabled = tgt_dfs_is_radar_enabled; 379 dfs_rx_ops->dfs_control = tgt_dfs_control; 380 dfs_rx_ops->dfs_is_precac_timer_running = 381 tgt_dfs_is_precac_timer_running; 382 dfs_rx_ops->dfs_find_vht80_chan_for_precac = 383 tgt_dfs_find_vht80_chan_for_precac; 384 dfs_rx_ops->dfs_agile_precac_start = 385 tgt_dfs_agile_precac_start; 386 dfs_rx_ops->dfs_set_agile_precac_state = 387 tgt_dfs_set_agile_precac_state; 388 dfs_rx_ops->dfs_start_precac_timer = utils_dfs_start_precac_timer; 389 dfs_rx_ops->dfs_cancel_precac_timer = utils_dfs_cancel_precac_timer; 390 dfs_rx_ops->dfs_override_precac_timeout = 391 ucfg_dfs_override_precac_timeout; 392 dfs_rx_ops->dfs_set_precac_enable = ucfg_dfs_set_precac_enable; 393 dfs_rx_ops->dfs_get_precac_enable = ucfg_dfs_get_precac_enable; 394 dfs_rx_ops->dfs_get_override_precac_timeout = 395 ucfg_dfs_get_override_precac_timeout; 396 dfs_rx_ops->dfs_set_current_channel = tgt_dfs_set_current_channel; 397 dfs_rx_ops->dfs_process_radar_ind = tgt_dfs_process_radar_ind; 398 dfs_rx_ops->dfs_dfs_cac_complete_ind = tgt_dfs_cac_complete; 399 dfs_rx_ops->dfs_dfs_ocac_complete_ind = tgt_dfs_ocac_complete; 400 dfs_rx_ops->dfs_stop = tgt_dfs_stop; 401 dfs_rx_ops->dfs_enable_stadfs = tgt_dfs_enable_stadfs; 402 dfs_rx_ops->dfs_is_stadfs_enabled = tgt_dfs_is_stadfs_enabled; 403 dfs_rx_ops->dfs_process_phyerr_filter_offload = 404 tgt_dfs_process_phyerr_filter_offload; 405 dfs_rx_ops->dfs_is_phyerr_filter_offload = 406 tgt_dfs_is_phyerr_filter_offload; 407 dfs_rx_ops->dfs_action_on_status = tgt_dfs_action_on_status_from_fw; 408 dfs_rx_ops->dfs_override_status_timeout = 409 ucfg_dfs_set_override_status_timeout; 410 dfs_rx_ops->dfs_get_override_status_timeout = 411 ucfg_dfs_get_override_status_timeout; 412 dfs_rx_ops->dfs_reset_spoof_test = 413 tgt_dfs_reset_spoof_test; 414 dfs_rx_ops->dfs_is_disable_radar_marking_set = 415 utils_dfs_get_disable_radar_marking; 416 dfs_rx_ops->dfs_set_nol_subchannel_marking = 417 ucfg_dfs_set_nol_subchannel_marking; 418 dfs_rx_ops->dfs_get_nol_subchannel_marking = 419 ucfg_dfs_get_nol_subchannel_marking; 420 dfs_rx_ops->dfs_set_bw_reduction = 421 utils_dfs_bw_reduce; 422 dfs_rx_ops->dfs_is_bw_reduction_needed = 423 utils_dfs_is_bw_reduce; 424 425 register_precac_auto_chan_rx_ops(dfs_rx_ops); 426 427 return QDF_STATUS_SUCCESS; 428 } 429 #else 430 static QDF_STATUS 431 wlan_lmac_if_umac_dfs_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops) 432 { 433 return QDF_STATUS_SUCCESS; 434 } 435 #endif 436 437 #ifdef FEATURE_WLAN_TDLS 438 static QDF_STATUS 439 wlan_lmac_if_umac_tdls_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops) 440 { 441 rx_ops->tdls_rx_ops.tdls_ev_handler = tgt_tdls_event_handler; 442 443 return QDF_STATUS_SUCCESS; 444 } 445 #else 446 static QDF_STATUS 447 wlan_lmac_if_umac_tdls_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops) 448 { 449 return QDF_STATUS_SUCCESS; 450 } 451 #endif 452 453 #ifdef WLAN_SUPPORT_GREEN_AP 454 static QDF_STATUS 455 wlan_lmac_if_umac_green_ap_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops) 456 { 457 rx_ops->green_ap_rx_ops.is_ps_enabled = wlan_green_ap_is_ps_enabled; 458 rx_ops->green_ap_rx_ops.is_dbg_print_enabled = 459 ucfg_green_ap_get_debug_prints; 460 rx_ops->green_ap_rx_ops.ps_set = ucfg_green_ap_set_ps_config; 461 rx_ops->green_ap_rx_ops.ps_get = ucfg_green_ap_get_ps_config; 462 rx_ops->green_ap_rx_ops.suspend_handle = wlan_green_ap_suspend_handle; 463 464 return QDF_STATUS_SUCCESS; 465 } 466 #else 467 static QDF_STATUS 468 wlan_lmac_if_umac_green_ap_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops) 469 { 470 return QDF_STATUS_SUCCESS; 471 } 472 #endif 473 474 #ifdef QCA_WIFI_FTM 475 static QDF_STATUS 476 wlan_lmac_if_umac_ftm_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops) 477 { 478 struct wlan_lmac_if_ftm_rx_ops *ftm_rx_ops; 479 480 ftm_rx_ops = &rx_ops->ftm_rx_ops; 481 482 ftm_rx_ops->ftm_ev_handler = wlan_ftm_process_utf_event; 483 484 return QDF_STATUS_SUCCESS; 485 } 486 #else 487 static QDF_STATUS 488 wlan_lmac_if_umac_ftm_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops) 489 { 490 return QDF_STATUS_SUCCESS; 491 } 492 #endif 493 /** 494 * wlan_lmac_if_umac_rx_ops_register() - UMAC rx handler register 495 * @rx_ops: Pointer to rx_ops structure to be populated 496 * 497 * Register umac RX callabacks which will be called by DA/OL/WMA/WMI 498 * 499 * Return: QDF_STATUS_SUCCESS - in case of success 500 */ 501 QDF_STATUS 502 wlan_lmac_if_umac_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops) 503 { 504 /* Component specific public api's to be called to register 505 * respective callbacks 506 * Ex: rx_ops->fp = function; 507 */ 508 struct wlan_lmac_if_mgmt_txrx_rx_ops *mgmt_txrx_rx_ops; 509 510 if (!rx_ops) { 511 qdf_print("%s: lmac if rx ops pointer is NULL", __func__); 512 return QDF_STATUS_E_INVAL; 513 } 514 515 /* mgmt txrx rx ops */ 516 mgmt_txrx_rx_ops = &rx_ops->mgmt_txrx_rx_ops; 517 518 mgmt_txrx_rx_ops->mgmt_tx_completion_handler = 519 tgt_mgmt_txrx_tx_completion_handler; 520 mgmt_txrx_rx_ops->mgmt_rx_frame_handler = 521 tgt_mgmt_txrx_rx_frame_handler; 522 mgmt_txrx_rx_ops->mgmt_txrx_get_nbuf_from_desc_id = 523 tgt_mgmt_txrx_get_nbuf_from_desc_id; 524 mgmt_txrx_rx_ops->mgmt_txrx_get_peer_from_desc_id = 525 tgt_mgmt_txrx_get_peer_from_desc_id; 526 mgmt_txrx_rx_ops->mgmt_txrx_get_vdev_id_from_desc_id = 527 tgt_mgmt_txrx_get_vdev_id_from_desc_id; 528 mgmt_txrx_rx_ops->mgmt_txrx_get_free_desc_pool_count = 529 tgt_mgmt_txrx_get_free_desc_pool_count; 530 531 /* scan rx ops */ 532 rx_ops->scan.scan_ev_handler = tgt_scan_event_handler; 533 rx_ops->scan.scan_set_max_active_scans = tgt_scan_set_max_active_scans; 534 535 wlan_lmac_if_atf_rx_ops_register(rx_ops); 536 537 wlan_lmac_if_cp_stats_rx_ops_register(rx_ops); 538 539 wlan_lmac_if_sa_api_rx_ops_register(rx_ops); 540 541 wlan_lmac_if_cfr_rx_ops_register(rx_ops); 542 543 wlan_lmac_if_crypto_rx_ops_register(rx_ops); 544 /* wifi_pos rx ops */ 545 wlan_lmac_if_umac_rx_ops_register_wifi_pos(rx_ops); 546 547 /* tdls rx ops */ 548 wlan_lmac_if_umac_tdls_rx_ops_register(rx_ops); 549 550 wlan_lmac_if_umac_reg_rx_ops_register(rx_ops); 551 552 /* p2p rx ops */ 553 wlan_lmac_if_umac_rx_ops_register_p2p(rx_ops); 554 555 /* DFS rx_ops */ 556 wlan_lmac_if_umac_dfs_rx_ops_register(rx_ops); 557 558 wlan_lmac_if_umac_green_ap_rx_ops_register(rx_ops); 559 560 /* FTM rx_ops */ 561 wlan_lmac_if_umac_ftm_rx_ops_register(rx_ops); 562 563 /* FILS Discovery */ 564 wlan_lmac_if_fd_rx_ops_register(rx_ops); 565 566 /* MLME rx_ops */ 567 tgt_vdev_mgr_rx_ops_register(rx_ops); 568 569 return QDF_STATUS_SUCCESS; 570 } 571 572 /** 573 * wlan_lmac_if_set_umac_txops_registration_cb() - tx registration 574 * callback assignment 575 * @dev_type: Dev type can be either Direct attach or Offload 576 * @handler: handler to be called for LMAC tx ops registration 577 * 578 * API to assign appropriate tx registration callback handler based on the 579 * device type(Offload or Direct attach) 580 * 581 * Return: QDF_STATUS_SUCCESS - in case of success 582 */ 583 QDF_STATUS wlan_lmac_if_set_umac_txops_registration_cb(QDF_STATUS (*handler) 584 (struct wlan_lmac_if_tx_ops *)) 585 { 586 wlan_lmac_if_umac_tx_ops_register = handler; 587 return QDF_STATUS_SUCCESS; 588 } 589 qdf_export_symbol(wlan_lmac_if_set_umac_txops_registration_cb); 590 591