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

Commit 00df58a1 authored by Srinivas Dasari's avatar Srinivas Dasari
Browse files

qcacld-3.0: Enable/Disable SRD support for vdev

Currently the driver enables the SRD channels
support for both P2P_GO and SAP if the SRD master
mode is enabled.

Have individual ini values to enable/disable
the SRD channel for each op-mode as required.

Change-Id: If6e66996ed19dacbde7f71a6702f378a7e9a273c
CRs-Fixed: 2748446
parent 85d3adb0
Loading
Loading
Loading
Loading
+18 −2
Original line number Diff line number Diff line
@@ -35,6 +35,7 @@
#include "wlan_nan_api.h"
#include "nan_ucfg_api.h"
#include "sap_api.h"
#include "wlan_mlme_api.h"

enum policy_mgr_conc_next_action (*policy_mgr_get_current_pref_hw_mode_ptr)
	(struct wlan_objmgr_psoc *psoc);
@@ -1940,6 +1941,22 @@ QDF_STATUS policy_mgr_valid_sap_conc_channel_check(
	uint32_t temp_ch_freq = 0;
	struct policy_mgr_psoc_priv_obj *pm_ctx;
	bool sta_sap_scc_on_dfs_chan;
	struct wlan_objmgr_vdev *vdev;
	enum QDF_OPMODE vdev_opmode;
	bool enable_srd_channel;

	vdev = wlan_objmgr_get_vdev_by_id_from_psoc(psoc, sap_vdev_id,
						    WLAN_POLICY_MGR_ID);
	if (!vdev) {
		policy_mgr_err("vdev is NULL");
		return QDF_STATUS_E_INVAL;
	}

	vdev_opmode = wlan_vdev_mlme_get_opmode(vdev);
	wlan_objmgr_vdev_release_ref(vdev, WLAN_POLICY_MGR_ID);

	wlan_mlme_get_srd_master_mode_for_vdev(psoc, vdev_opmode,
					       &enable_srd_channel);

	pm_ctx = policy_mgr_get_context(psoc);
	if (!pm_ctx) {
@@ -1981,8 +1998,7 @@ QDF_STATUS policy_mgr_valid_sap_conc_channel_check(
							    ch_freq) ||
		    !(policy_mgr_sta_sap_scc_on_lte_coex_chan(psoc) ||
		      policy_mgr_is_safe_channel(psoc, ch_freq)) ||
		    (!wlan_reg_is_etsi13_srd_chan_allowed_master_mode(
								pm_ctx->pdev) &&
		    (!enable_srd_channel &&
		     wlan_reg_is_etsi13_srd_chan_for_freq(pm_ctx->pdev,
							  ch_freq))) {
			if (wlan_reg_is_dfs_for_freq(pm_ctx->pdev, ch_freq) &&
+0 −9
Original line number Diff line number Diff line
@@ -2116,7 +2116,6 @@ QDF_STATUS policy_mgr_get_channel_list(struct wlan_objmgr_psoc *psoc,
	uint32_t sbs_num_channels = 0;
	uint32_t chan_index_24 = 0, chan_index_5 = 0, chan_index_6 = 0;
	bool skip_dfs_channel = false;
	bool is_etsi13_srd_chan_allowed_in_mas_mode = true;
	uint32_t i = 0, j = 0;
	struct policy_mgr_psoc_priv_obj *pm_ctx;
	bool sta_sap_scc_on_dfs_chan;
@@ -2180,9 +2179,6 @@ QDF_STATUS policy_mgr_get_channel_list(struct wlan_objmgr_psoc *psoc,
			policy_mgr_debug("skip DFS ch from pcl for SAP/Go");
			skip_dfs_channel = true;
		}
		is_etsi13_srd_chan_allowed_in_mas_mode =
			wlan_reg_is_etsi13_srd_chan_allowed_master_mode(pm_ctx->
									pdev);
	}

	/* Let's divide the list in 2.4 & 5 Ghz lists */
@@ -2195,11 +2191,6 @@ QDF_STATUS policy_mgr_get_channel_list(struct wlan_objmgr_psoc *psoc,
						     channel_list[i]))
				continue;

			if (!is_etsi13_srd_chan_allowed_in_mas_mode &&
			    wlan_reg_is_etsi13_srd_chan_for_freq(
			    pm_ctx->pdev, channel_list[i]))
				continue;

			channel_list_5[chan_index_5++] = channel_list[i];
		} else if (wlan_reg_is_6ghz_chan_freq(channel_list[i])) {
			/* Add to 5G list untill 6G conc support is enabled */
+24 −16
Original line number Diff line number Diff line
@@ -545,18 +545,12 @@ policy_mgr_modify_pcl_based_on_srd(struct wlan_objmgr_psoc *psoc,
	uint32_t pcl_list[NUM_CHANNELS];
	uint8_t weight_list[NUM_CHANNELS];
	struct policy_mgr_psoc_priv_obj *pm_ctx;
	bool is_etsi13_srd_chan_allowed_in_mas_mode = true;

	pm_ctx = policy_mgr_get_context(psoc);
	if (!pm_ctx) {
		policy_mgr_err("Invalid Context");
		return QDF_STATUS_E_FAILURE;
	}
	is_etsi13_srd_chan_allowed_in_mas_mode =
		wlan_reg_is_etsi13_srd_chan_allowed_master_mode(pm_ctx->pdev);

	if (is_etsi13_srd_chan_allowed_in_mas_mode)
		return QDF_STATUS_SUCCESS;

	if (*pcl_len_org > NUM_CHANNELS) {
		policy_mgr_err("Invalid PCL List Length %d", *pcl_len_org);
@@ -589,6 +583,7 @@ static QDF_STATUS policy_mgr_pcl_modification_for_sap(
	bool nol_modified_pcl = false;
	bool dfs_modified_pcl = false;
	bool modified_final_pcl = false;
	bool srd_chan_enabled;

	if (policy_mgr_is_sap_mandatory_channel_set(psoc)) {
		status = policy_mgr_modify_sap_pcl_based_on_mandatory_channel(
@@ -617,12 +612,18 @@ static QDF_STATUS policy_mgr_pcl_modification_for_sap(
	}
	dfs_modified_pcl = true;

	wlan_mlme_get_srd_master_mode_for_vdev(psoc, QDF_SAP_MODE,
					       &srd_chan_enabled);

	if (!srd_chan_enabled) {
		status = policy_mgr_modify_pcl_based_on_srd
				(psoc, pcl_channels, pcl_weight, len);
		if (QDF_IS_STATUS_ERROR(status)) {
		policy_mgr_err("failed to get srd modified pcl for SAP");
			policy_mgr_err("Failed to modify SRD in pcl for SAP");
			return status;
		}
	}

	modified_final_pcl = true;
	policy_mgr_debug(" %d %d %d %d",
			 mandatory_modified_pcl,
@@ -640,6 +641,7 @@ static QDF_STATUS policy_mgr_pcl_modification_for_p2p_go(
{
	QDF_STATUS status = QDF_STATUS_E_FAILURE;
	struct policy_mgr_psoc_priv_obj *pm_ctx;
	bool srd_chan_enabled;

	pm_ctx = policy_mgr_get_context(psoc);
	if (!pm_ctx) {
@@ -654,12 +656,18 @@ static QDF_STATUS policy_mgr_pcl_modification_for_p2p_go(
		return status;
	}

	wlan_mlme_get_srd_master_mode_for_vdev(psoc, QDF_P2P_GO_MODE,
					       &srd_chan_enabled);

	if (!srd_chan_enabled) {
		status = policy_mgr_modify_pcl_based_on_srd
				(psoc, pcl_channels, pcl_weight, len);
		if (QDF_IS_STATUS_ERROR(status)) {
		policy_mgr_err("failed to get srd modified pcl for P2P-GO");
			policy_mgr_err("Failed to modify SRD in pcl for GO");
			return status;
		}
	}

	policy_mgr_dump_channel_list(*len, pcl_channels, pcl_weight);

	return QDF_STATUS_SUCCESS;
+2 −2
Original line number Diff line number Diff line
@@ -2337,8 +2337,8 @@ static void mlme_init_reg_cfg(struct wlan_objmgr_psoc *psoc,
	struct wlan_objmgr_pdev *pdev = NULL;

	reg->self_gen_frm_pwr = cfg_get(psoc, CFG_SELF_GEN_FRM_PWR);
	reg->etsi13_srd_chan_in_master_mode =
			cfg_get(psoc, CFG_ETSI13_SRD_CHAN_IN_MASTER_MODE);
	reg->etsi_srd_chan_in_master_mode =
			cfg_get(psoc, CFG_ETSI_SRD_CHAN_IN_MASTER_MODE);
	reg->restart_beaconing_on_ch_avoid =
			cfg_get(psoc, CFG_RESTART_BEACONING_ON_CH_AVOID);
	reg->indoor_channel_support = cfg_get(psoc, CFG_INDOOR_CHANNEL_SUPPORT);
+15 −6
Original line number Diff line number Diff line
@@ -73,14 +73,20 @@

/*
 * <ini>
 * etsi13_srd_chan_in_master_mode - Enable/disable ETSI SRD channels in
 * etsi_srd_chan_in_master_mode - Enable/disable ETSI SRD channels in
 * master mode PCL and ACS functionality
 * @Min: 0
 * @Max: 1
 * @Default: 0
 * @Max: 0xFF
 * @Default: 6
 *
 * etsi13_srd_chan_in_master_mode is to enable/disable ETSI SRD channels in
 * etsi_srd_chan_in_master_mode is to enable/disable ETSI SRD channels in
 * master mode PCL and ACS functionality
 * Bit map for enabling the SRD mode in various modes are as follows:-
 * BIT 0:- Enable/Disable SRD channels for SAP.
 * BIT 1:- Enable/Disable SRD channels for P2P-GO.
 * BIT 2:- Enable/Disable SRD channels for NAN.
 * Rest of the bits are currently reserved for future SRD channel support for
 * other vdevs.
 *
 * Related: None
 *
@@ -90,9 +96,12 @@
 *
 * </ini>
 */
#define CFG_ETSI13_SRD_CHAN_IN_MASTER_MODE CFG_INI_BOOL( \
#define CFG_ETSI_SRD_CHAN_IN_MASTER_MODE CFG_INI_UINT( \
	"etsi13_srd_chan_in_master_mode", \
	0, \
	0xff, \
	6, \
	CFG_VALUE_OR_DEFAULT, \
	"enable/disable ETSI SRD channels in master mode")

#ifdef SAP_AVOID_ACS_FREQ_LIST
@@ -324,7 +333,7 @@
	CFG(CFG_SELF_GEN_FRM_PWR) \
	CFG(CFG_ENABLE_PENDING_CHAN_LIST_REQ) \
	CFG(CFG_ENABLE_11D_IN_WORLD_MODE) \
	CFG(CFG_ETSI13_SRD_CHAN_IN_MASTER_MODE) \
	CFG(CFG_ETSI_SRD_CHAN_IN_MASTER_MODE) \
	CFG(CFG_RESTART_BEACONING_ON_CH_AVOID) \
	CFG(CFG_INDOOR_CHANNEL_SUPPORT) \
	CFG(CFG_SCAN_11D_INTERVAL) \
Loading