1 /* 2 * Copyright (c) 2016-2020 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 #include <wlan_vdev_mgr_tgt_if_rx_api.h> 68 69 #ifdef WLAN_CFR_ENABLE 70 #include "wlan_cfr_tgt_api.h" 71 #endif 72 73 #ifdef WIFI_POS_CONVERGED 74 #include "wifi_pos_api.h" 75 #endif 76 77 /* Function pointer for OL/WMA specific UMAC tx_ops 78 * registration. 79 */ 80 QDF_STATUS (*wlan_lmac_if_umac_tx_ops_register) 81 (struct wlan_lmac_if_tx_ops *tx_ops); 82 qdf_export_symbol(wlan_lmac_if_umac_tx_ops_register); 83 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 90 #ifdef QCA_SUPPORT_CP_STATS 91 /** 92 * wlan_lmac_if_cp_stats_rx_ops_register() - API to register cp stats Rx Ops 93 * @rx_ops: pointer to lmac rx ops 94 * 95 * This API will be used to register function pointers for FW events 96 * 97 * Return: void 98 */ 99 static void 100 wlan_lmac_if_cp_stats_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops) 101 { 102 tgt_cp_stats_register_rx_ops(rx_ops); 103 } 104 #else 105 static void 106 wlan_lmac_if_cp_stats_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops) 107 { 108 } 109 #endif /* QCA_SUPPORT_CP_STATS */ 110 111 #ifdef DCS_INTERFERENCE_DETECTION 112 /** 113 * wlan_target_if_dcs_rx_ops_register() - API to register dcs Rx Ops 114 * @rx_ops: pointer to lmac rx ops 115 * 116 * This API will be used to register function pointers for FW events 117 * 118 * Return: void 119 */ 120 static void 121 wlan_target_if_dcs_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops) 122 { 123 rx_ops->dcs_rx_ops.process_dcs_event = tgt_dcs_process_event; 124 } 125 #else 126 static void 127 wlan_target_if_dcs_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops) 128 { 129 } 130 #endif /* DCS_INTERFERENCE_DETECTION */ 131 132 #ifdef WLAN_ATF_ENABLE 133 /** 134 * wlan_lmac_if_atf_rx_ops_register() - Function to register ATF RX ops. 135 */ 136 static void 137 wlan_lmac_if_atf_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops) 138 { 139 struct wlan_lmac_if_atf_rx_ops *atf_rx_ops = &rx_ops->atf_rx_ops; 140 141 /* ATF rx ops */ 142 atf_rx_ops->atf_get_atf_commit = tgt_atf_get_atf_commit; 143 atf_rx_ops->atf_get_fmcap = tgt_atf_get_fmcap; 144 atf_rx_ops->atf_get_obss_scale = tgt_atf_get_obss_scale; 145 atf_rx_ops->atf_get_mode = tgt_atf_get_mode; 146 atf_rx_ops->atf_get_msdu_desc = tgt_atf_get_msdu_desc; 147 atf_rx_ops->atf_get_max_vdevs = tgt_atf_get_max_vdevs; 148 atf_rx_ops->atf_get_peers = tgt_atf_get_peers; 149 atf_rx_ops->atf_get_tput_based = tgt_atf_get_tput_based; 150 atf_rx_ops->atf_get_logging = tgt_atf_get_logging; 151 atf_rx_ops->atf_update_buf_held = tgt_atf_update_buf_held; 152 atf_rx_ops->atf_get_ssidgroup = tgt_atf_get_ssidgroup; 153 atf_rx_ops->atf_get_vdev_ac_blk_cnt = tgt_atf_get_vdev_ac_blk_cnt; 154 atf_rx_ops->atf_get_peer_blk_txbitmap = tgt_atf_get_peer_blk_txbitmap; 155 atf_rx_ops->atf_get_vdev_blk_txtraffic = tgt_atf_get_vdev_blk_txtraffic; 156 atf_rx_ops->atf_get_sched = tgt_atf_get_sched; 157 atf_rx_ops->atf_get_tx_tokens = tgt_atf_get_tx_tokens; 158 atf_rx_ops->atf_account_subgroup_txtokens = 159 tgt_atf_account_subgroup_txtokens; 160 atf_rx_ops->atf_adjust_subgroup_txtokens = 161 tgt_atf_adjust_subgroup_txtokens; 162 atf_rx_ops->atf_get_subgroup_airtime = tgt_atf_get_subgroup_airtime; 163 atf_rx_ops->atf_subgroup_free_buf = tgt_atf_subgroup_free_buf; 164 atf_rx_ops->atf_update_subgroup_tidstate = 165 tgt_atf_update_subgroup_tidstate; 166 atf_rx_ops->atf_buf_distribute = tgt_atf_buf_distribute; 167 atf_rx_ops->atf_get_shadow_alloted_tx_tokens = 168 tgt_atf_get_shadow_alloted_tx_tokens; 169 atf_rx_ops->atf_get_txtokens_common = tgt_atf_get_txtokens_common; 170 atf_rx_ops->atf_get_peer_stats = tgt_atf_get_peer_stats; 171 atf_rx_ops->atf_get_token_allocated = tgt_atf_get_token_allocated; 172 atf_rx_ops->atf_get_token_utilized = tgt_atf_get_token_utilized; 173 174 atf_rx_ops->atf_set_sched = tgt_atf_set_sched; 175 atf_rx_ops->atf_set_fmcap = tgt_atf_set_fmcap; 176 atf_rx_ops->atf_set_obss_scale = tgt_atf_set_obss_scale; 177 atf_rx_ops->atf_set_msdu_desc = tgt_atf_set_msdu_desc; 178 atf_rx_ops->atf_set_max_vdevs = tgt_atf_set_max_vdevs; 179 atf_rx_ops->atf_set_peers = tgt_atf_set_peers; 180 atf_rx_ops->atf_set_peer_stats = tgt_atf_set_peer_stats; 181 atf_rx_ops->atf_set_vdev_blk_txtraffic = tgt_atf_set_vdev_blk_txtraffic; 182 atf_rx_ops->atf_peer_blk_txtraffic = tgt_atf_peer_blk_txtraffic; 183 atf_rx_ops->atf_peer_unblk_txtraffic = tgt_atf_peer_unblk_txtraffic; 184 atf_rx_ops->atf_set_token_allocated = tgt_atf_set_token_allocated; 185 atf_rx_ops->atf_set_token_utilized = tgt_atf_set_token_utilized; 186 atf_rx_ops->atf_process_ppdu_stats = tgt_atf_process_ppdu_stats; 187 atf_rx_ops->atf_is_stats_enabled = tgt_atf_is_stats_enabled; 188 } 189 #else 190 static void 191 wlan_lmac_if_atf_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops) 192 { 193 } 194 #endif 195 196 #ifdef WLAN_SUPPORT_FILS 197 static void 198 wlan_lmac_if_fd_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops) 199 { 200 struct wlan_lmac_if_fd_rx_ops *fd_rx_ops = &rx_ops->fd_rx_ops; 201 202 fd_rx_ops->fd_is_fils_enable = tgt_fd_is_fils_enable; 203 fd_rx_ops->fd_alloc = tgt_fd_alloc; 204 fd_rx_ops->fd_stop = tgt_fd_stop; 205 fd_rx_ops->fd_free = tgt_fd_free; 206 fd_rx_ops->fd_get_valid_fd_period = tgt_fd_get_valid_fd_period; 207 fd_rx_ops->fd_swfda_handler = tgt_fd_swfda_handler; 208 fd_rx_ops->fd_offload = tgt_fd_offload; 209 fd_rx_ops->fd_tmpl_update = tgt_fd_tmpl_update; 210 } 211 #else 212 static void 213 wlan_lmac_if_fd_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops) 214 { 215 } 216 #endif 217 218 #ifdef WLAN_SA_API_ENABLE 219 /** 220 * wlan_lmac_if_sa_api_rx_ops_register() - Function to register SA_API RX ops. 221 */ 222 static void 223 wlan_lmac_if_sa_api_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops) 224 { 225 struct wlan_lmac_if_sa_api_rx_ops *sa_api_rx_ops = &rx_ops->sa_api_rx_ops; 226 227 /* SA API rx ops */ 228 sa_api_rx_ops->sa_api_get_sa_supported = tgt_sa_api_get_sa_supported; 229 sa_api_rx_ops->sa_api_get_validate_sw = tgt_sa_api_get_validate_sw; 230 sa_api_rx_ops->sa_api_enable_sa = tgt_sa_api_enable_sa; 231 sa_api_rx_ops->sa_api_get_sa_enable = tgt_sa_api_get_sa_enable; 232 233 sa_api_rx_ops->sa_api_peer_assoc_hanldler = tgt_sa_api_peer_assoc_hanldler; 234 sa_api_rx_ops->sa_api_update_tx_feedback = tgt_sa_api_update_tx_feedback; 235 sa_api_rx_ops->sa_api_update_rx_feedback = tgt_sa_api_update_rx_feedback; 236 237 sa_api_rx_ops->sa_api_ucfg_set_param = tgt_sa_api_ucfg_set_param; 238 sa_api_rx_ops->sa_api_ucfg_get_param = tgt_sa_api_ucfg_get_param; 239 240 sa_api_rx_ops->sa_api_is_tx_feedback_enabled = tgt_sa_api_is_tx_feedback_enabled; 241 sa_api_rx_ops->sa_api_is_rx_feedback_enabled = tgt_sa_api_is_rx_feedback_enabled; 242 243 sa_api_rx_ops->sa_api_convert_rate_2g = tgt_sa_api_convert_rate_2g; 244 sa_api_rx_ops->sa_api_convert_rate_5g = tgt_sa_api_convert_rate_5g; 245 sa_api_rx_ops->sa_api_get_sa_mode = tgt_sa_api_get_sa_mode; 246 247 sa_api_rx_ops->sa_api_get_beacon_txantenna = tgt_sa_api_get_beacon_txantenna; 248 sa_api_rx_ops->sa_api_cwm_action = tgt_sa_api_cwm_action; 249 } 250 #else 251 static void 252 wlan_lmac_if_sa_api_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops) 253 { 254 } 255 #endif 256 257 #ifdef WLAN_CFR_ENABLE 258 /** 259 * wlan_lmac_if_cfr_rx_ops_register() - Function to register CFR RX ops 260 */ 261 static void 262 wlan_lmac_if_cfr_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops) 263 { 264 struct wlan_lmac_if_cfr_rx_ops *cfr_rx_ops = &rx_ops->cfr_rx_ops; 265 266 /* CFR rx ops */ 267 cfr_rx_ops->cfr_support_set = tgt_cfr_support_set; 268 cfr_rx_ops->cfr_info_send = tgt_cfr_info_send; 269 cfr_rx_ops->cfr_capture_count_support_set = 270 tgt_cfr_capture_count_support_set; 271 cfr_rx_ops->cfr_mo_marking_support_set = tgt_cfr_mo_marking_support_set; 272 } 273 #else 274 static void 275 wlan_lmac_if_cfr_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops) 276 { 277 } 278 #endif 279 280 #ifdef WLAN_CONV_CRYPTO_SUPPORTED 281 static void 282 wlan_lmac_if_crypto_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops) 283 { 284 wlan_crypto_register_crypto_rx_ops(&rx_ops->crypto_rx_ops); 285 } 286 #else 287 static void 288 wlan_lmac_if_crypto_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops) 289 { 290 } 291 #endif 292 293 #ifdef WIFI_POS_CONVERGED 294 static void wlan_lmac_if_umac_rx_ops_register_wifi_pos( 295 struct wlan_lmac_if_rx_ops *rx_ops) 296 { 297 wifi_pos_register_rx_ops(rx_ops); 298 } 299 #else 300 static void wlan_lmac_if_umac_rx_ops_register_wifi_pos( 301 struct wlan_lmac_if_rx_ops *rx_ops) 302 { 303 } 304 #endif /* WIFI_POS_CONVERGED */ 305 306 static void wlan_lmac_if_umac_reg_rx_ops_register( 307 struct wlan_lmac_if_rx_ops *rx_ops) 308 { 309 rx_ops->reg_rx_ops.master_list_handler = 310 tgt_reg_process_master_chan_list; 311 312 rx_ops->reg_rx_ops.reg_11d_new_cc_handler = 313 tgt_reg_process_11d_new_country; 314 315 rx_ops->reg_rx_ops.reg_set_regdb_offloaded = 316 tgt_reg_set_regdb_offloaded; 317 318 rx_ops->reg_rx_ops.reg_set_11d_offloaded = 319 tgt_reg_set_11d_offloaded; 320 321 rx_ops->reg_rx_ops.reg_set_6ghz_supported = 322 tgt_reg_set_6ghz_supported; 323 324 rx_ops->reg_rx_ops.reg_set_5dot9_ghz_supported = 325 tgt_reg_set_5dot9_ghz_supported; 326 327 rx_ops->reg_rx_ops.get_dfs_region = 328 wlan_reg_get_dfs_region; 329 330 rx_ops->reg_rx_ops.reg_ch_avoid_event_handler = 331 tgt_reg_process_ch_avoid_event; 332 333 rx_ops->reg_rx_ops.reg_freq_to_chan = 334 wlan_reg_freq_to_chan; 335 336 rx_ops->reg_rx_ops.reg_set_chan_144 = 337 ucfg_reg_modify_chan_144; 338 339 rx_ops->reg_rx_ops.reg_get_chan_144 = 340 ucfg_reg_get_en_chan_144; 341 342 rx_ops->reg_rx_ops.reg_program_default_cc = 343 ucfg_reg_program_default_cc; 344 345 rx_ops->reg_rx_ops.reg_get_current_regdomain = 346 wlan_reg_get_curr_regdomain; 347 348 rx_ops->reg_rx_ops.reg_enable_dfs_channels = 349 ucfg_reg_enable_dfs_channels; 350 351 rx_ops->reg_rx_ops.reg_modify_pdev_chan_range = 352 wlan_reg_modify_pdev_chan_range; 353 354 rx_ops->reg_rx_ops.reg_update_pdev_wireless_modes = 355 wlan_reg_update_pdev_wireless_modes; 356 357 rx_ops->reg_rx_ops.reg_is_range_only6g = 358 wlan_reg_is_range_only6g; 359 360 rx_ops->reg_rx_ops.reg_ignore_fw_reg_offload_ind = 361 tgt_reg_ignore_fw_reg_offload_ind; 362 363 rx_ops->reg_rx_ops.reg_disable_chan_coex = 364 wlan_reg_disable_chan_coex; 365 366 rx_ops->reg_rx_ops.reg_get_unii_5g_bitmap = 367 ucfg_reg_get_unii_5g_bitmap; 368 } 369 370 #ifdef CONVERGED_P2P_ENABLE 371 #ifdef FEATURE_P2P_LISTEN_OFFLOAD 372 static void wlan_lmac_if_umac_rx_ops_register_p2p( 373 struct wlan_lmac_if_rx_ops *rx_ops) 374 { 375 rx_ops->p2p.lo_ev_handler = tgt_p2p_lo_event_cb; 376 rx_ops->p2p.noa_ev_handler = tgt_p2p_noa_event_cb; 377 rx_ops->p2p.add_mac_addr_filter_evt_handler = 378 tgt_p2p_add_mac_addr_status_event_cb; 379 } 380 #else 381 static void wlan_lmac_if_umac_rx_ops_register_p2p( 382 struct wlan_lmac_if_rx_ops *rx_ops) 383 { 384 rx_ops->p2p.noa_ev_handler = tgt_p2p_noa_event_cb; 385 rx_ops->p2p.add_mac_addr_filter_evt_handler = 386 tgt_p2p_add_mac_addr_status_event_cb; 387 } 388 #endif 389 #else 390 static void wlan_lmac_if_umac_rx_ops_register_p2p( 391 struct wlan_lmac_if_rx_ops *rx_ops) 392 { 393 } 394 #endif 395 396 /* 397 * register_precac_auto_chan_rx_ops_ieee() - Register auto chan switch rx ops 398 * for IEEE channel based APIs. 399 * rx_ops: Pointer to wlan_lmac_if_dfs_rx_ops 400 */ 401 #ifdef DFS_COMPONENT_ENABLE 402 #if defined(WLAN_DFS_PRECAC_AUTO_CHAN_SUPPORT) && defined(CONFIG_CHAN_NUM_API) 403 static inline void 404 register_precac_auto_chan_rx_ops_ieee(struct wlan_lmac_if_dfs_rx_ops *rx_ops) 405 { 406 if (!rx_ops) 407 return; 408 rx_ops->dfs_get_precac_chan_state = ucfg_dfs_get_precac_chan_state; 409 } 410 #else 411 static inline void 412 register_precac_auto_chan_rx_ops_ieee(struct wlan_lmac_if_dfs_rx_ops *rx_ops) 413 { 414 } 415 #endif 416 #endif 417 418 /* 419 * register_precac_auto_chan_rx_ops_freq() - Register auto chan switch rx ops 420 * for frequency based channel APIs. 421 * rx_ops: Pointer to wlan_lmac_if_dfs_rx_ops 422 */ 423 #ifdef DFS_COMPONENT_ENABLE 424 #if defined(WLAN_DFS_PRECAC_AUTO_CHAN_SUPPORT) && defined(CONFIG_CHAN_FREQ_API) 425 static inline void 426 register_precac_auto_chan_rx_ops_freq(struct wlan_lmac_if_dfs_rx_ops *rx_ops) 427 { 428 if (!rx_ops) 429 return; 430 rx_ops->dfs_get_precac_chan_state_for_freq = 431 ucfg_dfs_get_precac_chan_state_for_freq; 432 } 433 #else 434 static inline void 435 register_precac_auto_chan_rx_ops_freq(struct wlan_lmac_if_dfs_rx_ops *rx_ops) 436 { 437 } 438 #endif 439 #endif 440 441 #ifdef DFS_COMPONENT_ENABLE 442 #ifdef WLAN_DFS_PRECAC_AUTO_CHAN_SUPPORT 443 static inline void 444 register_precac_auto_chan_rx_ops(struct wlan_lmac_if_dfs_rx_ops *rx_ops) 445 { 446 if (!rx_ops) 447 return; 448 rx_ops->dfs_set_precac_intermediate_chan = 449 ucfg_dfs_set_precac_intermediate_chan; 450 rx_ops->dfs_get_precac_intermediate_chan = 451 ucfg_dfs_get_precac_intermediate_chan; 452 } 453 #else 454 static inline void 455 register_precac_auto_chan_rx_ops(struct wlan_lmac_if_dfs_rx_ops *rx_ops) 456 { 457 } 458 #endif 459 460 /* 461 * register_dfs_rx_ops_for_freq() - Register DFS rx ops for frequency based 462 * channel APIs. 463 * rx_ops: Pointer to wlan_lmac_if_dfs_rx_ops. 464 */ 465 #ifdef CONFIG_CHAN_FREQ_API 466 static void register_dfs_rx_ops_for_freq(struct wlan_lmac_if_dfs_rx_ops *rx_ops) 467 { 468 if (!rx_ops) 469 return; 470 rx_ops->dfs_find_vht80_chan_for_precac_for_freq = 471 tgt_dfs_find_vht80_precac_chan_freq; 472 rx_ops->dfs_set_current_channel_for_freq = 473 tgt_dfs_set_current_channel_for_freq; 474 } 475 #endif 476 477 /* 478 * register_rcac_dfs_rx_ops() - Register DFS RX-Ops for RCAC specific 479 * APIs. 480 * @rx_ops: Pointer to wlan_lmac_if_dfs_rx_ops. 481 */ 482 #ifdef QCA_SUPPORT_ADFS_RCAC 483 static void register_rcac_dfs_rx_ops(struct wlan_lmac_if_dfs_rx_ops *rx_ops) 484 { 485 if (!rx_ops) 486 return; 487 rx_ops->dfs_set_rcac_enable = ucfg_dfs_set_rcac_enable; 488 rx_ops->dfs_get_rcac_enable = ucfg_dfs_get_rcac_enable; 489 rx_ops->dfs_set_rcac_freq = ucfg_dfs_set_rcac_freq; 490 rx_ops->dfs_get_rcac_freq = ucfg_dfs_get_rcac_freq; 491 rx_ops->dfs_is_agile_rcac_enabled = ucfg_dfs_is_agile_rcac_enabled; 492 } 493 #else 494 static inline void 495 register_rcac_dfs_rx_ops(struct wlan_lmac_if_dfs_rx_ops *rx_ops) 496 { 497 } 498 #endif 499 500 /* 501 * register_agile_dfs_rx_ops() - Register Rx-Ops for Agile Specific APIs 502 * @rx_ops: Pointer to wlan_lmac_if_dfs_rx_ops. 503 */ 504 #ifdef QCA_SUPPORT_AGILE_DFS 505 static void register_agile_dfs_rx_ops(struct wlan_lmac_if_dfs_rx_ops *rx_ops) 506 { 507 if (!rx_ops) 508 return; 509 rx_ops->dfs_agile_sm_deliver_evt = utils_dfs_agile_sm_deliver_evt; 510 } 511 #else 512 static inline void 513 register_agile_dfs_rx_ops(struct wlan_lmac_if_dfs_rx_ops *rx_ops) 514 { 515 } 516 #endif 517 518 #ifdef QCA_SUPPORT_DFS_CHAN_POSTNOL 519 /* register_dfs_chan_postnol_rx_ops() - Register DFS Rx-Ops for postNOL 520 * channel change APIs. 521 * @rx_ops: Pointer to wlan_lmac_if_dfs_rx_ops. 522 */ 523 static void 524 register_dfs_chan_postnol_rx_ops(struct wlan_lmac_if_dfs_rx_ops *rx_ops) 525 { 526 if (!rx_ops) 527 return; 528 529 rx_ops->dfs_set_postnol_freq = ucfg_dfs_set_postnol_freq; 530 rx_ops->dfs_set_postnol_mode = ucfg_dfs_set_postnol_mode; 531 rx_ops->dfs_set_postnol_cfreq2 = ucfg_dfs_set_postnol_cfreq2; 532 rx_ops->dfs_get_postnol_freq = ucfg_dfs_get_postnol_freq; 533 rx_ops->dfs_get_postnol_mode = ucfg_dfs_get_postnol_mode; 534 rx_ops->dfs_get_postnol_cfreq2 = ucfg_dfs_get_postnol_cfreq2; 535 } 536 #else 537 static inline void 538 register_dfs_chan_postnol_rx_ops(struct wlan_lmac_if_dfs_rx_ops *rx_ops) 539 { 540 } 541 #endif 542 543 static QDF_STATUS 544 wlan_lmac_if_umac_dfs_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops) 545 { 546 struct wlan_lmac_if_dfs_rx_ops *dfs_rx_ops; 547 548 dfs_rx_ops = &rx_ops->dfs_rx_ops; 549 550 dfs_rx_ops->dfs_get_radars = tgt_dfs_get_radars; 551 dfs_rx_ops->dfs_process_phyerr = tgt_dfs_process_phyerr; 552 dfs_rx_ops->dfs_destroy_object = tgt_dfs_destroy_object; 553 dfs_rx_ops->dfs_radar_enable = tgt_dfs_radar_enable; 554 dfs_rx_ops->dfs_is_radar_enabled = tgt_dfs_is_radar_enabled; 555 dfs_rx_ops->dfs_control = tgt_dfs_control; 556 dfs_rx_ops->dfs_is_precac_timer_running = 557 tgt_dfs_is_precac_timer_running; 558 dfs_rx_ops->dfs_agile_precac_start = 559 tgt_dfs_agile_precac_start; 560 dfs_rx_ops->dfs_set_agile_precac_state = 561 tgt_dfs_set_agile_precac_state; 562 dfs_rx_ops->dfs_start_precac_timer = utils_dfs_start_precac_timer; 563 dfs_rx_ops->dfs_cancel_precac_timer = utils_dfs_cancel_precac_timer; 564 dfs_rx_ops->dfs_reset_adfs_config = ucfg_dfs_reset_agile_config; 565 dfs_rx_ops->dfs_override_precac_timeout = 566 ucfg_dfs_override_precac_timeout; 567 dfs_rx_ops->dfs_set_precac_enable = ucfg_dfs_set_precac_enable; 568 dfs_rx_ops->dfs_get_legacy_precac_enable = 569 ucfg_dfs_get_legacy_precac_enable; 570 dfs_rx_ops->dfs_get_agile_precac_enable = 571 ucfg_dfs_get_agile_precac_enable; 572 dfs_rx_ops->dfs_get_override_precac_timeout = 573 ucfg_dfs_get_override_precac_timeout; 574 dfs_rx_ops->dfs_process_radar_ind = tgt_dfs_process_radar_ind; 575 dfs_rx_ops->dfs_dfs_cac_complete_ind = tgt_dfs_cac_complete; 576 dfs_rx_ops->dfs_dfs_ocac_complete_ind = tgt_dfs_ocac_complete; 577 dfs_rx_ops->dfs_stop = tgt_dfs_stop; 578 dfs_rx_ops->dfs_reinit_timers = ucfg_dfs_reinit_timers; 579 dfs_rx_ops->dfs_enable_stadfs = tgt_dfs_enable_stadfs; 580 dfs_rx_ops->dfs_is_stadfs_enabled = tgt_dfs_is_stadfs_enabled; 581 dfs_rx_ops->dfs_process_phyerr_filter_offload = 582 tgt_dfs_process_phyerr_filter_offload; 583 dfs_rx_ops->dfs_is_phyerr_filter_offload = 584 tgt_dfs_is_phyerr_filter_offload; 585 dfs_rx_ops->dfs_action_on_status = tgt_dfs_action_on_status_from_fw; 586 dfs_rx_ops->dfs_override_status_timeout = 587 ucfg_dfs_set_override_status_timeout; 588 dfs_rx_ops->dfs_get_override_status_timeout = 589 ucfg_dfs_get_override_status_timeout; 590 dfs_rx_ops->dfs_reset_spoof_test = 591 tgt_dfs_reset_spoof_test; 592 dfs_rx_ops->dfs_is_disable_radar_marking_set = 593 utils_dfs_get_disable_radar_marking; 594 dfs_rx_ops->dfs_set_nol_subchannel_marking = 595 ucfg_dfs_set_nol_subchannel_marking; 596 dfs_rx_ops->dfs_get_nol_subchannel_marking = 597 ucfg_dfs_get_nol_subchannel_marking; 598 dfs_rx_ops->dfs_set_bw_reduction = 599 utils_dfs_bw_reduce; 600 dfs_rx_ops->dfs_is_bw_reduction_needed = 601 utils_dfs_is_bw_reduce; 602 dfs_rx_ops->dfs_allow_hw_pulses = 603 ucfg_dfs_allow_hw_pulses; 604 dfs_rx_ops->dfs_is_hw_pulses_allowed = 605 ucfg_dfs_is_hw_pulses_allowed; 606 dfs_rx_ops->dfs_set_fw_adfs_support = 607 tgt_dfs_set_fw_adfs_support; 608 dfs_rx_ops->dfs_reset_dfs_prevchan = 609 utils_dfs_reset_dfs_prevchan; 610 dfs_rx_ops->dfs_init_tmp_psoc_nol = 611 tgt_dfs_init_tmp_psoc_nol; 612 dfs_rx_ops->dfs_deinit_tmp_psoc_nol = 613 tgt_dfs_deinit_tmp_psoc_nol; 614 dfs_rx_ops->dfs_save_dfs_nol_in_psoc = 615 tgt_dfs_save_dfs_nol_in_psoc; 616 dfs_rx_ops->dfs_reinit_nol_from_psoc_copy = 617 tgt_dfs_reinit_nol_from_psoc_copy; 618 dfs_rx_ops->dfs_reinit_precac_lists = 619 tgt_dfs_reinit_precac_lists; 620 dfs_rx_ops->dfs_complete_deferred_tasks = 621 tgt_dfs_complete_deferred_tasks; 622 register_precac_auto_chan_rx_ops(dfs_rx_ops); 623 register_precac_auto_chan_rx_ops_ieee(dfs_rx_ops); 624 register_precac_auto_chan_rx_ops_freq(dfs_rx_ops); 625 register_dfs_rx_ops_for_freq(dfs_rx_ops); 626 register_rcac_dfs_rx_ops(dfs_rx_ops); 627 register_agile_dfs_rx_ops(dfs_rx_ops); 628 register_dfs_chan_postnol_rx_ops(dfs_rx_ops); 629 630 return QDF_STATUS_SUCCESS; 631 } 632 #else 633 static QDF_STATUS 634 wlan_lmac_if_umac_dfs_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops) 635 { 636 return QDF_STATUS_SUCCESS; 637 } 638 #endif 639 640 #ifdef FEATURE_WLAN_TDLS 641 static QDF_STATUS 642 wlan_lmac_if_umac_tdls_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops) 643 { 644 rx_ops->tdls_rx_ops.tdls_ev_handler = tgt_tdls_event_handler; 645 646 return QDF_STATUS_SUCCESS; 647 } 648 #else 649 static QDF_STATUS 650 wlan_lmac_if_umac_tdls_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops) 651 { 652 return QDF_STATUS_SUCCESS; 653 } 654 #endif 655 656 #ifdef WLAN_SUPPORT_GREEN_AP 657 static QDF_STATUS 658 wlan_lmac_if_umac_green_ap_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops) 659 { 660 rx_ops->green_ap_rx_ops.is_ps_enabled = wlan_green_ap_is_ps_enabled; 661 rx_ops->green_ap_rx_ops.is_dbg_print_enabled = 662 ucfg_green_ap_get_debug_prints; 663 rx_ops->green_ap_rx_ops.ps_set = ucfg_green_ap_set_ps_config; 664 rx_ops->green_ap_rx_ops.ps_get = ucfg_green_ap_get_ps_config; 665 rx_ops->green_ap_rx_ops.suspend_handle = wlan_green_ap_suspend_handle; 666 667 return QDF_STATUS_SUCCESS; 668 } 669 #else 670 static QDF_STATUS 671 wlan_lmac_if_umac_green_ap_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops) 672 { 673 return QDF_STATUS_SUCCESS; 674 } 675 #endif 676 677 #ifdef QCA_WIFI_FTM 678 static QDF_STATUS 679 wlan_lmac_if_umac_ftm_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops) 680 { 681 struct wlan_lmac_if_ftm_rx_ops *ftm_rx_ops; 682 683 ftm_rx_ops = &rx_ops->ftm_rx_ops; 684 685 ftm_rx_ops->ftm_ev_handler = wlan_ftm_process_utf_event; 686 687 return QDF_STATUS_SUCCESS; 688 } 689 #else 690 static QDF_STATUS 691 wlan_lmac_if_umac_ftm_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops) 692 { 693 return QDF_STATUS_SUCCESS; 694 } 695 #endif 696 /** 697 * wlan_lmac_if_umac_rx_ops_register() - UMAC rx handler register 698 * @rx_ops: Pointer to rx_ops structure to be populated 699 * 700 * Register umac RX callabacks which will be called by DA/OL/WMA/WMI 701 * 702 * Return: QDF_STATUS_SUCCESS - in case of success 703 */ 704 QDF_STATUS 705 wlan_lmac_if_umac_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops) 706 { 707 /* Component specific public api's to be called to register 708 * respective callbacks 709 * Ex: rx_ops->fp = function; 710 */ 711 struct wlan_lmac_if_mgmt_txrx_rx_ops *mgmt_txrx_rx_ops; 712 713 if (!rx_ops) { 714 qdf_print("%s: lmac if rx ops pointer is NULL", __func__); 715 return QDF_STATUS_E_INVAL; 716 } 717 718 /* mgmt txrx rx ops */ 719 mgmt_txrx_rx_ops = &rx_ops->mgmt_txrx_rx_ops; 720 721 mgmt_txrx_rx_ops->mgmt_tx_completion_handler = 722 tgt_mgmt_txrx_tx_completion_handler; 723 mgmt_txrx_rx_ops->mgmt_rx_frame_handler = 724 tgt_mgmt_txrx_rx_frame_handler; 725 mgmt_txrx_rx_ops->mgmt_txrx_get_nbuf_from_desc_id = 726 tgt_mgmt_txrx_get_nbuf_from_desc_id; 727 mgmt_txrx_rx_ops->mgmt_txrx_get_peer_from_desc_id = 728 tgt_mgmt_txrx_get_peer_from_desc_id; 729 mgmt_txrx_rx_ops->mgmt_txrx_get_vdev_id_from_desc_id = 730 tgt_mgmt_txrx_get_vdev_id_from_desc_id; 731 mgmt_txrx_rx_ops->mgmt_txrx_get_free_desc_pool_count = 732 tgt_mgmt_txrx_get_free_desc_pool_count; 733 734 /* scan rx ops */ 735 rx_ops->scan.scan_ev_handler = tgt_scan_event_handler; 736 rx_ops->scan.scan_set_max_active_scans = tgt_scan_set_max_active_scans; 737 738 wlan_lmac_if_atf_rx_ops_register(rx_ops); 739 740 wlan_lmac_if_cp_stats_rx_ops_register(rx_ops); 741 742 wlan_target_if_dcs_rx_ops_register(rx_ops); 743 744 wlan_lmac_if_sa_api_rx_ops_register(rx_ops); 745 746 wlan_lmac_if_cfr_rx_ops_register(rx_ops); 747 748 wlan_lmac_if_crypto_rx_ops_register(rx_ops); 749 /* wifi_pos rx ops */ 750 wlan_lmac_if_umac_rx_ops_register_wifi_pos(rx_ops); 751 752 /* tdls rx ops */ 753 wlan_lmac_if_umac_tdls_rx_ops_register(rx_ops); 754 755 wlan_lmac_if_umac_reg_rx_ops_register(rx_ops); 756 757 /* p2p rx ops */ 758 wlan_lmac_if_umac_rx_ops_register_p2p(rx_ops); 759 760 /* DFS rx_ops */ 761 wlan_lmac_if_umac_dfs_rx_ops_register(rx_ops); 762 763 wlan_lmac_if_umac_green_ap_rx_ops_register(rx_ops); 764 765 /* FTM rx_ops */ 766 wlan_lmac_if_umac_ftm_rx_ops_register(rx_ops); 767 768 /* FILS Discovery */ 769 wlan_lmac_if_fd_rx_ops_register(rx_ops); 770 771 /* MLME rx_ops */ 772 tgt_vdev_mgr_rx_ops_register(rx_ops); 773 774 return QDF_STATUS_SUCCESS; 775 } 776 777 /** 778 * wlan_lmac_if_set_umac_txops_registration_cb() - tx registration 779 * callback assignment 780 * @dev_type: Dev type can be either Direct attach or Offload 781 * @handler: handler to be called for LMAC tx ops registration 782 * 783 * API to assign appropriate tx registration callback handler based on the 784 * device type(Offload or Direct attach) 785 * 786 * Return: QDF_STATUS_SUCCESS - in case of success 787 */ 788 QDF_STATUS wlan_lmac_if_set_umac_txops_registration_cb(QDF_STATUS (*handler) 789 (struct wlan_lmac_if_tx_ops *)) 790 { 791 wlan_lmac_if_umac_tx_ops_register = handler; 792 return QDF_STATUS_SUCCESS; 793 } 794 qdf_export_symbol(wlan_lmac_if_set_umac_txops_registration_cb); 795 796