Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2964e46e authored by abhinav kumar's avatar abhinav kumar Committed by Madan Koyyalamudi
Browse files

qcacld-3.0: Dont allow SAP on indoor channel

In case of STA + SAP concurrency and STA is on indoor channel.
Dont allow SAP to turn on, irrespective of DBS, MCC or SCC mode
of concurrency, if STA + SAP concurrency not allowed
on indoor channel.

Change-Id: I79582f88e81cb2c95d2da2480d1e3d7a8b86906f
CRs-Fixed: 2967952
parent 4e70761f
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -3067,6 +3067,22 @@ QDF_STATUS policy_mgr_valid_sap_conc_channel_check(
	uint32_t sap_ch_freq, uint8_t sap_vdev_id,
	struct ch_params *ch_params);

/**
 * policy_mgr_sap_allowed_on_indoor_freq() - Check whether STA+SAP concurrency
 * allowed on indoor channel or not
 * @psoc: pointer to PSOC object information
 * @pdev: pointer to PDEV object information
 * @sap_ch_freq: initial channel frequency for SAP
 *
 * This function checks whether SAP is allowed to turn on in case of STA+SAP
 * concurrency if STA is on indoor channel.
 *
 * Return: false if SAP not allowed to come up on a indoor channel
 */
bool policy_mgr_sap_allowed_on_indoor_freq(struct wlan_objmgr_psoc *psoc,
					   struct wlan_objmgr_pdev *pdev,
					   uint32_t sap_ch_freq);

/**
 * policy_mgr_get_alternate_channel_for_sap() - Get an alternate
 * channel to move the SAP to
+24 −4
Original line number Diff line number Diff line
@@ -36,6 +36,7 @@
#include "wlan_mlme_api.h"
#include "sap_api.h"
#include "wlan_mlme_api.h"
#include "wlan_mlme_ucfg_api.h"

enum policy_mgr_conc_next_action (*policy_mgr_get_current_pref_hw_mode_ptr)
	(struct wlan_objmgr_psoc *psoc);
@@ -2202,6 +2203,23 @@ static QDF_STATUS policy_mgr_check_6ghz_sap_conc(
	return QDF_STATUS_SUCCESS;
}

bool policy_mgr_sap_allowed_on_indoor_freq(struct wlan_objmgr_psoc *psoc,
					   struct wlan_objmgr_pdev *pdev,
					   uint32_t sap_ch_freq)
{
	bool include_indoor_channel = 0;

	ucfg_mlme_get_indoor_channel_support(psoc, &include_indoor_channel);

	if (!include_indoor_channel &&
	    wlan_reg_is_freq_indoor(pdev, sap_ch_freq)) {
		policy_mgr_debug("No more operation on indoor channel");
		return false;
	}

	return true;
}

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,
@@ -2307,11 +2325,13 @@ QDF_STATUS policy_mgr_valid_sap_conc_channel_check(
					return QDF_STATUS_E_FAILURE;
				}
			} else {
				if (!(policy_mgr_sta_sap_scc_on_lte_coex_chan
				if ((!(policy_mgr_sta_sap_scc_on_lte_coex_chan
				    (psoc)) && !(policy_mgr_is_safe_channel
				    (psoc, ch_freq))) {
					policy_mgr_warn("Can't have concurrency due to unsafe channel %d",
							ch_freq);
				    (psoc, ch_freq))) ||
				    !policy_mgr_sap_allowed_on_indoor_freq(psoc,
						pm_ctx->pdev, sap_ch_freq)) {
					policy_mgr_warn("Can't have concurrency due to unsafe/indoor channel:%d, sap_ch_freq:%d",
							ch_freq, sap_ch_freq);
					return QDF_STATUS_E_FAILURE;
				}
			}