|
@@ -3965,7 +3965,6 @@ bool policy_mgr_is_5g_channel_allowed(struct wlan_objmgr_psoc *psoc,
|
|
|
* @sap_ch_freq: sap/go channel starting channel frequency
|
|
|
* @acs_band: acs band
|
|
|
* @allow_6ghz: allow 6 Ghz channel or not
|
|
|
- * @allow_non_scc: allow non SCC channel or not
|
|
|
*
|
|
|
* This API will consider protocol 6ghz allow flag - allow_6ghz.
|
|
|
* Also for regdomain, it will consider PCL allow or not.
|
|
@@ -3981,8 +3980,7 @@ policy_mgr_get_pref_force_scc_freq(struct wlan_objmgr_psoc *psoc,
|
|
|
qdf_freq_t *intf_ch_freq,
|
|
|
qdf_freq_t sap_ch_freq,
|
|
|
uint32_t acs_band,
|
|
|
- bool allow_6ghz,
|
|
|
- bool allow_non_scc)
|
|
|
+ bool allow_6ghz)
|
|
|
{
|
|
|
struct policy_mgr_psoc_priv_obj *pm_ctx;
|
|
|
enum policy_mgr_con_mode mode;
|
|
@@ -3990,13 +3988,15 @@ policy_mgr_get_pref_force_scc_freq(struct wlan_objmgr_psoc *psoc,
|
|
|
uint32_t i;
|
|
|
struct policy_mgr_pcl_list pcl;
|
|
|
bool allow_2ghz_only = false;
|
|
|
- qdf_freq_t scc_ch_freq_on_same_band = 0;
|
|
|
- qdf_freq_t scc_ch_freq_on_diff_band_freq = 0;
|
|
|
+ qdf_freq_t scc_ch_freq_on_same_mac = 0;
|
|
|
+ qdf_freq_t scc_ch_freq_on_diff_mac = 0;
|
|
|
qdf_freq_t scc_ch_freq_same_as_sap = 0;
|
|
|
- qdf_freq_t non_scc_ch_freq_on_same_band = 0;
|
|
|
- qdf_freq_t non_scc_ch_freq_on_diff_band_freq = 0;
|
|
|
+ qdf_freq_t non_scc_ch_freq_on_same_mac = 0;
|
|
|
+ qdf_freq_t non_scc_ch_freq_on_diff_mac = 0;
|
|
|
+ qdf_freq_t non_scc_ch_freq_same_as_sap = 0;
|
|
|
enum QDF_OPMODE op_mode;
|
|
|
qdf_freq_t pcl_freq;
|
|
|
+ bool same_mac, sbs_ml_sta_present = false, dbs_ml_sta_present = false;
|
|
|
|
|
|
pm_ctx = policy_mgr_get_context(psoc);
|
|
|
if (!pm_ctx) {
|
|
@@ -4004,6 +4004,11 @@ policy_mgr_get_pref_force_scc_freq(struct wlan_objmgr_psoc *psoc,
|
|
|
return QDF_STATUS_E_INVAL;
|
|
|
}
|
|
|
|
|
|
+ if (policy_mgr_is_mlo_in_mode_dbs(psoc, PM_STA_MODE, NULL, NULL))
|
|
|
+ dbs_ml_sta_present = true;
|
|
|
+ else if (policy_mgr_is_mlo_in_mode_sbs(psoc, PM_STA_MODE, NULL, NULL))
|
|
|
+ sbs_ml_sta_present = true;
|
|
|
+
|
|
|
op_mode = wlan_get_opmode_vdev_id(pm_ctx->pdev, vdev_id);
|
|
|
mode = policy_mgr_convert_device_mode_to_qdf_type(op_mode);
|
|
|
|
|
@@ -4023,11 +4028,11 @@ policy_mgr_get_pref_force_scc_freq(struct wlan_objmgr_psoc *psoc,
|
|
|
WLAN_REG_IS_24GHZ_CH_FREQ(sap_ch_freq))
|
|
|
allow_2ghz_only = true;
|
|
|
|
|
|
- /* qdf_conc_list_lock has been locked by caller.
|
|
|
+ /*
|
|
|
* The preferred force SCC channel is SAP original channel,
|
|
|
- * and then the SCC channel on the same band, and then the SCC
|
|
|
- * channel on the different band.
|
|
|
- * We will make sure the PCL only contains valid channels - not
|
|
|
+ * and then the SCC channel on the same mac, and then the SCC
|
|
|
+ * channel on the different mac.
|
|
|
+ * Make sure the PCL only contains valid channels - not
|
|
|
* causing 3 vif on same mac.
|
|
|
* If none of channels are available, we have to keep SAP channel
|
|
|
* unchanged, and that may cause SAP MCC.
|
|
@@ -4040,275 +4045,155 @@ policy_mgr_get_pref_force_scc_freq(struct wlan_objmgr_psoc *psoc,
|
|
|
if (allow_2ghz_only && !WLAN_REG_IS_24GHZ_CH_FREQ(pcl_freq))
|
|
|
continue;
|
|
|
|
|
|
+ /*
|
|
|
+ * If ML STA is present, as ML STA cannot be on same mac,
|
|
|
+ * check same band logic as per the ML hw mode, else
|
|
|
+ * use the API which is hw mode agnostic.
|
|
|
+ */
|
|
|
+ if (dbs_ml_sta_present)
|
|
|
+ same_mac = policy_mgr_2_freq_same_mac_in_dbs(pm_ctx,
|
|
|
+ sap_ch_freq,
|
|
|
+ pcl_freq);
|
|
|
+ else if (sbs_ml_sta_present)
|
|
|
+ same_mac = policy_mgr_2_freq_same_mac_in_sbs(pm_ctx,
|
|
|
+ sap_ch_freq,
|
|
|
+ pcl_freq);
|
|
|
+ else
|
|
|
+ same_mac = policy_mgr_2_freq_always_on_same_mac(psoc,
|
|
|
+ sap_ch_freq,
|
|
|
+ pcl_freq);
|
|
|
if (!((pm_conc_connection_list[0].in_use &&
|
|
|
(pcl_freq == pm_conc_connection_list[0].freq)) ||
|
|
|
(pm_conc_connection_list[1].in_use &&
|
|
|
(pcl_freq == pm_conc_connection_list[1].freq)) ||
|
|
|
(pm_conc_connection_list[2].in_use &&
|
|
|
(pcl_freq == pm_conc_connection_list[2].freq)))) {
|
|
|
- if (!non_scc_ch_freq_on_same_band &&
|
|
|
- WLAN_REG_IS_SAME_BAND_FREQS(sap_ch_freq, pcl_freq))
|
|
|
- non_scc_ch_freq_on_same_band = pcl_freq;
|
|
|
- else if (!non_scc_ch_freq_on_diff_band_freq)
|
|
|
- non_scc_ch_freq_on_diff_band_freq = pcl_freq;
|
|
|
+ if (sap_ch_freq == pcl_freq)
|
|
|
+ non_scc_ch_freq_same_as_sap = pcl_freq;
|
|
|
+ else if (!non_scc_ch_freq_on_same_mac && same_mac)
|
|
|
+ non_scc_ch_freq_on_same_mac = pcl_freq;
|
|
|
+ else if (!non_scc_ch_freq_on_diff_mac && !same_mac)
|
|
|
+ non_scc_ch_freq_on_diff_mac = pcl_freq;
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
if (sap_ch_freq == pcl_freq)
|
|
|
scc_ch_freq_same_as_sap = pcl_freq;
|
|
|
- else if (!scc_ch_freq_on_same_band &&
|
|
|
- WLAN_REG_IS_SAME_BAND_FREQS(sap_ch_freq, pcl_freq))
|
|
|
- scc_ch_freq_on_same_band = pcl_freq;
|
|
|
- else if (!scc_ch_freq_on_diff_band_freq)
|
|
|
- scc_ch_freq_on_diff_band_freq = pcl_freq;
|
|
|
+ else if (!scc_ch_freq_on_same_mac && same_mac)
|
|
|
+ scc_ch_freq_on_same_mac = pcl_freq;
|
|
|
+ else if (!scc_ch_freq_on_diff_mac && !same_mac)
|
|
|
+ scc_ch_freq_on_diff_mac = pcl_freq;
|
|
|
}
|
|
|
|
|
|
if (scc_ch_freq_same_as_sap)
|
|
|
*intf_ch_freq = scc_ch_freq_same_as_sap;
|
|
|
- else if (scc_ch_freq_on_same_band)
|
|
|
- *intf_ch_freq = scc_ch_freq_on_same_band;
|
|
|
- else if (scc_ch_freq_on_diff_band_freq)
|
|
|
- *intf_ch_freq = scc_ch_freq_on_diff_band_freq;
|
|
|
- else if (allow_non_scc && non_scc_ch_freq_on_same_band)
|
|
|
- *intf_ch_freq = non_scc_ch_freq_on_same_band;
|
|
|
- else if (allow_non_scc && non_scc_ch_freq_on_diff_band_freq)
|
|
|
- *intf_ch_freq = non_scc_ch_freq_on_diff_band_freq;
|
|
|
+ else if (scc_ch_freq_on_same_mac)
|
|
|
+ *intf_ch_freq = scc_ch_freq_on_same_mac;
|
|
|
+ else if (non_scc_ch_freq_same_as_sap)
|
|
|
+ *intf_ch_freq = non_scc_ch_freq_same_as_sap;
|
|
|
+ else if (scc_ch_freq_on_diff_mac)
|
|
|
+ *intf_ch_freq = scc_ch_freq_on_diff_mac;
|
|
|
+ else if (non_scc_ch_freq_on_same_mac)
|
|
|
+ *intf_ch_freq = non_scc_ch_freq_on_same_mac;
|
|
|
+ else if (non_scc_ch_freq_on_diff_mac)
|
|
|
+ *intf_ch_freq = non_scc_ch_freq_on_diff_mac;
|
|
|
else
|
|
|
*intf_ch_freq = 0;
|
|
|
|
|
|
+ policy_mgr_debug("2ghz_only %d allow_6ghz %d, ml sta SBS:%d DBS:%d, SCC: same_as_sap %d same_mac %d on_diff_mac %d, NON-SCC: same_as_sap %d same_mac %d on_diff_mac %d. intf_ch_freq %d",
|
|
|
+ allow_2ghz_only, allow_6ghz, sbs_ml_sta_present,
|
|
|
+ dbs_ml_sta_present, scc_ch_freq_same_as_sap,
|
|
|
+ scc_ch_freq_on_same_mac, scc_ch_freq_on_diff_mac,
|
|
|
+ non_scc_ch_freq_same_as_sap,
|
|
|
+ non_scc_ch_freq_on_same_mac,
|
|
|
+ non_scc_ch_freq_on_diff_mac, *intf_ch_freq);
|
|
|
+
|
|
|
return QDF_STATUS_SUCCESS;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * policy_mgr_check_force_scc_three_connection() - Check 3 connection cases
|
|
|
- * to find the force SCC channel for SAP/GO
|
|
|
+ * policy_mgr_handle_sta_sap_fav_channel() - Get preferred force SCC
|
|
|
+ * channel frequency using favorite mandatory channel list
|
|
|
* @psoc: Pointer to Psoc
|
|
|
- * @vdev_id: vdev id of SAP/GO
|
|
|
- * @intf_ch_freq: interference channel frequency
|
|
|
- * @sap_ch_freq: SAP/GO current home channel frequency
|
|
|
- * @acs_band: acs band preference
|
|
|
- * @allow_6ghz: interface supports 6Ghz band
|
|
|
- *
|
|
|
- * This function gets the force SCC channel in 3 connections case.
|
|
|
+ * @pm_ctx: pm ctx
|
|
|
+ * @vdev_id: vdev id
|
|
|
+ * @intf_ch_freq: prefer force scc frequency
|
|
|
+ * @sap_ch_freq: sap/go channel starting channel frequency
|
|
|
+ * @acs_band: acs band
|
|
|
*
|
|
|
- * Return: QDF_STATUS_SUCCESS if success
|
|
|
+ * Return: QDF_STATUS_SUCCESS if a valid favorite mandatory force scc channel
|
|
|
+ * is found.
|
|
|
*/
|
|
|
static QDF_STATUS
|
|
|
-policy_mgr_check_force_scc_three_connection(struct wlan_objmgr_psoc *psoc,
|
|
|
- uint8_t vdev_id,
|
|
|
- qdf_freq_t *intf_ch_freq,
|
|
|
- qdf_freq_t sap_ch_freq,
|
|
|
- uint32_t acs_band,
|
|
|
- bool allow_6ghz)
|
|
|
+policy_mgr_handle_sta_sap_fav_channel(struct wlan_objmgr_psoc *psoc,
|
|
|
+ struct policy_mgr_psoc_priv_obj *pm_ctx,
|
|
|
+ uint8_t vdev_id, qdf_freq_t sap_ch_freq,
|
|
|
+ qdf_freq_t *intf_ch_freq,
|
|
|
+ uint32_t acs_band)
|
|
|
{
|
|
|
- return policy_mgr_get_pref_force_scc_freq(psoc,
|
|
|
- vdev_id,
|
|
|
- intf_ch_freq,
|
|
|
- sap_ch_freq,
|
|
|
- acs_band,
|
|
|
- allow_6ghz,
|
|
|
- false);
|
|
|
-}
|
|
|
+ bool sta_sap_scc_on_indoor_channel_allowed;
|
|
|
+ QDF_STATUS status = QDF_STATUS_E_FAILURE;
|
|
|
+ qdf_freq_t user_config_freq;
|
|
|
|
|
|
-static void
|
|
|
-policy_mgr_check_force_scc_two_connection(struct wlan_objmgr_psoc *psoc,
|
|
|
- uint8_t vdev_id,
|
|
|
- qdf_freq_t *intf_ch_freq,
|
|
|
- qdf_freq_t sap_ch_freq,
|
|
|
- uint8_t cc_mode,
|
|
|
- bool same_band_present,
|
|
|
- uint32_t acs_band,
|
|
|
- bool allow_6ghz)
|
|
|
-{
|
|
|
- bool sbs_mlo_present = false;
|
|
|
- bool dbs_mlo_present = false;
|
|
|
+ /* intf_ch_freq and SAP freq in same band */
|
|
|
+ if (WLAN_REG_IS_24GHZ_CH_FREQ(*intf_ch_freq) ==
|
|
|
+ WLAN_REG_IS_24GHZ_CH_FREQ(sap_ch_freq))
|
|
|
+ return policy_mgr_get_sap_mandatory_channel(psoc, sap_ch_freq,
|
|
|
+ intf_ch_freq, vdev_id);
|
|
|
|
|
|
+ /* intf_ch_freq and SAP freq in different band */
|
|
|
/*
|
|
|
- * 1st: 2nd: 3rd(SAP): Action:
|
|
|
- * -------------------------------------------------
|
|
|
- * 2Ghz 2Ghz(SMM/DBS) 5Ghz Start on 5Ghz
|
|
|
- * 2Ghz 5Ghz(DBS) 5Ghz Force SCC to 5Ghz
|
|
|
- * 2Ghz 5Ghz(DBS) 2Ghz Force SCC to 5Ghz
|
|
|
- * 5Ghz 5Ghz(SBS) 2Ghz If acs is ALL band force SCC
|
|
|
- * else start on 2.4Ghz
|
|
|
- * 5Ghz 5Ghz(SBS) 5Ghz Force SCC to one of 5Ghz
|
|
|
- * 5Ghz 5Ghz(SMM) 2Ghz Start on 2.4Ghz
|
|
|
- * 5Ghz 5Ghz(SMM) 5Ghz Allow SAP on sap_ch_freq if all
|
|
|
- * 3, 5Ghz freq doesn't end up
|
|
|
- * on same mac, ie 2 of them lead
|
|
|
- * to SBS. Else force SCC on
|
|
|
- * one of the freq (3 home channel
|
|
|
- * will not be allowed)
|
|
|
- * 2Ghz 2Ghz(SMM/DBS) 2Ghz force SCC on one of the freq
|
|
|
- * (3 home channel
|
|
|
- * will not be allowed)
|
|
|
+ * STA + SAP where doing SCC on 5 GHz indoor channel.
|
|
|
+ * STA moved/roamed to 2.4 GHz. Move SAP to initially
|
|
|
+ * started channel.
|
|
|
+ *
|
|
|
+ * STA+SAP where STA is moved/roamed to 5GHz indoor
|
|
|
+ * and SAP is on 2.4 GHz due to previous concurrency.
|
|
|
+ * Move SAP to STA channel on SCC.
|
|
|
*/
|
|
|
+ sta_sap_scc_on_indoor_channel_allowed =
|
|
|
+ policy_mgr_get_sta_sap_scc_allowed_on_indoor_chnl(psoc);
|
|
|
|
|
|
- /* Check if STA or SAP SBS MLO is present */
|
|
|
- if (policy_mgr_is_hw_sbs_capable(psoc) &&
|
|
|
- (policy_mgr_is_mlo_in_mode_sbs(psoc, PM_STA_MODE,
|
|
|
- NULL, NULL) ||
|
|
|
- policy_mgr_is_mlo_in_mode_sbs(psoc, PM_SAP_MODE,
|
|
|
- NULL, NULL)))
|
|
|
- sbs_mlo_present = true;
|
|
|
-
|
|
|
- /*
|
|
|
- * Check for SBS mlo present as if 1 link is inactive the
|
|
|
- * HW mode will be SMM and not SBS.
|
|
|
- */
|
|
|
- if (policy_mgr_is_current_hwmode_sbs(psoc) || sbs_mlo_present) {
|
|
|
- /*
|
|
|
- * 1st: 2nd: 3rd(SAP): Action:
|
|
|
- * -------------------------------------------------
|
|
|
- * 5Ghz 5Ghz(SBS) 2Ghz If acs is ALL band force SCC
|
|
|
- * else start on 2.4Ghz
|
|
|
- * 5Ghz 5Ghz(SBS) 5Ghz Force SCC to one of 5Ghz
|
|
|
- *
|
|
|
- * Need to consider protocol 6ghz allow flag - allow_6ghz.
|
|
|
- * Also for regdomain, need to consider PCL if STA is on 6ghz
|
|
|
- * LPI mode, SAP is not allowed started on 6ghz, see API
|
|
|
- * policy_mgr_modify_sap_pcl_for_6G_channels.
|
|
|
- */
|
|
|
- policy_mgr_get_pref_force_scc_freq(psoc,
|
|
|
- vdev_id,
|
|
|
- intf_ch_freq,
|
|
|
- sap_ch_freq,
|
|
|
- acs_band,
|
|
|
- allow_6ghz,
|
|
|
- true);
|
|
|
- return;
|
|
|
- }
|
|
|
/*
|
|
|
- * Check for dbs mlo present as if 1 link is inactive the
|
|
|
- * HW mode will be SMM and not dbs.
|
|
|
+ * SAP and interface freq in different band and 5 GHz freq is
|
|
|
+ * indoor
|
|
|
*/
|
|
|
- if (policy_mgr_is_hw_dbs_capable(psoc) &&
|
|
|
- (policy_mgr_is_mlo_in_mode_dbs(psoc, PM_STA_MODE,
|
|
|
- NULL, NULL) ||
|
|
|
- policy_mgr_is_mlo_in_mode_dbs(psoc, PM_SAP_MODE,
|
|
|
- NULL, NULL)))
|
|
|
- dbs_mlo_present = true;
|
|
|
-
|
|
|
- if (policy_mgr_is_current_hwmode_dbs(psoc) || dbs_mlo_present) {
|
|
|
- /*
|
|
|
- * 1st: 2nd: 3rd(SAP): Action:
|
|
|
- * -------------------------------------------------
|
|
|
- * 2Ghz 2Ghz(DBS) 5Ghz Start on 5Ghz
|
|
|
- * 2Ghz 5Ghz(DBS) 5Ghz Force SCC to 5Ghz
|
|
|
- * 2Ghz 5Ghz(DBS) 2Ghz Force SCC to 5Ghz
|
|
|
- * 2Ghz 2Ghz(DBS) 2Ghz force SCC on one of
|
|
|
- * the freq (3 home
|
|
|
- * channel will not be
|
|
|
- * allowed)
|
|
|
- *
|
|
|
- * Need to consider protocol 6ghz allow flag - allow_6ghz.
|
|
|
- * Also for regdomain, need to consider PCL if STA is on 6ghz
|
|
|
- * LPI mode, SAP is not allowed started on 6ghz, see API
|
|
|
- * policy_mgr_modify_sap_pcl_for_6G_channels.
|
|
|
- */
|
|
|
- policy_mgr_get_pref_force_scc_freq(psoc,
|
|
|
- vdev_id,
|
|
|
- intf_ch_freq,
|
|
|
- sap_ch_freq,
|
|
|
- acs_band,
|
|
|
- allow_6ghz,
|
|
|
- true);
|
|
|
- return;
|
|
|
+ if (sta_sap_scc_on_indoor_channel_allowed &&
|
|
|
+ ((wlan_reg_is_freq_indoor(pm_ctx->pdev, sap_ch_freq) &&
|
|
|
+ WLAN_REG_IS_24GHZ_CH_FREQ(*intf_ch_freq)) ||
|
|
|
+ (wlan_reg_is_freq_indoor(pm_ctx->pdev, *intf_ch_freq) &&
|
|
|
+ WLAN_REG_IS_24GHZ_CH_FREQ(sap_ch_freq) &&
|
|
|
+ !(acs_band == QCA_ACS_MODE_IEEE80211B ||
|
|
|
+ acs_band == QCA_ACS_MODE_IEEE80211G)))) {
|
|
|
+ status = policy_mgr_get_sap_mandatory_channel(psoc, sap_ch_freq,
|
|
|
+ intf_ch_freq,
|
|
|
+ vdev_id);
|
|
|
+ if (QDF_IS_STATUS_SUCCESS(status))
|
|
|
+ return status;
|
|
|
}
|
|
|
|
|
|
- if (!same_band_present) {
|
|
|
- /*
|
|
|
- * 1st: 2nd: 3rd(SAP): Action:
|
|
|
- * -------------------------------------------------
|
|
|
- * 2Ghz 2Ghz(SMM) 5Ghz Start on 5Ghz(DBS)
|
|
|
- * 5Ghz 5Ghz(SMM) 2Ghz Start on 2.4Ghz(DBS)
|
|
|
- */
|
|
|
- if (policy_mgr_is_hw_dbs_capable(psoc))
|
|
|
- *intf_ch_freq = 0;
|
|
|
- return;
|
|
|
- }
|
|
|
+ user_config_freq =
|
|
|
+ policy_mgr_get_user_config_sap_freq(psoc, vdev_id);
|
|
|
|
|
|
- if (!policy_mgr_3_freq_always_on_same_mac(psoc, sap_ch_freq,
|
|
|
- pm_conc_connection_list[0].freq,
|
|
|
- pm_conc_connection_list[1].freq)) {
|
|
|
- /*
|
|
|
- * 1st: 2nd: 3rd(SAP): Action:
|
|
|
- * -------------------------------------------------
|
|
|
- * 5Ghz 5Ghz(SMM) 5Ghz Allow SAP on sap_ch_freq
|
|
|
- * if all 3, 5Ghz freq
|
|
|
- * doesn't end up, on same
|
|
|
- * mac, ie 2 of them lead
|
|
|
- * to SBS, ie at least one
|
|
|
- * of them is high 5Ghz and
|
|
|
- * one low 5Ghz.
|
|
|
- */
|
|
|
- *intf_ch_freq = 0;
|
|
|
- return;
|
|
|
+ if (WLAN_REG_IS_24GHZ_CH_FREQ(sap_ch_freq) &&
|
|
|
+ user_config_freq &&
|
|
|
+ !WLAN_REG_IS_24GHZ_CH_FREQ(user_config_freq) &&
|
|
|
+ (wlan_reg_get_channel_state_for_pwrmode(pm_ctx->pdev, *intf_ch_freq,
|
|
|
+ REG_CURRENT_PWR_MODE) == CHANNEL_STATE_ENABLE)) {
|
|
|
+ status = policy_mgr_get_sap_mandatory_channel(psoc, sap_ch_freq,
|
|
|
+ intf_ch_freq,
|
|
|
+ vdev_id);
|
|
|
+ if (QDF_IS_STATUS_SUCCESS(status))
|
|
|
+ return status;
|
|
|
}
|
|
|
|
|
|
- /*
|
|
|
- * 1st: 2nd: 3rd(SAP): Action:
|
|
|
- * -------------------------------------------------
|
|
|
- * 5Ghz 5Ghz(SMM) 5Ghz force SCC on one of the freq
|
|
|
- * (3 home channel will not be
|
|
|
- * allowed)
|
|
|
- * 2Ghz 2Ghz(SMM) 2Ghz force SCC on one of the freq
|
|
|
- * (3 home channel will not be
|
|
|
- * allowed)
|
|
|
- */
|
|
|
- policy_mgr_debug("%d Can lead to 3 home channel on same MAC",
|
|
|
- sap_ch_freq);
|
|
|
-}
|
|
|
-
|
|
|
-static void
|
|
|
-policy_mgr_check_force_scc_one_connection(struct wlan_objmgr_psoc *psoc,
|
|
|
- qdf_freq_t *intf_ch_freq,
|
|
|
- qdf_freq_t sap_ch_freq,
|
|
|
- bool same_band_present,
|
|
|
- uint8_t cc_mode)
|
|
|
-{
|
|
|
- /*
|
|
|
- * 1st: 2nd(SAP): Action:
|
|
|
- * ------------------------------------
|
|
|
- * 2Ghz 2Ghz Force SCC on 2Ghz
|
|
|
- * 5Ghz 5Ghz Force SCC on 5Ghz for non SBS, for SBS freq
|
|
|
- * allow sap freq
|
|
|
- * 2Ghz 5Ghz Start on 5Ghz (DBS)
|
|
|
- * 5Ghz 2Ghz Start on 2.4Ghz(DBS)
|
|
|
- */
|
|
|
-
|
|
|
- if (same_band_present) {
|
|
|
- /*
|
|
|
- * 1st: 2nd(SAP): Action:
|
|
|
- * ------------------------------------
|
|
|
- * 2Ghz 2Ghz Force SCC on 2Ghz
|
|
|
- * 5Ghz 5Ghz Force SCC on 5Ghz for non SBS,
|
|
|
- * for SBS freq allow sap freq
|
|
|
- */
|
|
|
- if (policy_mgr_are_sbs_chan(psoc, sap_ch_freq, *intf_ch_freq)) {
|
|
|
- policy_mgr_debug("Do not overwrite as sap_ch_freq %d intf_ch_freq %d are SBS freq",
|
|
|
- sap_ch_freq, *intf_ch_freq);
|
|
|
- *intf_ch_freq = 0;
|
|
|
- }
|
|
|
- return;
|
|
|
- }
|
|
|
- if (policy_mgr_is_hw_dbs_capable(psoc) ||
|
|
|
- cc_mode == QDF_MCC_TO_SCC_WITH_PREFERRED_BAND) {
|
|
|
- /*
|
|
|
- * 1st: 2nd(SAP): Action:
|
|
|
- * ------------------------------------
|
|
|
- * 2Ghz 5Ghz Start on 5Ghz (DBS)
|
|
|
- * 5Ghz 2Ghz Start on 2.4Ghz(DBS)
|
|
|
- */
|
|
|
- /* Different bands can do DBS so dont overwrite */
|
|
|
- *intf_ch_freq = 0;
|
|
|
- }
|
|
|
+ return status;
|
|
|
}
|
|
|
|
|
|
-void policy_mgr_check_scc_sbs_channel(struct wlan_objmgr_psoc *psoc,
|
|
|
- qdf_freq_t *intf_ch_freq,
|
|
|
- qdf_freq_t sap_ch_freq,
|
|
|
- uint8_t vdev_id, uint8_t cc_mode)
|
|
|
+void policy_mgr_check_scc_channel(struct wlan_objmgr_psoc *psoc,
|
|
|
+ qdf_freq_t *intf_ch_freq,
|
|
|
+ qdf_freq_t sap_ch_freq,
|
|
|
+ uint8_t vdev_id, uint8_t cc_mode)
|
|
|
{
|
|
|
uint32_t num_connections, acs_band = QCA_ACS_MODE_IEEE80211ANY;
|
|
|
struct policy_mgr_psoc_priv_obj *pm_ctx;
|
|
@@ -4316,11 +4201,8 @@ void policy_mgr_check_scc_sbs_channel(struct wlan_objmgr_psoc *psoc,
|
|
|
struct policy_mgr_conc_connection_info
|
|
|
info[MAX_NUMBER_OF_CONC_CONNECTIONS] = { {0} };
|
|
|
uint8_t num_cxn_del = 0;
|
|
|
- bool same_band_present = false;
|
|
|
- bool sbs_mlo_present = false;
|
|
|
- bool allow_6ghz = true, sta_sap_scc_on_indoor_channel_allowed;
|
|
|
+ bool allow_6ghz = true;
|
|
|
uint8_t sta_count;
|
|
|
- qdf_freq_t user_config_freq;
|
|
|
|
|
|
pm_ctx = policy_mgr_get_context(psoc);
|
|
|
if (!pm_ctx) {
|
|
@@ -4335,25 +4217,6 @@ void policy_mgr_check_scc_sbs_channel(struct wlan_objmgr_psoc *psoc,
|
|
|
|
|
|
sta_count = policy_mgr_mode_specific_connection_count(psoc, PM_STA_MODE,
|
|
|
NULL);
|
|
|
- /*
|
|
|
- * If same band interface is present, as
|
|
|
- * csr_check_concurrent_channel_overlap try to find same band vdev
|
|
|
- * if available
|
|
|
- */
|
|
|
- if ((WLAN_REG_IS_24GHZ_CH_FREQ(sap_ch_freq) &&
|
|
|
- WLAN_REG_IS_24GHZ_CH_FREQ(*intf_ch_freq)) ||
|
|
|
- (!WLAN_REG_IS_24GHZ_CH_FREQ(*intf_ch_freq) &&
|
|
|
- !WLAN_REG_IS_24GHZ_CH_FREQ(sap_ch_freq)))
|
|
|
- same_band_present = true;
|
|
|
-
|
|
|
- /* Check if STA or SAP SBS MLO is present */
|
|
|
- if (policy_mgr_is_hw_sbs_capable(psoc) &&
|
|
|
- (policy_mgr_is_mlo_in_mode_sbs(psoc, PM_STA_MODE,
|
|
|
- NULL, NULL) ||
|
|
|
- policy_mgr_is_mlo_in_mode_sbs(psoc, PM_SAP_MODE,
|
|
|
- NULL, NULL)))
|
|
|
- sbs_mlo_present = true;
|
|
|
-
|
|
|
if (pm_ctx->hdd_cbacks.wlan_get_sap_acs_band) {
|
|
|
status = pm_ctx->hdd_cbacks.wlan_get_sap_acs_band(psoc,
|
|
|
vdev_id,
|
|
@@ -4362,106 +4225,17 @@ void policy_mgr_check_scc_sbs_channel(struct wlan_objmgr_psoc *psoc,
|
|
|
policy_mgr_debug("acs_band: %d", acs_band);
|
|
|
}
|
|
|
|
|
|
- /*
|
|
|
- * Different band, this also mean that there is no other interface on
|
|
|
- * on same band as csr_check_concurrent_channel_overlap
|
|
|
- * try to find same band vdev if available.
|
|
|
- * this mean for DBS HW we can use the other available band and thus
|
|
|
- * set *intf_ch_freq = 0, to bring sap on sap_ch_freq.
|
|
|
- */
|
|
|
- if (!same_band_present) {
|
|
|
- /*
|
|
|
- * STA + SAP where doing SCC on 5 GHz indoor channel.
|
|
|
- * STA moved/roamed to 2.4 GHz. Move SAP to initially
|
|
|
- * started channel.
|
|
|
- *
|
|
|
- * STA+SAP where STA is moved/roamed to 5GHz indoor
|
|
|
- * and SAP is on 2.4GHz due to previous concurrency.
|
|
|
- * Move SAP to STA channel on SCC.
|
|
|
- */
|
|
|
- sta_sap_scc_on_indoor_channel_allowed =
|
|
|
- policy_mgr_get_sta_sap_scc_allowed_on_indoor_chnl(psoc);
|
|
|
-
|
|
|
- if (sta_count && cc_mode ==
|
|
|
- QDF_MCC_TO_SCC_SWITCH_WITH_FAVORITE_CHANNEL &&
|
|
|
- sta_sap_scc_on_indoor_channel_allowed &&
|
|
|
- ((wlan_reg_is_freq_indoor(pm_ctx->pdev, sap_ch_freq) &&
|
|
|
- WLAN_REG_IS_24GHZ_CH_FREQ(*intf_ch_freq)) ||
|
|
|
- (wlan_reg_is_freq_indoor(pm_ctx->pdev, *intf_ch_freq) &&
|
|
|
- WLAN_REG_IS_24GHZ_CH_FREQ(sap_ch_freq) &&
|
|
|
- !(acs_band == QCA_ACS_MODE_IEEE80211B ||
|
|
|
- acs_band == QCA_ACS_MODE_IEEE80211G)))) {
|
|
|
- status = policy_mgr_get_sap_mandatory_channel(
|
|
|
- psoc, sap_ch_freq,
|
|
|
- intf_ch_freq, vdev_id);
|
|
|
- if (QDF_IS_STATUS_SUCCESS(status))
|
|
|
- return;
|
|
|
-
|
|
|
- policy_mgr_err("No mandatory channels");
|
|
|
- }
|
|
|
-
|
|
|
- user_config_freq =
|
|
|
- policy_mgr_get_user_config_sap_freq(psoc, vdev_id);
|
|
|
-
|
|
|
- if (sta_count && cc_mode ==
|
|
|
- QDF_MCC_TO_SCC_SWITCH_WITH_FAVORITE_CHANNEL &&
|
|
|
- WLAN_REG_IS_24GHZ_CH_FREQ(sap_ch_freq) &&
|
|
|
- user_config_freq &&
|
|
|
- !WLAN_REG_IS_24GHZ_CH_FREQ(user_config_freq) &&
|
|
|
- (wlan_reg_get_channel_state_for_pwrmode(
|
|
|
- pm_ctx->pdev,
|
|
|
- *intf_ch_freq,
|
|
|
- REG_CURRENT_PWR_MODE) == CHANNEL_STATE_ENABLE)) {
|
|
|
- status = policy_mgr_get_sap_mandatory_channel(
|
|
|
- psoc, sap_ch_freq,
|
|
|
- intf_ch_freq, vdev_id);
|
|
|
- if (QDF_IS_STATUS_SUCCESS(status))
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- if (policy_mgr_is_current_hwmode_sbs(psoc) || sbs_mlo_present)
|
|
|
- goto sbs_check;
|
|
|
- /*
|
|
|
- * #1 port:
|
|
|
- * 1st: 2nd(SAP): Action:
|
|
|
- * ------------------------------------
|
|
|
- * 2Ghz 5Ghz Start on 5Ghz(DBS)
|
|
|
- * 5Ghz 2Ghz Start on 2.4Ghz(DBS)
|
|
|
- *
|
|
|
- * #2 port:
|
|
|
- * 1st: 2nd: 3rd(SAP): Action:
|
|
|
- * -------------------------------------------------
|
|
|
- * 2Ghz 2Ghz(SMM/DBS) 5Ghz Start on 5Ghz(DBS)
|
|
|
- * 5Ghz 5Ghz(SMM) 2Ghz Start on 2.4Ghz(DBS)
|
|
|
- *
|
|
|
- * #3 port:
|
|
|
- * 1st: 2nd: 3rd: 4th(SAP) Action:
|
|
|
- * -------------------------------------------------
|
|
|
- * 2Ghz 2Ghz 2Ghz 5Ghz Start on 5Ghz(DBS)
|
|
|
- * 5Ghz 5Ghz 5Ghz 2Ghz Start on 2.4Ghz(DBS)
|
|
|
- */
|
|
|
- if (policy_mgr_is_hw_dbs_capable(psoc) ||
|
|
|
- cc_mode == QDF_MCC_TO_SCC_WITH_PREFERRED_BAND) {
|
|
|
- *intf_ch_freq = 0;
|
|
|
- return;
|
|
|
- }
|
|
|
- } else if (sta_count && sta_count < 2 &&
|
|
|
- policy_mgr_is_hw_dbs_capable(psoc) &&
|
|
|
- cc_mode == QDF_MCC_TO_SCC_SWITCH_WITH_FAVORITE_CHANNEL) {
|
|
|
- /* Same band with Fav channel if STA is present */
|
|
|
- status = policy_mgr_get_sap_mandatory_channel(psoc,
|
|
|
- sap_ch_freq,
|
|
|
- intf_ch_freq,
|
|
|
- vdev_id);
|
|
|
+ /* Handle STA + SAP mandaory freq cases */
|
|
|
+ if (sta_count && sta_count < 2 &&
|
|
|
+ cc_mode == QDF_MCC_TO_SCC_SWITCH_WITH_FAVORITE_CHANNEL) {
|
|
|
+ status = policy_mgr_handle_sta_sap_fav_channel(psoc, pm_ctx,
|
|
|
+ vdev_id, sap_ch_freq, intf_ch_freq, acs_band);
|
|
|
if (QDF_IS_STATUS_SUCCESS(status))
|
|
|
return;
|
|
|
-
|
|
|
policy_mgr_debug("no mandatory channels (%d, %d)", sap_ch_freq,
|
|
|
*intf_ch_freq);
|
|
|
}
|
|
|
|
|
|
-sbs_check:
|
|
|
-
|
|
|
/* Get allow 6Gz before interface entry is temporary deleted */
|
|
|
if (sap_ch_freq && !WLAN_REG_IS_6GHZ_CHAN_FREQ(sap_ch_freq) &&
|
|
|
!policy_mgr_get_ap_6ghz_capable(psoc, vdev_id, NULL))
|
|
@@ -4475,44 +4249,25 @@ sbs_check:
|
|
|
policy_mgr_store_and_del_conn_info_by_vdev_id(psoc, vdev_id, info,
|
|
|
&num_cxn_del);
|
|
|
|
|
|
- /*
|
|
|
- * If at least one interface is in same band OR HW mode is SBS OR
|
|
|
- * SBS MLO is present, try set SBS/DBS/SCC.
|
|
|
- */
|
|
|
num_connections = policy_mgr_get_connection_count(psoc);
|
|
|
- policy_mgr_dump_sbs_freq_range(pm_ctx);
|
|
|
switch (num_connections) {
|
|
|
case 0:
|
|
|
/* use sap channel */
|
|
|
*intf_ch_freq = 0;
|
|
|
break;
|
|
|
- case 1:
|
|
|
- policy_mgr_check_force_scc_one_connection(psoc, intf_ch_freq,
|
|
|
- sap_ch_freq,
|
|
|
- same_band_present,
|
|
|
- cc_mode);
|
|
|
- break;
|
|
|
- case 2:
|
|
|
- policy_mgr_check_force_scc_two_connection(psoc, vdev_id,
|
|
|
- intf_ch_freq,
|
|
|
- sap_ch_freq,
|
|
|
- cc_mode,
|
|
|
- same_band_present,
|
|
|
- acs_band,
|
|
|
- allow_6ghz);
|
|
|
- break;
|
|
|
- case 3:
|
|
|
- policy_mgr_check_force_scc_three_connection(psoc, vdev_id,
|
|
|
- intf_ch_freq,
|
|
|
- sap_ch_freq,
|
|
|
- acs_band,
|
|
|
- allow_6ghz);
|
|
|
- break;
|
|
|
default:
|
|
|
- policy_mgr_debug("invalid num_connections: %d",
|
|
|
- num_connections);
|
|
|
+ if (num_connections > 3) {
|
|
|
+ policy_mgr_debug("invalid num_connections: %d",
|
|
|
+ num_connections);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ /* Use PCL and concurrency combo to get the best channel */
|
|
|
+ policy_mgr_get_pref_force_scc_freq(psoc, vdev_id, intf_ch_freq,
|
|
|
+ sap_ch_freq, acs_band,
|
|
|
+ allow_6ghz);
|
|
|
break;
|
|
|
}
|
|
|
+
|
|
|
/* Restore the connection entry */
|
|
|
if (num_cxn_del > 0)
|
|
|
policy_mgr_restore_deleted_conn_info(psoc, info, num_cxn_del);
|