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

Commit c019ed2f authored by Linux Build Service Account's avatar Linux Build Service Account
Browse files

Merge 29620f09 on remote branch

Change-Id: If4f463d0ce27fffeb93d930dad5f550cae2ff223
parents 394b1100 29620f09
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -2615,7 +2615,6 @@ cppflags-$(CONFIG_THERMAL_STATS_SUPPORT) += -DTHERMAL_STATS_SUPPORT
cppflags-$(CONFIG_PTT_SOCK_SVC_ENABLE) += -DPTT_SOCK_SVC_ENABLE
cppflags-$(CONFIG_FEATURE_WLAN_WAPI) += -DFEATURE_WLAN_WAPI
cppflags-$(CONFIG_FEATURE_WLAN_WAPI) += -DATH_SUPPORT_WAPI
cppflags-$(CONFIG_AGEIE_ON_SCAN_RESULTS) += -DWLAN_ENABLE_AGEIE_ON_SCAN_RESULTS
cppflags-$(CONFIG_SOFTAP_CHANNEL_RANGE) += -DSOFTAP_CHANNEL_RANGE
cppflags-$(CONFIG_FEATURE_WLAN_SCAN_PNO) += -DFEATURE_WLAN_SCAN_PNO
cppflags-$(CONFIG_WLAN_FEATURE_PACKET_FILTERING) += -DWLAN_FEATURE_PACKET_FILTERING
@@ -2853,6 +2852,7 @@ cppflags-y += -DCONN_MGR_ADV_FEATURE
cppflags-$(CONFIG_QCACLD_WLAN_LFR3) += -DWLAN_FEATURE_ROAM_OFFLOAD

cppflags-$(CONFIG_WLAN_FEATURE_MBSSID) += -DWLAN_FEATURE_MBSSID
cppflags-$(CONFIG_WLAN_FEATURE_P2P_P2P_STA) += -DWLAN_FEATURE_P2P_P2P_STA

ifeq (y,$(findstring y, $(CONFIG_CNSS_GENL) $(CONFIG_CNSS_GENL_MODULE)))
cppflags-y += -DCNSS_GENL
@@ -3649,7 +3649,7 @@ ccflags-y += -DWLAN_PDEV_MAX_VDEVS=$(CONFIG_WLAN_PDEV_MAX_VDEVS)
CONFIG_WLAN_PSOC_MAX_VDEVS ?= $(CONFIG_WLAN_MAX_VDEVS)
ccflags-y += -DWLAN_PSOC_MAX_VDEVS=$(CONFIG_WLAN_PSOC_MAX_VDEVS)

CONFIG_MAX_SCAN_CACHE_SIZE ?= 300
CONFIG_MAX_SCAN_CACHE_SIZE ?= 500
ccflags-y += -DMAX_SCAN_CACHE_SIZE=$(CONFIG_MAX_SCAN_CACHE_SIZE)
CONFIG_SCAN_MAX_REST_TIME ?= 0
ccflags-y += -DSCAN_MAX_REST_TIME=$(CONFIG_SCAN_MAX_REST_TIME)
+133 −0
Original line number Diff line number Diff line
@@ -611,6 +611,125 @@ static inline void policy_mgr_change_sap_channel_with_csa(
}
#endif

#ifdef WLAN_FEATURE_P2P_P2P_STA
/**
 * policy_mgr_is_p2p_p2p_conc_supported() - p2p concurrency support
 * @psoc: pointer to psoc
 *
 * This API is used to check whether firmware supports p2p concurrency
 *
 * Return: QDF_STATUS_SUCCESS up on success and any other status for failure.
 */
bool
policy_mgr_is_p2p_p2p_conc_supported(struct wlan_objmgr_psoc *psoc);
#else
static inline bool
policy_mgr_is_p2p_p2p_conc_supported(struct wlan_objmgr_psoc *psoc)
{
	return false;
}
#endif

#define GO_FORCE_SCC_DISABLE 0
#define GO_FORCE_SCC_STRICT 1
#define GO_FORCE_SCC_LIBERAL 2
#ifdef WLAN_FEATURE_P2P_P2P_STA
/**
 * Stay in MCC for 1 second, in case of first p2p go channel
 * needs to be moved to curr go channel
 */
#define WAIT_BEFORE_GO_FORCESCC_RESTART (1000)

/**
 * policy_mgr_is_go_scc_strict() - Get GO force SCC enabled or not
 * @psoc: psoc object
 *
 * This function checks if force SCC logic should be used on GO interface
 * as a strict mode.
 *
 * Return: True if p2p needs o be start on provided channel only.
 */
bool policy_mgr_is_go_scc_strict(struct wlan_objmgr_psoc *psoc);

/**
 * policy_mgr_check_forcescc_for_other_go() - check if another p2pgo
 * is present and find vdev id.
 *
 * @psoc: psoc object
 * @vdev: vdev id
 * @freq: frequency
 *
 * This function checks if another p2p go is there.
 *
 * Return: vdev_id
 */
uint8_t
policy_mgr_check_forcescc_for_other_go(struct wlan_objmgr_psoc *psoc,
				       uint8_t vdev_id, uint32_t curr_go_freq);

/**
 * policy_mgr_process_forcescc_for_go () - start work queue to move first p2p go
 * to new p2p go's channel
 *
 * @psoc: PSOC object information
 * @vdev_id: Vdev id
 * @ch_freq: Channel frequency to change
 * @ch_width: channel width to change
 *
 * starts delayed work queue of 1 second to move first p2p go to new
 * p2p go's channel.
 *
 * Return: None
 */
void policy_mgr_process_forcescc_for_go(
		struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
		uint32_t ch_freq, uint32_t ch_width);

/**
 * policy_mgr_do_go_plus_go_force_scc() - First p2p go
 * to new p2p go's channel
 *
 * @psoc: PSOC object information
 * @vdev_id: Vdev id
 * @ch_freq: Channel frequency to change
 * @ch_width: channel width to change
 *
 * Move first p2p go to new
 * p2p go's channel.
 *
 * Return: None
 */
void policy_mgr_do_go_plus_go_force_scc(
		struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
		uint32_t ch_freq, uint32_t ch_width);
#else
static inline
bool policy_mgr_is_go_scc_strict(struct wlan_objmgr_psoc *psoc)
{
	return false;
}

static inline
uint8_t policy_mgr_check_forcescc_for_other_go(struct wlan_objmgr_psoc *psoc,
					       uint8_t vdev_id,
					       uint32_t curr_go_freq)
{
	return WLAN_UMAC_VDEV_ID_MAX;
}

static inline
void policy_mgr_process_forcescc_for_go(
		struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
		uint32_t ch_freq, uint32_t ch_width)
{}

static inline
void policy_mgr_do_go_plus_go_force_scc(
		struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
		uint32_t ch_freq, uint32_t ch_width)
{}
#endif

/**
 * policy_mgr_set_pcl_for_existing_combo() - SET PCL for existing combo
 * @psoc: PSOC object information
@@ -3752,4 +3871,18 @@ QDF_STATUS policy_mgr_check_mon_concurrency(struct wlan_objmgr_psoc *psoc);
bool policy_mgr_is_sta_chan_valid_for_connect_and_roam(
				struct wlan_objmgr_pdev *pdev,
				qdf_freq_t freq);
/**
 * policy_mgr_is_3rd_conn_on_same_band_allowed() - Check the third connection
 * on same band allowed or not
 * list for third connection
 * @psoc: PSOC object information
 * @mode: Device mode
 *
 * This function checks whether to allow third connection on same band or not
 * based on pcl table
 *
 * Return: TRUE/FALSE
 */
bool policy_mgr_is_3rd_conn_on_same_band_allowed(struct wlan_objmgr_psoc *psoc,
						 enum policy_mgr_con_mode mode);
#endif /* __WLAN_POLICY_MGR_API_H */
+10 −2
Original line number Diff line number Diff line
/*
 * Copyright (c) 2012-2020 The Linux Foundation. All rights reserved.
 * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
 *
 * Permission to use, copy, modify, and/or distribute this software for
 * any purpose with or without fee is hereby granted, provided that the
@@ -548,12 +549,19 @@ CFG_INI_UINT("g_mark_sap_indoor_as_disable", 0, 1, 0, CFG_VALUE_OR_DEFAULT, \
 * <ini>
 * g_enable_go_force_scc - Enable/Disable force SCC on P2P GO
 * @Min: 0
 * @Max: 1
 * @Max: 2
 * @Default: 0
 *
 * This ini and along with "gWlanMccToSccSwitchMode" is used to enable
 * force SCC on P2P GO interface.
 *
 * GO_FORCE_SCC_DISABLED (value 0): GO force scc disabled and GO can come up
 * in MCC mode
 * GO_FORCE_SCC_STRICT (value 1): New GO will be forced to form on existing
 * GO/STA/GC channel in start bss itself.
 * GO_FORCE_SCC_LIBERAL (value 2): After SET KEY is done, do force SCC for the
 * first GO to move to new GO channel.
 *
 * Supported Feature: P2P GO
 *
 * Usage: External
@@ -562,7 +570,7 @@ CFG_INI_UINT("g_mark_sap_indoor_as_disable", 0, 1, 0, CFG_VALUE_OR_DEFAULT, \
 */

#define CFG_P2P_GO_ENABLE_FORCE_SCC \
CFG_INI_UINT("g_enable_go_force_scc", 0, 1, 0, CFG_VALUE_OR_DEFAULT, \
CFG_INI_UINT("g_enable_go_force_scc", 0, 2, 0, CFG_VALUE_OR_DEFAULT, \
	     "Enable/Disable P2P GO force SCC")

/**
+79 −28
Original line number Diff line number Diff line
/*
 * Copyright (c) 2012-2021 The Linux Foundation. All rights reserved.
 * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
 *
 * Permission to use, copy, modify, and/or distribute this software for
 * any purpose with or without fee is hereby granted, provided that the
@@ -522,6 +523,21 @@ enum policy_mgr_one_connection_mode {
 *			2x2
 * @PM_P2P_GO_SAP_SBS_5_1x1: P2P GO & SAP connection on 5G SBS
 *			using 1x1
 * @PM_P2P_GO_P2P_GO_SCC_24_1x1: P2P GO & P2P GO SCC on 2.4G using 1x1
 * @PM_P2P_GO_P2P_GO_SCC_24_2x2: P2P GO & P2P GO SCC on 2.4G using 2x2
 * @PM_P2P_GO_P2P_GO_MCC_24_1x1: P2P GO & P2P GO MCC on 2.4G using 1x1
 * @PM_P2P_GO_P2P_GO_MCC_24_2x2: P2P GO & P2P GO MCC on 2.4G using 2x2
 * @PM_P2P_GO_P2P_GO_SCC_5_1x1: P2P GO & P2P GO SCC on 5G using 1x1
 * @PM_P2P_GO_P2P_GO_SCC_5_2x2: P2P GO & P2P GO SCC on 5G using 2x2
 * @PM_P2P_GO_P2P_GO_MCC_5_1x1: P2P GO & P2P GO MCC on 5G using 1x1
 * @PM_P2P_GO_P2P_GO_MCC_5_2x2: P2P GO & P2P GO MCC on 5G using 2x2
 * @PM_P2P_GO_P2P_GO_MCC_24_5_1x1: P2P GO 2.4G & P2P GO 5G dual band MCC
 *                                 using 1x1
 * @PM_P2P_GO_P2P_GO_MCC_24_5_2x2: P2P GO 2.4G & P2P GO 5G dual band MCC
 *                                 using 2x2
 * @PM_P2P_GO_P2P_GO_DBS_1x1: P2P GO & P2P GO on DBS using 1x1
 * @PM_P2P_GO_P2P_GO_DBS_2x2: P2P GO & P2P GO on DBS using 2x2
 * @PM_P2P_GO_P2P_GO_SBS_5_1x1: P2P GO & P2P GO on SBS using 1x1
 * @PM_P2P_CLI_SAP_SCC_24_1x1: CLI & SAP connection on SCC using
 *			1x1@2.4 Ghz
 * @PM_P2P_CLI_SAP_SCC_24_2x2: CLI & SAP connection on SCC using
@@ -547,6 +563,21 @@ enum policy_mgr_one_connection_mode {
 *			2x2
 * @PM_P2P_CLI_SAP_SBS_5_1x1: P2P CLI & SAP connection on 5G SBS
 *			using 1x1
 * @PM_P2P_CLI_P2P_CLI_SCC_24_1x1: P2P CLI & P2P CLI SCC on 2.4G using 1x1
 * @PM_P2P_CLI_P2P_CLI_SCC_24_2x2: P2P CLI & P2P CLI SCC on 2.4G using 2x2
 * @PM_P2P_CLI_P2P_CLI_MCC_24_1x1: P2P CLI & P2P CLI MCC on 2.4G using 1x1
 * @PM_P2P_CLI_P2P_CLI_MCC_24_2x2: P2P CLI & P2P CLI MCC on 2.4G using 2x2
 * @PM_P2P_CLI_P2P_CLI_SCC_5_1x1: P2P CLI & P2P CLI SCC on 5G using 1x1
 * @PM_P2P_CLI_P2P_CLI_SCC_5_2x2: P2P CLI & P2P CLI SCC on 5G using 2x2
 * @PM_P2P_CLI_P2P_CLI_MCC_5_1x1: P2P CLI & P2P CLI MCC on 5G using 1x1
 * @PM_P2P_CLI_P2P_CLI_MCC_5_2x2: P2P CLI & P2P CLI MCC on 5G using 2x2
 * @PM_P2P_CLI_P2P_CLI_MCC_24_5_1x1: P2P CLI 2.4G & P2P CLI 5G dual band MCC
 *                                 using 1x1
 * @PM_P2P_CLI_P2P_CLI_MCC_24_5_2x2: P2P CLI 2.4G & P2P CLI 5G dual band MCC
 *                                 using 2x2
 * @PM_P2P_CLI_P2P_CLI_DBS_1x1: P2P CLI & P2P CLI on DBS using 1x1
 * @PM_P2P_CLI_P2P_CLI_DBS_2x2: P2P CLI & P2P CLI on DBS using 2x2
 * @PM_P2P_CLI_P2P_CLI_SBS_5_1x1: P2P CLI & P2P CLI on SBS using 1x1
 * @PM_SAP_SAP_SCC_24_1x1: SAP & SAP connection on
 *			SCC using 1x1@2.4 Ghz
 * @PM_SAP_SAP_SCC_24_2x2: SAP & SAP connection on
@@ -617,21 +648,6 @@ enum policy_mgr_one_connection_mode {
 * @PM_NAN_DISC_NDI_MCC_24_2x2: NAN & NDI connection on MCC using 2x2 on 2.4 GHz
 * @PM_NAN_DISC_NDI_DBS_1x1: NAN & NDI connection on DBS using 1x1
 * @PM_NAN_DISC_NDI_DBS_2x2: NAN & NDI connection on DBS using 2x2
 * @PM_P2P_GO_P2P_GO_SCC_24_1x1: P2P GO & P2P GO SCC on 2.4G using 1x1
 * @PM_P2P_GO_P2P_GO_SCC_24_2x2: P2P GO & P2P GO SCC on 2.4G using 2x2
 * @PM_P2P_GO_P2P_GO_MCC_24_1x1: P2P GO & P2P GO MCC on 2.4G using 1x1
 * @PM_P2P_GO_P2P_GO_MCC_24_2x2: P2P GO & P2P GO MCC on 2.4G using 2x2
 * @PM_P2P_GO_P2P_GO_SCC_5_1x1: P2P GO & P2P GO SCC on 5G using 1x1
 * @PM_P2P_GO_P2P_GO_SCC_5_2x2: P2P GO & P2P GO SCC on 5G using 2x2
 * @PM_P2P_GO_P2P_GO_MCC_5_1x1: P2P GO & P2P GO MCC on 5G using 1x1
 * @PM_P2P_GO_P2P_GO_MCC_5_2x2: P2P GO & P2P GO MCC on 5G using 2x2
 * @PM_P2P_GO_P2P_GO_MCC_24_5_1x1: P2P GO 2.4G & P2P GO 5G dual band MCC
 *                                 using 1x1
 * @PM_P2P_GO_P2P_GO_MCC_24_5_2x2: P2P GO 2.4G & P2P GO 5G dual band MCC
 *                                 using 2x2
 * @PM_P2P_GO_P2P_GO_DBS_1x1: P2P GO & P2P GO on DBS using 1x1
 * @PM_P2P_GO_P2P_GO_DBS_2x2: P2P GO & P2P GO on DBS using 2x2
 * @PM_P2P_GO_P2P_GO_SBS_5_1x1: P2P GO & P2P GO on SBS using 1x1
 *
 * These are generic IDs that identify the various roles in the
 * software system
@@ -702,6 +718,21 @@ enum policy_mgr_two_connection_mode {
	PM_P2P_GO_SAP_DBS_1x1,
	PM_P2P_GO_SAP_DBS_2x2,
	PM_P2P_GO_SAP_SBS_5_1x1,
	PM_P2P_GO_SAP_SBS_5_2x2 = PM_P2P_GO_SAP_SBS_5_1x1,
	PM_P2P_GO_P2P_GO_SCC_24_1x1,
	PM_P2P_GO_P2P_GO_SCC_24_2x2,
	PM_P2P_GO_P2P_GO_MCC_24_1x1,
	PM_P2P_GO_P2P_GO_MCC_24_2x2,
	PM_P2P_GO_P2P_GO_SCC_5_1x1,
	PM_P2P_GO_P2P_GO_SCC_5_2x2,
	PM_P2P_GO_P2P_GO_MCC_5_1x1,
	PM_P2P_GO_P2P_GO_MCC_5_2x2,
	PM_P2P_GO_P2P_GO_MCC_24_5_1x1,
	PM_P2P_GO_P2P_GO_MCC_24_5_2x2,
	PM_P2P_GO_P2P_GO_DBS_1x1,
	PM_P2P_GO_P2P_GO_DBS_2x2,
	PM_P2P_GO_P2P_GO_SBS_5_1x1,
	PM_P2P_GO_P2P_GO_SBS_5_2x2 = PM_P2P_GO_P2P_GO_SBS_5_1x1,
	PM_P2P_CLI_SAP_SCC_24_1x1,
	PM_P2P_CLI_SAP_SCC_24_2x2,
	PM_P2P_CLI_SAP_MCC_24_1x1,
@@ -715,6 +746,21 @@ enum policy_mgr_two_connection_mode {
	PM_P2P_CLI_SAP_DBS_1x1,
	PM_P2P_CLI_SAP_DBS_2x2,
	PM_P2P_CLI_SAP_SBS_5_1x1,
	PM_P2P_CLI_SAP_SBS_5_2x2 = PM_P2P_CLI_SAP_SBS_5_1x1,
	PM_P2P_CLI_P2P_CLI_SCC_24_1x1,
	PM_P2P_CLI_P2P_CLI_SCC_24_2x2,
	PM_P2P_CLI_P2P_CLI_MCC_24_1x1,
	PM_P2P_CLI_P2P_CLI_MCC_24_2x2,
	PM_P2P_CLI_P2P_CLI_SCC_5_1x1,
	PM_P2P_CLI_P2P_CLI_SCC_5_2x2,
	PM_P2P_CLI_P2P_CLI_MCC_5_1x1,
	PM_P2P_CLI_P2P_CLI_MCC_5_2x2,
	PM_P2P_CLI_P2P_CLI_MCC_24_5_1x1,
	PM_P2P_CLI_P2P_CLI_MCC_24_5_2x2,
	PM_P2P_CLI_P2P_CLI_DBS_1x1,
	PM_P2P_CLI_P2P_CLI_DBS_2x2,
	PM_P2P_CLI_P2P_CLI_SBS_5_1x1,
	PM_P2P_CLI_P2P_CLI_SBS_5_2x2 = PM_P2P_CLI_P2P_CLI_SBS_5_1x1,
	PM_SAP_SAP_SCC_24_1x1,
	PM_SAP_SAP_SCC_24_2x2,
	PM_SAP_SAP_MCC_24_1x1,
@@ -759,19 +805,6 @@ enum policy_mgr_two_connection_mode {
	PM_NAN_DISC_NDI_MCC_24_2x2,
	PM_NAN_DISC_NDI_DBS_1x1,
	PM_NAN_DISC_NDI_DBS_2x2,
	PM_P2P_GO_P2P_GO_SCC_24_1x1,
	PM_P2P_GO_P2P_GO_SCC_24_2x2,
	PM_P2P_GO_P2P_GO_MCC_24_1x1,
	PM_P2P_GO_P2P_GO_MCC_24_2x2,
	PM_P2P_GO_P2P_GO_SCC_5_1x1,
	PM_P2P_GO_P2P_GO_SCC_5_2x2,
	PM_P2P_GO_P2P_GO_MCC_5_1x1,
	PM_P2P_GO_P2P_GO_MCC_5_2x2,
	PM_P2P_GO_P2P_GO_MCC_24_5_1x1,
	PM_P2P_GO_P2P_GO_MCC_24_5_2x2,
	PM_P2P_GO_P2P_GO_DBS_1x1,
	PM_P2P_GO_P2P_GO_DBS_2x2,
	PM_P2P_GO_P2P_GO_SBS_5_1x1,
	PM_MAX_TWO_CONNECTION_MODE
};

@@ -1284,12 +1317,30 @@ struct connection_info {
	uint32_t ch_freq;
};

/**
 * struct go_plus_go_force_scc - structure to hold p2p go
 * params for forcescc restart
 *
 * @vdev_id: vdev id of first p2p go which needs to do csa
 * @ch_freq: ch freq of curr p2p go
 * @ch_width: ch width of curr p2p go
 */
struct go_plus_go_force_scc {
	uint8_t vdev_id;
	uint32_t ch_freq;
	uint32_t ch_width;
};

/**
 * struct sta_ap_intf_check_work_ctx - sta_ap_intf_check_work
 * related info
 * @psoc: pointer to PSOC object information
 * @go_plus_go_force_scc: structure to hold params of
 *			  curr and first p2p go ctx
 */
struct sta_ap_intf_check_work_ctx {
	struct wlan_objmgr_psoc *psoc;
	struct go_plus_go_force_scc go_plus_go_force_scc;
};

#endif /* __WLAN_POLICY_MGR_PUBLIC_STRUCT_H */
+78 −25
Original line number Diff line number Diff line
/*
 * Copyright (c) 2012-2021 The Linux Foundation. All rights reserved.
 * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
 *
 * Permission to use, copy, modify, and/or distribute this software for
 * any purpose with or without fee is hereby granted, provided that the
@@ -1974,52 +1975,54 @@ void policy_mgr_check_sap_restart(struct wlan_objmgr_psoc *psoc,
	pm_ctx->do_sap_unsafe_ch_check = false;
}

static void __policy_mgr_check_sta_ap_concurrent_ch_intf(void *data)
static void __policy_mgr_check_sta_ap_concurrent_ch_intf(
				struct policy_mgr_psoc_priv_obj *pm_ctx)
{
	struct wlan_objmgr_psoc *psoc;
	struct policy_mgr_psoc_priv_obj *pm_ctx = NULL;
	struct sta_ap_intf_check_work_ctx *work_info = NULL;
	uint32_t mcc_to_scc_switch, cc_count = 0, i;
	QDF_STATUS status;
	uint32_t ch_freq;
	uint32_t op_ch_freq_list[MAX_NUMBER_OF_CONC_CONNECTIONS];
	uint8_t vdev_id[MAX_NUMBER_OF_CONC_CONNECTIONS];

	work_info = data;
	if (!work_info) {
		policy_mgr_err("Invalid work_info");
		return;
	}

	psoc = work_info->psoc;
	if (!psoc) {
		policy_mgr_err("Invalid psoc");
		return;
	}

	pm_ctx = policy_mgr_get_context(psoc);
	if (!pm_ctx) {
		policy_mgr_err("Invalid context");
		return;
	}
	/*
	 * Check if force scc is required for GO + GO case. vdev id will be
	 * valid in case of GO+GO force scc only. So, for valid vdev id move
	 * first GO to newly formed GO channel.
	 */
	policy_mgr_debug("p2p go vdev id: %d",
			 pm_ctx->sta_ap_intf_check_work_info->go_plus_go_force_scc.vdev_id);
	if (pm_ctx->sta_ap_intf_check_work_info->go_plus_go_force_scc.vdev_id <
	    WLAN_UMAC_VDEV_ID_MAX) {
		policy_mgr_do_go_plus_go_force_scc(
			pm_ctx->psoc, pm_ctx->sta_ap_intf_check_work_info->go_plus_go_force_scc.vdev_id,
			pm_ctx->sta_ap_intf_check_work_info->go_plus_go_force_scc.ch_freq,
			pm_ctx->sta_ap_intf_check_work_info->go_plus_go_force_scc.ch_width);
		pm_ctx->sta_ap_intf_check_work_info->go_plus_go_force_scc.vdev_id = WLAN_UMAC_VDEV_ID_MAX;
		return;
	}

	mcc_to_scc_switch =
		policy_mgr_get_mcc_to_scc_switch_mode(psoc);
		policy_mgr_get_mcc_to_scc_switch_mode(pm_ctx->psoc);

	policy_mgr_debug("Concurrent open sessions running: %d",
			 policy_mgr_concurrent_open_sessions_running(psoc));
			 policy_mgr_concurrent_open_sessions_running(
							pm_ctx->psoc));

	if (!policy_mgr_is_sap_go_existed(psoc))
	if (!policy_mgr_is_sap_go_existed(pm_ctx->psoc))
		goto end;

	cc_count = policy_mgr_get_mode_specific_conn_info(
				psoc, &op_ch_freq_list[cc_count],
				pm_ctx->psoc, &op_ch_freq_list[cc_count],
				&vdev_id[cc_count], PM_SAP_MODE);
	policy_mgr_debug("Number of concurrent SAP: %d", cc_count);
	if (cc_count < MAX_NUMBER_OF_CONC_CONNECTIONS)
		cc_count = cc_count +
			   policy_mgr_get_mode_specific_conn_info(
					psoc, &op_ch_freq_list[cc_count],
				pm_ctx->psoc, &op_ch_freq_list[cc_count],
				&vdev_id[cc_count], PM_P2P_GO_MODE);
	policy_mgr_debug("Number of beaconing entities (SAP + GO):%d",
							cc_count);
@@ -2046,7 +2049,7 @@ static void __policy_mgr_check_sta_ap_concurrent_ch_intf(void *data)
		for (i = 0; i < cc_count; i++) {
			status = pm_ctx->hdd_cbacks.
				wlan_hdd_get_channel_for_sap_restart
					(psoc, vdev_id[i], &ch_freq);
					(pm_ctx->psoc, vdev_id[i], &ch_freq);
			if (status == QDF_STATUS_SUCCESS) {
				policy_mgr_debug("SAP vdev id %d restarts due to MCC->SCC switch, old ch freq :%d new ch freq: %d",
						 vdev_id[i],
@@ -2511,6 +2514,56 @@ void policy_mgr_change_sap_channel_with_csa(struct wlan_objmgr_psoc *psoc,
}
#endif

#ifdef WLAN_FEATURE_P2P_P2P_STA
void policy_mgr_do_go_plus_go_force_scc(struct wlan_objmgr_psoc *psoc,
					uint8_t vdev_id, uint32_t ch_freq,
					uint32_t ch_width)
{
	uint8_t total_connection;

	total_connection = policy_mgr_mode_specific_connection_count(
						psoc, PM_P2P_GO_MODE, NULL);

	policy_mgr_debug("Total p2p go connection %d", total_connection);

	/* If any p2p disconnected, don't do csa */
	if (total_connection > 1) {
		policy_mgr_change_sap_channel_with_csa(psoc, vdev_id,
						       ch_freq, ch_width, true);
	}
}

void policy_mgr_process_forcescc_for_go(struct wlan_objmgr_psoc *psoc,
					uint8_t vdev_id, uint32_t ch_freq,
					uint32_t ch_width)
{
	struct policy_mgr_psoc_priv_obj *pm_ctx;

	pm_ctx = policy_mgr_get_context(psoc);
	if (!pm_ctx) {
		policy_mgr_err("Invalid Context");
		return;
	}
	if (!pm_ctx->sta_ap_intf_check_work_info) {
		policy_mgr_err("invalid work info");
		return;
	}
	pm_ctx->sta_ap_intf_check_work_info->go_plus_go_force_scc.vdev_id =
								vdev_id;
	pm_ctx->sta_ap_intf_check_work_info->go_plus_go_force_scc.ch_freq =
								ch_freq;
	pm_ctx->sta_ap_intf_check_work_info->go_plus_go_force_scc.ch_width =
								ch_width;

	if (!qdf_delayed_work_start(&pm_ctx->sta_ap_intf_check_work,
				    WAIT_BEFORE_GO_FORCESCC_RESTART)) {
		policy_mgr_err("change interface request failure");
		pm_ctx->sta_ap_intf_check_work_info->go_plus_go_force_scc.vdev_id =
						WLAN_UMAC_VDEV_ID_MAX;
	}
}
#endif

QDF_STATUS policy_mgr_wait_for_connection_update(struct wlan_objmgr_psoc *psoc)
{
	QDF_STATUS status;
Loading