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 } 187 #else 188 static void 189 wlan_lmac_if_atf_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops) 190 { 191 } 192 #endif 193 194 #ifdef WLAN_SUPPORT_FILS 195 static void 196 wlan_lmac_if_fd_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops) 197 { 198 struct wlan_lmac_if_fd_rx_ops *fd_rx_ops = &rx_ops->fd_rx_ops; 199 200 fd_rx_ops->fd_is_fils_enable = tgt_fd_is_fils_enable; 201 fd_rx_ops->fd_alloc = tgt_fd_alloc; 202 fd_rx_ops->fd_stop = tgt_fd_stop; 203 fd_rx_ops->fd_free = tgt_fd_free; 204 fd_rx_ops->fd_get_valid_fd_period = tgt_fd_get_valid_fd_period; 205 fd_rx_ops->fd_swfda_handler = tgt_fd_swfda_handler; 206 fd_rx_ops->fd_offload = tgt_fd_offload; 207 fd_rx_ops->fd_tmpl_update = tgt_fd_tmpl_update; 208 } 209 #else 210 static void 211 wlan_lmac_if_fd_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops) 212 { 213 } 214 #endif 215 216 #ifdef WLAN_SA_API_ENABLE 217 /** 218 * wlan_lmac_if_sa_api_rx_ops_register() - Function to register SA_API RX ops. 219 */ 220 static void 221 wlan_lmac_if_sa_api_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops) 222 { 223 struct wlan_lmac_if_sa_api_rx_ops *sa_api_rx_ops = &rx_ops->sa_api_rx_ops; 224 225 /* SA API rx ops */ 226 sa_api_rx_ops->sa_api_get_sa_supported = tgt_sa_api_get_sa_supported; 227 sa_api_rx_ops->sa_api_get_validate_sw = tgt_sa_api_get_validate_sw; 228 sa_api_rx_ops->sa_api_enable_sa = tgt_sa_api_enable_sa; 229 sa_api_rx_ops->sa_api_get_sa_enable = tgt_sa_api_get_sa_enable; 230 231 sa_api_rx_ops->sa_api_peer_assoc_hanldler = tgt_sa_api_peer_assoc_hanldler; 232 sa_api_rx_ops->sa_api_update_tx_feedback = tgt_sa_api_update_tx_feedback; 233 sa_api_rx_ops->sa_api_update_rx_feedback = tgt_sa_api_update_rx_feedback; 234 235 sa_api_rx_ops->sa_api_ucfg_set_param = tgt_sa_api_ucfg_set_param; 236 sa_api_rx_ops->sa_api_ucfg_get_param = tgt_sa_api_ucfg_get_param; 237 238 sa_api_rx_ops->sa_api_is_tx_feedback_enabled = tgt_sa_api_is_tx_feedback_enabled; 239 sa_api_rx_ops->sa_api_is_rx_feedback_enabled = tgt_sa_api_is_rx_feedback_enabled; 240 241 sa_api_rx_ops->sa_api_convert_rate_2g = tgt_sa_api_convert_rate_2g; 242 sa_api_rx_ops->sa_api_convert_rate_5g = tgt_sa_api_convert_rate_5g; 243 sa_api_rx_ops->sa_api_get_sa_mode = tgt_sa_api_get_sa_mode; 244 245 sa_api_rx_ops->sa_api_get_beacon_txantenna = tgt_sa_api_get_beacon_txantenna; 246 sa_api_rx_ops->sa_api_cwm_action = tgt_sa_api_cwm_action; 247 } 248 #else 249 static void 250 wlan_lmac_if_sa_api_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops) 251 { 252 } 253 #endif 254 255 #ifdef WLAN_CFR_ENABLE 256 /** 257 * wlan_lmac_if_cfr_rx_ops_register() - Function to register CFR RX ops 258 */ 259 static void 260 wlan_lmac_if_cfr_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops) 261 { 262 struct wlan_lmac_if_cfr_rx_ops *cfr_rx_ops = &rx_ops->cfr_rx_ops; 263 264 /* CFR rx ops */ 265 cfr_rx_ops->cfr_support_set = tgt_cfr_support_set; 266 cfr_rx_ops->cfr_info_send = tgt_cfr_info_send; 267 } 268 #else 269 static void 270 wlan_lmac_if_cfr_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops) 271 { 272 } 273 #endif 274 275 #ifdef WLAN_CONV_CRYPTO_SUPPORTED 276 static void 277 wlan_lmac_if_crypto_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops) 278 { 279 wlan_crypto_register_crypto_rx_ops(&rx_ops->crypto_rx_ops); 280 } 281 #else 282 static void 283 wlan_lmac_if_crypto_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops) 284 { 285 } 286 #endif 287 288 #ifdef WIFI_POS_CONVERGED 289 static void wlan_lmac_if_umac_rx_ops_register_wifi_pos( 290 struct wlan_lmac_if_rx_ops *rx_ops) 291 { 292 wifi_pos_register_rx_ops(rx_ops); 293 } 294 #else 295 static void wlan_lmac_if_umac_rx_ops_register_wifi_pos( 296 struct wlan_lmac_if_rx_ops *rx_ops) 297 { 298 } 299 #endif /* WIFI_POS_CONVERGED */ 300 301 static void wlan_lmac_if_umac_reg_rx_ops_register( 302 struct wlan_lmac_if_rx_ops *rx_ops) 303 { 304 rx_ops->reg_rx_ops.master_list_handler = 305 tgt_reg_process_master_chan_list; 306 307 rx_ops->reg_rx_ops.reg_11d_new_cc_handler = 308 tgt_reg_process_11d_new_country; 309 310 rx_ops->reg_rx_ops.reg_set_regdb_offloaded = 311 tgt_reg_set_regdb_offloaded; 312 313 rx_ops->reg_rx_ops.reg_set_11d_offloaded = 314 tgt_reg_set_11d_offloaded; 315 316 rx_ops->reg_rx_ops.reg_set_6ghz_supported = 317 tgt_reg_set_6ghz_supported; 318 319 rx_ops->reg_rx_ops.get_dfs_region = 320 wlan_reg_get_dfs_region; 321 322 rx_ops->reg_rx_ops.reg_ch_avoid_event_handler = 323 tgt_reg_process_ch_avoid_event; 324 325 rx_ops->reg_rx_ops.reg_freq_to_chan = 326 wlan_reg_freq_to_chan; 327 328 rx_ops->reg_rx_ops.reg_set_chan_144 = 329 ucfg_reg_modify_chan_144; 330 331 rx_ops->reg_rx_ops.reg_get_chan_144 = 332 ucfg_reg_get_en_chan_144; 333 334 rx_ops->reg_rx_ops.reg_program_default_cc = 335 ucfg_reg_program_default_cc; 336 337 rx_ops->reg_rx_ops.reg_get_current_regdomain = 338 wlan_reg_get_curr_regdomain; 339 340 rx_ops->reg_rx_ops.reg_enable_dfs_channels = 341 ucfg_reg_enable_dfs_channels; 342 343 rx_ops->reg_rx_ops.reg_modify_pdev_chan_range = 344 wlan_reg_modify_pdev_chan_range; 345 346 rx_ops->reg_rx_ops.reg_update_pdev_wireless_modes = 347 wlan_reg_update_pdev_wireless_modes; 348 349 rx_ops->reg_rx_ops.reg_is_range_only6g = 350 wlan_reg_is_range_only6g; 351 352 rx_ops->reg_rx_ops.reg_ignore_fw_reg_offload_ind = 353 tgt_reg_ignore_fw_reg_offload_ind; 354 355 rx_ops->reg_rx_ops.reg_disable_chan_coex = 356 wlan_reg_disable_chan_coex; 357 358 rx_ops->reg_rx_ops.reg_get_unii_5g_bitmap = 359 ucfg_reg_get_unii_5g_bitmap; 360 } 361 362 #ifdef CONVERGED_P2P_ENABLE 363 #ifdef FEATURE_P2P_LISTEN_OFFLOAD 364 static void wlan_lmac_if_umac_rx_ops_register_p2p( 365 struct wlan_lmac_if_rx_ops *rx_ops) 366 { 367 rx_ops->p2p.lo_ev_handler = tgt_p2p_lo_event_cb; 368 rx_ops->p2p.noa_ev_handler = tgt_p2p_noa_event_cb; 369 rx_ops->p2p.add_mac_addr_filter_evt_handler = 370 tgt_p2p_add_mac_addr_status_event_cb; 371 } 372 #else 373 static void wlan_lmac_if_umac_rx_ops_register_p2p( 374 struct wlan_lmac_if_rx_ops *rx_ops) 375 { 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 #endif 381 #else 382 static void wlan_lmac_if_umac_rx_ops_register_p2p( 383 struct wlan_lmac_if_rx_ops *rx_ops) 384 { 385 } 386 #endif 387 388 /* 389 * register_precac_auto_chan_rx_ops_ieee() - Register auto chan switch rx ops 390 * for IEEE channel based APIs. 391 * rx_ops: Pointer to wlan_lmac_if_dfs_rx_ops 392 */ 393 #ifdef DFS_COMPONENT_ENABLE 394 #if defined(WLAN_DFS_PRECAC_AUTO_CHAN_SUPPORT) && defined(CONFIG_CHAN_NUM_API) 395 static inline void 396 register_precac_auto_chan_rx_ops_ieee(struct wlan_lmac_if_dfs_rx_ops *rx_ops) 397 { 398 if (!rx_ops) 399 return; 400 rx_ops->dfs_get_precac_chan_state = ucfg_dfs_get_precac_chan_state; 401 } 402 #else 403 static inline void 404 register_precac_auto_chan_rx_ops_ieee(struct wlan_lmac_if_dfs_rx_ops *rx_ops) 405 { 406 } 407 #endif 408 #endif 409 410 /* 411 * register_precac_auto_chan_rx_ops_freq() - Register auto chan switch rx ops 412 * for frequency based channel APIs. 413 * rx_ops: Pointer to wlan_lmac_if_dfs_rx_ops 414 */ 415 #ifdef DFS_COMPONENT_ENABLE 416 #if defined(WLAN_DFS_PRECAC_AUTO_CHAN_SUPPORT) && defined(CONFIG_CHAN_FREQ_API) 417 static inline void 418 register_precac_auto_chan_rx_ops_freq(struct wlan_lmac_if_dfs_rx_ops *rx_ops) 419 { 420 if (!rx_ops) 421 return; 422 rx_ops->dfs_get_precac_chan_state_for_freq = 423 ucfg_dfs_get_precac_chan_state_for_freq; 424 } 425 #else 426 static inline void 427 register_precac_auto_chan_rx_ops_freq(struct wlan_lmac_if_dfs_rx_ops *rx_ops) 428 { 429 } 430 #endif 431 #endif 432 433 #ifdef DFS_COMPONENT_ENABLE 434 #ifdef WLAN_DFS_PRECAC_AUTO_CHAN_SUPPORT 435 static inline void 436 register_precac_auto_chan_rx_ops(struct wlan_lmac_if_dfs_rx_ops *rx_ops) 437 { 438 if (!rx_ops) 439 return; 440 rx_ops->dfs_set_precac_intermediate_chan = 441 ucfg_dfs_set_precac_intermediate_chan; 442 rx_ops->dfs_get_precac_intermediate_chan = 443 ucfg_dfs_get_precac_intermediate_chan; 444 } 445 #else 446 static inline void 447 register_precac_auto_chan_rx_ops(struct wlan_lmac_if_dfs_rx_ops *rx_ops) 448 { 449 } 450 #endif 451 452 /* 453 * register_dfs_rx_ops_for_freq() - Register DFS rx ops for frequency based 454 * channel APIs. 455 * rx_ops: Pointer to wlan_lmac_if_dfs_rx_ops. 456 */ 457 #ifdef CONFIG_CHAN_FREQ_API 458 static void register_dfs_rx_ops_for_freq(struct wlan_lmac_if_dfs_rx_ops *rx_ops) 459 { 460 if (!rx_ops) 461 return; 462 rx_ops->dfs_find_vht80_chan_for_precac_for_freq = 463 tgt_dfs_find_vht80_precac_chan_freq; 464 rx_ops->dfs_set_current_channel_for_freq = 465 tgt_dfs_set_current_channel_for_freq; 466 } 467 #endif 468 469 /* 470 * register_dfs_rx_ops_for_ieee() - Register DFS rx ops for IEEE channel based 471 * APIs 472 * rx_ops: Pointer to wlan_lmac_if_dfs_rx_ops. 473 */ 474 475 #ifdef CONFIG_CHAN_NUM_API 476 static void register_dfs_rx_ops_for_ieee(struct wlan_lmac_if_dfs_rx_ops *rx_ops) 477 { 478 if (!rx_ops) 479 return; 480 rx_ops->dfs_find_vht80_chan_for_precac = 481 tgt_dfs_find_vht80_chan_for_precac; 482 rx_ops->dfs_set_current_channel = 483 tgt_dfs_set_current_channel; 484 } 485 #endif 486 487 /* 488 * register_rcac_dfs_rx_ops() - Register DFS RX-Ops for Rolling CAC specific 489 * APIs. 490 * @rx_ops: Pointer to wlan_lmac_if_dfs_rx_ops. 491 */ 492 #ifdef QCA_SUPPORT_ADFS_RCAC 493 static void register_rcac_dfs_rx_ops(struct wlan_lmac_if_dfs_rx_ops *rx_ops) 494 { 495 if (!rx_ops) 496 return; 497 498 rx_ops->dfs_set_rcac_enable = ucfg_dfs_set_rcac_enable; 499 rx_ops->dfs_get_rcac_enable = ucfg_dfs_get_rcac_enable; 500 rx_ops->dfs_set_rcac_freq = ucfg_dfs_set_rcac_freq; 501 rx_ops->dfs_get_rcac_freq = ucfg_dfs_get_rcac_freq; 502 rx_ops->dfs_rcac_sm_deliver_evt = utils_dfs_rcac_sm_deliver_evt; 503 rx_ops->dfs_is_agile_rcac_enabled = ucfg_dfs_is_agile_rcac_enabled; 504 } 505 #else 506 static inline void 507 register_rcac_dfs_rx_ops(struct wlan_lmac_if_dfs_rx_ops *rx_ops) 508 { 509 } 510 #endif 511 512 static QDF_STATUS 513 wlan_lmac_if_umac_dfs_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops) 514 { 515 struct wlan_lmac_if_dfs_rx_ops *dfs_rx_ops; 516 517 dfs_rx_ops = &rx_ops->dfs_rx_ops; 518 519 dfs_rx_ops->dfs_get_radars = tgt_dfs_get_radars; 520 dfs_rx_ops->dfs_process_phyerr = tgt_dfs_process_phyerr; 521 dfs_rx_ops->dfs_destroy_object = tgt_dfs_destroy_object; 522 dfs_rx_ops->dfs_radar_enable = tgt_dfs_radar_enable; 523 dfs_rx_ops->dfs_is_radar_enabled = tgt_dfs_is_radar_enabled; 524 dfs_rx_ops->dfs_control = tgt_dfs_control; 525 dfs_rx_ops->dfs_is_precac_timer_running = 526 tgt_dfs_is_precac_timer_running; 527 dfs_rx_ops->dfs_agile_precac_start = 528 tgt_dfs_agile_precac_start; 529 dfs_rx_ops->dfs_set_agile_precac_state = 530 tgt_dfs_set_agile_precac_state; 531 dfs_rx_ops->dfs_start_precac_timer = utils_dfs_start_precac_timer; 532 dfs_rx_ops->dfs_cancel_precac_timer = utils_dfs_cancel_precac_timer; 533 dfs_rx_ops->dfs_reset_adfs_config = ucfg_dfs_reset_agile_config; 534 dfs_rx_ops->dfs_override_precac_timeout = 535 ucfg_dfs_override_precac_timeout; 536 dfs_rx_ops->dfs_set_precac_enable = ucfg_dfs_set_precac_enable; 537 dfs_rx_ops->dfs_get_legacy_precac_enable = 538 ucfg_dfs_get_legacy_precac_enable; 539 dfs_rx_ops->dfs_get_agile_precac_enable = 540 ucfg_dfs_get_agile_precac_enable; 541 dfs_rx_ops->dfs_get_override_precac_timeout = 542 ucfg_dfs_get_override_precac_timeout; 543 dfs_rx_ops->dfs_process_radar_ind = tgt_dfs_process_radar_ind; 544 dfs_rx_ops->dfs_dfs_cac_complete_ind = tgt_dfs_cac_complete; 545 dfs_rx_ops->dfs_dfs_ocac_complete_ind = tgt_dfs_ocac_complete; 546 dfs_rx_ops->dfs_stop = tgt_dfs_stop; 547 dfs_rx_ops->dfs_reinit_timers = ucfg_dfs_reinit_timers; 548 dfs_rx_ops->dfs_enable_stadfs = tgt_dfs_enable_stadfs; 549 dfs_rx_ops->dfs_is_stadfs_enabled = tgt_dfs_is_stadfs_enabled; 550 dfs_rx_ops->dfs_process_phyerr_filter_offload = 551 tgt_dfs_process_phyerr_filter_offload; 552 dfs_rx_ops->dfs_is_phyerr_filter_offload = 553 tgt_dfs_is_phyerr_filter_offload; 554 dfs_rx_ops->dfs_action_on_status = tgt_dfs_action_on_status_from_fw; 555 dfs_rx_ops->dfs_override_status_timeout = 556 ucfg_dfs_set_override_status_timeout; 557 dfs_rx_ops->dfs_get_override_status_timeout = 558 ucfg_dfs_get_override_status_timeout; 559 dfs_rx_ops->dfs_reset_spoof_test = 560 tgt_dfs_reset_spoof_test; 561 dfs_rx_ops->dfs_is_disable_radar_marking_set = 562 utils_dfs_get_disable_radar_marking; 563 dfs_rx_ops->dfs_set_nol_subchannel_marking = 564 ucfg_dfs_set_nol_subchannel_marking; 565 dfs_rx_ops->dfs_get_nol_subchannel_marking = 566 ucfg_dfs_get_nol_subchannel_marking; 567 dfs_rx_ops->dfs_set_bw_reduction = 568 utils_dfs_bw_reduce; 569 dfs_rx_ops->dfs_is_bw_reduction_needed = 570 utils_dfs_is_bw_reduce; 571 dfs_rx_ops->dfs_allow_hw_pulses = 572 ucfg_dfs_allow_hw_pulses; 573 dfs_rx_ops->dfs_is_hw_pulses_allowed = 574 ucfg_dfs_is_hw_pulses_allowed; 575 dfs_rx_ops->dfs_set_fw_adfs_support = 576 tgt_dfs_set_fw_adfs_support; 577 dfs_rx_ops->dfs_reset_dfs_prevchan = 578 utils_dfs_reset_dfs_prevchan; 579 dfs_rx_ops->dfs_init_tmp_psoc_nol = 580 tgt_dfs_init_tmp_psoc_nol; 581 dfs_rx_ops->dfs_deinit_tmp_psoc_nol = 582 tgt_dfs_deinit_tmp_psoc_nol; 583 dfs_rx_ops->dfs_save_dfs_nol_in_psoc = 584 tgt_dfs_save_dfs_nol_in_psoc; 585 dfs_rx_ops->dfs_reinit_nol_from_psoc_copy = 586 tgt_dfs_reinit_nol_from_psoc_copy; 587 dfs_rx_ops->dfs_reinit_precac_lists = 588 tgt_dfs_reinit_precac_lists; 589 dfs_rx_ops->dfs_complete_deferred_tasks = 590 tgt_dfs_complete_deferred_tasks; 591 register_precac_auto_chan_rx_ops(dfs_rx_ops); 592 register_precac_auto_chan_rx_ops_ieee(dfs_rx_ops); 593 register_precac_auto_chan_rx_ops_freq(dfs_rx_ops); 594 register_dfs_rx_ops_for_freq(dfs_rx_ops); 595 register_dfs_rx_ops_for_ieee(dfs_rx_ops); 596 register_rcac_dfs_rx_ops(dfs_rx_ops); 597 598 return QDF_STATUS_SUCCESS; 599 } 600 #else 601 static QDF_STATUS 602 wlan_lmac_if_umac_dfs_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops) 603 { 604 return QDF_STATUS_SUCCESS; 605 } 606 #endif 607 608 #ifdef FEATURE_WLAN_TDLS 609 static QDF_STATUS 610 wlan_lmac_if_umac_tdls_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops) 611 { 612 rx_ops->tdls_rx_ops.tdls_ev_handler = tgt_tdls_event_handler; 613 614 return QDF_STATUS_SUCCESS; 615 } 616 #else 617 static QDF_STATUS 618 wlan_lmac_if_umac_tdls_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops) 619 { 620 return QDF_STATUS_SUCCESS; 621 } 622 #endif 623 624 #ifdef WLAN_SUPPORT_GREEN_AP 625 static QDF_STATUS 626 wlan_lmac_if_umac_green_ap_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops) 627 { 628 rx_ops->green_ap_rx_ops.is_ps_enabled = wlan_green_ap_is_ps_enabled; 629 rx_ops->green_ap_rx_ops.is_dbg_print_enabled = 630 ucfg_green_ap_get_debug_prints; 631 rx_ops->green_ap_rx_ops.ps_set = ucfg_green_ap_set_ps_config; 632 rx_ops->green_ap_rx_ops.ps_get = ucfg_green_ap_get_ps_config; 633 rx_ops->green_ap_rx_ops.suspend_handle = wlan_green_ap_suspend_handle; 634 635 return QDF_STATUS_SUCCESS; 636 } 637 #else 638 static QDF_STATUS 639 wlan_lmac_if_umac_green_ap_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops) 640 { 641 return QDF_STATUS_SUCCESS; 642 } 643 #endif 644 645 #ifdef QCA_WIFI_FTM 646 static QDF_STATUS 647 wlan_lmac_if_umac_ftm_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops) 648 { 649 struct wlan_lmac_if_ftm_rx_ops *ftm_rx_ops; 650 651 ftm_rx_ops = &rx_ops->ftm_rx_ops; 652 653 ftm_rx_ops->ftm_ev_handler = wlan_ftm_process_utf_event; 654 655 return QDF_STATUS_SUCCESS; 656 } 657 #else 658 static QDF_STATUS 659 wlan_lmac_if_umac_ftm_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops) 660 { 661 return QDF_STATUS_SUCCESS; 662 } 663 #endif 664 /** 665 * wlan_lmac_if_umac_rx_ops_register() - UMAC rx handler register 666 * @rx_ops: Pointer to rx_ops structure to be populated 667 * 668 * Register umac RX callabacks which will be called by DA/OL/WMA/WMI 669 * 670 * Return: QDF_STATUS_SUCCESS - in case of success 671 */ 672 QDF_STATUS 673 wlan_lmac_if_umac_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops) 674 { 675 /* Component specific public api's to be called to register 676 * respective callbacks 677 * Ex: rx_ops->fp = function; 678 */ 679 struct wlan_lmac_if_mgmt_txrx_rx_ops *mgmt_txrx_rx_ops; 680 681 if (!rx_ops) { 682 qdf_print("%s: lmac if rx ops pointer is NULL", __func__); 683 return QDF_STATUS_E_INVAL; 684 } 685 686 /* mgmt txrx rx ops */ 687 mgmt_txrx_rx_ops = &rx_ops->mgmt_txrx_rx_ops; 688 689 mgmt_txrx_rx_ops->mgmt_tx_completion_handler = 690 tgt_mgmt_txrx_tx_completion_handler; 691 mgmt_txrx_rx_ops->mgmt_rx_frame_handler = 692 tgt_mgmt_txrx_rx_frame_handler; 693 mgmt_txrx_rx_ops->mgmt_txrx_get_nbuf_from_desc_id = 694 tgt_mgmt_txrx_get_nbuf_from_desc_id; 695 mgmt_txrx_rx_ops->mgmt_txrx_get_peer_from_desc_id = 696 tgt_mgmt_txrx_get_peer_from_desc_id; 697 mgmt_txrx_rx_ops->mgmt_txrx_get_vdev_id_from_desc_id = 698 tgt_mgmt_txrx_get_vdev_id_from_desc_id; 699 mgmt_txrx_rx_ops->mgmt_txrx_get_free_desc_pool_count = 700 tgt_mgmt_txrx_get_free_desc_pool_count; 701 702 /* scan rx ops */ 703 rx_ops->scan.scan_ev_handler = tgt_scan_event_handler; 704 rx_ops->scan.scan_set_max_active_scans = tgt_scan_set_max_active_scans; 705 706 wlan_lmac_if_atf_rx_ops_register(rx_ops); 707 708 wlan_lmac_if_cp_stats_rx_ops_register(rx_ops); 709 710 wlan_target_if_dcs_rx_ops_register(rx_ops); 711 712 wlan_lmac_if_sa_api_rx_ops_register(rx_ops); 713 714 wlan_lmac_if_cfr_rx_ops_register(rx_ops); 715 716 wlan_lmac_if_crypto_rx_ops_register(rx_ops); 717 /* wifi_pos rx ops */ 718 wlan_lmac_if_umac_rx_ops_register_wifi_pos(rx_ops); 719 720 /* tdls rx ops */ 721 wlan_lmac_if_umac_tdls_rx_ops_register(rx_ops); 722 723 wlan_lmac_if_umac_reg_rx_ops_register(rx_ops); 724 725 /* p2p rx ops */ 726 wlan_lmac_if_umac_rx_ops_register_p2p(rx_ops); 727 728 /* DFS rx_ops */ 729 wlan_lmac_if_umac_dfs_rx_ops_register(rx_ops); 730 731 wlan_lmac_if_umac_green_ap_rx_ops_register(rx_ops); 732 733 /* FTM rx_ops */ 734 wlan_lmac_if_umac_ftm_rx_ops_register(rx_ops); 735 736 /* FILS Discovery */ 737 wlan_lmac_if_fd_rx_ops_register(rx_ops); 738 739 /* MLME rx_ops */ 740 tgt_vdev_mgr_rx_ops_register(rx_ops); 741 742 return QDF_STATUS_SUCCESS; 743 } 744 745 /** 746 * wlan_lmac_if_set_umac_txops_registration_cb() - tx registration 747 * callback assignment 748 * @dev_type: Dev type can be either Direct attach or Offload 749 * @handler: handler to be called for LMAC tx ops registration 750 * 751 * API to assign appropriate tx registration callback handler based on the 752 * device type(Offload or Direct attach) 753 * 754 * Return: QDF_STATUS_SUCCESS - in case of success 755 */ 756 QDF_STATUS wlan_lmac_if_set_umac_txops_registration_cb(QDF_STATUS (*handler) 757 (struct wlan_lmac_if_tx_ops *)) 758 { 759 wlan_lmac_if_umac_tx_ops_register = handler; 760 return QDF_STATUS_SUCCESS; 761 } 762 qdf_export_symbol(wlan_lmac_if_set_umac_txops_registration_cb); 763 764