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 f43a000b63b3..fc1528320e4c 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 @@ -414,17 +414,8 @@ uint32_t policy_mgr_search_and_check_for_session_conc( * * Return: true if channel is in diff band */ -bool policy_mgr_is_chnl_in_diff_band_int(struct wlan_objmgr_psoc *psoc, - uint32_t ch_freq); - -static inline bool policy_mgr_is_chnl_in_diff_band(struct wlan_objmgr_psoc *psoc, - uint8_t channel) -{ - return policy_mgr_is_chnl_in_diff_band_int(psoc, - wlan_chan_to_freq( - channel)); -} + uint32_t ch_freq); /** * policy_mgr_check_for_session_conc() - Check if concurrency is @@ -437,17 +428,9 @@ bool policy_mgr_is_chnl_in_diff_band(struct wlan_objmgr_psoc *psoc, * * True if the concurrency is allowed, false otherwise */ -bool policy_mgr_check_for_session_conc_int(struct wlan_objmgr_psoc *psoc, - uint8_t session_id, - uint32_t ch_freq); -static inline bool policy_mgr_check_for_session_conc(struct wlan_objmgr_psoc *psoc, - uint8_t session_id, uint8_t channel) -{ - return policy_mgr_check_for_session_conc_int(psoc, session_id, - wlan_chan_to_freq( - channel)); -} + uint8_t session_id, uint32_t ch_freq); + /** * policy_mgr_handle_conc_multiport() - to handle multiport concurrency * @session_id: Session ID @@ -459,21 +442,11 @@ bool policy_mgr_check_for_session_conc(struct wlan_objmgr_psoc *psoc, * * Return: QDF_STATUS */ -QDF_STATUS policy_mgr_handle_conc_multiport_int(struct wlan_objmgr_psoc *psoc, - uint8_t session_id, - uint32_t ch_freq, - enum policy_mgr_conn_update_reason reason); +QDF_STATUS +policy_mgr_handle_conc_multiport(struct wlan_objmgr_psoc *psoc, + uint8_t session_id, uint32_t ch_freq, + enum policy_mgr_conn_update_reason reason); -static inline -QDF_STATUS policy_mgr_handle_conc_multiport(struct wlan_objmgr_psoc *psoc, - uint8_t session_id, uint8_t channel, - enum policy_mgr_conn_update_reason - reason) -{ - return policy_mgr_handle_conc_multiport_int(psoc, session_id, - wlan_chan_to_freq(channel), - reason); -} #ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH /** * policy_mgr_check_concurrent_intf_and_restart_sap() - Check @@ -535,27 +508,15 @@ QDF_STATUS policy_mgr_change_mcc_go_beacon_interval( * * Return: None */ -void policy_mgr_change_sap_channel_with_csa_int(struct wlan_objmgr_psoc *psoc, - uint8_t vdev_id, - uint32_t ch_freq, - uint32_t ch_width, - bool forced); - -static inline void policy_mgr_change_sap_channel_with_csa(struct wlan_objmgr_psoc *psoc, - uint8_t vdev_id, uint8_t channel, - uint32_t ch_width, bool forced) -{ - policy_mgr_change_sap_channel_with_csa_int(psoc, vdev_id, - wlan_chan_to_freq(channel), - ch_width, forced); -} + uint8_t vdev_id, uint32_t ch_freq, + uint32_t ch_width, bool forced); + #else static inline void policy_mgr_change_sap_channel_with_csa( struct wlan_objmgr_psoc *psoc, uint8_t vdev_id, uint32_t ch_freq, - uint32_t ch_width, - bool forced) + uint32_t ch_width, bool forced) { } @@ -626,17 +587,9 @@ void policy_mgr_decr_session_set_pcl(struct wlan_objmgr_psoc *psoc, * * Return: channel frequency value */ -uint32_t policy_mgr_get_channel_int(struct wlan_objmgr_psoc *psoc, - enum policy_mgr_con_mode mode, - uint32_t *vdev_id); - -static inline uint8_t policy_mgr_get_channel(struct wlan_objmgr_psoc *psoc, - enum policy_mgr_con_mode mode, - uint32_t *vdev_id) -{ - return wlan_freq_to_chan(policy_mgr_get_channel_int(psoc, mode, - vdev_id)); -} +uint32_t policy_mgr_get_channel(struct wlan_objmgr_psoc *psoc, + enum policy_mgr_con_mode mode, + uint32_t *vdev_id); /** * policy_mgr_get_pcl() - provides the preferred channel list for @@ -709,18 +662,9 @@ void policy_mgr_update_with_safe_channel_list(struct wlan_objmgr_psoc *psoc, * Return: uint32_t non-dfs channel frequency */ uint32_t -policy_mgr_get_nondfs_preferred_channel_int(struct wlan_objmgr_psoc *psoc, - enum policy_mgr_con_mode mode, - bool for_existing_conn); - -static inline -uint8_t policy_mgr_get_nondfs_preferred_channel(struct wlan_objmgr_psoc *psoc, - enum policy_mgr_con_mode mode, - bool for_existing_conn) -{ - return wlan_freq_to_chan(policy_mgr_get_nondfs_preferred_channel_int( - psoc, mode, for_existing_conn)); -} +policy_mgr_get_nondfs_preferred_channel(struct wlan_objmgr_psoc *psoc, + enum policy_mgr_con_mode mode, + bool for_existing_conn); /** * policy_mgr_is_any_nondfs_chnl_present() - Find any non-dfs 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 7918f9059abf..fc928153d66a 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 @@ -481,8 +481,8 @@ bool policy_mgr_is_dbs_allowed_for_concurrency( return ret; } -bool policy_mgr_is_chnl_in_diff_band_int(struct wlan_objmgr_psoc *psoc, - uint32_t ch_freq) +bool policy_mgr_is_chnl_in_diff_band(struct wlan_objmgr_psoc *psoc, + uint32_t ch_freq) { uint8_t i; struct policy_mgr_psoc_priv_obj *pm_ctx; @@ -1211,13 +1211,13 @@ QDF_STATUS policy_mgr_next_actions( } QDF_STATUS -policy_mgr_handle_conc_multiport_int(struct wlan_objmgr_psoc *psoc, - uint8_t session_id, uint32_t ch_freq, - enum policy_mgr_conn_update_reason reason) +policy_mgr_handle_conc_multiport(struct wlan_objmgr_psoc *psoc, + uint8_t session_id, uint32_t ch_freq, + enum policy_mgr_conn_update_reason reason) { QDF_STATUS status; - if (!policy_mgr_check_for_session_conc_int(psoc, session_id, ch_freq)) { + if (!policy_mgr_check_for_session_conc(psoc, session_id, ch_freq)) { policy_mgr_err("Conc not allowed for the session %d", session_id); return QDF_STATUS_E_FAILURE; @@ -1663,15 +1663,13 @@ void policy_mgr_nan_sap_post_enable_conc_check(struct wlan_objmgr_psoc *psoc) CSA_REASON_CONCURRENT_NAN_EVENT); if (WLAN_REG_IS_5GHZ_CH_FREQ(sap_info->freq)) { - policy_mgr_change_sap_channel_with_csa_int( - psoc, sap_info->vdev_id, + policy_mgr_change_sap_channel_with_csa(psoc, sap_info->vdev_id, nan_freq_5g, policy_mgr_get_ch_width( sap_info->bw), true); } else { - policy_mgr_change_sap_channel_with_csa_int( - psoc, sap_info->vdev_id, + policy_mgr_change_sap_channel_with_csa(psoc, sap_info->vdev_id, nan_freq_2g, policy_mgr_get_ch_width( sap_info->bw), @@ -1703,9 +1701,8 @@ void policy_mgr_nan_sap_post_disable_conc_check(struct wlan_objmgr_psoc *psoc) if (sap_freq == 0 || policy_mgr_is_safe_channel_int(psoc, sap_freq)) return; - sap_freq = policy_mgr_get_nondfs_preferred_channel_int(psoc, - PM_SAP_MODE, - false); + sap_freq = policy_mgr_get_nondfs_preferred_channel(psoc, PM_SAP_MODE, + false); policy_mgr_debug("User/ACS orig Freq: %d New SAP Freq: %d", pm_ctx->user_config_sap_ch_freq, sap_freq); if (pm_ctx->hdd_cbacks.hdd_is_chan_switch_in_progress && @@ -1723,10 +1720,10 @@ void policy_mgr_nan_sap_post_disable_conc_check(struct wlan_objmgr_psoc *psoc) psoc, sap_info->vdev_id, CSA_REASON_CONCURRENT_NAN_EVENT); - policy_mgr_change_sap_channel_with_csa_int(psoc, sap_info->vdev_id, - sap_freq, - policy_mgr_get_ch_width( - sap_info->bw), true); + policy_mgr_change_sap_channel_with_csa(psoc, sap_info->vdev_id, + sap_freq, + policy_mgr_get_ch_width( + sap_info->bw), true); } static void __policy_mgr_check_sta_ap_concurrent_ch_intf(void *data) @@ -2066,11 +2063,9 @@ sap_restart: * * Return: None */ -void policy_mgr_change_sap_channel_with_csa_int(struct wlan_objmgr_psoc *psoc, - uint8_t vdev_id, - uint32_t ch_freq, - uint32_t ch_width, - bool forced) +void policy_mgr_change_sap_channel_with_csa(struct wlan_objmgr_psoc *psoc, + uint8_t vdev_id, uint32_t ch_freq, + uint32_t ch_width, bool forced) { struct policy_mgr_psoc_priv_obj *pm_ctx; 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 5693c8d139bb..198e6133c3a5 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 @@ -2698,8 +2698,8 @@ bool policy_mgr_is_mcc_in_24G(struct wlan_objmgr_psoc *psoc) return is_24G_mcc; } -bool policy_mgr_check_for_session_conc_int(struct wlan_objmgr_psoc *psoc, - uint8_t session_id, uint32_t ch_freq) +bool policy_mgr_check_for_session_conc(struct wlan_objmgr_psoc *psoc, + uint8_t session_id, uint32_t ch_freq) { enum policy_mgr_con_mode mode; bool ret; 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 fd5e01c58961..ef2c3684e043 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 @@ -381,9 +381,9 @@ static QDF_STATUS policy_mgr_modify_pcl_based_on_dnbs( return QDF_STATUS_SUCCESS; } -uint32_t policy_mgr_get_channel_int(struct wlan_objmgr_psoc *psoc, - enum policy_mgr_con_mode mode, - uint32_t *vdev_id) +uint32_t policy_mgr_get_channel(struct wlan_objmgr_psoc *psoc, + enum policy_mgr_con_mode mode, + uint32_t *vdev_id) { uint32_t idx = 0; struct policy_mgr_psoc_priv_obj *pm_ctx; @@ -1954,9 +1954,9 @@ enum policy_mgr_three_connection_mode #endif uint32_t -policy_mgr_get_nondfs_preferred_channel_int(struct wlan_objmgr_psoc *psoc, - enum policy_mgr_con_mode mode, - bool for_existing_conn) +policy_mgr_get_nondfs_preferred_channel(struct wlan_objmgr_psoc *psoc, + enum policy_mgr_con_mode mode, + bool for_existing_conn) { uint32_t pcl_channels[QDF_MAX_NUM_CHAN]; uint8_t pcl_weight[QDF_MAX_NUM_CHAN]; diff --git a/components/tdls/core/src/wlan_tdls_cmds_process.c b/components/tdls/core/src/wlan_tdls_cmds_process.c index 2a8c03c59ee9..e6de135428fe 100644 --- a/components/tdls/core/src/wlan_tdls_cmds_process.c +++ b/components/tdls/core/src/wlan_tdls_cmds_process.c @@ -2238,9 +2238,11 @@ QDF_STATUS tdls_process_antenna_switch(struct tdls_antenna_switch_request *req) vdev_id = wlan_vdev_get_id(vdev); opmode = wlan_vdev_mlme_get_opmode(vdev); - channel = policy_mgr_get_channel(soc_obj->soc, + channel = wlan_freq_to_chan( + policy_mgr_get_channel( + soc_obj->soc, policy_mgr_convert_device_mode_to_qdf_type(opmode), - &vdev_id); + &vdev_id)); /* Check supported nss for TDLS, if is 1x1, no need to teardown links */ if (WLAN_REG_IS_24GHZ_CH(channel)) diff --git a/components/tdls/core/src/wlan_tdls_peer.c b/components/tdls/core/src/wlan_tdls_peer.c index 34e74b0602de..d6cdb4ffecaa 100644 --- a/components/tdls/core/src/wlan_tdls_peer.c +++ b/components/tdls/core/src/wlan_tdls_peer.c @@ -399,9 +399,11 @@ static void tdls_determine_channel_opclass(struct tdls_soc_priv_obj *soc_obj, vdev_id = wlan_vdev_get_id(vdev_obj->vdev); opmode = wlan_vdev_mlme_get_opmode(vdev_obj->vdev); - *channel = policy_mgr_get_channel(soc_obj->soc, + *channel = wlan_freq_to_chan( + policy_mgr_get_channel( + soc_obj->soc, policy_mgr_convert_device_mode_to_qdf_type(opmode), - &vdev_id); + &vdev_id)); *opclass = 0; } else { *channel = peer->pref_off_chan_num; diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index 65bce41f270e..d2fe9c190a20 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -6496,8 +6496,8 @@ static int wlan_hdd_handle_restrict_offchan_config(struct hdd_adapter *adapter, wlan_vdev_obj_lock(vdev); wlan_vdev_mlme_cap_set(vdev, WLAN_VDEV_C_RESTRICT_OFFCHAN); wlan_vdev_obj_unlock(vdev); - chan = policy_mgr_get_channel(hdd_ctx->psoc, pmode, - &vdev_id); + chan = wlan_freq_to_chan( + policy_mgr_get_channel(hdd_ctx->psoc, pmode, &vdev_id)); if (!chan || wlan_hdd_send_avoid_freq_for_dnbs(hdd_ctx, chan)) { hdd_err("unable to send avoid_freq"); @@ -17678,8 +17678,9 @@ bool wlan_hdd_handle_sap_sta_dfs_conc(struct hdd_adapter *adapter, */ if (!channel || wlan_reg_is_dfs_ch(hdd_ctx->pdev, channel) || !policy_mgr_is_safe_channel(hdd_ctx->psoc, channel)) - channel = policy_mgr_get_nondfs_preferred_channel( - hdd_ctx->psoc, PM_SAP_MODE, true); + channel = wlan_freq_to_chan( + policy_mgr_get_nondfs_preferred_channel( + hdd_ctx->psoc, PM_SAP_MODE, true)); hostapd_state = WLAN_HDD_GET_HOSTAP_STATE_PTR(ap_adapter); qdf_event_reset(&hostapd_state->qdf_event); diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 4f5fcf378a2f..a63833f7dd07 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -9200,8 +9200,9 @@ void hdd_switch_sap_channel(struct hdd_adapter *adapter, uint8_t channel, hdd_debug("chan:%d width:%d", channel, hdd_ap_ctx->sap_config.ch_width_orig); - policy_mgr_change_sap_channel_with_csa(hdd_ctx->psoc, - adapter->vdev_id, channel, + policy_mgr_change_sap_channel_with_csa( + hdd_ctx->psoc, adapter->vdev_id, + wlan_chan_to_freq(channel), hdd_ap_ctx->sap_config.ch_width_orig, forced); } diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index acf36b1899d4..f55528b8116d 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -8555,8 +8555,9 @@ QDF_STATUS csr_roam_connect(struct mac_context *mac, uint32_t sessionId, if (!channel_id) channel_id = first_ap_chan_id; - status = policy_mgr_handle_conc_multiport(mac->psoc, - sessionId, channel_id, + status = policy_mgr_handle_conc_multiport( + mac->psoc, sessionId, + wlan_chan_to_freq(channel_id), POLICY_MGR_UPDATE_REASON_NORMAL_STA); if ((QDF_IS_STATUS_SUCCESS(status)) && (!csr_wait_for_connection_update(mac, true))) { @@ -10017,8 +10018,7 @@ void csr_handle_disassoc_ho(struct mac_context *mac, uint32_t session_id) status = policy_mgr_handle_conc_multiport( mac->psoc, session_id, - wlan_reg_freq_to_chan( - mac->pdev,bss_node->pBssDescription->chan_freq), + mac->pdev, bss_node->pBssDescription->chan_freq, POLICY_MGR_UPDATE_REASON_LFR2_ROAM); if (QDF_IS_STATUS_SUCCESS(status)) { mac->roam.neighborRoamInfo[session_id].scan_res_lfr2_roam_ap = diff --git a/core/sme/src/csr/csr_api_scan.c b/core/sme/src/csr/csr_api_scan.c index 379f9eab22aa..8174bc463494 100644 --- a/core/sme/src/csr/csr_api_scan.c +++ b/core/sme/src/csr/csr_api_scan.c @@ -2044,8 +2044,8 @@ csr_scan_get_channel_for_hw_mode_change(struct mac_context *mac_ctx, status, first_ap_ch); return 0; } - if (!policy_mgr_check_for_session_conc(mac_ctx->psoc, session_id, - first_ap_ch)) { + if (!policy_mgr_check_for_session_conc( + mac_ctx->psoc, session_id, wlan_chan_to_freq(first_ap_ch))) { sme_scan_result_purge(result_handle); sme_err("Conc not allowed for the session %d ch %d", session_id, first_ap_ch);