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 fc1528320e..6eb615dbb7 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 @@ -717,21 +717,12 @@ bool policy_mgr_is_any_dfs_beaconing_session_present( * concurrency combination including the new connection is * allowed or not based on the HW capability * - * Return: True/False + * Return: True/False based on concurrency support */ -bool policy_mgr_allow_concurrency_int(struct wlan_objmgr_psoc *psoc, - enum policy_mgr_con_mode mode, - uint32_t ch_freq, - enum hw_mode_bandwidth bw); - -static inline bool policy_mgr_allow_concurrency(struct wlan_objmgr_psoc *psoc, enum policy_mgr_con_mode mode, - uint8_t channel, enum hw_mode_bandwidth bw) -{ - return policy_mgr_allow_concurrency_int(psoc, mode, - wlan_chan_to_freq(channel), bw); -} + uint32_t ch_freq, + enum hw_mode_bandwidth bw); /** * policy_mgr_nan_sap_pre_enable_conc_check() - Check if NAN+SAP SCC is @@ -743,18 +734,9 @@ bool policy_mgr_allow_concurrency(struct wlan_objmgr_psoc *psoc, * Return: True if allowed else false */ bool -policy_mgr_nan_sap_pre_enable_conc_check_int(struct wlan_objmgr_psoc *psoc, - enum policy_mgr_con_mode mode, - uint32_t ch_freq); -static inline bool policy_mgr_nan_sap_pre_enable_conc_check(struct wlan_objmgr_psoc *psoc, enum policy_mgr_con_mode mode, - uint8_t ch) -{ - return policy_mgr_nan_sap_pre_enable_conc_check_int(psoc, mode, - wlan_chan_to_freq( - ch)); -} + uint32_t ch_freq); /** * policy_mgr_allow_concurrency_csa() - Check for allowed concurrency @@ -778,25 +760,11 @@ policy_mgr_nan_sap_pre_enable_conc_check(struct wlan_objmgr_psoc *psoc, * * Return: True/False */ -bool policy_mgr_allow_concurrency_csa_int(struct wlan_objmgr_psoc *psoc, - enum policy_mgr_con_mode mode, - uint32_t ch_freq, - uint32_t vdev_id, - bool forced, - enum sap_csa_reason_code reason); - -static inline -bool policy_mgr_allow_concurrency_csa(struct wlan_objmgr_psoc *psoc, - enum policy_mgr_con_mode mode, - uint8_t channel, - uint32_t vdev_id, - bool forced, - enum sap_csa_reason_code reason) -{ - return policy_mgr_allow_concurrency_csa_int(psoc, mode, - wlan_chan_to_freq(channel), - vdev_id, forced, reason); -} +bool +policy_mgr_allow_concurrency_csa(struct wlan_objmgr_psoc *psoc, + enum policy_mgr_con_mode mode, + uint32_t ch_freq, uint32_t vdev_id, + bool forced, enum sap_csa_reason_code reason); /** * policy_mgr_get_first_connection_pcl_table_index() - provides the @@ -927,20 +895,10 @@ QDF_STATUS policy_mgr_decr_connection_count(struct wlan_objmgr_psoc *psoc, * Return: QDF_STATUS enum */ QDF_STATUS -policy_mgr_current_connections_update_int(struct wlan_objmgr_psoc *psoc, - uint32_t session_id, - uint32_t ch_freq, - enum policy_mgr_conn_update_reason); - -static inline QDF_STATUS policy_mgr_current_connections_update(struct wlan_objmgr_psoc *psoc, - uint32_t session_id, uint8_t channel, - enum policy_mgr_conn_update_reason reason) -{ - return policy_mgr_current_connections_update_int(psoc, session_id, - wlan_chan_to_freq( - channel), reason); -} + uint32_t session_id, uint32_t ch_freq, + enum policy_mgr_conn_update_reason); + /** * policy_mgr_is_dbs_allowed_for_concurrency() - If dbs is allowed for current * concurreny @@ -1025,27 +983,13 @@ struct policy_mgr_conc_connection_info *policy_mgr_get_conn_info( * Return: QDF_STATUS */ QDF_STATUS -policy_mgr_incr_connection_count_utfw_int(struct wlan_objmgr_psoc *psoc, - uint32_t vdev_id, uint32_t tx_streams, - uint32_t rx_streams, - uint32_t chain_mask, uint32_t type, - uint32_t sub_type, - uint32_t ch_freq, uint32_t mac_id); - -static inline QDF_STATUS policy_mgr_incr_connection_count_utfw(struct wlan_objmgr_psoc *psoc, uint32_t vdev_id, uint32_t tx_streams, - uint32_t rx_streams, uint32_t chain_mask, - uint32_t type, uint32_t sub_type, - uint32_t channelid, uint32_t mac_id) -{ - return policy_mgr_incr_connection_count_utfw_int(psoc, vdev_id, - tx_streams, rx_streams, - chain_mask, type, - sub_type, - wlan_chan_to_freq( - channelid), mac_id); -} + uint32_t rx_streams, + uint32_t chain_mask, uint32_t type, + uint32_t sub_type, + uint32_t ch_freq, uint32_t mac_id); + /** * policy_mgr_update_connection_info_utfw() - updates the * existing connection in the current connections list @@ -1065,30 +1009,13 @@ policy_mgr_incr_connection_count_utfw(struct wlan_objmgr_psoc *psoc, * Return: QDF_STATUS */ QDF_STATUS -policy_mgr_update_connection_info_utfw_int(struct wlan_objmgr_psoc *psoc, - uint32_t vdev_id, - uint32_t tx_streams, - uint32_t rx_streams, - uint32_t chain_mask, uint32_t type, - uint32_t sub_type, - uint32_t ch_freq, uint32_t mac_id); - -static inline QDF_STATUS policy_mgr_update_connection_info_utfw(struct wlan_objmgr_psoc *psoc, - uint32_t vdev_id, uint32_t tx_streams, + uint32_t vdev_id, + uint32_t tx_streams, uint32_t rx_streams, uint32_t chain_mask, uint32_t type, uint32_t sub_type, - uint32_t channelid, uint32_t mac_id) -{ - return policy_mgr_update_connection_info_utfw_int(psoc, vdev_id, - tx_streams, - rx_streams, - chain_mask, type, - sub_type, - wlan_chan_to_freq( - channelid), mac_id); -} + uint32_t ch_freq, uint32_t mac_id); /** * policy_mgr_decr_connection_count_utfw() - remove the old @@ -1561,22 +1488,10 @@ bool policy_mgr_map_concurrency_mode(enum QDF_OPMODE *old_mode, * Return: QDF_STATUS */ QDF_STATUS -policy_mgr_get_channel_from_scan_result_int(struct wlan_objmgr_psoc *psoc, - void *roam_profile, - uint32_t *ch_freq); - -static inline QDF_STATUS policy_mgr_get_channel_from_scan_result(struct wlan_objmgr_psoc *psoc, - void *roam_profile, uint8_t *channel) -{ - uint32_t ch_freq; - QDF_STATUS status; + void *roam_profile, + uint32_t *ch_freq); - status = policy_mgr_get_channel_from_scan_result_int(psoc, roam_profile, - &ch_freq); - *channel = wlan_freq_to_chan(ch_freq); - return status; -} /** * policy_mgr_mode_specific_num_open_sessions() - to get number of open sessions * for a specific mode @@ -1796,20 +1711,10 @@ QDF_STATUS policy_mgr_modify_sap_pcl_based_on_mandatory_channel( * * Return: QDF_STATUS */ -QDF_STATUS policy_mgr_update_and_wait_for_connection_update_int( +QDF_STATUS policy_mgr_update_and_wait_for_connection_update( 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_update_and_wait_for_connection_update( - struct wlan_objmgr_psoc *psoc, uint8_t session_id, - uint8_t channel, enum policy_mgr_conn_update_reason reason) -{ - return - policy_mgr_update_and_wait_for_connection_update_int(psoc, session_id, - wlan_chan_to_freq( - channel), reason); -} - /** * policy_mgr_is_sap_mandatory_channel_set() - Checks if SAP * mandatory channel is set @@ -1892,20 +1797,8 @@ QDF_STATUS policy_mgr_get_nss_for_vdev(struct wlan_objmgr_psoc *psoc, * Return: QDF_STATUS */ QDF_STATUS -policy_mgr_get_sap_mandatory_channel_int(struct wlan_objmgr_psoc *psoc, - uint32_t *ch_freq); -static inline QDF_STATUS policy_mgr_get_sap_mandatory_channel(struct wlan_objmgr_psoc *psoc, - uint16_t *chan) -{ - uint32_t ch_freq; - QDF_STATUS status; - - status = policy_mgr_get_sap_mandatory_channel_int(psoc, &ch_freq); - *chan = wlan_freq_to_chan(ch_freq); - - return status; -} + uint32_t *ch_freq); /** * policy_mgr_set_sap_mandatory_channels() - Set the mandatory channel for SAP @@ -2133,15 +2026,8 @@ bool policy_mgr_is_hw_mode_change_after_vdev_up(struct wlan_objmgr_psoc *psoc); * * Return: None */ -void policy_mgr_checkn_update_hw_mode_single_mac_mode_int( - struct wlan_objmgr_psoc *psoc, uint32_t ch_freq); -static inline void policy_mgr_checkn_update_hw_mode_single_mac_mode( - struct wlan_objmgr_psoc *psoc, uint8_t channel) -{ - policy_mgr_checkn_update_hw_mode_single_mac_mode_int( - psoc, wlan_chan_to_freq(channel)); -} + struct wlan_objmgr_psoc *psoc, uint32_t ch_freq); /** * policy_mgr_dump_connection_status_info() - Dump the concurrency information 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 fc928153d6..54dd43fcc8 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 @@ -369,7 +369,7 @@ QDF_STATUS policy_mgr_update_connection_info(struct wlan_objmgr_psoc *psoc, return QDF_STATUS_SUCCESS; } -QDF_STATUS policy_mgr_update_and_wait_for_connection_update_int( +QDF_STATUS policy_mgr_update_and_wait_for_connection_update( struct wlan_objmgr_psoc *psoc, uint8_t session_id, uint32_t ch_freq, @@ -384,7 +384,7 @@ QDF_STATUS policy_mgr_update_and_wait_for_connection_update_int( if (QDF_IS_STATUS_ERROR(status)) policy_mgr_err("clearing event failed"); - status = policy_mgr_current_connections_update_int( + status = policy_mgr_current_connections_update( psoc, session_id, ch_freq, reason); if (QDF_STATUS_E_FAILURE == status) { policy_mgr_err("connections update failed"); @@ -888,11 +888,10 @@ policy_mgr_get_next_action(struct wlan_objmgr_psoc *psoc, } QDF_STATUS -policy_mgr_current_connections_update_int(struct wlan_objmgr_psoc *psoc, - uint32_t session_id, - uint32_t ch_freq, - enum policy_mgr_conn_update_reason - reason) +policy_mgr_current_connections_update(struct wlan_objmgr_psoc *psoc, + uint32_t session_id, uint32_t ch_freq, + enum policy_mgr_conn_update_reason + reason) { enum policy_mgr_conc_next_action next_action = PM_NOP; QDF_STATUS status; @@ -1227,8 +1226,8 @@ policy_mgr_handle_conc_multiport(struct wlan_objmgr_psoc *psoc, if (!QDF_IS_STATUS_SUCCESS(status)) policy_mgr_err("clearing event failed"); - status = policy_mgr_current_connections_update_int(psoc, session_id, - ch_freq, reason); + status = policy_mgr_current_connections_update(psoc, session_id, + ch_freq, reason); if (QDF_STATUS_E_FAILURE == status) { policy_mgr_err("connections update failed"); return status; @@ -1526,9 +1525,9 @@ bool policy_mgr_nan_sap_scc_on_unsafe_ch_chk_int(struct wlan_objmgr_psoc *psoc, } bool -policy_mgr_nan_sap_pre_enable_conc_check_int(struct wlan_objmgr_psoc *psoc, - enum policy_mgr_con_mode mode, - uint32_t ch_freq) +policy_mgr_nan_sap_pre_enable_conc_check(struct wlan_objmgr_psoc *psoc, + enum policy_mgr_con_mode mode, + uint32_t ch_freq) { struct policy_mgr_psoc_priv_obj *pm_ctx; uint32_t sap_freq, nan_2g_freq, nan_5g_freq; @@ -2402,7 +2401,7 @@ chk_opportunistic_timer: return status; } -void policy_mgr_checkn_update_hw_mode_single_mac_mode_int( +void policy_mgr_checkn_update_hw_mode_single_mac_mode( struct wlan_objmgr_psoc *psoc, uint32_t ch_freq) { uint8_t i; @@ -2559,7 +2558,7 @@ ret_value: } #ifdef MPC_UT_FRAMEWORK -QDF_STATUS policy_mgr_update_connection_info_utfw_int( +QDF_STATUS policy_mgr_update_connection_info_utfw( struct wlan_objmgr_psoc *psoc, uint32_t vdev_id, uint32_t tx_streams, uint32_t rx_streams, uint32_t chain_mask, uint32_t type, uint32_t sub_type, @@ -2601,7 +2600,7 @@ QDF_STATUS policy_mgr_update_connection_info_utfw_int( return QDF_STATUS_SUCCESS; } -QDF_STATUS policy_mgr_incr_connection_count_utfw_int( +QDF_STATUS policy_mgr_incr_connection_count_utfw( struct wlan_objmgr_psoc *psoc, uint32_t vdev_id, uint32_t tx_streams, uint32_t rx_streams, uint32_t chain_mask, uint32_t type, uint32_t sub_type, 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 198e6133c3..7cb5128bb2 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 @@ -2380,10 +2380,10 @@ done: return status; } -bool policy_mgr_allow_concurrency_int(struct wlan_objmgr_psoc *psoc, - enum policy_mgr_con_mode mode, - uint32_t ch_freq, - enum hw_mode_bandwidth bw) +bool policy_mgr_allow_concurrency(struct wlan_objmgr_psoc *psoc, + enum policy_mgr_con_mode mode, + uint32_t ch_freq, + enum hw_mode_bandwidth bw) { QDF_STATUS status; struct policy_mgr_pcl_list pcl; @@ -2410,12 +2410,11 @@ bool policy_mgr_allow_concurrency_int(struct wlan_objmgr_psoc *psoc, return allowed; } -bool policy_mgr_allow_concurrency_csa_int(struct wlan_objmgr_psoc *psoc, - enum policy_mgr_con_mode mode, - uint32_t ch_freq, - uint32_t vdev_id, - bool forced, - enum sap_csa_reason_code reason) +bool +policy_mgr_allow_concurrency_csa(struct wlan_objmgr_psoc *psoc, + enum policy_mgr_con_mode mode, + uint32_t ch_freq, uint32_t vdev_id, + bool forced, enum sap_csa_reason_code reason) { bool allow = false; struct policy_mgr_conc_connection_info @@ -2468,8 +2467,8 @@ bool policy_mgr_allow_concurrency_csa_int(struct wlan_objmgr_psoc *psoc, policy_mgr_store_and_del_conn_info_by_vdev_id( psoc, vdev_id, info, &num_cxn_del); - allow = policy_mgr_allow_concurrency_int(psoc, mode, ch_freq, - HW_MODE_20_MHZ); + allow = policy_mgr_allow_concurrency(psoc, mode, ch_freq, + HW_MODE_20_MHZ); /* Restore the connection entry */ if (num_cxn_del > 0) policy_mgr_restore_deleted_conn_info(psoc, info, num_cxn_del); @@ -2516,7 +2515,7 @@ uint32_t policy_mgr_get_concurrency_mode(struct wlan_objmgr_psoc *psoc) * * Return: QDF_STATUS */ -QDF_STATUS policy_mgr_get_channel_from_scan_result_int( +QDF_STATUS policy_mgr_get_channel_from_scan_result( struct wlan_objmgr_psoc *psoc, void *roam_profile, uint32_t *ch_freq) { @@ -2608,7 +2607,7 @@ uint32_t policy_mgr_search_and_check_for_session_conc( } else return ch_freq; - status = policy_mgr_get_channel_from_scan_result_int( + status = policy_mgr_get_channel_from_scan_result( psoc, roam_profile, &ch_freq); if (QDF_STATUS_SUCCESS != status || ch_freq == 0) { policy_mgr_err("%s error %d %d", @@ -2617,8 +2616,8 @@ uint32_t policy_mgr_search_and_check_for_session_conc( } /* Take care of 160MHz and 80+80Mhz later */ - ret = policy_mgr_allow_concurrency_int(psoc, mode, ch_freq, - HW_MODE_20_MHZ); + ret = policy_mgr_allow_concurrency(psoc, mode, ch_freq, + HW_MODE_20_MHZ); if (false == ret) { policy_mgr_err("Connection failed due to conc check fail"); return 0; @@ -2727,8 +2726,7 @@ bool policy_mgr_check_for_session_conc(struct wlan_objmgr_psoc *psoc, } /* Take care of 160MHz and 80+80Mhz later */ - ret = policy_mgr_allow_concurrency_int(psoc, mode, ch_freq, - HW_MODE_20_MHZ); + ret = policy_mgr_allow_concurrency(psoc, mode, ch_freq, HW_MODE_20_MHZ); if (false == ret) { policy_mgr_err("Connection failed due to conc check fail"); return 0; 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 ef2c3684e0..ab375e2c54 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 @@ -2265,8 +2265,7 @@ QDF_STATUS policy_mgr_modify_sap_pcl_based_on_mandatory_channel( return QDF_STATUS_SUCCESS; } -QDF_STATUS policy_mgr_get_sap_mandatory_channel_int( - struct wlan_objmgr_psoc *psoc, +QDF_STATUS policy_mgr_get_sap_mandatory_channel(struct wlan_objmgr_psoc *psoc, uint32_t *ch_freq) { QDF_STATUS status; diff --git a/components/nan/core/src/nan_main.c b/components/nan/core/src/nan_main.c index 687853881b..b69cd2fcab 100644 --- a/components/nan/core/src/nan_main.c +++ b/components/nan/core/src/nan_main.c @@ -584,9 +584,9 @@ static QDF_STATUS nan_handle_confirm( return status; } - status = policy_mgr_current_connections_update(psoc, - vdev_id, channel, - POLICY_MGR_UPDATE_REASON_NDP_UPDATE); + status = policy_mgr_current_connections_update( + psoc, vdev_id, wlan_chan_to_freq(channel), + POLICY_MGR_UPDATE_REASON_NDP_UPDATE); if (QDF_STATUS_E_FAILURE == status) { nan_err("connections update failed!!"); return status; @@ -1042,7 +1042,8 @@ bool nan_is_enable_allowed(struct wlan_objmgr_psoc *psoc, uint8_t nan_chan) } return (NAN_DISC_DISABLED == nan_get_discovery_state(psoc) && - policy_mgr_allow_concurrency(psoc, PM_NAN_DISC_MODE, nan_chan, + policy_mgr_allow_concurrency(psoc, PM_NAN_DISC_MODE, + wlan_chan_to_freq(nan_chan), HW_MODE_20_MHZ)); } @@ -1089,8 +1090,8 @@ QDF_STATUS nan_discovery_pre_enable(struct wlan_objmgr_psoc *psoc, goto pre_enable_failure; } - if (!policy_mgr_nan_sap_pre_enable_conc_check(psoc, PM_NAN_DISC_MODE, - nan_social_channel)) { + if (!policy_mgr_nan_sap_pre_enable_conc_check( + psoc, PM_NAN_DISC_MODE, wlan_chan_to_freq(nan_social_channel))) { nan_debug("NAN not enabled due to concurrency constraints"); status = QDF_STATUS_E_INVAL; goto pre_enable_failure; @@ -1106,9 +1107,9 @@ QDF_STATUS nan_discovery_pre_enable(struct wlan_objmgr_psoc *psoc, vdev_id = wlan_vdev_get_id(vdev); wlan_objmgr_vdev_release_ref(vdev, WLAN_NAN_ID); - status = policy_mgr_update_and_wait_for_connection_update(psoc, vdev_id, - nan_social_channel, - POLICY_MGR_UPDATE_REASON_NAN_DISCOVERY); + status = policy_mgr_update_and_wait_for_connection_update( + psoc, vdev_id, wlan_chan_to_freq(nan_social_channel), + POLICY_MGR_UPDATE_REASON_NAN_DISCOVERY); if (QDF_IS_STATUS_ERROR(status)) { nan_err("Failed to set or wait for HW mode change"); goto pre_enable_failure; diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index d2fe9c190a..d589e39772 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -9775,7 +9775,7 @@ static int __wlan_hdd_cfg80211_set_probable_oper_channel(struct wiphy *wiphy, int ret = 0; enum policy_mgr_con_mode intf_mode; struct nlattr *tb[QCA_WLAN_VENDOR_ATTR_PROBABLE_OPER_CHANNEL_MAX + 1]; - uint32_t channel_hint; + uint32_t ch_freq, channel_hint; hdd_enter_dev(ndev); @@ -9809,12 +9809,12 @@ static int __wlan_hdd_cfg80211_set_probable_oper_channel(struct wiphy *wiphy, return -EINVAL; } - channel_hint = cds_freq_to_chan(nla_get_u32(tb - [QCA_WLAN_VENDOR_ATTR_PROBABLE_OPER_CHANNEL_FREQ])); - + ch_freq = nla_get_u32(tb[ + QCA_WLAN_VENDOR_ATTR_PROBABLE_OPER_CHANNEL_FREQ]); + channel_hint = cds_freq_to_chan(ch_freq); /* check pcl table */ if (!policy_mgr_allow_concurrency(hdd_ctx->psoc, intf_mode, - channel_hint, HW_MODE_20_MHZ)) { + ch_freq, HW_MODE_20_MHZ)) { hdd_err("Set channel hint failed due to concurrency check"); return -EINVAL; } @@ -17613,6 +17613,7 @@ bool wlan_hdd_handle_sap_sta_dfs_conc(struct hdd_adapter *adapter, struct hdd_hostapd_state *hostapd_state; uint8_t channel = 0; QDF_STATUS status; + uint32_t ch_freq; hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD); if (!hdd_ctx) { @@ -17658,8 +17659,9 @@ bool wlan_hdd_handle_sap_sta_dfs_conc(struct hdd_adapter *adapter, * find out by looking in to scan cache where sta is going to * connect by passing its roam_profile. */ - status = policy_mgr_get_channel_from_scan_result(hdd_ctx->psoc, - roam_profile, &channel); + status = policy_mgr_get_channel_from_scan_result( + hdd_ctx->psoc, roam_profile, &ch_freq); + channel = wlan_freq_to_chan(ch_freq); /* * If the STA's channel is 2.4 GHz, then set pcl with only 2.4 GHz @@ -19507,8 +19509,10 @@ static int __wlan_hdd_cfg80211_join_ibss(struct wiphy *wiphy, /* Disable NAN Discovery if enabled */ ucfg_nan_disable_concurrency(hdd_ctx->psoc); - if (!policy_mgr_allow_concurrency(hdd_ctx->psoc, - PM_IBSS_MODE, channelNum, HW_MODE_20_MHZ)) { + if (!policy_mgr_allow_concurrency( + hdd_ctx->psoc, PM_IBSS_MODE, + wlan_reg_chan_to_freq(hdd_ctx->pdev, channelNum), + HW_MODE_20_MHZ)) { hdd_err("This concurrency combination is not allowed"); return -ECONNREFUSED; } @@ -19517,9 +19521,10 @@ static int __wlan_hdd_cfg80211_join_ibss(struct wiphy *wiphy, if (!QDF_IS_STATUS_SUCCESS(status)) hdd_err("qdf_reset_connection_update failed status: %d", status); - status = policy_mgr_current_connections_update(hdd_ctx->psoc, - adapter->vdev_id, channelNum, - POLICY_MGR_UPDATE_REASON_JOIN_IBSS); + status = policy_mgr_current_connections_update( + hdd_ctx->psoc, adapter->vdev_id, + wlan_reg_chan_to_freq(hdd_ctx->pdev, channelNum), + POLICY_MGR_UPDATE_REASON_JOIN_IBSS); if (QDF_STATUS_E_FAILURE == status) { hdd_err("connections update failed!!"); return -EINVAL; @@ -20396,7 +20401,7 @@ static int __wlan_hdd_cfg80211_connect(struct wiphy *wiphy, if (!policy_mgr_allow_concurrency(hdd_ctx->psoc, policy_mgr_convert_device_mode_to_qdf_type( adapter->device_mode), - req->channel->hw_value, HW_MODE_20_MHZ)) { + req->channel->center_freq, HW_MODE_20_MHZ)) { hdd_warn("This concurrency combination is not allowed"); status = -ECONNREFUSED; goto con_chk_failed; @@ -22680,8 +22685,9 @@ int wlan_hdd_change_hw_mode_for_given_chnl(struct hdd_adapter *adapter, if (!QDF_IS_STATUS_SUCCESS(status)) hdd_err("clearing event failed"); - status = policy_mgr_current_connections_update(hdd_ctx->psoc, - adapter->vdev_id, channel, reason); + status = policy_mgr_current_connections_update( + hdd_ctx->psoc, adapter->vdev_id, + wlan_chan_to_freq(channel), reason); switch (status) { case QDF_STATUS_E_FAILURE: /* diff --git a/core/hdd/src/wlan_hdd_conc_ut.c b/core/hdd/src/wlan_hdd_conc_ut.c index 37606ab1f6..852b8c8d49 100644 --- a/core/hdd/src/wlan_hdd_conc_ut.c +++ b/core/hdd/src/wlan_hdd_conc_ut.c @@ -705,10 +705,10 @@ void wlan_hdd_two_connections_scenario(struct hdd_context *hdd_ctx, /* sub_type mapping between HDD and WMA are different */ wlan_hdd_map_subtypes_hdd_wma(&dummy_type, &sub_type); /* add first connection as STA */ - policy_mgr_incr_connection_count_utfw(hdd_ctx->psoc, - vdevid, tx_stream, - rx_stream, chain_mask, type, dummy_type, - channel_id, mac_id); + policy_mgr_incr_connection_count_utfw( + hdd_ctx->psoc, vdevid, tx_stream, + rx_stream, chain_mask, type, dummy_type, + wlan_chan_to_freq(channel_id), mac_id); /* validate one connection is created or no */ if (policy_mgr_get_connection_count(hdd_ctx->psoc) != 1) { hdd_err("Test failed - No. of connection is not 1"); @@ -811,9 +811,10 @@ void wlan_hdd_three_connections_scenario(struct hdd_context *hdd_ctx, /* sub_type mapping between HDD and WMA are different */ wlan_hdd_map_subtypes_hdd_wma(&dummy_type_1, &sub_type_1); /* add first connection as STA */ - policy_mgr_incr_connection_count_utfw(hdd_ctx->psoc, - vdevid_1, tx_stream_1, rx_stream_1, chain_mask_1, - type_1, dummy_type_1, channel_id_1, mac_id_1); + policy_mgr_incr_connection_count_utfw( + hdd_ctx->psoc, vdevid_1, tx_stream_1, rx_stream_1, + chain_mask_1, type_1, dummy_type_1, + wlan_chan_to_freq(channel_id_1), mac_id_1); /* validate one connection is created or no */ if (policy_mgr_get_connection_count(hdd_ctx->psoc) != 1) { hdd_err("Test fail - No. of connection not 1"); @@ -826,10 +827,11 @@ void wlan_hdd_three_connections_scenario(struct hdd_context *hdd_ctx, /* sub_type mapping between HDD and WMA are different */ wlan_hdd_map_subtypes_hdd_wma(&dummy_type_2, &sub_type_2); - policy_mgr_incr_connection_count_utfw(hdd_ctx->psoc, - vdevid_2, tx_stream_2, rx_stream_2, - chain_mask_2, type_2, - dummy_type_2, channel_id_2, mac_id_2); + policy_mgr_incr_connection_count_utfw( + hdd_ctx->psoc, vdevid_2, tx_stream_2, + rx_stream_2, chain_mask_2, type_2, + dummy_type_2, + wlan_chan_to_freq(channel_id_2), mac_id_2); /* validate two connections are created or no */ if (policy_mgr_get_connection_count(hdd_ctx->psoc) != 2) { diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c index 5a8352d9cc..016b53fee4 100644 --- a/core/hdd/src/wlan_hdd_hostapd.c +++ b/core/hdd/src/wlan_hdd_hostapd.c @@ -2987,7 +2987,7 @@ int hdd_softap_set_channel_change(struct net_device *dev, int target_channel, hdd_ctx->psoc, policy_mgr_convert_device_mode_to_qdf_type( adapter->device_mode), - target_channel, + wlan_chan_to_freq(target_channel), adapter->vdev_id, forced, sap_ctx->csa_reason)) { @@ -6323,15 +6323,15 @@ static int __wlan_hdd_cfg80211_start_ap(struct wiphy *wiphy, /* NDI + SAP not supported */ ucfg_nan_check_and_disable_unsupported_ndi(hdd_ctx->psoc, true); - if (!policy_mgr_nan_sap_pre_enable_conc_check(hdd_ctx->psoc, - PM_SAP_MODE, channel)) + if (!policy_mgr_nan_sap_pre_enable_conc_check( + hdd_ctx->psoc, PM_SAP_MODE, wlan_chan_to_freq(channel))) hdd_debug("NAN disabled due to concurrency constraints"); /* check if concurrency is allowed */ if (!policy_mgr_allow_concurrency(hdd_ctx->psoc, policy_mgr_convert_device_mode_to_qdf_type( adapter->device_mode), - channel, + wlan_chan_to_freq(channel), channel_width)) { hdd_err("Connection failed due to concurrency check failure"); return -EINVAL; @@ -6354,15 +6354,16 @@ static int __wlan_hdd_cfg80211_start_ap(struct wiphy *wiphy, * back to single MAC 2x2 (if initial was 2x2). */ - policy_mgr_checkn_update_hw_mode_single_mac_mode(hdd_ctx->psoc, - channel); + policy_mgr_checkn_update_hw_mode_single_mac_mode( + hdd_ctx->psoc, wlan_chan_to_freq(channel)); if (status != QDF_STATUS_SUCCESS) { hdd_err("Failed to stop DBS opportunistic timer"); return -EINVAL; } - status = policy_mgr_current_connections_update(hdd_ctx->psoc, - adapter->vdev_id, channel, + status = policy_mgr_current_connections_update( + hdd_ctx->psoc, adapter->vdev_id, + wlan_chan_to_freq(channel), POLICY_MGR_UPDATE_REASON_START_AP); if (status == QDF_STATUS_E_FAILURE) { hdd_err("ERROR: connections update failed!!"); diff --git a/core/hdd/src/wlan_hdd_sap_cond_chan_switch.c b/core/hdd/src/wlan_hdd_sap_cond_chan_switch.c index da82ec7f38..31f8b0beeb 100644 --- a/core/hdd/src/wlan_hdd_sap_cond_chan_switch.c +++ b/core/hdd/src/wlan_hdd_sap_cond_chan_switch.c @@ -330,10 +330,9 @@ static int __wlan_hdd_request_pre_cac(struct hdd_context *hdd_ctx, * connection update should result in DBS mode */ status = policy_mgr_update_and_wait_for_connection_update( - hdd_ctx->psoc, - ap_adapter->vdev_id, - pre_cac_chan, - POLICY_MGR_UPDATE_REASON_PRE_CAC); + hdd_ctx->psoc, ap_adapter->vdev_id, + wlan_chan_to_freq(pre_cac_chan), + POLICY_MGR_UPDATE_REASON_PRE_CAC); if (QDF_IS_STATUS_ERROR(status)) { hdd_err("error in moving to DBS mode"); goto stop_close_pre_cac_adapter; diff --git a/core/hdd/src/wlan_hdd_wext.c b/core/hdd/src/wlan_hdd_wext.c index 4fc4dcc707..c1100bd108 100644 --- a/core/hdd/src/wlan_hdd_wext.c +++ b/core/hdd/src/wlan_hdd_wext.c @@ -7563,9 +7563,11 @@ static int iw_get_policy_manager_ut_ops(struct hdd_context *hdd_ctx, hdd_err("Invalid input params received for the IOCTL"); return 0; } - policy_mgr_update_connection_info_utfw(hdd_ctx->psoc, + policy_mgr_update_connection_info_utfw( + hdd_ctx->psoc, apps_args[0], apps_args[1], apps_args[2], apps_args[3], - apps_args[4], apps_args[5], apps_args[6], apps_args[7]); + apps_args[4], apps_args[5], + wlan_chan_to_freq(apps_args[6]), apps_args[7]); } break; @@ -7624,8 +7626,8 @@ static int iw_get_policy_manager_ut_ops(struct hdd_context *hdd_ctx, return 0; } policy_mgr_current_connections_update( - hdd_ctx->psoc, - adapter->vdev_id, apps_args[0], + hdd_ctx->psoc, adapter->vdev_id, + wlan_chan_to_freq(apps_args[0]), POLICY_MGR_UPDATE_REASON_UT); } break; @@ -7640,8 +7642,9 @@ static int iw_get_policy_manager_ut_ops(struct hdd_context *hdd_ctx, hdd_err("Invalid input params received for the IOCTL"); return 0; } - allow = policy_mgr_allow_concurrency(hdd_ctx->psoc, - apps_args[0], apps_args[1], apps_args[2]); + allow = policy_mgr_allow_concurrency( + hdd_ctx->psoc, apps_args[0], + wlan_chan_to_freq(apps_args[1]), apps_args[2]); hdd_debug("allow %d {0 = don't allow, 1 = allow}", allow); } break; diff --git a/core/sap/src/sap_fsm.c b/core/sap/src/sap_fsm.c index 48700eb24f..9ae6efe083 100644 --- a/core/sap/src/sap_fsm.c +++ b/core/sap/src/sap_fsm.c @@ -814,10 +814,9 @@ validation_done: */ qdf_status = policy_mgr_update_and_wait_for_connection_update( - mac_ctx->psoc, - sap_context->sessionId, - sap_ch, - POLICY_MGR_UPDATE_REASON_START_AP); + mac_ctx->psoc, sap_context->sessionId, + sap_context->chan_freq, + POLICY_MGR_UPDATE_REASON_START_AP); if (QDF_IS_STATUS_ERROR(qdf_status)) return qdf_status; } diff --git a/core/sme/src/csr/csr_api_scan.c b/core/sme/src/csr/csr_api_scan.c index 8174bc4634..1f5ca0efab 100644 --- a/core/sme/src/csr/csr_api_scan.c +++ b/core/sme/src/csr/csr_api_scan.c @@ -1170,9 +1170,10 @@ static void csr_handle_nxt_cmd(struct mac_context *mac_ctx, csr_scan_handle_search_for_ssid_failure(mac_ctx, session_id); break; case eCsrNextCheckAllowConc: - ret = policy_mgr_current_connections_update(mac_ctx->psoc, - session_id, chan, - POLICY_MGR_UPDATE_REASON_HIDDEN_STA); + ret = policy_mgr_current_connections_update( + mac_ctx->psoc, session_id, + wlan_chan_to_freq(chan), + POLICY_MGR_UPDATE_REASON_HIDDEN_STA); sme_debug("chan: %d session: %d status: %d", chan, session_id, ret); diff --git a/core/sme/src/csr/csr_util.c b/core/sme/src/csr/csr_util.c index 0d17ba3edf..0ae1413f46 100644 --- a/core/sme/src/csr/csr_util.c +++ b/core/sme/src/csr/csr_util.c @@ -1026,6 +1026,7 @@ uint16_t csr_check_concurrent_channel_overlap(struct mac_context *mac_ctx, uint16_t sap_cfreq = 0; uint16_t sap_lfreq, sap_hfreq, intf_lfreq, intf_hfreq, sap_cch = 0; QDF_STATUS status; + uint32_t intf_ch_freq; sme_debug("sap_ch: %d sap_phymode: %d", sap_ch, sap_phymode); @@ -1125,22 +1126,23 @@ uint16_t csr_check_concurrent_channel_overlap(struct mac_context *mac_ctx, QDF_MCC_TO_SCC_WITH_PREFERRED_BAND) intf_ch = 0; } else if (cc_switch_mode == - QDF_MCC_TO_SCC_SWITCH_WITH_FAVORITE_CHANNEL) { - status = - policy_mgr_get_sap_mandatory_channel( - mac_ctx->psoc, - &intf_ch); + QDF_MCC_TO_SCC_SWITCH_WITH_FAVORITE_CHANNEL) { + status = policy_mgr_get_sap_mandatory_channel( + mac_ctx->psoc, + &intf_ch_freq); if (QDF_IS_STATUS_ERROR(status)) sme_err("no mandatory channel"); + intf_ch = wlan_freq_to_chan(intf_ch_freq); } } else if ((intf_ch == sap_ch) && (cc_switch_mode == QDF_MCC_TO_SCC_SWITCH_WITH_FAVORITE_CHANNEL)) { if (cds_chan_to_band(intf_ch) == CDS_BAND_2GHZ) { status = policy_mgr_get_sap_mandatory_channel( - mac_ctx->psoc, &intf_ch); + mac_ctx->psoc, &intf_ch_freq); if (QDF_IS_STATUS_ERROR(status)) sme_err("no mandatory channel"); + intf_ch = wlan_freq_to_chan(intf_ch_freq); } }