diff --git a/components/cmn_services/policy_mgr/inc/wlan_policy_mgr_api.h b/components/cmn_services/policy_mgr/inc/wlan_policy_mgr_api.h index 6eb615dbb7de..a7663132eabb 100644 --- a/components/cmn_services/policy_mgr/inc/wlan_policy_mgr_api.h +++ b/components/cmn_services/policy_mgr/inc/wlan_policy_mgr_api.h @@ -1847,21 +1847,9 @@ bool policy_mgr_is_any_mode_active_on_band_along_with_session( * * Return: QDF_STATUS */ -QDF_STATUS policy_mgr_get_chan_by_session_id_int(struct wlan_objmgr_psoc *psoc, - uint8_t session_id, - uint32_t *ch_freq); -static inline QDF_STATUS -policy_mgr_get_chan_by_session_id(struct wlan_objmgr_psoc *psoc, - uint8_t session_id, uint8_t *chan) -{ - uint32_t ch_freq; - QDF_STATUS status; - - status = policy_mgr_get_chan_by_session_id_int(psoc, - session_id, &ch_freq); - *chan = wlan_freq_to_chan(ch_freq); - return status; -} +QDF_STATUS policy_mgr_get_chan_by_session_id(struct wlan_objmgr_psoc *psoc, + uint8_t session_id, + uint32_t *ch_freq); /** * policy_mgr_get_mac_id_by_session_id() - Get MAC ID for a given session ID @@ -1900,15 +1888,9 @@ QDF_STATUS policy_mgr_get_mcc_session_id_on_mac(struct wlan_objmgr_psoc *psoc, * * Return: '0' (INVALID_CHANNEL_ID) or valid channel frequency */ -uint32_t policy_mgr_get_mcc_operating_channel_int(struct wlan_objmgr_psoc *psoc, - uint8_t session_id); -static inline uint8_t -policy_mgr_get_mcc_operating_channel(struct wlan_objmgr_psoc *psoc, - uint8_t session_id) -{ - return wlan_freq_to_chan(policy_mgr_get_mcc_operating_channel_int(psoc, - session_id)); -} +uint32_t policy_mgr_get_mcc_operating_channel(struct wlan_objmgr_psoc *psoc, + uint8_t session_id); + /** * policy_mgr_get_pcl_for_existing_conn() - Get PCL for existing connection * @psoc: PSOC object information @@ -1975,19 +1957,10 @@ QDF_STATUS policy_mgr_set_hw_mode_on_channel_switch( * * Return: QDF_STATUS, success if HW mode change is required else Failure */ -QDF_STATUS policy_mgr_check_and_set_hw_mode_for_channel_switch_int( +QDF_STATUS policy_mgr_check_and_set_hw_mode_for_channel_switch( struct wlan_objmgr_psoc *psoc, uint8_t vdev_id, uint32_t ch_freq, enum policy_mgr_conn_update_reason reason); -static inline -QDF_STATUS policy_mgr_check_and_set_hw_mode_for_channel_switch( - struct wlan_objmgr_psoc *psoc, uint8_t vdev_id, uint8_t chan, - enum policy_mgr_conn_update_reason reason) -{ - return policy_mgr_check_and_set_hw_mode_for_channel_switch_int( - psoc, vdev_id, wlan_chan_to_freq(chan), reason); -} - /** * policy_mgr_set_do_hw_mode_change_flag() - Set flag to indicate hw mode change * @psoc: PSOC object information @@ -2673,16 +2646,8 @@ void policy_mgr_update_new_hw_mode_index(struct wlan_objmgr_psoc *psoc, * "Do Not Break Stream" * Return: SUCCESS or FAILURE */ -QDF_STATUS policy_mgr_is_chan_ok_for_dnbs_int(struct wlan_objmgr_psoc *psoc, - uint32_t ch_freq, bool *ok); -static inline QDF_STATUS -policy_mgr_is_chan_ok_for_dnbs(struct wlan_objmgr_psoc *psoc, - uint8_t channel, bool *ok) -{ - return policy_mgr_is_chan_ok_for_dnbs_int(psoc, - wlan_chan_to_freq(channel), - ok); -} +QDF_STATUS policy_mgr_is_chan_ok_for_dnbs(struct wlan_objmgr_psoc *psoc, + uint32_t ch_freq, bool *ok); /** * policy_mgr_get_hw_dbs_nss() - Computes DBS NSS @@ -2732,13 +2697,9 @@ QDF_STATUS policy_mgr_get_updated_scan_and_fw_mode_config( * * Return: true for success, else false */ -bool policy_mgr_is_safe_channel_int(struct wlan_objmgr_psoc *psoc, - uint32_t ch_freq); -static inline bool policy_mgr_is_safe_channel(struct wlan_objmgr_psoc *psoc, - uint8_t channel) -{ - return policy_mgr_is_safe_channel_int(psoc, wlan_chan_to_freq(channel)); -} +bool policy_mgr_is_safe_channel(struct wlan_objmgr_psoc *psoc, + uint32_t ch_freq); + /** * policy_mgr_is_force_scc() - checks if SCC needs to be * mandated @@ -2761,8 +2722,8 @@ bool policy_mgr_is_force_scc(struct wlan_objmgr_psoc *psoc); bool policy_mgr_go_scc_enforced(struct wlan_objmgr_psoc *psoc); /** - * policy_mgr_valid_sap_conc_channel_check() - checks & updates - * the channel SAP to come up on in case of STA+SAP concurrency + * policy_mgr_valid_sap_conc_channel_check() - Check and update + * the SAP channel in case of STA+SAP concurrency * @psoc: PSOC object information * @con_ch_freq: pointer to the chan freq on which sap will come up * @sap_ch_freq: initial channel frequency for SAP @@ -2772,25 +2733,10 @@ bool policy_mgr_go_scc_enforced(struct wlan_objmgr_psoc *psoc); * case of STA+SAP concurrency * Return: Success if SAP can come up on a channel */ -QDF_STATUS policy_mgr_valid_sap_conc_channel_check_int( +QDF_STATUS policy_mgr_valid_sap_conc_channel_check( struct wlan_objmgr_psoc *psoc, uint32_t *con_ch_freq, uint32_t sap_ch_freq, uint8_t sap_vdev_id); -static inline QDF_STATUS policy_mgr_valid_sap_conc_channel_check( - struct wlan_objmgr_psoc *psoc, uint8_t *con_ch, uint8_t sap_ch, - uint8_t sap_vdev_id) -{ - uint32_t con_ch_freq; - QDF_STATUS status; - - con_ch_freq = wlan_chan_to_freq(*con_ch); - status = policy_mgr_valid_sap_conc_channel_check_int( - psoc, &con_ch_freq, - wlan_chan_to_freq(sap_ch), sap_vdev_id); - *con_ch = wlan_freq_to_chan(con_ch_freq); - return status; -} - /** * policy_mgr_get_alternate_channel_for_sap() - Get an alternate * channel to move the SAP to @@ -2817,13 +2763,8 @@ uint32_t policy_mgr_get_alternate_channel_for_sap( * * Return: True if it is causing MCC */ -bool policy_mgr_disallow_mcc_int(struct wlan_objmgr_psoc *psoc, - uint32_t ch_freq); -static inline bool policy_mgr_disallow_mcc(struct wlan_objmgr_psoc *psoc, - uint8_t channel) -{ - return policy_mgr_disallow_mcc_int(psoc, wlan_chan_to_freq(channel)); -} +bool policy_mgr_disallow_mcc(struct wlan_objmgr_psoc *psoc, + uint32_t ch_freq); /** * policy_mgr_mode_specific_get_channel() - Get channel for a @@ -2848,14 +2789,9 @@ uint32_t policy_mgr_mode_specific_get_channel(struct wlan_objmgr_psoc *psoc, * * Return: None */ -void policy_mgr_add_sap_mandatory_chan_int(struct wlan_objmgr_psoc *psoc, - uint32_t ch_freq); -static inline void policy_mgr_add_sap_mandatory_chan(struct wlan_objmgr_psoc *psoc, - uint8_t chan) -{ - policy_mgr_add_sap_mandatory_chan_int(psoc, wlan_chan_to_freq(chan)); -} + uint32_t ch_freq); + /** * policy_mgr_get_sap_mandatory_chan_list_len() - Return the SAP mandatory * channel list len @@ -2889,14 +2825,8 @@ void policy_mgr_init_sap_mandatory_2g_chan(struct wlan_objmgr_psoc *psoc); * * Return: None */ -void policy_mgr_remove_sap_mandatory_chan_int(struct wlan_objmgr_psoc *psoc, - uint32_t ch_freq); -static inline void -policy_mgr_remove_sap_mandatory_chan(struct wlan_objmgr_psoc *psoc, - uint8_t chan) -{ - policy_mgr_remove_sap_mandatory_chan_int(psoc, wlan_chan_to_freq(chan)); -} +void policy_mgr_remove_sap_mandatory_chan(struct wlan_objmgr_psoc *psoc, + uint32_t ch_freq); /* * policy_set_cur_conc_system_pref - set current conc_system_pref @@ -2991,16 +2921,8 @@ bool policy_mgr_scan_trim_5g_chnls_for_dfs_ap(struct wlan_objmgr_psoc *psoc); * * Return: true if HW mode is set properly else false */ -bool policy_mgr_is_hwmode_set_for_given_chnl_int(struct wlan_objmgr_psoc *psoc, - uint32_t ch_freq); - -static inline bool -policy_mgr_is_hwmode_set_for_given_chnl(struct wlan_objmgr_psoc *psoc, - uint8_t channel) -{ - return policy_mgr_is_hwmode_set_for_given_chnl_int( - psoc, wlan_chan_to_freq(channel)); -} +bool policy_mgr_is_hwmode_set_for_given_chnl(struct wlan_objmgr_psoc *psoc, + uint32_t ch_freq); /** * policy_mgr_get_connection_info() - Get info of all active connections @@ -3101,16 +3023,9 @@ bool policy_mgr_sta_sap_scc_on_lte_coex_chan( * * Return: true or false */ -bool policy_mgr_is_valid_for_channel_switch_int(struct wlan_objmgr_psoc *psoc, - uint32_t ch_freq); -static inline bool policy_mgr_is_valid_for_channel_switch(struct wlan_objmgr_psoc *psoc, - uint8_t channel) -{ - return policy_mgr_is_valid_for_channel_switch_int(psoc, - wlan_chan_to_freq( - channel)); -} + uint32_t ch_freq); + /** * policy_mgr_update_user_config_sap_chan() - Update user configured channel * @psoc: poniter to psoc @@ -3118,15 +3033,9 @@ bool policy_mgr_is_valid_for_channel_switch(struct wlan_objmgr_psoc *psoc, * * Return: void **/ -void policy_mgr_update_user_config_sap_chan_int(struct wlan_objmgr_psoc *psoc, - uint32_t ch_freq); -static inline void policy_mgr_update_user_config_sap_chan(struct wlan_objmgr_psoc *psoc, - uint32_t channel) -{ - policy_mgr_update_user_config_sap_chan_int(psoc, - wlan_chan_to_freq(channel)); -} + uint32_t ch_freq); + /** * policy_mgr_nan_sap_post_enable_conc_check() - Do concurrency operations * post nan/sap enable @@ -3159,22 +3068,10 @@ void policy_mgr_nan_sap_post_disable_conc_check(struct wlan_objmgr_psoc *psoc); * * Return: true if sap restart is required, otherwise false */ -bool policy_mgr_is_sap_restart_required_after_sta_disconnect_int( +bool policy_mgr_is_sap_restart_required_after_sta_disconnect( struct wlan_objmgr_psoc *psoc, uint32_t sap_vdev_id, uint32_t *intf_ch_freq); -static inline bool policy_mgr_is_sap_restart_required_after_sta_disconnect( - struct wlan_objmgr_psoc *psoc, - uint32_t sap_vdev_id, uint8_t *intf_ch) -{ - uint32_t intf_ch_freq; - bool ret; - - ret = policy_mgr_is_sap_restart_required_after_sta_disconnect_int( - psoc, sap_vdev_id, &intf_ch_freq); - *intf_ch = wlan_freq_to_chan(intf_ch_freq); - return ret; -} /** * policy_mgr_is_sta_sap_scc() - check whether SAP is doing SCC with * STA @@ -3184,13 +3081,8 @@ static inline bool policy_mgr_is_sap_restart_required_after_sta_disconnect( * * Return: true or false */ -bool policy_mgr_is_sta_sap_scc_int(struct wlan_objmgr_psoc *psoc, - uint32_t sap_ch_freq); -static inline bool policy_mgr_is_sta_sap_scc(struct wlan_objmgr_psoc *psoc, - uint8_t sap_ch) -{ - return policy_mgr_is_sta_sap_scc_int(psoc, wlan_chan_to_freq(sap_ch)); -} +bool policy_mgr_is_sta_sap_scc(struct wlan_objmgr_psoc *psoc, + uint32_t sap_ch_freq); /** * policy_mgr_nan_sap_scc_on_unsafe_ch_chk() - check whether SAP is doing SCC @@ -3200,16 +3092,9 @@ static inline bool policy_mgr_is_sta_sap_scc(struct wlan_objmgr_psoc *psoc, * * Return: true or false */ -bool policy_mgr_nan_sap_scc_on_unsafe_ch_chk_int(struct wlan_objmgr_psoc *psoc, - uint32_t sap_freq); -static inline bool policy_mgr_nan_sap_scc_on_unsafe_ch_chk(struct wlan_objmgr_psoc *psoc, - uint8_t sap_ch) -{ - return policy_mgr_nan_sap_scc_on_unsafe_ch_chk_int(psoc, - wlan_chan_to_freq( - sap_ch)); -} + uint32_t sap_freq); + /** * policy_mgr_get_hw_mode_from_idx() - Get HW mode based on index * @psoc: psoc object diff --git a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_action.c b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_action.c index 54dd43fcc8eb..fdd0ca314f76 100644 --- a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_action.c +++ b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_action.c @@ -512,8 +512,8 @@ bool policy_mgr_is_chnl_in_diff_band(struct wlan_objmgr_psoc *psoc, return false; } -bool policy_mgr_is_hwmode_set_for_given_chnl_int(struct wlan_objmgr_psoc *psoc, - uint32_t ch_freq) +bool policy_mgr_is_hwmode_set_for_given_chnl(struct wlan_objmgr_psoc *psoc, + uint32_t ch_freq) { enum policy_mgr_band band; bool is_hwmode_dbs, is_2x2_dbs; @@ -1237,7 +1237,7 @@ policy_mgr_handle_conc_multiport(struct wlan_objmgr_psoc *psoc, } #ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH -void policy_mgr_update_user_config_sap_chan_int( +void policy_mgr_update_user_config_sap_chan( struct wlan_objmgr_psoc *psoc, uint32_t ch_freq) { struct policy_mgr_psoc_priv_obj *pm_ctx; @@ -1292,8 +1292,8 @@ static bool policy_mgr_is_restart_sap_allowed( return false; } -bool policy_mgr_is_safe_channel_int(struct wlan_objmgr_psoc *psoc, - uint32_t ch_freq) +bool policy_mgr_is_safe_channel(struct wlan_objmgr_psoc *psoc, + uint32_t ch_freq) { struct policy_mgr_psoc_priv_obj *pm_ctx; bool is_safe = true; @@ -1322,7 +1322,7 @@ bool policy_mgr_is_safe_channel_int(struct wlan_objmgr_psoc *psoc, return is_safe; } -bool policy_mgr_is_sap_restart_required_after_sta_disconnect_int( +bool policy_mgr_is_sap_restart_required_after_sta_disconnect( struct wlan_objmgr_psoc *psoc, uint32_t sap_vdev_id, uint32_t *intf_ch_freq) { @@ -1389,7 +1389,7 @@ bool policy_mgr_is_sap_restart_required_after_sta_disconnect_int( break; } if (sta_sap_scc_on_lte_coex_chan && - !policy_mgr_is_safe_channel_int(psoc, op_ch_freq_list[i])) { + !policy_mgr_is_safe_channel(psoc, op_ch_freq_list[i])) { sap_vdev_id = vdev_id[i]; curr_sap_freq = op_ch_freq_list[i]; policy_mgr_debug("sta_sap_scc_on_lte_coex_chan %u unsafe sap_ch_freq %u", @@ -1421,7 +1421,7 @@ bool policy_mgr_is_sap_restart_required_after_sta_disconnect_int( if (!wlan_reg_is_same_band_freqs( curr_sap_freq, pcl_channels[i])) continue; - if (!policy_mgr_is_safe_channel_int(psoc, pcl_channels[i]) || + if (!policy_mgr_is_safe_channel(psoc, pcl_channels[i]) || wlan_reg_is_dfs_for_freq(pm_ctx->pdev, pcl_channels[i])) continue; new_sap_freq = pcl_channels[i]; @@ -1456,7 +1456,7 @@ static bool policy_mgr_is_nan_sap_unsafe_ch_scc_allowed(struct policy_mgr_psoc_priv_obj *pm_ctx, uint32_t ch_freq) { - if (policy_mgr_is_safe_channel_int(pm_ctx->psoc, ch_freq) || + if (policy_mgr_is_safe_channel(pm_ctx->psoc, ch_freq) || pm_ctx->cfg.nan_sap_scc_on_lte_coex_chnl) return true; @@ -1476,8 +1476,8 @@ static void policy_mgr_nan_disable_work(void *data) ucfg_nan_disable_concurrency(psoc); } -bool policy_mgr_nan_sap_scc_on_unsafe_ch_chk_int(struct wlan_objmgr_psoc *psoc, - uint32_t sap_freq) +bool policy_mgr_nan_sap_scc_on_unsafe_ch_chk(struct wlan_objmgr_psoc *psoc, + uint32_t sap_freq) { uint32_t nan_2g_freq, nan_5g_freq; struct policy_mgr_psoc_priv_obj *pm_ctx; @@ -1697,7 +1697,7 @@ void policy_mgr_nan_sap_post_disable_conc_check(struct wlan_objmgr_psoc *psoc) break; } } - if (sap_freq == 0 || policy_mgr_is_safe_channel_int(psoc, sap_freq)) + if (sap_freq == 0 || policy_mgr_is_safe_channel(psoc, sap_freq)) return; sap_freq = policy_mgr_get_nondfs_preferred_channel(psoc, PM_SAP_MODE, @@ -1853,7 +1853,7 @@ static bool policy_mgr_valid_sta_channel_check(struct wlan_objmgr_psoc *psoc, !sta_sap_scc_on_dfs_chan) || wlan_reg_is_passive_or_disable_for_freq( pm_ctx->pdev, sta_ch_freq) || - !policy_mgr_is_safe_channel_int(psoc, sta_ch_freq)) { + !policy_mgr_is_safe_channel(psoc, sta_ch_freq)) { if (policy_mgr_is_hw_dbs_capable(psoc)) return true; else @@ -1863,7 +1863,7 @@ static bool policy_mgr_valid_sta_channel_check(struct wlan_objmgr_psoc *psoc, return true; } -QDF_STATUS policy_mgr_valid_sap_conc_channel_check_int( +QDF_STATUS policy_mgr_valid_sap_conc_channel_check( struct wlan_objmgr_psoc *psoc, uint32_t *con_ch_freq, uint32_t sap_ch_freq, uint8_t sap_vdev_id) { @@ -1907,7 +1907,7 @@ QDF_STATUS policy_mgr_valid_sap_conc_channel_check_int( wlan_reg_is_passive_or_disable_for_freq(pm_ctx->pdev, ch_freq) || !(policy_mgr_sta_sap_scc_on_lte_coex_chan(psoc) || - policy_mgr_is_safe_channel_int(psoc, ch_freq)) || + policy_mgr_is_safe_channel(psoc, ch_freq)) || (!wlan_reg_is_etsi13_srd_chan_allowed_master_mode( pm_ctx->pdev) && wlan_reg_is_etsi13_srd_chan_for_freq(pm_ctx->pdev, @@ -1932,7 +1932,7 @@ QDF_STATUS policy_mgr_valid_sap_conc_channel_check_int( else ch_freq = PM_5_GHZ_CH_FREQ_36; } - if (!policy_mgr_is_safe_channel_int( + if (!policy_mgr_is_safe_channel( psoc, ch_freq)) { policy_mgr_warn("Can't have concurrency on %d as it is not safe", *con_ch_freq); @@ -1988,7 +1988,7 @@ void policy_mgr_check_concurrent_intf_and_restart_sap( * enabled on unsafe channel then move the SAP to safe channel * as soon as STA disconnected. */ - if (policy_mgr_is_sap_restart_required_after_sta_disconnect_int( + if (policy_mgr_is_sap_restart_required_after_sta_disconnect( psoc, INVALID_VDEV_ID, &sap_freq)) { policy_mgr_debug("move the SAP to configured channel %u", sap_freq); @@ -2323,7 +2323,7 @@ done: return status; } -QDF_STATUS policy_mgr_check_and_set_hw_mode_for_channel_switch_int( +QDF_STATUS policy_mgr_check_and_set_hw_mode_for_channel_switch( struct wlan_objmgr_psoc *psoc, uint8_t vdev_id, uint32_t ch_freq, enum policy_mgr_conn_update_reason reason) { diff --git a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_core.c b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_core.c index cedd9f501e9b..d88899a9723e 100644 --- a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_core.c +++ b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_core.c @@ -2461,8 +2461,8 @@ end: return status; } -bool policy_mgr_disallow_mcc_int(struct wlan_objmgr_psoc *psoc, - uint32_t ch_freq) +bool policy_mgr_disallow_mcc(struct wlan_objmgr_psoc *psoc, + uint32_t ch_freq) { uint32_t index = 0; bool match = false; @@ -3181,8 +3181,8 @@ QDF_STATUS policy_mgr_reset_sap_mandatory_channels( return QDF_STATUS_SUCCESS; } -void policy_mgr_add_sap_mandatory_chan_int(struct wlan_objmgr_psoc *psoc, - uint32_t ch_freq) +void policy_mgr_add_sap_mandatory_chan(struct wlan_objmgr_psoc *psoc, + uint32_t ch_freq) { int i; struct policy_mgr_psoc_priv_obj *pm_ctx; @@ -3249,8 +3249,8 @@ void policy_mgr_init_sap_mandatory_2g_chan(struct wlan_objmgr_psoc *psoc) } } -void policy_mgr_remove_sap_mandatory_chan_int(struct wlan_objmgr_psoc *psoc, - uint32_t ch_freq) +void policy_mgr_remove_sap_mandatory_chan(struct wlan_objmgr_psoc *psoc, + uint32_t ch_freq) { uint32_t ch_freq_list[QDF_MAX_NUM_CHAN] = {0}; uint32_t num_chan = 0; diff --git a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_get_set_utils.c b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_get_set_utils.c index 7cb5128bb278..bbc6a6f6642e 100644 --- a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_get_set_utils.c +++ b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_get_set_utils.c @@ -2221,8 +2221,8 @@ bool policy_mgr_is_concurrency_allowed(struct wlan_objmgr_psoc *psoc, if (!sta_sap_scc_on_dfs_chan && ((mode == PM_P2P_GO_MODE) || (mode == PM_SAP_MODE))) { if (wlan_reg_is_dfs_for_freq(pm_ctx->pdev, ch_freq)) - match = policy_mgr_disallow_mcc_int(psoc, - ch_freq); + match = policy_mgr_disallow_mcc(psoc, + ch_freq); } if (true == match) { policy_mgr_err("No MCC, SAP/GO about to come up on DFS channel"); @@ -2432,8 +2432,8 @@ policy_mgr_allow_concurrency_csa(struct wlan_objmgr_psoc *psoc, policy_mgr_debug("check concurrency_csa vdev:%d ch %d, forced %d, reason %d", vdev_id, ch_freq, forced, reason); - status = policy_mgr_get_chan_by_session_id_int(psoc, vdev_id, - &old_ch_freq); + status = policy_mgr_get_chan_by_session_id(psoc, vdev_id, + &old_ch_freq); if (QDF_IS_STATUS_ERROR(status)) { policy_mgr_err("Failed to get channel for vdev:%d", vdev_id); @@ -3202,9 +3202,9 @@ send_status: return status; } -QDF_STATUS policy_mgr_get_chan_by_session_id_int(struct wlan_objmgr_psoc *psoc, - uint8_t session_id, - uint32_t *ch_freq) +QDF_STATUS policy_mgr_get_chan_by_session_id(struct wlan_objmgr_psoc *psoc, + uint8_t session_id, + uint32_t *ch_freq) { uint32_t i; struct policy_mgr_psoc_priv_obj *pm_ctx; @@ -3270,8 +3270,7 @@ QDF_STATUS policy_mgr_get_mcc_session_id_on_mac(struct wlan_objmgr_psoc *psoc, return QDF_STATUS_E_FAILURE; } - status = policy_mgr_get_chan_by_session_id_int(psoc, session_id, - &ch_freq); + status = policy_mgr_get_chan_by_session_id(psoc, session_id, &ch_freq); if (QDF_IS_STATUS_ERROR(status)) { policy_mgr_err("Failed to get channel for session id:%d", session_id); @@ -3297,8 +3296,8 @@ QDF_STATUS policy_mgr_get_mcc_session_id_on_mac(struct wlan_objmgr_psoc *psoc, return QDF_STATUS_E_FAILURE; } -uint32_t policy_mgr_get_mcc_operating_channel_int(struct wlan_objmgr_psoc *psoc, - uint8_t session_id) +uint32_t policy_mgr_get_mcc_operating_channel(struct wlan_objmgr_psoc *psoc, + uint8_t session_id) { uint8_t mac_id, mcc_session_id; QDF_STATUS status; @@ -3324,8 +3323,8 @@ uint32_t policy_mgr_get_mcc_operating_channel_int(struct wlan_objmgr_psoc *psoc, return INVALID_CHANNEL_ID; } - status = policy_mgr_get_chan_by_session_id_int(psoc, mcc_session_id, - &ch_freq); + status = policy_mgr_get_chan_by_session_id(psoc, mcc_session_id, + &ch_freq); if (QDF_IS_STATUS_ERROR(status)) { policy_mgr_err("Failed to get channel for MCC session ID:%d", mcc_session_id); @@ -3388,8 +3387,8 @@ bool policy_mgr_is_dnsc_set(struct wlan_objmgr_vdev *vdev) return roffchan; } -QDF_STATUS policy_mgr_is_chan_ok_for_dnbs_int(struct wlan_objmgr_psoc *psoc, - uint32_t ch_freq, bool *ok) +QDF_STATUS policy_mgr_is_chan_ok_for_dnbs(struct wlan_objmgr_psoc *psoc, + uint32_t ch_freq, bool *ok) { uint32_t cc_count = 0, i; uint32_t op_ch_freq_list[MAX_NUMBER_OF_CONC_CONNECTIONS]; @@ -3836,8 +3835,8 @@ bool policy_mgr_sta_sap_scc_on_lte_coex_chan( return scc_lte_coex; } -bool policy_mgr_is_valid_for_channel_switch_int(struct wlan_objmgr_psoc *psoc, - uint32_t ch_freq) +bool policy_mgr_is_valid_for_channel_switch(struct wlan_objmgr_psoc *psoc, + uint32_t ch_freq) { uint32_t sta_sap_scc_on_dfs_chan; uint32_t sap_count; @@ -3870,8 +3869,8 @@ bool policy_mgr_is_valid_for_channel_switch_int(struct wlan_objmgr_psoc *psoc, return false; } -bool policy_mgr_is_sta_sap_scc_int(struct wlan_objmgr_psoc *psoc, - uint32_t sap_freq) +bool policy_mgr_is_sta_sap_scc(struct wlan_objmgr_psoc *psoc, + uint32_t sap_freq) { uint32_t conn_index; bool is_scc = false; diff --git a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_pcl.c b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_pcl.c index ab375e2c548c..40372973a78f 100644 --- a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_pcl.c +++ b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_pcl.c @@ -2002,7 +2002,7 @@ policy_mgr_get_nondfs_preferred_channel(struct wlan_objmgr_psoc *psoc, for (i = 0; i < pcl_len; i++) { if (wlan_reg_is_dfs_for_freq(pm_ctx->pdev, pcl_channels[i]) || - !policy_mgr_is_safe_channel_int(psoc, pcl_channels[i])) { + !policy_mgr_is_safe_channel(psoc, pcl_channels[i])) { continue; } else { freq = pcl_channels[i]; diff --git a/core/hdd/src/wlan_hdd_assoc.c b/core/hdd/src/wlan_hdd_assoc.c index 6baa7d56d0a1..c64503d56eae 100644 --- a/core/hdd/src/wlan_hdd_assoc.c +++ b/core/hdd/src/wlan_hdd_assoc.c @@ -3056,8 +3056,9 @@ hdd_association_completion_handler(struct hdd_adapter *adapter, sta_ctx->conn_info.chan_freq); hdd_debug("check if STA chan ok for DNBS"); - if (policy_mgr_is_chan_ok_for_dnbs(hdd_ctx->psoc, - conn_info_channel, + if (policy_mgr_is_chan_ok_for_dnbs( + hdd_ctx->psoc, + wlan_chan_to_freq(conn_info_channel), &ok)) { hdd_err("Unable to check DNBS eligibility for chan(freq):%u", sta_ctx->conn_info.chan_freq); diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index d589e397723c..c4728b8f449d 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -17679,7 +17679,8 @@ bool wlan_hdd_handle_sap_sta_dfs_conc(struct hdd_adapter *adapter, * for 3port MCC scenario. */ if (!channel || wlan_reg_is_dfs_ch(hdd_ctx->pdev, channel) || - !policy_mgr_is_safe_channel(hdd_ctx->psoc, channel)) + !policy_mgr_is_safe_channel(hdd_ctx->psoc, + wlan_chan_to_freq(channel))) channel = wlan_freq_to_chan( policy_mgr_get_nondfs_preferred_channel( hdd_ctx->psoc, PM_SAP_MODE, true)); @@ -20367,7 +20368,7 @@ static int __wlan_hdd_cfg80211_connect(struct wiphy *wiphy, if (req->channel->hw_value && policy_mgr_is_chan_ok_for_dnbs( hdd_ctx->psoc, - req->channel->hw_value, + req->channel->center_freq, &ok)) { hdd_warn("Unable to get channel:%d eligibility for DNBS", req->channel->hw_value); diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c index 016b53fee458..4cdef48bfb66 100644 --- a/core/hdd/src/wlan_hdd_hostapd.c +++ b/core/hdd/src/wlan_hdd_hostapd.c @@ -3143,6 +3143,7 @@ QDF_STATUS wlan_hdd_get_channel_for_sap_restart( struct ch_params ch_params; struct hdd_adapter *ap_adapter = wlan_hdd_get_adapter_from_vdev( psoc, vdev_id); + uint32_t sap_ch_freq, intf_ch_freq; if (!ap_adapter) { hdd_err("ap_adapter is NULL"); @@ -3187,7 +3188,8 @@ QDF_STATUS wlan_hdd_get_channel_for_sap_restart( * as soon as STA gets disconnect. */ if (policy_mgr_is_sap_restart_required_after_sta_disconnect( - psoc, vdev_id, &intf_ch)) { + psoc, vdev_id, &intf_ch_freq)) { + intf_ch = wlan_freq_to_chan(intf_ch_freq); hdd_debug("Move the sap (vdev %d) to user configured channel %u", vdev_id, intf_ch); goto sap_restart; @@ -3205,14 +3207,16 @@ QDF_STATUS wlan_hdd_get_channel_for_sap_restart( hdd_info("sap_vdev %d intf_ch: %d", vdev_id, intf_ch); if (QDF_MCC_TO_SCC_SWITCH_FORCE_PREFERRED_WITHOUT_DISCONNECTION != mcc_to_scc_switch) { - policy_mgr_get_chan_by_session_id(psoc, vdev_id, &sap_ch); + policy_mgr_get_chan_by_session_id(psoc, vdev_id, &sap_ch_freq); if (QDF_IS_STATUS_ERROR( - policy_mgr_valid_sap_conc_channel_check( - hdd_ctx->psoc, &intf_ch, sap_ch, vdev_id))) { + policy_mgr_valid_sap_conc_channel_check( + hdd_ctx->psoc, &intf_ch_freq, sap_ch_freq, vdev_id))) { hdd_debug("can't move sap to chan(freq): %u", hdd_sta_ctx->conn_info.chan_freq); return QDF_STATUS_E_FAILURE; } + sap_ch = wlan_freq_to_chan(sap_ch_freq); + intf_ch = wlan_freq_to_chan(intf_ch_freq); } sap_restart: @@ -5142,9 +5146,8 @@ int wlan_hdd_cfg80211_start_bss(struct hdd_adapter *adapter, config->acs_dfs_mode = wlan_hdd_get_dfs_mode(mode); } - policy_mgr_update_user_config_sap_chan( - hdd_ctx->psoc, - wlan_reg_freq_to_chan(hdd_ctx->pdev, config->chan_freq)); + policy_mgr_update_user_config_sap_chan(hdd_ctx->psoc, + config->chan_freq); hdd_debug("config->chan_freq %d, config->acs_dfs_mode %d", config->chan_freq, config->acs_dfs_mode); @@ -6240,8 +6243,8 @@ static int __wlan_hdd_cfg80211_start_ap(struct wiphy *wiphy, policy_mgr_init_sap_mandatory_2g_chan( hdd_ctx->psoc); - policy_mgr_add_sap_mandatory_chan(hdd_ctx->psoc, - channel); + policy_mgr_add_sap_mandatory_chan( + hdd_ctx->psoc, wlan_chan_to_freq(channel)); } else { policy_mgr_init_sap_mandatory_2g_chan( hdd_ctx->psoc); diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index a63833f7dd07..b57f508c5a03 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -9311,10 +9311,12 @@ void hdd_unsafe_channel_restart_sap(struct hdd_context *hdd_ctxt) * is set, no need to move SAP. */ if ((policy_mgr_is_sta_sap_scc( - hdd_ctxt->psoc, ap_chan) && - scc_on_lte_coex) || - policy_mgr_nan_sap_scc_on_unsafe_ch_chk( - hdd_ctxt->psoc, ap_chan)) { + hdd_ctxt->psoc, + adapter->session.ap.operating_chan_freq) && + scc_on_lte_coex) || + policy_mgr_nan_sap_scc_on_unsafe_ch_chk( + hdd_ctxt->psoc, + adapter->session.ap.operating_chan_freq)) { hdd_debug("SAP allowed in unsafe SCC channel"); } else { for (i = 0; i < hdd_ctxt->unsafe_channel_count; i++) { diff --git a/core/hdd/src/wlan_hdd_p2p.c b/core/hdd/src/wlan_hdd_p2p.c index f7e78d8a1bbe..6b0ba2842978 100644 --- a/core/hdd/src/wlan_hdd_p2p.c +++ b/core/hdd/src/wlan_hdd_p2p.c @@ -1308,8 +1308,9 @@ static uint32_t set_second_connection_operating_channel( { uint8_t operating_channel; - operating_channel = policy_mgr_get_mcc_operating_channel( - hdd_ctx->psoc, vdev_id); + operating_channel = wlan_freq_to_chan( + policy_mgr_get_mcc_operating_channel( + hdd_ctx->psoc, vdev_id)); if (operating_channel == 0) { hdd_err("Second adapter operating channel is invalid"); diff --git a/core/mac/src/pe/lim/lim_process_action_frame.c b/core/mac/src/pe/lim/lim_process_action_frame.c index e8972aad6f2e..6d2bacadbb5b 100644 --- a/core/mac/src/pe/lim/lim_process_action_frame.c +++ b/core/mac/src/pe/lim/lim_process_action_frame.c @@ -85,7 +85,8 @@ void lim_stop_tx_and_switch_channel(struct mac_context *mac, uint8_t sessionId) mac->lim.lim_timers.gLimChannelSwitchTimer.sessionId = sessionId; status = policy_mgr_check_and_set_hw_mode_for_channel_switch(mac->psoc, pe_session->smeSessionId, - pe_session->gLimChannelSwitch.primaryChannel, + wlan_chan_to_freq( + pe_session->gLimChannelSwitch.primaryChannel), POLICY_MGR_UPDATE_REASON_CHANNEL_SWITCH_STA); /* diff --git a/core/mac/src/pe/lim/lim_utils.c b/core/mac/src/pe/lim/lim_utils.c index 79c4bf114d10..73c3c77b708a 100644 --- a/core/mac/src/pe/lim/lim_utils.c +++ b/core/mac/src/pe/lim/lim_utils.c @@ -4407,7 +4407,8 @@ bool lim_is_channel_valid_for_channel_switch(struct mac_context *mac, uint8_t ch uint8_t index; bool ok = false; - if (policy_mgr_is_chan_ok_for_dnbs(mac->psoc, channel, &ok)) { + if (policy_mgr_is_chan_ok_for_dnbs(mac->psoc, + wlan_chan_to_freq(channel), &ok)) { pe_err("policy_mgr_is_chan_ok_for_dnbs() returned error"); return false; } @@ -4422,8 +4423,8 @@ bool lim_is_channel_valid_for_channel_switch(struct mac_context *mac, uint8_t ch wlan_reg_chan_to_freq(mac->pdev, channel)) continue; - ok = policy_mgr_is_valid_for_channel_switch(mac->psoc, - channel); + ok = policy_mgr_is_valid_for_channel_switch( + mac->psoc, wlan_chan_to_freq(channel)); return ok; } diff --git a/core/sap/src/sap_api_link_cntl.c b/core/sap/src/sap_api_link_cntl.c index 0a5afef3b5aa..d5c06dd26d95 100644 --- a/core/sap/src/sap_api_link_cntl.c +++ b/core/sap/src/sap_api_link_cntl.c @@ -253,8 +253,9 @@ wlansap_filter_unsafe_ch(struct wlan_objmgr_psoc *psoc, * the acs channel list before chosing one of them as a default channel */ for (i = 0; i < sap_ctx->acs_cfg->ch_list_count; i++) { - if (!policy_mgr_is_safe_channel(psoc, - sap_ctx->acs_cfg->ch_list[i])) { + if (!policy_mgr_is_safe_channel( + psoc, wlan_chan_to_freq( + sap_ctx->acs_cfg->ch_list[i]))) { sap_debug("unsafe ch %d removed from acs list", sap_ctx->acs_cfg->ch_list[i]); continue; diff --git a/core/sap/src/sap_ch_select.c b/core/sap/src/sap_ch_select.c index 33400a0a9d33..729682392da7 100644 --- a/core/sap/src/sap_ch_select.c +++ b/core/sap/src/sap_ch_select.c @@ -427,8 +427,9 @@ uint8_t sap_select_preferred_channel_from_channel_list(uint8_t best_chnl, /* Select the best channel from allowed list */ for (i = 0; i < sap_ctx->acs_cfg->ch_list_count; i++) { if ((sap_ctx->acs_cfg->ch_list[i] == best_chnl) && - !(wlan_reg_is_dfs_ch(mac_ctx->pdev, best_chnl) && - policy_mgr_disallow_mcc(mac_ctx->psoc, best_chnl))) { + !(wlan_reg_is_dfs_ch(mac_ctx->pdev, best_chnl) && + policy_mgr_disallow_mcc( + mac_ctx->psoc, wlan_chan_to_freq(best_chnl)))) { QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO, "Best channel so far is: %d", @@ -530,7 +531,8 @@ static bool sap_chan_sel_init(mac_handle_t mac_handle, } } - if (!policy_mgr_is_safe_channel(mac->psoc, channel)) + if (!policy_mgr_is_safe_channel(mac->psoc, + wlan_chan_to_freq(channel))) chSafe = false; /* OFDM rates are not supported on channel 14 */ @@ -2555,9 +2557,10 @@ uint8_t sap_select_channel(mac_handle_t mac_handle, } if (wlan_reg_is_dfs_ch(mac_ctx->pdev, - spect_info->pSpectCh[count].chNum) && - policy_mgr_disallow_mcc(mac_ctx->psoc, - spect_info->pSpectCh[count].chNum)) { + spect_info->pSpectCh[count].chNum) && + policy_mgr_disallow_mcc( + mac_ctx->psoc, wlan_chan_to_freq( + spect_info->pSpectCh[count].chNum))) { QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_HIGH, "No DFS MCC"); diff --git a/core/sap/src/sap_fsm.c b/core/sap/src/sap_fsm.c index 9ae6efe0833a..79047db9ba23 100644 --- a/core/sap/src/sap_fsm.c +++ b/core/sap/src/sap_fsm.c @@ -764,16 +764,19 @@ sap_validate_chan(struct sap_context *sap_context, con_ch); if (sap_context->cc_switch_mode != QDF_MCC_TO_SCC_SWITCH_FORCE_PREFERRED_WITHOUT_DISCONNECTION) { + uint32_t con_ch_freq; + if (QDF_IS_STATUS_ERROR( policy_mgr_valid_sap_conc_channel_check( - mac_ctx->psoc, &con_ch, - sap_ch, + mac_ctx->psoc, &con_ch_freq, + sap_context->chan_freq, sap_context->sessionId))) { QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_WARN, FL("SAP can't start (no MCC)")); return QDF_STATUS_E_ABORTED; } + con_ch = wlan_freq_to_chan(con_ch_freq); } QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_DEBUG, FL("After check concurrency: con_ch:%d"), @@ -783,11 +786,11 @@ sap_validate_chan(struct sap_context *sap_context, mac_ctx->psoc); if (con_ch && (policy_mgr_sta_sap_scc_on_lte_coex_chan( - mac_ctx->psoc) || - policy_mgr_is_safe_channel(mac_ctx->psoc, - con_ch)) && - (!wlan_reg_is_dfs_ch(mac_ctx->pdev, con_ch) || - sta_sap_scc_on_dfs_chan)) { + mac_ctx->psoc) || + policy_mgr_is_safe_channel( + mac_ctx->psoc, wlan_chan_to_freq(con_ch))) && + (!wlan_reg_is_dfs_ch(mac_ctx->pdev, con_ch) || + sta_sap_scc_on_dfs_chan)) { QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR, "%s: Override ch freq %d to %d due to CC Intf", @@ -3349,7 +3352,7 @@ static QDF_STATUS sap_get_freq_list(struct sap_context *sap_ctx, if (wlan_reg_is_dfs_ch(mac_ctx->pdev, WLAN_REG_CH_NUM(loop_count)) && (policy_mgr_disallow_mcc(mac_ctx->psoc, - WLAN_REG_CH_NUM(loop_count)) || + WLAN_REG_CH_TO_FREQ(loop_count)) || !dfs_master_enable)) continue; diff --git a/core/sap/src/sap_module.c b/core/sap/src/sap_module.c index e6408baccba0..f874c6e3b650 100644 --- a/core/sap/src/sap_module.c +++ b/core/sap/src/sap_module.c @@ -1402,7 +1402,8 @@ QDF_STATUS wlansap_set_channel_change_with_csa(struct sap_context *sap_ctx, } mac_handle = MAC_HANDLE(mac); - if (strict && !policy_mgr_is_safe_channel(mac->psoc, targetChannel)) { + if (strict && !policy_mgr_is_safe_channel( + mac->psoc, wlan_chan_to_freq(targetChannel))) { QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR, "%u is unsafe channel", targetChannel); return QDF_STATUS_E_FAULT; @@ -1461,7 +1462,8 @@ QDF_STATUS wlansap_set_channel_change_with_csa(struct sap_context *sap_ctx, hw_mode_status = policy_mgr_check_and_set_hw_mode_for_channel_switch( - mac->psoc, sap_ctx->sessionId, targetChannel, + mac->psoc, sap_ctx->sessionId, + wlan_chan_to_freq(targetChannel), POLICY_MGR_UPDATE_REASON_CHANNEL_SWITCH); /* diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c index f020e8b0402b..bd41ba7a5357 100644 --- a/core/sme/src/common/sme_api.c +++ b/core/sme/src/common/sme_api.c @@ -14906,9 +14906,9 @@ static bool sme_get_status_for_candidate(mac_handle_t mac_handle, * reject the candidate with MBO reason code 5. */ if (policy_mgr_is_safe_channel(mac_ctx->psoc, - conn_bss_chan_id) && + wlan_chan_to_freq(conn_bss_chan_id)) && !(policy_mgr_is_safe_channel(mac_ctx->psoc, - bss_chan_id))) { + wlan_chan_to_freq(bss_chan_id)))) { sme_err("High interference expected if transitioned to BSS " QDF_MAC_ADDR_STR" hence reject", QDF_MAC_ADDR_ARRAY(bss_desc->bssId)); diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index f55528b8116d..7374df840036 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -5465,8 +5465,8 @@ static bool csr_roam_select_bss(struct mac_context *mac_ctx, * check if channel is allowed for current hw mode, if not fetch * next BSS. */ - if (!policy_mgr_is_hwmode_set_for_given_chnl(mac_ctx->psoc, - chan_id)) { + if (!policy_mgr_is_hwmode_set_for_given_chnl( + mac_ctx->psoc, result->BssDescriptor.chan_freq)) { sme_err("HW mode isn't properly set, freq %d BSSID %pM", result->BssDescriptor.chan_freq, result->BssDescriptor.bssId); @@ -8533,7 +8533,7 @@ QDF_STATUS csr_roam_connect(struct mac_context *mac, uint32_t sessionId, first_ap_profile->chan_freq); status = policy_mgr_is_chan_ok_for_dnbs( mac->psoc, - first_ap_chan_id, &ok); + first_ap_profile->chan_freq, &ok); if (QDF_IS_STATUS_ERROR(status)) { sme_debug("policy_mgr_is_chan_ok_for_dnbs():error:%d", status); diff --git a/os_if/p2p/src/wlan_cfg80211_p2p.c b/os_if/p2p/src/wlan_cfg80211_p2p.c index 480be2541e4b..5a2ddfb4bbac 100644 --- a/os_if/p2p/src/wlan_cfg80211_p2p.c +++ b/os_if/p2p/src/wlan_cfg80211_p2p.c @@ -372,7 +372,7 @@ int wlan_cfg80211_roc(struct wlan_objmgr_vdev *vdev, roc_req.duration = duration; roc_req.vdev_id = (uint32_t)vdev_id; - ret = policy_mgr_is_chan_ok_for_dnbs(psoc, roc_req.chan, &ok); + ret = policy_mgr_is_chan_ok_for_dnbs(psoc, chan->center_freq, &ok); if (QDF_IS_STATUS_ERROR(ret)) { osif_err("policy_mgr_is_chan_ok_for_dnbs():ret:%d", ret); @@ -444,7 +444,8 @@ int wlan_cfg80211_mgmt_tx(struct wlan_objmgr_vdev *vdev, int ret; bool ok; - ret = policy_mgr_is_chan_ok_for_dnbs(psoc, channel, &ok); + ret = policy_mgr_is_chan_ok_for_dnbs( + psoc, wlan_chan_to_freq(channel), &ok); if (QDF_IS_STATUS_ERROR(ret)) { osif_err("policy_mgr_is_chan_ok_for_dnbs():ret:%d", ret);