ソースを参照

qcacld-3.0: Cleanup MPC Unit Test Framework

Cleanup MPC Unit Test Framework.

Change-Id: I76aa0ad227069b68b9efedbbc7e87573e9a004c0
CRs-Fixed: 3178591
Utkarsh Bhatnagar 2 年 前
コミット
7c666d30a8

+ 0 - 4
Kbuild

@@ -226,10 +226,6 @@ ifeq ($(CONFIG_WLAN_SYNC_TSF), y)
 HDD_OBJS +=	$(HDD_SRC_DIR)/wlan_hdd_tsf.o
 endif
 
-ifeq ($(CONFIG_MPC_UT_FRAMEWORK), y)
-HDD_OBJS +=	$(HDD_SRC_DIR)/wlan_hdd_conc_ut.o
-endif
-
 ifeq ($(CONFIG_WLAN_FEATURE_DISA), y)
 HDD_OBJS += $(HDD_SRC_DIR)/wlan_hdd_disa.o
 endif

+ 0 - 157
components/cmn_services/policy_mgr/inc/wlan_policy_mgr_api.h

@@ -1391,143 +1391,6 @@ policy_mgr_get_preferred_dbs_action_table(
  */
 struct policy_mgr_conc_connection_info *policy_mgr_get_conn_info(
 		uint32_t *len);
-#ifdef MPC_UT_FRAMEWORK
-/**
- * policy_mgr_incr_connection_count_utfw() - adds the new
- * connection to the current connections list
- * @psoc: PSOC object information
- * @vdev_id: vdev id
- * @tx_streams: number of transmit spatial streams
- * @rx_streams: number of receive spatial streams
- * @chain_mask: chain mask
- * @mode: conn mode
- * @ch_freq: channel frequency value
- * @mac_id: mac id
- *
- * This function adds the new connection to the current
- * connections list
- *
- * Return: QDF_STATUS
- */
-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,
-				      enum policy_mgr_con_mode mode,
-				      uint32_t ch_freq, uint32_t mac_id);
-
-/**
- * policy_mgr_update_connection_info_utfw() - updates the
- * existing connection in the current connections list
- * @psoc: PSOC object information
- * @vdev_id: vdev id
- * @tx_streams: number of transmit spatial streams
- * @rx_streams: number of receive spatial streams
- * @chain_mask: chain mask
- * @type: connection type
- * @sub_type: connection subtype
- * @ch_freq: channel frequency value
- * @mac_id: mac id
- *
- * This function updates the connection to the current
- * connections list
- *
- * Return: QDF_STATUS
- */
-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,
-				       uint32_t ch_freq, uint32_t mac_id);
-
-/**
- * policy_mgr_decr_connection_count_utfw() - remove the old
- * connection from the current connections list
- * @psoc: PSOC object information
- * @del_all: delete all entries
- * @vdev_id: vdev id
- *
- * This function removes the old connection from the current
- * connections list
- *
- * Return: QDF_STATUS
- */
-QDF_STATUS policy_mgr_decr_connection_count_utfw(struct wlan_objmgr_psoc *psoc,
-		uint32_t del_all, uint32_t vdev_id);
-
-/**
- * policy_mgr_get_pcl_from_first_conn_table() - Get PCL for new
- * connection from first connection table
- * @type: Connection mode of type 'policy_mgr_con_mode'
- * @sys_pref: System preference
- *
- * Get the PCL for a new connection
- *
- * Return: PCL channels enum
- */
-enum policy_mgr_pcl_type policy_mgr_get_pcl_from_first_conn_table(
-		enum policy_mgr_con_mode type,
-		enum policy_mgr_conc_priority_mode sys_pref);
-
-/**
- * policy_mgr_get_pcl_from_second_conn_table() - Get PCL for new
- * connection from second connection table
- * @idx: index into first connection table
- * @type: Connection mode of type 'policy_mgr_con_mode'
- * @sys_pref: System preference
- * @dbs_capable: if HW DBS capable
- *
- * Get the PCL for a new connection
- *
- * Return: PCL channels enum
- */
-enum policy_mgr_pcl_type policy_mgr_get_pcl_from_second_conn_table(
-	enum policy_mgr_one_connection_mode idx, enum policy_mgr_con_mode type,
-	enum policy_mgr_conc_priority_mode sys_pref, uint8_t dbs_capable);
-
-/**
- * policy_mgr_get_pcl_from_third_conn_table() - Get PCL for new
- * connection from third connection table
- * @idx: index into second connection table
- * @type: Connection mode of type 'policy_mgr_con_mode'
- * @sys_pref: System preference
- * @dbs_capable: if HW DBS capable
- *
- * Get the PCL for a new connection
- *
- * Return: PCL channels enum
- */
-enum policy_mgr_pcl_type policy_mgr_get_pcl_from_third_conn_table(
-	enum policy_mgr_two_connection_mode idx, enum policy_mgr_con_mode type,
-	enum policy_mgr_conc_priority_mode sys_pref, uint8_t dbs_capable);
-#else
-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, enum policy_mgr_con_mode mode,
-		uint32_t ch_freq, uint32_t mac_id)
-{
-	return QDF_STATUS_SUCCESS;
-}
-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 rx_streams,
-		uint32_t chain_mask, uint32_t type, uint32_t sub_type,
-		uint32_t ch_freq, uint32_t mac_id)
-{
-	return QDF_STATUS_SUCCESS;
-}
-static inline QDF_STATUS policy_mgr_decr_connection_count_utfw(
-		struct wlan_objmgr_psoc *psoc, uint32_t del_all,
-		uint32_t vdev_id)
-{
-	return QDF_STATUS_SUCCESS;
-}
-#endif
 
 /**
  * policy_mgr_convert_device_mode_to_qdf_type() - provides the
@@ -4361,24 +4224,4 @@ bool policy_mgr_is_hwmode_offload_enabled(struct wlan_objmgr_psoc *psoc);
  */
 bool policy_mgr_is_3rd_conn_on_same_band_allowed(struct wlan_objmgr_psoc *psoc,
 						 enum policy_mgr_con_mode mode);
-
-#ifdef MPC_UT_FRAMEWORK
-/**
- * policy_mgr_set_dbs_cap_ut() - Set DBS capability for UT framework
- *
- * @psoc: Pointer to psoc
- * @dbs: Value of DBS capability to be set
- *
- * Sets the DBS capability for unit test framework. If the HW mode is
- * already sent by the FW, only the DBS capability needs to be set. If the
- * FW did not send any HW mode list, a single entry is created and DBS mode
- * is set in it. The DBS capability is also set in the service bit map.
- *
- * Return: None
- */
-void policy_mgr_set_dbs_cap_ut(struct wlan_objmgr_psoc *psoc, uint32_t dbs);
-#else
-static inline void
-policy_mgr_set_dbs_cap_ut(struct wlan_objmgr_psoc *psoc, uint32_t dbs) {}
-#endif
 #endif /* __WLAN_POLICY_MGR_API_H */

+ 0 - 2
components/cmn_services/policy_mgr/inc/wlan_policy_mgr_public_struct.h

@@ -1011,7 +1011,6 @@ enum policy_mgr_band {
 /**
  * enum policy_mgr_conn_update_reason: Reason for conc connection update
  * @POLICY_MGR_UPDATE_REASON_SET_OPER_CHAN: Set probable operating channel
- * @POLICY_MGR_UPDATE_REASON_UT: Unit test related
  * @POLICY_MGR_UPDATE_REASON_START_AP: Start AP
  * @POLICY_MGR_UPDATE_REASON_NORMAL_STA: Connection to Normal STA
  * @POLICY_MGR_UPDATE_REASON_OPPORTUNISTIC: Opportunistic HW mode update
@@ -1029,7 +1028,6 @@ enum policy_mgr_band {
  */
 enum policy_mgr_conn_update_reason {
 	POLICY_MGR_UPDATE_REASON_SET_OPER_CHAN,
-	POLICY_MGR_UPDATE_REASON_UT,
 	POLICY_MGR_UPDATE_REASON_START_AP,
 	POLICY_MGR_UPDATE_REASON_NORMAL_STA,
 	POLICY_MGR_UPDATE_REASON_OPPORTUNISTIC,

+ 0 - 170
components/cmn_services/policy_mgr/src/wlan_policy_mgr_action.c

@@ -3177,173 +3177,3 @@ ret_value:
 	return value;
 }
 
-#ifdef MPC_UT_FRAMEWORK
-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,
-		uint32_t ch_freq, uint32_t mac_id)
-{
-	QDF_STATUS status = QDF_STATUS_E_FAILURE;
-	uint32_t conn_index = 0, found = 0;
-	struct policy_mgr_psoc_priv_obj *pm_ctx;
-	uint16_t ch_flagext = 0;
-
-	pm_ctx = policy_mgr_get_context(psoc);
-	if (!pm_ctx) {
-		policy_mgr_err("Invalid Context");
-		return status;
-	}
-
-	qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock);
-	while (PM_CONC_CONNECTION_LIST_VALID_INDEX(conn_index)) {
-		if (vdev_id == pm_conc_connection_list[conn_index].vdev_id) {
-			/* debug msg */
-			found = 1;
-			break;
-		}
-		conn_index++;
-	}
-	qdf_mutex_release(&pm_ctx->qdf_conc_list_lock);
-	if (!found) {
-		/* err msg */
-		policy_mgr_err("can't find vdev_id %d in pm_conc_connection_list",
-			vdev_id);
-		return status;
-	}
-	policy_mgr_debug("--> updating entry at index[%d]", conn_index);
-
-	if (wlan_reg_is_dfs_for_freq(pm_ctx->pdev, ch_freq))
-		ch_flagext |= IEEE80211_CHAN_DFS;
-
-	policy_mgr_update_conc_list(psoc, conn_index,
-			policy_mgr_get_mode(type, sub_type),
-			ch_freq, HW_MODE_20_MHZ,
-			mac_id, chain_mask, 0, vdev_id, true, true,
-			ch_flagext);
-
-	return QDF_STATUS_SUCCESS;
-}
-
-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, enum policy_mgr_con_mode mode,
-		uint32_t ch_freq, uint32_t mac_id)
-{
-	QDF_STATUS status = QDF_STATUS_E_FAILURE;
-	uint32_t conn_index = 0;
-	bool update_conn = true;
-	uint16_t ch_flagext = 0;
-	struct policy_mgr_psoc_priv_obj *pm_ctx;
-
-	conn_index = policy_mgr_get_connection_count(psoc);
-	if (MAX_NUMBER_OF_CONC_CONNECTIONS <= conn_index) {
-		/* err msg */
-		policy_mgr_err("exceeded max connection limit %d",
-			MAX_NUMBER_OF_CONC_CONNECTIONS);
-		return status;
-	}
-	policy_mgr_debug("--> filling entry at index[%d]", conn_index);
-
-	if (mode == PM_STA_MODE || mode == PM_P2P_CLIENT_MODE)
-		update_conn = false;
-
-	pm_ctx = policy_mgr_get_context(psoc);
-	if (!pm_ctx) {
-		policy_mgr_err("Invalid pm context");
-		return false;
-	}
-	if (wlan_reg_is_dfs_for_freq(pm_ctx->pdev, ch_freq))
-		ch_flagext |= IEEE80211_CHAN_DFS;
-	if (mode < PM_MAX_NUM_OF_MODE) {
-		pm_ctx->no_of_active_sessions[mode]++;
-		policy_mgr_update_conc_list(psoc, conn_index, mode, ch_freq,
-					    HW_MODE_20_MHZ, mac_id, chain_mask,
-					    0, vdev_id, true, update_conn,
-					    ch_flagext);
-	}
-
-	return QDF_STATUS_SUCCESS;
-}
-
-QDF_STATUS policy_mgr_decr_connection_count_utfw(struct wlan_objmgr_psoc *psoc,
-		uint32_t del_all, uint32_t vdev_id)
-{
-	QDF_STATUS status;
-	struct policy_mgr_psoc_priv_obj *pm_ctx;
-
-	pm_ctx = policy_mgr_get_context(psoc);
-	if (!pm_ctx) {
-		policy_mgr_err("Invalid pm context");
-		return QDF_STATUS_E_FAILURE;
-	}
-
-	if (del_all) {
-		status = policy_mgr_psoc_disable(psoc);
-		if (!QDF_IS_STATUS_SUCCESS(status)) {
-			policy_mgr_err("Policy manager initialization failed");
-			return QDF_STATUS_E_FAILURE;
-		}
-		status = policy_mgr_psoc_enable(psoc);
-		if (!QDF_IS_STATUS_SUCCESS(status)) {
-			policy_mgr_err("Policy manager initialization failed");
-			return QDF_STATUS_E_FAILURE;
-		}
-	} else {
-		enum policy_mgr_con_mode mode =
-			policy_mgr_get_mode_by_vdev_id(psoc, vdev_id);
-
-		if (mode < PM_MAX_NUM_OF_MODE &&
-		    pm_ctx->no_of_active_sessions[mode]) {
-			pm_ctx->no_of_active_sessions[mode]--;
-			policy_mgr_decr_connection_count(psoc, vdev_id);
-		} else {
-			policy_mgr_err("mode %d unexpected", mode);
-			return QDF_STATUS_E_FAILURE;
-		}
-	}
-
-	return QDF_STATUS_SUCCESS;
-}
-
-enum policy_mgr_pcl_type policy_mgr_get_pcl_from_first_conn_table(
-		enum policy_mgr_con_mode type,
-		enum policy_mgr_conc_priority_mode sys_pref)
-{
-	if ((sys_pref >= PM_MAX_CONC_PRIORITY_MODE) ||
-		(type >= PM_MAX_NUM_OF_MODE))
-		return PM_MAX_PCL_TYPE;
-	return first_connection_pcl_table[type][sys_pref];
-}
-
-enum policy_mgr_pcl_type policy_mgr_get_pcl_from_second_conn_table(
-	enum policy_mgr_one_connection_mode idx, enum policy_mgr_con_mode type,
-	enum policy_mgr_conc_priority_mode sys_pref, uint8_t dbs_capable)
-{
-	if ((idx >= PM_MAX_ONE_CONNECTION_MODE) ||
-		(sys_pref >= PM_MAX_CONC_PRIORITY_MODE) ||
-		(type >= PM_MAX_NUM_OF_MODE))
-		return PM_MAX_PCL_TYPE;
-	if (dbs_capable)
-		return (*second_connection_pcl_dbs_table)[idx][type][sys_pref];
-	else
-		return (*second_connection_pcl_non_dbs_table)
-			[idx][type][sys_pref];
-}
-
-enum policy_mgr_pcl_type policy_mgr_get_pcl_from_third_conn_table(
-	enum policy_mgr_two_connection_mode idx, enum policy_mgr_con_mode type,
-	enum policy_mgr_conc_priority_mode sys_pref, uint8_t dbs_capable)
-{
-	if ((idx >= PM_MAX_TWO_CONNECTION_MODE) ||
-		(sys_pref >= PM_MAX_CONC_PRIORITY_MODE) ||
-		(type >= PM_MAX_NUM_OF_MODE))
-		return PM_MAX_PCL_TYPE;
-	if (dbs_capable)
-		return (*third_connection_pcl_dbs_table)[idx][type][sys_pref];
-	else
-		return (*third_connection_pcl_non_dbs_table)
-			[idx][type][sys_pref];
-}
-#endif

+ 0 - 28
components/cmn_services/policy_mgr/src/wlan_policy_mgr_get_set_utils.c

@@ -7112,31 +7112,3 @@ bool policy_mgr_is_hwmode_offload_enabled(struct wlan_objmgr_psoc *psoc)
 				   wmi_service_hw_mode_policy_offload_support);
 }
 
-#ifdef MPC_UT_FRAMEWORK
-void policy_mgr_set_dbs_cap_ut(struct wlan_objmgr_psoc *psoc, uint32_t dbs)
-{
-	struct policy_mgr_psoc_priv_obj *pm_ctx;
-	uint32_t i;
-
-	pm_ctx = policy_mgr_get_context(psoc);
-	if (!pm_ctx) {
-		policy_mgr_err("Invalid Context");
-		return;
-	}
-
-	if (!pm_ctx->hw_mode.hw_mode_list) {
-		pm_ctx->num_dbs_hw_modes = 1;
-		pm_ctx->hw_mode.hw_mode_list =
-			qdf_mem_malloc(sizeof(*pm_ctx->hw_mode.hw_mode_list) *
-				       pm_ctx->num_dbs_hw_modes);
-		if (!pm_ctx->hw_mode.hw_mode_list)
-			return;
-
-		pm_ctx->hw_mode.hw_mode_list[0] = 0x0000;
-	}
-
-	for (i = 0; i < pm_ctx->num_dbs_hw_modes; i++)
-		POLICY_MGR_HW_MODE_DBS_MODE_SET(pm_ctx->hw_mode.hw_mode_list[i],
-						dbs);
-}
-#endif

+ 0 - 83
core/hdd/inc/wlan_hdd_conc_ut.h

@@ -1,83 +0,0 @@
-/*
- * Copyright (c) 2015-2017, 2021 The Linux Foundation. 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
- * above copyright notice and this permission notice appear in all
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#ifndef __WLAN_HDD_CONC_UT_H
-#define __WLAN_HDD_CONC_UT_H
-
-/* Include files */
-
-#include "wlan_hdd_main.h"
-#include "wlan_policy_mgr_api.h"
-#ifdef MPC_UT_FRAMEWORK
-void clean_report(struct hdd_context *hdd_ctx);
-void fill_report(struct hdd_context *hdd_ctx, char *title,
-	uint32_t first_persona, uint32_t second_persona, uint32_t third_persona,
-	qdf_freq_t chnl_1st_conn, qdf_freq_t chnl_2nd_conn,
-	qdf_freq_t chnl_3rd_conn, bool status,
-	enum policy_mgr_pcl_type pcl_type, char *reason,
-	uint32_t *pcl_freqs, uint32_t pcl_len);
-void print_report(struct hdd_context *hdd_ctx);
-void wlan_hdd_one_connection_scenario(struct hdd_context *hdd_ctx);
-void wlan_hdd_two_connections_scenario(struct hdd_context *hdd_ctx,
-	qdf_freq_t first_chnl, enum policy_mgr_chain_mode first_chain_mask);
-void wlan_hdd_three_connections_scenario(struct hdd_context *hdd_ctx,
-	qdf_freq_t first_chnl, qdf_freq_t second_chnl,
-	enum policy_mgr_chain_mode chain_mask, uint8_t use_same_mac);
-#else
-static inline
-void clean_report(struct hdd_context *hdd_ctx)
-{
-}
-
-static inline
-void fill_report(struct hdd_context *hdd_ctx, char *title,
-	uint32_t first_persona, uint32_t second_persona,
-	uint32_t third_persona, qdf_freq_t chnl_1st_conn,
-	qdf_freq_t chnl_2nd_conn, qdf_freq_t chnl_3rd_conn,
-	bool status, enum policy_mgr_pcl_type pcl_type, char *reason,
-	uint32_t *pcl_freqs, uint32_t pcl_len)
-{
-}
-
-static inline
-void print_report(struct hdd_context *hdd_ctx)
-{
-}
-
-static inline
-void wlan_hdd_one_connection_scenario(struct hdd_context *hdd_ctx)
-{
-}
-
-static inline
-void wlan_hdd_two_connections_scenario(
-		struct hdd_context *hdd_ctx,
-		qdf_freq_t first_chnl,
-		enum policy_mgr_chain_mode first_chain_mask)
-{
-}
-
-static inline
-void wlan_hdd_three_connections_scenario(
-		struct hdd_context *hdd_ctx,
-		qdf_freq_t first_chnl, qdf_freq_t second_chnl,
-		enum policy_mgr_chain_mode chain_mask, uint8_t use_same_mac)
-{
-}
-#endif
-#endif

+ 1 - 33
core/hdd/inc/wlan_hdd_sysfs_policy_mgr.h

@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2011-2020, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2022 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 above
@@ -59,28 +60,6 @@ int hdd_sysfs_pm_pcl_create(struct kobject *driver_kobject);
  */
 void
 hdd_sysfs_pm_pcl_destroy(struct kobject *driver_kobject);
-
-/**
- * hdd_sysfs_pm_dbs_create() - API to create pm_dbs
- * @driver_kobject: sysfs driver kobject
- *
- * file path: /sys/kernel/wifi/pm_dbs
- *
- * usage:
- *      echo [dbs] [system_pref] > pm_dbs
- *
- * Return: 0 on success and errno on failure
- */
-int hdd_sysfs_pm_dbs_create(struct kobject *driver_kobject);
-
-/**
- * hdd_sysfs_pm_dbs_destroy() -
- *   API to destroy pm_dbs
- *
- * Return: none
- */
-void
-hdd_sysfs_pm_dbs_destroy(struct kobject *driver_kobject);
 #else
 static inline int
 hdd_sysfs_pm_pcl_create(struct kobject *driver_kobject)
@@ -102,16 +81,5 @@ static inline
 void hdd_sysfs_pm_cinfo_destroy(struct kobject *driver_kobject)
 {
 }
-
-static inline int
-hdd_sysfs_pm_dbs_create(struct kobject *driver_kobject)
-{
-	return 0;
-}
-
-static inline void
-hdd_sysfs_pm_dbs_destroy(struct kobject *driver_kobject)
-{
-}
 #endif
 #endif

+ 0 - 1195
core/hdd/src/wlan_hdd_conc_ut.c

@@ -1,1195 +0,0 @@
-/*
- * Copyright (c) 2015-2021 The Linux Foundation. All rights reserved.
- * Copyright (c) 2022 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
- * above copyright notice and this permission notice appear in all
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-/* Include files */
-
-#include <wlan_hdd_includes.h>
-#include <cds_api.h>
-#include <cds_sched.h>
-#include <wni_api.h>
-#include <wlan_hdd_cfg.h>
-#include "wlan_hdd_trace.h"
-#include "wlan_policy_mgr_api.h"
-#include "wlan_hdd_conc_ut.h"
-#include "qdf_types.h"
-#include "qdf_trace.h"
-#include "cds_utils.h"
-#include "wma_types.h"
-#include "wma.h"
-#include "wma_api.h"
-#include "wlan_policy_mgr_ucfg.h"
-#include "wlan_reg_services_api.h"
-
-#define NUMBER_OF_SCENARIO 300
-#define MAX_ALLOWED_CHAR_IN_REPORT 50
-
-/**
- * struct report_t: Data structure to fill report
- *
- * @title: title of the concurrency case scenario
- * @first_persona: device type of first persona
- * @second_persona: device type of second persona
- * @third_persona: device type of third persona
- * @dbs_value: string to mention whether dbs enable or disable
- * @system_conf: string to mention what is system's configuration
- * @status: status field
- * @result_code: string to mention whether test case passed or failed
- * @reason: reason why test case failed
- * @pcl: preferred channel list
- *
- * This structure will be used by unit test framework to fill
- * report after running various concurrency scenarios.
- */
-struct report_t {
-	char title[2 * MAX_ALLOWED_CHAR_IN_REPORT];
-	char first_persona[MAX_ALLOWED_CHAR_IN_REPORT];
-	char second_persona[MAX_ALLOWED_CHAR_IN_REPORT];
-	char third_persona[MAX_ALLOWED_CHAR_IN_REPORT];
-	char dbs_value[MAX_ALLOWED_CHAR_IN_REPORT];
-	char system_conf[MAX_ALLOWED_CHAR_IN_REPORT];
-	bool status;
-	char result_code[MAX_ALLOWED_CHAR_IN_REPORT];
-	char reason[MAX_ALLOWED_CHAR_IN_REPORT];
-	char pcl_freqs[6 * NUM_CHANNELS + 16];
-};
-
-static struct report_t report[NUMBER_OF_SCENARIO];
-static uint32_t report_idx;
-static const char *system_config_to_string(uint8_t idx)
-{
-	switch (idx) {
-	CASE_RETURN_STRING(PM_THROUGHPUT);
-	CASE_RETURN_STRING(PM_POWERSAVE);
-	CASE_RETURN_STRING(PM_LATENCY);
-	default:
-		return "Unknown";
-	}
-
-}
-
-void clean_report(struct hdd_context *hdd_ctx)
-{
-	uint32_t idx = 0;
-
-	while (idx < NUMBER_OF_SCENARIO) {
-		qdf_mem_zero(&report[idx], sizeof(struct report_t));
-		idx++;
-	}
-	report_idx = 0;
-}
-
-void print_report(struct hdd_context *hdd_ctx)
-{
-	uint32_t idx = 0;
-
-	pr_info("+----------Report start -----------+\n");
-	while (idx < report_idx) {
-		pr_info("Idx:[%d] Title:%s Result:[%s] 1st_person[%s] 2nd_persona[%s] 3rd_persona[%s] DBS[%s] system_config[%s] reason[%s] pcl_freqs[%s]\n",
-			idx,
-			report[idx].title, report[idx].result_code,
-			report[idx].first_persona, report[idx].second_persona,
-			report[idx].third_persona, report[idx].dbs_value,
-			report[idx].system_conf, report[idx].reason,
-			report[idx].pcl_freqs);
-		idx++;
-	}
-	pr_info("+----------Report end -----------+\n");
-}
-
-void fill_report(struct hdd_context *hdd_ctx, char *title,
-	uint32_t first_persona, uint32_t second_persona, uint32_t third_persona,
-	qdf_freq_t chnl_1st_conn, qdf_freq_t chnl_2nd_conn,
-	qdf_freq_t chnl_3rd_conn, bool status,
-	enum policy_mgr_pcl_type pcl_type, char *reason,
-	uint32_t *pcl_freqs, uint32_t pcl_len)
-{
-	int i;
-	char buf[5] = {0};
-	uint8_t sys_pref = 0;
-
-	if (report_idx >= NUMBER_OF_SCENARIO) {
-		pr_info("report buffer overflow %d", report_idx);
-		return;
-	}
-
-	ucfg_policy_mgr_get_sys_pref(hdd_ctx->psoc, &sys_pref);
-
-	snprintf(report[report_idx].title,
-		2 * MAX_ALLOWED_CHAR_IN_REPORT, "pcl for[%s] pcl_type[%s]",
-		title, pcl_type_to_string(pcl_type));
-	if (chnl_1st_conn == 0)
-		snprintf(report[report_idx].first_persona,
-			MAX_ALLOWED_CHAR_IN_REPORT, "%s",
-			device_mode_to_string(first_persona));
-	else
-		snprintf(report[report_idx].first_persona,
-			MAX_ALLOWED_CHAR_IN_REPORT,
-			"%s-chnl{%d}",
-			device_mode_to_string(first_persona), chnl_1st_conn);
-	if (chnl_2nd_conn == 0)
-		snprintf(report[report_idx].second_persona,
-			MAX_ALLOWED_CHAR_IN_REPORT, "%s",
-			device_mode_to_string(second_persona));
-	else
-		snprintf(report[report_idx].second_persona,
-			MAX_ALLOWED_CHAR_IN_REPORT,
-			"%s-chnl{%d}",
-			device_mode_to_string(second_persona), chnl_2nd_conn);
-	if (chnl_3rd_conn == 0)
-		snprintf(report[report_idx].third_persona,
-			MAX_ALLOWED_CHAR_IN_REPORT, "%s",
-			device_mode_to_string(third_persona));
-	else
-		snprintf(report[report_idx].third_persona,
-			MAX_ALLOWED_CHAR_IN_REPORT,
-			"%s-chnl{%d}",
-			device_mode_to_string(third_persona), chnl_3rd_conn);
-
-	report[report_idx].status = status;
-	snprintf(report[report_idx].dbs_value,
-		MAX_ALLOWED_CHAR_IN_REPORT, "%s",
-		policy_mgr_is_hw_dbs_capable(hdd_ctx->psoc)
-		? "enable" : "disable");
-	snprintf(report[report_idx].system_conf,
-		MAX_ALLOWED_CHAR_IN_REPORT, "%s",
-		system_config_to_string(sys_pref));
-	snprintf(report[report_idx].result_code,
-		MAX_ALLOWED_CHAR_IN_REPORT, "%s",
-		status ? "PASS" : "FAIL");
-	snprintf(report[report_idx].reason,
-		MAX_ALLOWED_CHAR_IN_REPORT,
-		reason);
-	if (pcl_freqs) {
-		qdf_mem_zero(report[report_idx].pcl_freqs,
-				sizeof(report[report_idx].pcl_freqs));
-		snprintf(buf, sizeof(buf), "pcl len %d :", pcl_len);
-		strlcat(report[report_idx].pcl_freqs, buf,
-			sizeof(report[report_idx].pcl_freqs));
-		for (i = 0; i < pcl_len && i < NUM_CHANNELS; i++) {
-			qdf_mem_zero(buf, sizeof(buf));
-			snprintf(buf, sizeof(buf), "%d ", pcl_freqs[i]);
-			strlcat(report[report_idx].pcl_freqs, buf,
-				sizeof(report[report_idx].pcl_freqs));
-			strlcat(report[report_idx].pcl_freqs, ", ",
-				sizeof(report[report_idx].pcl_freqs));
-		}
-	}
-	report_idx++;
-}
-
-static void _validate_24g(bool *status, uint32_t *first_idx,
-			  uint32_t *pcl_freqs, uint32_t pcl_len,
-			  qdf_freq_t first_connection_chnl,
-			  qdf_freq_t second_connection_chnl,
-			  char *reason, uint32_t reason_length)
-{
-	bool found2g = false;
-
-	if (!*status)
-		return;
-	for (; *first_idx < pcl_len; (*first_idx)++) {
-		if (WLAN_REG_IS_24GHZ_CH_FREQ(pcl_freqs[(*first_idx)]))
-			found2g = true;
-		else
-			break;
-	}
-	if (!found2g) {
-		snprintf(reason, reason_length,
-			 "Not 2g ch list");
-		*status = false;
-	}
-}
-
-static void _validate_5g(bool *status, uint32_t *first_idx,
-			 uint32_t *pcl_freqs, uint32_t pcl_len,
-			 qdf_freq_t first_connection_chnl,
-			 qdf_freq_t second_connection_chnl,
-			 char *reason, uint32_t reason_length)
-{
-	bool found5g = false;
-
-	if (!*status)
-		return;
-	for (; *first_idx < pcl_len; (*first_idx)++) {
-		if (WLAN_REG_IS_5GHZ_CH_FREQ(pcl_freqs[*first_idx]) ||
-		    WLAN_REG_IS_6GHZ_CHAN_FREQ(pcl_freqs[*first_idx])) {
-			found5g = true;
-		} else {
-			break;
-		}
-	}
-	if (!found5g) {
-		snprintf(reason, reason_length,
-			 "Not 5/6g ch list");
-		*status = false;
-	}
-}
-
-static void _validate_scc(bool *status, uint32_t *first_idx,
-			  uint32_t *pcl_freqs, uint32_t pcl_len,
-			  qdf_freq_t first_connection_chnl,
-			  qdf_freq_t second_connection_chnl,
-			  char *reason, uint32_t reason_length)
-{
-	if (!*status)
-		return;
-
-	if (!first_connection_chnl) {
-		snprintf(reason, reason_length,
-			 "scc ch invalid %d",
-			 first_connection_chnl);
-		*status = false;
-		return;
-	}
-	if (*first_idx >= pcl_len) {
-		snprintf(reason, reason_length,
-			 "no scc ch");
-		*status = false;
-		return;
-	}
-	if (pcl_freqs[*first_idx] != first_connection_chnl &&
-	    !(second_connection_chnl &&
-	      pcl_freqs[*first_idx] == second_connection_chnl)) {
-		snprintf(reason, reason_length,
-			 "1st scc ch is not correct %d expect %d %d",
-			 pcl_freqs[*first_idx],
-			 first_connection_chnl,
-			 second_connection_chnl);
-		*status = false;
-		return;
-	}
-	(*first_idx)++;
-	if (second_connection_chnl) {
-		if (*first_idx >= pcl_len) {
-			snprintf(reason, reason_length,
-				 "no 2nd scc ch");
-			*status = false;
-			return;
-		}
-		if (pcl_freqs[*first_idx] != first_connection_chnl &&
-		    pcl_freqs[*first_idx] != second_connection_chnl) {
-			snprintf(reason, reason_length,
-				 "2nd scc ch is not correct %d expect %d %d",
-				 pcl_freqs[*first_idx],
-				 first_connection_chnl,
-				 second_connection_chnl);
-			*status = false;
-			return;
-		}
-		(*first_idx)++;
-	}
-}
-
-static void _validate_mcc(bool *status, uint32_t *first_idx,
-			  uint32_t *pcl_freqs, uint32_t pcl_len,
-			  qdf_freq_t first_connection_chnl,
-			  qdf_freq_t second_connection_chnl,
-			  char *reason, uint32_t reason_length)
-{
-	if (!*status)
-		return;
-
-	if (!first_connection_chnl || !second_connection_chnl ||
-	    first_connection_chnl == second_connection_chnl) {
-		snprintf(reason, reason_length,
-			 "mcc ch invalid %d %d",
-			 first_connection_chnl,
-			 second_connection_chnl);
-		*status = false;
-		return;
-	}
-	if (*first_idx >= pcl_len) {
-		snprintf(reason, reason_length,
-			 "no mcc ch");
-		*status = false;
-		return;
-	}
-	if (pcl_freqs[*first_idx] != first_connection_chnl &&
-	    pcl_freqs[*first_idx] != second_connection_chnl) {
-		snprintf(reason, reason_length,
-			 "mcc ch is not correct %d",
-			 pcl_freqs[*first_idx]);
-		*status = false;
-		return;
-	}
-	(*first_idx)++;
-	if (pcl_freqs[*first_idx] != first_connection_chnl &&
-	    pcl_freqs[*first_idx] != second_connection_chnl) {
-		snprintf(reason, reason_length,
-			 "mcc ch is not correct %d",
-			 pcl_freqs[*first_idx]);
-		*status = false;
-		return;
-	}
-	(*first_idx)++;
-}
-
-static void _validate_sbs(struct wlan_objmgr_psoc *psoc,
-			  bool *status, uint32_t *first_idx,
-			  uint32_t *pcl_freqs, uint32_t pcl_len,
-			  qdf_freq_t first_connection_chnl,
-			  qdf_freq_t second_connection_chnl,
-			  char *reason, uint32_t reason_length)
-{
-	bool found_sbs = false;
-	uint32_t non_sbs_freq = 0;
-
-	if (!*status)
-		return;
-
-	if (*first_idx >= pcl_len) {
-		snprintf(reason, reason_length,
-			 "no sbs ch list");
-		*status = false;
-		return;
-	}
-	for (; *first_idx < pcl_len; (*first_idx)++) {
-		if (policy_mgr_are_sbs_chan(psoc, pcl_freqs[*first_idx],
-					    first_connection_chnl)) {
-			found_sbs = true;
-		} else {
-			non_sbs_freq = pcl_freqs[*first_idx];
-			break;
-		}
-	}
-	if (!found_sbs) {
-		snprintf(reason, reason_length,
-			 "not sbs ch list %d",
-			 non_sbs_freq);
-		*status = false;
-		return;
-	}
-}
-
-static void _validate_end(bool *status, uint32_t *first_idx,
-			  uint32_t *pcl_freqs, uint32_t pcl_len,
-			  qdf_freq_t first_connection_chnl,
-			  qdf_freq_t second_connection_chnl,
-			  char *reason, uint32_t reason_length)
-{
-	if (!*status)
-		return;
-
-	if (*first_idx < pcl_len) {
-		snprintf(reason, reason_length,
-			 "unexpected ch in pcl");
-		*status = false;
-		return;
-	}
-}
-
-#define validate_24g _validate_24g(					\
-			&status, &first_idx, pcl_freqs, pcl_len,	\
-			first_connection_chnl, second_connection_chnl,	\
-			reason, reason_length)
-
-#define validate_5g _validate_5g(					\
-			&status, &first_idx, pcl_freqs, pcl_len,	\
-			first_connection_chnl, second_connection_chnl,	\
-			reason, reason_length)
-
-#define validate_scc _validate_scc(					\
-			&status, &first_idx, pcl_freqs, pcl_len,	\
-			first_connection_chnl, second_connection_chnl,	\
-			reason, reason_length)
-
-#define validate_mcc _validate_mcc(					\
-			&status, &first_idx, pcl_freqs, pcl_len,	\
-			first_connection_chnl, second_connection_chnl,	\
-			reason, reason_length)
-
-#define validate_sbs _validate_sbs(					\
-			psoc, &status, &first_idx, pcl_freqs, pcl_len,	\
-			first_connection_chnl, second_connection_chnl,	\
-			reason, reason_length)
-
-#define validate_end _validate_end(					\
-			&status, &first_idx, pcl_freqs, pcl_len,	\
-			first_connection_chnl, second_connection_chnl,	\
-			reason, reason_length)
-
-static bool wlan_hdd_validate_pcl(struct hdd_context *hdd_ctx,
-	enum policy_mgr_pcl_type pcl_type, uint32_t *pcl_freqs,
-	uint32_t pcl_len, qdf_freq_t first_connection_chnl,
-	qdf_freq_t second_connection_chnl, char *reason,
-	uint32_t reason_length)
-{
-	bool status = true;
-	uint32_t first_idx = 0;
-	struct wlan_objmgr_psoc *psoc = hdd_ctx->psoc;
-
-	if ((pcl_type != PM_NONE) && (pcl_len == 0)) {
-		snprintf(reason, reason_length, "no of channels = 0");
-		return false;
-	}
-
-	switch (pcl_type) {
-	case PM_NONE:
-		if (pcl_len != 0) {
-			snprintf(reason, reason_length, "no of channels>0");
-			return false;
-		}
-		break;
-	case PM_5G:
-		for (first_idx = 0; first_idx < pcl_len; first_idx++) {
-			if (!WLAN_REG_IS_5GHZ_CH_FREQ(pcl_freqs[first_idx]) &&
-			    !WLAN_REG_IS_6GHZ_CHAN_FREQ(pcl_freqs[first_idx])) {
-				snprintf(reason, reason_length,
-					"2G channel found");
-				return false;
-			}
-		}
-		break;
-	case PM_24G:
-		for (first_idx = 0; first_idx < pcl_len; first_idx++) {
-			if (!WLAN_REG_IS_24GHZ_CH_FREQ(pcl_freqs[first_idx])) {
-				snprintf(reason, reason_length,
-					"5G channel found");
-				return false;
-			}
-		}
-		break;
-	case PM_SCC_CH:
-		if (second_connection_chnl > 0 &&
-			(first_connection_chnl != second_connection_chnl)) {
-			snprintf(reason, reason_length,
-				"invalid connections");
-			return false;
-		}
-		if (pcl_freqs[0] != first_connection_chnl) {
-			snprintf(reason, reason_length,
-				"No SCC found");
-			return false;
-		}
-		break;
-	case PM_MCC_CH:
-		if ((pcl_freqs[0] != first_connection_chnl) &&
-				((second_connection_chnl > 0) &&
-				 (pcl_freqs[0] != second_connection_chnl))) {
-			snprintf(reason, reason_length,
-				"MCC invalid");
-			return false;
-		}
-		if ((second_connection_chnl > 0) &&
-				(pcl_freqs[1] != first_connection_chnl &&
-				 pcl_freqs[1] != second_connection_chnl)) {
-			snprintf(reason, reason_length,
-				"MCC invalid");
-			return false;
-		}
-		break;
-	case PM_SCC_CH_24G:
-		if (second_connection_chnl > 0 &&
-			(first_connection_chnl != second_connection_chnl)) {
-			snprintf(reason, reason_length,
-				"invalid connections");
-			return false;
-		}
-		if (pcl_freqs[0] != first_connection_chnl) {
-			snprintf(reason, reason_length,
-				"No SCC found");
-			return false;
-		}
-		if (!WLAN_REG_IS_24GHZ_CH_FREQ(pcl_freqs[pcl_len - 1])) {
-			snprintf(reason, reason_length,
-				"No 2.4Ghz chnl");
-			return false;
-		}
-		break;
-	case PM_SCC_CH_5G:
-		if (second_connection_chnl > 0 &&
-			(first_connection_chnl != second_connection_chnl)) {
-			snprintf(reason, reason_length,
-				"invalid connections");
-			return false;
-		}
-		if (pcl_freqs[0] != first_connection_chnl) {
-			snprintf(reason, reason_length,
-				"No SCC found");
-			return false;
-		}
-		if (!WLAN_REG_IS_5GHZ_CH_FREQ(pcl_freqs[pcl_len - 1]) &&
-		    !WLAN_REG_IS_6GHZ_CHAN_FREQ(pcl_freqs[pcl_len - 1])) {
-			snprintf(reason, reason_length,
-				"No 5Ghz chnl");
-			return false;
-		}
-		break;
-	case PM_24G_SCC_CH:
-		if (!WLAN_REG_IS_24GHZ_CH_FREQ(pcl_freqs[0])) {
-			snprintf(reason, reason_length,
-				"No 2.4Ghz chnl");
-			return false;
-		}
-		if (second_connection_chnl > 0 &&
-			(first_connection_chnl != second_connection_chnl)) {
-			snprintf(reason, reason_length,
-				"invalid connections");
-			return false;
-		}
-		if (pcl_freqs[pcl_len-1] != first_connection_chnl) {
-			snprintf(reason, reason_length,
-				"No SCC found");
-			return false;
-		}
-		break;
-	case PM_5G_SCC_CH:
-		if (!WLAN_REG_IS_5GHZ_CH_FREQ(pcl_freqs[0]) &&
-		    !WLAN_REG_IS_6GHZ_CHAN_FREQ(pcl_freqs[0])) {
-			snprintf(reason, reason_length,
-				"No 5Ghz chnl");
-			return false;
-		}
-		if (second_connection_chnl > 0 &&
-			(first_connection_chnl != second_connection_chnl)) {
-			snprintf(reason, reason_length,
-				"invalid connections");
-			return false;
-		}
-		if (pcl_freqs[pcl_len-1] != first_connection_chnl) {
-			snprintf(reason, reason_length,
-				"No SCC found");
-			return false;
-		}
-		break;
-	case PM_MCC_CH_24G:
-		if ((pcl_freqs[0] != first_connection_chnl) &&
-			((second_connection_chnl > 0) &&
-			 (pcl_freqs[0] != second_connection_chnl))) {
-			snprintf(reason, reason_length,
-				"MCC invalid");
-			return false;
-		}
-		if ((second_connection_chnl > 0) &&
-			(pcl_freqs[1] != first_connection_chnl &&
-			 pcl_freqs[1] != second_connection_chnl)) {
-			snprintf(reason, reason_length,
-				"MCC invalid");
-			return false;
-		}
-		if (!WLAN_REG_IS_24GHZ_CH_FREQ(pcl_freqs[pcl_len - 1])) {
-			snprintf(reason, reason_length,
-				"No 24Ghz chnl");
-			return false;
-		}
-		break;
-	case PM_MCC_CH_5G:
-		if ((pcl_freqs[0] != first_connection_chnl) &&
-			((second_connection_chnl > 0) &&
-			 (pcl_freqs[0] != second_connection_chnl))) {
-			snprintf(reason, reason_length,
-				"MCC invalid");
-			return false;
-		}
-		if ((second_connection_chnl > 0) &&
-			(pcl_freqs[1] != first_connection_chnl &&
-			 pcl_freqs[1] != second_connection_chnl)) {
-			snprintf(reason, reason_length,
-				"MCC invalid");
-			return false;
-		}
-		if (!WLAN_REG_IS_5GHZ_CH_FREQ(pcl_freqs[pcl_len - 1]) &&
-		    !WLAN_REG_IS_6GHZ_CHAN_FREQ(pcl_freqs[pcl_len - 1])) {
-			snprintf(reason, reason_length,
-				"No 5Ghz chnl");
-			return false;
-		}
-		break;
-	case PM_24G_MCC_CH:
-		if (!WLAN_REG_IS_24GHZ_CH_FREQ(pcl_freqs[0])) {
-			snprintf(reason, reason_length,
-				"No 24Ghz chnl");
-			return false;
-		}
-		if ((pcl_freqs[pcl_len-1] != first_connection_chnl) &&
-			((second_connection_chnl > 0) &&
-			 (pcl_freqs[pcl_len-1] != second_connection_chnl))) {
-			snprintf(reason, reason_length,
-				"MCC invalid");
-			return false;
-		}
-		if ((second_connection_chnl > 0) &&
-			(pcl_freqs[pcl_len-2] != first_connection_chnl &&
-			 pcl_freqs[pcl_len-2] != second_connection_chnl)) {
-			snprintf(reason, reason_length,
-				"MCC invalid");
-			return false;
-		}
-		break;
-	case PM_5G_MCC_CH:
-		if (!WLAN_REG_IS_5GHZ_CH_FREQ(pcl_freqs[0]) &&
-		    !WLAN_REG_IS_6GHZ_CHAN_FREQ(pcl_freqs[0])) {
-			snprintf(reason, reason_length,
-				"No 5Ghz chnl");
-			return false;
-		}
-		if ((pcl_freqs[pcl_len-1] != first_connection_chnl) &&
-			((second_connection_chnl > 0) &&
-			 (pcl_freqs[pcl_len-1] != second_connection_chnl))) {
-			snprintf(reason, reason_length,
-				"MCC invalid");
-			return false;
-		}
-		if ((second_connection_chnl > 0) &&
-			(pcl_freqs[pcl_len-2] != first_connection_chnl &&
-			 pcl_freqs[pcl_len-2] != second_connection_chnl)) {
-			snprintf(reason, reason_length,
-				"MCC invalid");
-			return false;
-		}
-		break;
-	case PM_SCC_ON_5_CH_5G:
-		if ((!WLAN_REG_IS_5GHZ_CH_FREQ(pcl_freqs[0]) &&
-		     !WLAN_REG_IS_6GHZ_CHAN_FREQ(pcl_freqs[0])) ||
-			(pcl_freqs[0] != first_connection_chnl &&
-			 pcl_freqs[0] != second_connection_chnl)) {
-			snprintf(reason, reason_length,
-				 "No 5Ghz scc chnl");
-			return false;
-		}
-		if (!WLAN_REG_IS_5GHZ_CH_FREQ(
-				pcl_freqs[pcl_len - 1]) &&
-		    !WLAN_REG_IS_6GHZ_CHAN_FREQ(
-				pcl_freqs[pcl_len - 1])) {
-			snprintf(reason, reason_length,
-				 "No 5Ghz chnl");
-			return false;
-		}
-		break;
-	case PM_SCC_ON_5_SCC_ON_24_24G:
-		if ((!WLAN_REG_IS_5GHZ_CH_FREQ(pcl_freqs[0]) &&
-		     !WLAN_REG_IS_6GHZ_CHAN_FREQ(pcl_freqs[0])) ||
-			(pcl_freqs[0] != first_connection_chnl &&
-			 pcl_freqs[0] != second_connection_chnl)) {
-			snprintf(reason, reason_length,
-				"No 5Ghz chnl/scc");
-			return false;
-		}
-		if (!WLAN_REG_IS_24GHZ_CH_FREQ(pcl_freqs[1]) ||
-			(pcl_freqs[1] != first_connection_chnl &&
-			 pcl_freqs[1] != second_connection_chnl)) {
-			snprintf(reason, reason_length,
-				"No 24Ghz chnl/scc");
-			return false;
-		}
-		if (!WLAN_REG_IS_24GHZ_CH_FREQ(pcl_freqs[pcl_len - 1])) {
-			snprintf(reason, reason_length,
-				"No 24Ghz chnls");
-			return false;
-		}
-		break;
-	case PM_SCC_ON_5_SCC_ON_24_5G:
-		if ((!WLAN_REG_IS_5GHZ_CH_FREQ(pcl_freqs[0]) &&
-		     !WLAN_REG_IS_6GHZ_CHAN_FREQ(pcl_freqs[0])) ||
-			(pcl_freqs[0] != first_connection_chnl &&
-			 pcl_freqs[0] != second_connection_chnl)) {
-			snprintf(reason, reason_length,
-				"No 5Ghz chnl/scc");
-			return false;
-		}
-		if (!WLAN_REG_IS_24GHZ_CH_FREQ(pcl_freqs[1]) ||
-			(pcl_freqs[1] != first_connection_chnl &&
-			 pcl_freqs[1] != second_connection_chnl)) {
-			snprintf(reason, reason_length,
-				"No 24Ghz chnl/scc");
-			return false;
-		}
-		if (!WLAN_REG_IS_5GHZ_CH_FREQ(pcl_freqs[pcl_len - 1]) &&
-		    !WLAN_REG_IS_6GHZ_CHAN_FREQ(pcl_freqs[pcl_len - 1])) {
-			snprintf(reason, reason_length,
-				"No 5Ghz chnls");
-			return false;
-		}
-		break;
-	case PM_SCC_ON_5_5G_24G:
-		if ((!WLAN_REG_IS_5GHZ_CH_FREQ(pcl_freqs[0]) &&
-		     !WLAN_REG_IS_6GHZ_CHAN_FREQ(pcl_freqs[0])) ||
-			(pcl_freqs[0] != first_connection_chnl &&
-			 pcl_freqs[0] != second_connection_chnl)) {
-			snprintf(reason, reason_length,
-				 "No 5Ghz chnl/scc");
-			return false;
-		}
-		if (!WLAN_REG_IS_5GHZ_CH_FREQ(
-			pcl_freqs[pcl_len - (NUM_24GHZ_CHANNELS - 1)]) &&
-		    !WLAN_REG_IS_6GHZ_CHAN_FREQ(
-			pcl_freqs[pcl_len - (NUM_24GHZ_CHANNELS - 1)])) {
-			snprintf(reason, reason_length,
-				 "No 5Ghz chnls");
-			return false;
-		}
-		if (!WLAN_REG_IS_24GHZ_CH_FREQ(pcl_freqs[pcl_len - 1])) {
-			snprintf(reason, reason_length,
-				 "No 24Ghz chnls");
-			return false;
-		}
-		break;
-	case PM_SCC_ON_5_5G_SCC_ON_24G:
-		if ((!WLAN_REG_IS_5GHZ_CH_FREQ(pcl_freqs[0]) &&
-		     !WLAN_REG_IS_6GHZ_CHAN_FREQ(pcl_freqs[0])) ||
-			(pcl_freqs[0] != first_connection_chnl &&
-			 pcl_freqs[0] != second_connection_chnl)) {
-			snprintf(reason, reason_length,
-				 "No 5Ghz chnl/scc");
-			return false;
-		}
-		if (!WLAN_REG_IS_5GHZ_CH_FREQ(
-				pcl_freqs[pcl_len - 2]) &&
-		    !WLAN_REG_IS_6GHZ_CHAN_FREQ(
-				pcl_freqs[pcl_len - 2])) {
-			snprintf(reason, reason_length,
-				 "No 5Ghz chnls");
-			return false;
-		}
-		if (!WLAN_REG_IS_24GHZ_CH_FREQ(pcl_freqs[pcl_len - 1]) ||
-		    (pcl_freqs[1] != first_connection_chnl &&
-		     pcl_freqs[1] != second_connection_chnl)) {
-			snprintf(reason, reason_length,
-				 "No 24Ghz chnl/scc");
-			return false;
-		}
-	case PM_SCC_ON_24_SCC_ON_5_24G:
-		if (!WLAN_REG_IS_24GHZ_CH_FREQ(pcl_freqs[0]) ||
-			(pcl_freqs[0] != first_connection_chnl &&
-			 pcl_freqs[0] != second_connection_chnl)) {
-			snprintf(reason, reason_length,
-				"No 24Ghz chnl/scc");
-			return false;
-		}
-		if ((!WLAN_REG_IS_5GHZ_CH_FREQ(pcl_freqs[1]) &&
-		     !WLAN_REG_IS_6GHZ_CHAN_FREQ(pcl_freqs[1])) ||
-			(pcl_freqs[1] != first_connection_chnl &&
-			 pcl_freqs[1] != second_connection_chnl)) {
-			snprintf(reason, reason_length,
-				"No 5Ghz chnl/scc");
-			return false;
-		}
-		if (!WLAN_REG_IS_24GHZ_CH_FREQ(pcl_freqs[pcl_len - 1])) {
-			snprintf(reason, reason_length,
-				"No 24Ghz chnls");
-			return false;
-		}
-		break;
-	case PM_SCC_ON_24_SCC_ON_5_5G:
-		if (!WLAN_REG_IS_24GHZ_CH_FREQ(pcl_freqs[0]) ||
-			(pcl_freqs[0] != first_connection_chnl &&
-			 pcl_freqs[0] != second_connection_chnl)) {
-			snprintf(reason, reason_length,
-				"No 24Ghz chnl/scc");
-			return false;
-		}
-		if ((!WLAN_REG_IS_5GHZ_CH_FREQ(pcl_freqs[1]) &&
-		     !WLAN_REG_IS_6GHZ_CHAN_FREQ(pcl_freqs[1])) ||
-			(pcl_freqs[1] != first_connection_chnl &&
-			 pcl_freqs[1] != second_connection_chnl)) {
-			snprintf(reason, reason_length,
-				"No 5Ghz chnl/scc");
-			return false;
-		}
-		if (!WLAN_REG_IS_5GHZ_CH_FREQ(pcl_freqs[pcl_len - 1]) &&
-		    !WLAN_REG_IS_6GHZ_CHAN_FREQ(pcl_freqs[pcl_len - 1])) {
-			snprintf(reason, reason_length,
-				"No 5Ghz chnls");
-			return false;
-		}
-		break;
-	case PM_SCC_ON_5_SCC_ON_24:
-		if ((!WLAN_REG_IS_5GHZ_CH_FREQ(pcl_freqs[0]) &&
-		     !WLAN_REG_IS_6GHZ_CHAN_FREQ(pcl_freqs[0])) ||
-			(pcl_freqs[0] != first_connection_chnl &&
-			 pcl_freqs[0] != second_connection_chnl)) {
-			snprintf(reason, reason_length,
-				"No 5Ghz chnl/scc");
-			return false;
-		}
-		if (!WLAN_REG_IS_24GHZ_CH_FREQ(pcl_freqs[1]) ||
-			(pcl_freqs[1] != first_connection_chnl &&
-			 pcl_freqs[1] != second_connection_chnl)) {
-			snprintf(reason, reason_length,
-				"No 24Ghz chnl/scc");
-			return false;
-		}
-		if (pcl_len != 2) {
-			snprintf(reason, reason_length,
-				"more than 2 chnls");
-			return false;
-		}
-		break;
-	case PM_SCC_ON_24_SCC_ON_5:
-		if (!WLAN_REG_IS_24GHZ_CH_FREQ(pcl_freqs[0]) ||
-			(pcl_freqs[0] != first_connection_chnl &&
-			 pcl_freqs[0] != second_connection_chnl)) {
-			snprintf(reason, reason_length,
-				"No 24Ghz chnl/scc");
-			return false;
-		}
-		if ((!WLAN_REG_IS_5GHZ_CH_FREQ(pcl_freqs[1]) &&
-		     !WLAN_REG_IS_6GHZ_CHAN_FREQ(pcl_freqs[1])) ||
-			(pcl_freqs[1] != first_connection_chnl &&
-			 pcl_freqs[1] != second_connection_chnl)) {
-			snprintf(reason, reason_length,
-				"No 5Ghz chnl/scc");
-			return false;
-		}
-		if (pcl_len != 2) {
-			snprintf(reason, reason_length,
-				"more than 2 chnls");
-			return false;
-		}
-		break;
-	case PM_SBS_CH:
-		validate_scc;
-		validate_end;
-		break;
-	case PM_SBS_CH_5G:
-		validate_scc;
-		validate_5g;
-		validate_end;
-		break;
-	case PM_24G_SCC_CH_SBS_CH:
-		validate_24g;
-		validate_scc;
-		validate_sbs;
-		validate_end;
-		break;
-	case PM_24G_SCC_CH_SBS_CH_5G:
-		validate_24g;
-		validate_scc;
-		validate_sbs;
-		validate_5g;
-		validate_end;
-		break;
-	case PM_24G_SBS_CH_MCC_CH:
-		validate_24g;
-		validate_sbs;
-		validate_mcc;
-		validate_end;
-		break;
-	case PM_SBS_CH_24G_SCC_CH:
-		validate_sbs;
-		validate_24g;
-		validate_scc;
-		validate_end;
-		break;
-	case PM_SBS_CH_SCC_CH_24G:
-		validate_sbs;
-		validate_scc;
-		validate_24g;
-		validate_end;
-		break;
-	case PM_SCC_CH_SBS_CH_24G:
-		validate_scc;
-		validate_sbs;
-		validate_24g;
-		validate_end;
-		break;
-	case PM_SBS_CH_SCC_CH_5G_24G:
-		validate_sbs;
-		validate_scc;
-		validate_5g;
-		validate_24g;
-		validate_end;
-		break;
-	case PM_SCC_CH_MCC_CH_SBS_CH_24G:
-		validate_scc;
-		validate_5g;
-		validate_24g;
-		validate_end;
-		break;
-	case PM_SBS_CH_2G:
-		validate_sbs;
-		validate_24g;
-		validate_end;
-	default:
-		snprintf(reason, reason_length,
-			"Unknown option");
-		status = false;
-	}
-	if (status == true) {
-		snprintf(reason, reason_length,
-			"success");
-	}
-	return status;
-}
-
-void wlan_hdd_one_connection_scenario(struct hdd_context *hdd_ctx)
-{
-	enum policy_mgr_con_mode sub_type;
-	uint8_t weight_list[NUM_CHANNELS] = {0};
-	uint32_t pcl_len = 0;
-	uint32_t pcl_freqs[NUM_CHANNELS] = {0};
-	bool status = false;
-	enum policy_mgr_pcl_type pcl_type;
-	char reason[20] = {0};
-	QDF_STATUS ret;
-	struct policy_mgr_sme_cbacks sme_cbacks;
-	uint8_t system_pref = 0;
-
-	ucfg_policy_mgr_get_sys_pref(hdd_ctx->psoc, &system_pref);
-
-	sme_cbacks.sme_get_nss_for_vdev = sme_get_vdev_type_nss;
-	/* flush the entire table first */
-	policy_mgr_psoc_disable(hdd_ctx->psoc);
-	ret = policy_mgr_psoc_enable(hdd_ctx->psoc);
-	if (!QDF_IS_STATUS_SUCCESS(ret)) {
-		hdd_err("Policy manager initialization failed");
-		return;
-	}
-
-	for (sub_type = 0; sub_type < PM_MAX_NUM_OF_MODE; sub_type++) {
-		/* validate one connection is created or no */
-		if (policy_mgr_get_connection_count(hdd_ctx->psoc) != 0) {
-			hdd_err("Test failed - No. of connection is not 0");
-			return;
-		}
-		pcl_len = 0;
-		pcl_type = policy_mgr_get_pcl_from_first_conn_table(
-			sub_type, system_pref);
-
-		/* check PCL value for second connection is correct or no */
-		policy_mgr_get_pcl(hdd_ctx->psoc, sub_type, pcl_freqs, &pcl_len,
-				   weight_list, QDF_ARRAY_SIZE(weight_list));
-
-		status = wlan_hdd_validate_pcl(hdd_ctx,
-				pcl_type, pcl_freqs, pcl_len, 0, 0,
-				reason, sizeof(reason));
-		if ((pcl_type == PM_MAX_PCL_TYPE) && (pcl_freqs[0] == 0))
-			continue;
-
-		fill_report(hdd_ctx, "1 connection", sub_type,
-				PM_MAX_NUM_OF_MODE,
-				PM_MAX_NUM_OF_MODE,
-				0, 0, 0,
-				status, pcl_type, reason, pcl_freqs,
-				pcl_len);
-	}
-}
-
-void wlan_hdd_two_connections_scenario(
-		struct hdd_context *hdd_ctx,
-		qdf_freq_t first_chnl,
-		enum policy_mgr_chain_mode first_chain_mask)
-{
-	uint8_t vdevid = 0, tx_stream = 2, rx_stream = 2;
-	uint8_t mac_id = 1;
-	uint8_t weight_list[NUM_CHANNELS] = {0};
-	uint32_t pcl_len = 0;
-	uint32_t pcl_freqs[NUM_CHANNELS];
-	enum policy_mgr_chain_mode chain_mask = first_chain_mask;
-	enum policy_mgr_con_mode sub_type, next_sub_type;
-	enum policy_mgr_pcl_type pcl_type;
-	enum policy_mgr_one_connection_mode second_index;
-	char reason[20] = {0};
-	bool status = false;
-	QDF_STATUS ret;
-	uint8_t system_pref = 0;
-
-	ucfg_policy_mgr_get_sys_pref(hdd_ctx->psoc, &system_pref);
-
-	for (sub_type = PM_STA_MODE;
-		sub_type < PM_MAX_NUM_OF_MODE; sub_type++) {
-
-		/* flush the entire table first */
-		policy_mgr_psoc_disable(hdd_ctx->psoc);
-		ret = policy_mgr_psoc_enable(hdd_ctx->psoc);
-		if (!QDF_IS_STATUS_SUCCESS(ret)) {
-			hdd_err("Policy manager initialization failed");
-			return;
-		}
-
-		/* add first connection as STA */
-		policy_mgr_incr_connection_count_utfw(
-			hdd_ctx->psoc, vdevid, tx_stream,
-			rx_stream, chain_mask, sub_type,
-			first_chnl, 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");
-			return;
-		}
-		next_sub_type = PM_STA_MODE;
-		while (next_sub_type < PM_MAX_NUM_OF_MODE) {
-			/* get the PCL value & check the channels accordingly */
-			second_index =
-			policy_mgr_get_second_connection_pcl_table_index(
-				hdd_ctx->psoc);
-			if (PM_MAX_ONE_CONNECTION_MODE == second_index) {
-				/* not valid combination*/
-				hdd_err("couldn't find index for 2nd connection pcl table");
-				next_sub_type++;
-				continue;
-			}
-			pcl_len = 0;
-			pcl_type = policy_mgr_get_pcl_from_second_conn_table(
-				second_index, next_sub_type, system_pref,
-				policy_mgr_is_hw_dbs_capable(
-					hdd_ctx->psoc));
-			/* check PCL for second connection is correct or no */
-			policy_mgr_get_pcl(hdd_ctx->psoc,
-					   next_sub_type, pcl_freqs, &pcl_len,
-					   weight_list,
-					   QDF_ARRAY_SIZE(weight_list));
-			status = wlan_hdd_validate_pcl(hdd_ctx,
-					pcl_type, pcl_freqs, pcl_len,
-					first_chnl, 0,
-					reason, sizeof(reason));
-			if ((pcl_type == PM_MAX_PCL_TYPE) && (pcl_freqs[0] == 0)) {
-				next_sub_type++;
-				continue;
-			}
-			fill_report(hdd_ctx, "2 connections", sub_type,
-					next_sub_type,
-					PM_MAX_NUM_OF_MODE, first_chnl,
-					0, 0, status, pcl_type, reason,
-					pcl_freqs, pcl_len);
-			next_sub_type++;
-		}
-		policy_mgr_decr_connection_count_utfw(
-				hdd_ctx->psoc, false, vdevid);
-	}
-}
-
-void wlan_hdd_three_connections_scenario(struct hdd_context *hdd_ctx,
-		qdf_freq_t first_chnl, qdf_freq_t second_chnl,
-		enum policy_mgr_chain_mode chain_mask, uint8_t use_same_mac)
-{
-	uint8_t vdevid_1 = 0, tx_stream_1 = 2, rx_stream_1 = 2;
-	uint8_t vdevid_2 = 1, tx_stream_2 = 2, rx_stream_2 = 2;
-	uint8_t mac_id_1, mac_id_2;
-	uint8_t weight_list[NUM_CHANNELS] = {0};
-	uint32_t pcl_len = 0;
-	uint32_t pcl_freqs[NUM_CHANNELS];
-	enum policy_mgr_chain_mode chain_mask_1;
-	enum policy_mgr_chain_mode chain_mask_2;
-	enum policy_mgr_con_mode sub_type_1, sub_type_2, next_sub_type;
-	enum policy_mgr_pcl_type pcl_type;
-	enum policy_mgr_two_connection_mode third_index;
-	char reason[20] = {0};
-	bool status = false;
-	QDF_STATUS ret;
-	uint8_t system_pref = 0;
-
-	ucfg_policy_mgr_get_sys_pref(hdd_ctx->psoc, &system_pref);
-
-	/* let's set the chain_mask, mac_ids*/
-	if (chain_mask == POLICY_MGR_TWO_TWO) {
-		if (use_same_mac) {
-			mac_id_1 = 1;
-			mac_id_2 = 1;
-		} else {
-			mac_id_1 = 1;
-			mac_id_2 = 2;
-		}
-		chain_mask_1 = POLICY_MGR_TWO_TWO;
-		chain_mask_2 = POLICY_MGR_TWO_TWO;
-	} else if (use_same_mac == 1) {
-		mac_id_1 = 1;
-		mac_id_2 = 1;
-		chain_mask_1 = POLICY_MGR_ONE_ONE;
-		chain_mask_2 = POLICY_MGR_ONE_ONE;
-	} else {
-		mac_id_1 = 1;
-		mac_id_2 = 2;
-		chain_mask_1 = POLICY_MGR_ONE_ONE;
-		chain_mask_2 = POLICY_MGR_ONE_ONE;
-	}
-
-	for (sub_type_1 = PM_STA_MODE;
-		sub_type_1 < PM_MAX_NUM_OF_MODE; sub_type_1++) {
-
-		/* flush the entire table first */
-		policy_mgr_psoc_disable(hdd_ctx->psoc);
-		ret = policy_mgr_psoc_enable(hdd_ctx->psoc);
-		if (!QDF_IS_STATUS_SUCCESS(ret)) {
-			hdd_err("Policy manager initialization failed");
-			return;
-		}
-
-		/* 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, sub_type_1,
-			first_chnl, 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");
-			return;
-		}
-		for (sub_type_2 = PM_STA_MODE;
-			sub_type_2 < PM_MAX_NUM_OF_MODE; sub_type_2++) {
-
-			policy_mgr_incr_connection_count_utfw(
-				hdd_ctx->psoc, vdevid_2, tx_stream_2,
-				rx_stream_2, chain_mask_2, sub_type_2,
-				second_chnl, mac_id_2);
-			/* validate two connections are created or no */
-			if (policy_mgr_get_connection_count(hdd_ctx->psoc)
-				!= 2) {
-				hdd_err("Test fail - No. connection not 2");
-				return;
-			}
-			next_sub_type = PM_STA_MODE;
-			while (next_sub_type < PM_MAX_NUM_OF_MODE) {
-				third_index =
-				policy_mgr_get_third_connection_pcl_table_index(
-						hdd_ctx->psoc);
-				if (PM_MAX_TWO_CONNECTION_MODE ==
-						third_index) {
-					/* not valid combination */
-					next_sub_type++;
-					continue;
-				}
-				pcl_len = 0;
-				pcl_type =
-				policy_mgr_get_pcl_from_third_conn_table(
-					third_index, next_sub_type,
-					system_pref,
-					policy_mgr_is_hw_dbs_capable(
-					hdd_ctx->psoc));
-				policy_mgr_get_pcl(
-					hdd_ctx->psoc, next_sub_type,
-					pcl_freqs, &pcl_len, weight_list,
-					QDF_ARRAY_SIZE(weight_list));
-				status = wlan_hdd_validate_pcl(hdd_ctx,
-					pcl_type, pcl_freqs, pcl_len,
-					first_chnl, second_chnl,
-					reason, sizeof(reason));
-				if ((pcl_type == PM_MAX_PCL_TYPE) &&
-					(pcl_freqs[0] == 0)) {
-					next_sub_type++;
-					continue;
-				}
-				fill_report(hdd_ctx, "3 connections",
-					sub_type_1, sub_type_2,
-					next_sub_type, first_chnl,
-					second_chnl, 0, status,
-					pcl_type, reason, pcl_freqs,
-					pcl_len);
-				next_sub_type++;
-			}
-			/* remove entry to make a room for next iteration */
-			policy_mgr_decr_connection_count_utfw(
-				hdd_ctx->psoc, false, vdevid_2);
-		}
-		policy_mgr_decr_connection_count_utfw(
-				hdd_ctx->psoc, false, vdevid_1);
-
-		next_sub_type = PM_STA_MODE;
-	}
-}

+ 0 - 2
core/hdd/src/wlan_hdd_sysfs.c

@@ -857,7 +857,6 @@ void hdd_create_sysfs_files(struct hdd_context *hdd_ctx)
 		hdd_sysfs_pktlog_create(driver_kobject);
 		hdd_sysfs_pm_cinfo_create(driver_kobject);
 		hdd_sysfs_pm_pcl_create(driver_kobject);
-		hdd_sysfs_pm_dbs_create(driver_kobject);
 		hdd_sysfs_dp_aggregation_create(driver_kobject);
 		hdd_sysfs_dp_swlm_create(driver_kobject);
 		hdd_sysfs_create_wakeup_logs_to_console();
@@ -876,7 +875,6 @@ void hdd_destroy_sysfs_files(void)
 		hdd_sysfs_destroy_wakeup_logs_to_console();
 		hdd_sysfs_dp_swlm_destroy(driver_kobject);
 		hdd_sysfs_dp_aggregation_destroy(driver_kobject);
-		hdd_sysfs_pm_dbs_destroy(driver_kobject);
 		hdd_sysfs_pm_pcl_destroy(driver_kobject);
 		hdd_sysfs_pm_cinfo_destroy(driver_kobject);
 		hdd_sysfs_pktlog_destroy(driver_kobject);

+ 1 - 130
core/hdd/src/wlan_hdd_sysfs_policy_mgr.c

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2011-2021, The Linux Foundation. All rights reserved.
- * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-2022 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 above
@@ -164,105 +164,6 @@ hdd_sysfs_pm_pcl_store(struct kobject *kobj,
 	return errno_size;
 }
 
-static ssize_t
-__hdd_sysfs_pm_dbs_store(struct hdd_context *hdd_ctx,
-			 struct kobj_attribute *attr,
-			 const char *buf,
-			 size_t count)
-{
-	char buf_local[MAX_SYSFS_USER_COMMAND_SIZE_LENGTH + 1];
-	char *sptr, *token;
-	QDF_STATUS status;
-	int ret, value;
-
-	if (!wlan_hdd_validate_modules_state(hdd_ctx))
-		return -EINVAL;
-
-	ret = hdd_sysfs_validate_and_copy_buf(buf_local, sizeof(buf_local),
-					      buf, count);
-	if (ret) {
-		hdd_err_rl("invalid input");
-		return ret;
-	}
-
-	if (!hdd_ctx->config->is_unit_test_framework_enabled) {
-		hdd_warn_rl("UT framework is disabled");
-		return -EINVAL;
-	}
-
-	sptr = buf_local;
-	hdd_debug("pm_pcl: count %zu buf_local:(%s)",
-		  count, buf_local);
-
-	token = strsep(&sptr, " ");
-	if (!token)
-		return -EINVAL;
-	if (kstrtou32(token, 0, &value))
-		return -EINVAL;
-
-	switch (value) {
-	case 0:
-	case 1:
-		policy_mgr_set_dbs_cap_ut(hdd_ctx->psoc, value);
-		wma_enable_dbs_service_ut();
-		break;
-	default:
-		hdd_err_rl("invalid value %d", value);
-		return -EINVAL;
-	}
-
-	token = strsep(&sptr, " ");
-	if (!token)
-		return -EINVAL;
-	if (kstrtou32(token, 0, &value))
-		return -EINVAL;
-
-	switch (value) {
-	case PM_THROUGHPUT:
-	case PM_POWERSAVE:
-	case PM_LATENCY:
-		status = ucfg_policy_mgr_set_sys_pref(hdd_ctx->psoc, value);
-		if (status != QDF_STATUS_SUCCESS) {
-			hdd_err("ucfg_policy_mgr_set_sys_pref failed");
-			return -EINVAL;
-		}
-		break;
-	default:
-		hdd_err_rl("invalid value %d", value);
-		return -EINVAL;
-	}
-
-	return count;
-}
-
-static ssize_t
-hdd_sysfs_pm_dbs_store(struct kobject *kobj,
-		       struct kobj_attribute *attr,
-		       const char *buf,
-		       size_t count)
-{
-	struct osif_psoc_sync *psoc_sync;
-	struct hdd_context *hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
-	ssize_t errno_size;
-	int ret;
-
-	ret = wlan_hdd_validate_context(hdd_ctx);
-	if (ret != 0)
-		return ret;
-
-	errno_size = osif_psoc_sync_op_start(wiphy_dev(hdd_ctx->wiphy),
-					     &psoc_sync);
-	if (errno_size)
-		return errno_size;
-
-	errno_size = __hdd_sysfs_pm_dbs_store(hdd_ctx, attr,
-					      buf, count);
-
-	osif_psoc_sync_op_stop(psoc_sync);
-
-	return errno_size;
-}
-
 static struct kobj_attribute pm_pcl_attribute =
 	__ATTR(pm_pcl, 0220, NULL,
 	       hdd_sysfs_pm_pcl_store);
@@ -271,10 +172,6 @@ static struct kobj_attribute pm_cinfo_attribute =
 	__ATTR(pm_cinfo, 0440,
 	       hdd_sysfs_pm_cminfo_show, NULL);
 
-static struct kobj_attribute pm_dbs_attribute =
-	__ATTR(pm_dbs, 0220, NULL,
-	       hdd_sysfs_pm_dbs_store);
-
 int hdd_sysfs_pm_pcl_create(struct kobject *driver_kobject)
 {
 	int error;
@@ -313,29 +210,3 @@ void hdd_sysfs_pm_cinfo_destroy(struct kobject *driver_kobject)
 	sysfs_remove_file(driver_kobject, &pm_cinfo_attribute.attr);
 }
 
-int hdd_sysfs_pm_dbs_create(struct kobject *driver_kobject)
-{
-	int error;
-
-	if (!driver_kobject) {
-		hdd_err("could not get driver kobject!");
-		return -EINVAL;
-	}
-
-	error = sysfs_create_file(driver_kobject,
-				  &pm_dbs_attribute.attr);
-	if (error)
-		hdd_err("could not create pm_dbs sysfs file");
-
-	return error;
-}
-
-void
-hdd_sysfs_pm_dbs_destroy(struct kobject *driver_kobject)
-{
-	if (!driver_kobject) {
-		hdd_err("could not get driver kobject!");
-		return;
-	}
-	sysfs_remove_file(driver_kobject, &pm_dbs_attribute.attr);
-}

+ 1 - 638
core/hdd/src/wlan_hdd_wext.c

@@ -75,7 +75,6 @@
 #include "wlan_hdd_scan.h"
 #include "sme_power_save_api.h"
 #include "wlan_policy_mgr_api.h"
-#include "wlan_hdd_conc_ut.h"
 #include "wlan_hdd_fips.h"
 #include "wlan_hdd_tsf.h"
 #include "wlan_hdd_ocb.h"
@@ -2180,112 +2179,10 @@
 #define WE_LED_FLASHING_PARAM    10
 #endif
 
-/*
- * <ioctl>
- * pm_clist - Increments the index value of the concurrent connection list
- * and update with the input parameters provided.
- *
- * @INPUT: Following 8 arguments:
- * @vdev_id: vdev id
- * @tx_streams: TX streams
- * @rx_streams: RX streams
- * @chain_mask: Chain mask
- * @type: vdev_type
- *    AP:1    STA:2    IBSS:3    Monitor:4    NAN:5    OCB:6    NDI:7
- * @sub_type: vdev_subtype
- *    P2P_Device:1    P2P_Client:2     P2P_GO:3
- *    Proxy_STA:4     Mesh:5           Mesh_11s:6
- * @channel: Channel
- * @mac: Mac id
- *
- * @OUTPUT: None
- *
- * This IOCTL is used to increments the index value of the concurrent connection
- * list and update with the input parameters provided.
- *
- * @E.g: iwpriv wlan0 pm_clist vdev_id tx_streams rx_streams chain_mask type
- *                    sub_type channel mac
- * iwpriv wlan0 pm_clist 1 2 2 1 2 3 10 1
- *
- * Supported Feature: DBS
- *
- * Usage: Internal/External
- *
- * </ioctl>
- */
-#define WE_POLICY_MANAGER_CLIST_CMD    11
-
-/*
- * <ioctl>
- * pm_dlist - Delete the index from the concurrent connection list that is
- * present in the given vdev_id.
- *
- * @INPUT: delete_all, vdev_id
- * @delete_all: delete all indices
- * @vdev_id: vdev id
- *
- * @OUTPUT: None
- *
- * This IOCTL is used to delete the index from the concurrent connection list
- * that is present in the given vdev_id.
- *
- * @E.g: iwpriv wlan0 pm_dlist delete_all vdev_id
- * iwpriv wlan0 pm_dlist 0 1
- *
- * Supported Feature: DBS
- *
- * Usage: Internal/External
- *
- * </ioctl>
- */
-#define WE_POLICY_MANAGER_DLIST_CMD    12
-
-/*
- * <ioctl>
- * pm_dbs - Set dbs capability and system preference
- *
- * @INPUT: dbs, system_pref
- * @dbs: Value of DBS capability to be set
- * @system_pref: System preference
- *     0:PM_THROUGHPUT 1: PM_POWERSAVE 2: PM_LATENCY
- *
- * @OUTPUT: None
- *
- * This IOCTL is used to set dbs capability and system preference.
- *
- * @E.g: iwpriv wlan0 pm_dbs dbs system_pref
- * iwpriv wlan0 pm_dbs 1 0
- *
- * Supported Feature: DBS
- *
- * Usage: Internal/External
- *
- * </ioctl>
- */
-#define WE_POLICY_MANAGER_DBS_CMD      13
 
 /*
- * <ioctl>
- * pm_pcl - Set pcl for concurrency mode.
- *
- * @INPUT: policy_mgr_con_mode
- * @policy_mgr_con_mode: concurrency mode for PCL table
- *     0:STA  1:SAP  2:P2P_Client  3:P2P_GO  4:IBSS
- *
- * @OUTPUT: None
- *
- * This IOCTL is used to set pcl for concurrency mode.
- *
- * @E.g: iwpriv wlan0 pm_pcl policy_mgr_con_mode
- * iwpriv wlan0 pm_pcl 0
- *
- * Supported Feature: DBS
- *
- * Usage: Internal/External
- *
- * </ioctl>
+ * Sequence Numbers 11-14, 16, 17-20 are not in use.
  */
-#define WE_POLICY_MANAGER_PCL_CMD      14
 
 /*
  * <ioctl>
@@ -2307,139 +2204,6 @@
  */
 #define WE_POLICY_MANAGER_CINFO_CMD    15
 
-/*
- * <ioctl>
- * pm_ulist - Updates the index value of the concurrent connection list
- * with the input parameters provided.
- *
- * @INPUT: Following 8 arguments:
- * @vdev_id: vdev id
- * @tx_streams: TX streams
- * @rx_streams: RX streams
- * @chain_mask: Chain mask
- * @type: vdev_type
- *    AP:1    STA:2    IBSS:3    Monitor:4    NAN:5    OCB:6    NDI:7
- * @sub_type: vdev_subtype
- *    P2P_Device:1    P2P_Client:2     P2P_GO:3
- *    Proxy_STA:4     Mesh:5           Mesh_11s:6
- * @channel: Channel
- * @mac: Mac id
- *
- * @OUTPUT: None
- *
- * This IOCTL is used to updates the index value of the concurrent
- * connection list with the input parameters provided.
- *
- * @E.g: iwpriv wlan0 pm_ulist vdev_id tx_streams rx_streams chain_mask type
- *                    sub_type channel mac
- * iwpriv wlan0 pm_ulist 1 2 2 1 2 3 10 1
- *
- * Supported Feature: DBS
- *
- * Usage: Internal/External
- *
- * </ioctl>
- */
-#define WE_POLICY_MANAGER_ULIST_CMD    16
-
-/*
- * <ioctl>
- * pm_query_action - Initiate actions needed on current connections as
- * per the channel provided.
- *
- * @INPUT: channel
- * @channel: Channel on which new connection will be.
- *
- * @OUTPUT: None
- *
- * This IOCTL is used to initiate actions needed on current connections
- * as per the channel provided.
- *
- * @E.g: iwpriv wlan0 pm_query_action channel
- * iwpriv wlan0 pm_query_action 6
- *
- * Supported Feature: DBS
- *
- * Usage: Internal/External
- *
- * </ioctl>
- */
-#define WE_POLICY_MANAGER_QUERY_ACTION_CMD    17
-
-/*
- * <ioctl>
- * pm_query_allow - Checks for allowed concurrency combination
- *
- * @INPUT: mode, channel, bandwidth
- * @mode:	new connection mode
- *     0:STA  1:SAP  2:P2P_Client  3:P2P_GO  4:IBSS
- * @channel: channel on which new connection is coming up
- * @bandwidth: Bandwidth requested by the connection
- *     0:None    1:5MHz    2:10MHz      3:20MHz
- *     4:40MHz   5:80MHz   6:80+80MHz   7:160MHz
- *
- * @OUTPUT: None
- *
- * This IOCTL is used to checks for allowed concurrency combination.
- *
- * @E.g: iwpriv wlan0 pm_query_allow mode channel bandwidth
- * iwpriv wlan0 pm_query_allow 0 6 4
- *
- * Supported Feature: DBS
- *
- * Usage: Internal/External
- *
- * </ioctl>
- */
-#define WE_POLICY_MANAGER_QUERY_ALLOW_CMD    18
-
-/*
- * <ioctl>
- * pm_run_scenario - Create scenario with number of connections provided.
- *
- * @INPUT: num_of_conn
- * @num_of_conn: the number of connections (values: 1~3)
- *
- * @OUTPUT: None
- *
- * This IOCTL is used to create scenario with the number of connections
- * provided.
- *
- * @E.g: iwpriv wlan0 pm_run_scenario num_of_conn
- * iwpriv wlan0 pm_run_scenario 1
- *
- * Supported Feature: DBS
- *
- * Usage: Internal/External
- *
- * </ioctl>
- */
-#define WE_POLICY_MANAGER_SCENARIO_CMD 19
-
-/*
- * <ioctl>
- * pm_set_hw_mode - Set hardware for single/dual mac.
- *
- * @INPUT: hw_mode
- *     0:single mac     1:dual mac
- *     2: 2x2 5g + 1x1 2g dbs mode
- *     3: 2x2 2g + 1x1 5g dbs mode
- *
- * @OUTPUT: None
- *
- * This IOCTL is used to set hardware for single/dual mac.
- *
- * @E.g: iwpriv wlan0 pm_set_hw_mode hw_mode
- * iwpriv wlan0 pm_set_hw_mode 1
- *
- * Supported Feature: DBS
- *
- * Usage: Internal/External
- *
- * </ioctl>
- */
-#define WE_POLICY_SET_HW_MODE_CMD 20
-
 /*
  * <ioctl>
  * ch_avoid - unit test SAP channel avoidance
@@ -6662,343 +6426,6 @@ static int iw_setnone_getnone(struct net_device *dev,
 	return errno;
 }
 
-#ifdef MPC_UT_FRAMEWORK
-static void
-hdd_policy_mgr_set_hw_mode_ut(struct hdd_context *hdd_ctx,
-			      struct hdd_adapter *adapter, int cmd)
-{
-	enum hw_mode_ss_config mac0_ss;
-	enum hw_mode_bandwidth mac0_bw;
-	enum hw_mode_ss_config mac1_ss;
-	enum hw_mode_bandwidth mac1_bw;
-	enum hw_mode_mac_band_cap mac0_band_cap;
-	enum hw_mode_dbs_capab dbs;
-	enum policy_mgr_conc_next_action action;
-
-	switch (cmd) {
-	case 0:
-		hdd_debug("set hw mode for single mac");
-		mac0_ss = HW_MODE_SS_2x2;
-		mac0_bw = HW_MODE_80_MHZ;
-		mac1_ss = HW_MODE_SS_0x0;
-		mac1_bw = HW_MODE_BW_NONE;
-		mac0_band_cap = HW_MODE_MAC_BAND_NONE;
-		dbs = HW_MODE_DBS_NONE;
-		action = PM_SINGLE_MAC;
-		break;
-	case 1:
-		hdd_debug("set hw mode for dual mac");
-		mac0_ss = HW_MODE_SS_1x1;
-		mac0_bw = HW_MODE_80_MHZ;
-		mac1_ss = HW_MODE_SS_1x1;
-		mac1_bw = HW_MODE_40_MHZ;
-		mac0_band_cap = HW_MODE_MAC_BAND_NONE;
-		dbs = HW_MODE_DBS;
-		action = PM_DBS;
-		break;
-	case 2:
-		hdd_debug("set hw mode for 2x2 5g + 1x1 2g");
-		mac0_ss = HW_MODE_SS_2x2;
-		mac0_bw = HW_MODE_80_MHZ;
-		mac1_ss = HW_MODE_SS_1x1;
-		mac1_bw = HW_MODE_40_MHZ;
-		mac0_band_cap = HW_MODE_MAC_BAND_5G;
-		dbs = HW_MODE_DBS;
-		action = PM_DBS1;
-		break;
-	case 3:
-		hdd_debug("set hw mode for 2x2 2g + 1x1 5g");
-		mac0_ss = HW_MODE_SS_2x2;
-		mac0_bw = HW_MODE_40_MHZ;
-		mac1_ss = HW_MODE_SS_1x1;
-		mac1_bw = HW_MODE_40_MHZ;
-		mac0_band_cap = HW_MODE_MAC_BAND_2G;
-		dbs = HW_MODE_DBS;
-		action = PM_DBS2;
-		break;
-	default:
-		hdd_err("unknown cmd %d", cmd);
-		return;
-	}
-	policy_mgr_pdev_set_hw_mode(hdd_ctx->psoc, adapter->vdev_id,
-				    mac0_ss, mac0_bw, mac1_ss, mac1_bw,
-				    mac0_band_cap, dbs, HW_MODE_AGILE_DFS_NONE,
-				    HW_MODE_SBS_NONE,
-				    POLICY_MGR_UPDATE_REASON_UT, PM_NOP,
-				    action, POLICY_MGR_DEF_REQ_ID);
-}
-
-static int iw_get_policy_manager_ut_ops(struct hdd_context *hdd_ctx,
-			struct hdd_adapter *adapter, int sub_cmd, int *apps_args)
-{
-	switch (sub_cmd) {
-	case WE_POLICY_MANAGER_CLIST_CMD:
-	{
-		hdd_debug("<iwpriv wlan0 pm_clist> is called");
-		if ((apps_args[0] < 0) || (apps_args[1] < 0) ||
-		    (apps_args[2] < 0) || (apps_args[3] < 0) ||
-		    (apps_args[4] < 0) || (apps_args[5] < 0) ||
-		    (apps_args[6] < 0)) {
-			hdd_err("Invalid input params received for the IOCTL");
-			return 0;
-		}
-		policy_mgr_incr_connection_count_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]);
-	}
-	break;
-
-	case WE_POLICY_MANAGER_DLIST_CMD:
-	{
-		hdd_debug("<iwpriv wlan0 pm_dlist> is called");
-		if ((apps_args[0] < 0) || (apps_args[1] < 0)) {
-			hdd_err("Invalid input params received for the IOCTL");
-			return 0;
-		}
-		policy_mgr_decr_connection_count_utfw(hdd_ctx->psoc,
-			apps_args[0], apps_args[1]);
-	}
-	break;
-
-	case WE_POLICY_MANAGER_ULIST_CMD:
-	{
-		hdd_debug("<iwpriv wlan0 pm_ulist> is called");
-		if ((apps_args[0] < 0) || (apps_args[1] < 0) ||
-		    (apps_args[2] < 0) || (apps_args[3] < 0) ||
-		    (apps_args[4] < 0) || (apps_args[5] < 0) ||
-		    (apps_args[6] < 0) || (apps_args[7] < 0)) {
-			hdd_err("Invalid input params received for the IOCTL");
-			return 0;
-		}
-		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],
-			wlan_reg_legacy_chan_to_freq(hdd_ctx->pdev,
-						     apps_args[6]),
-						     apps_args[7]);
-	}
-	break;
-
-	case WE_POLICY_MANAGER_DBS_CMD:
-	{
-		hdd_debug("<iwpriv wlan0 pm_dbs> is called");
-		if (apps_args[0] == 0)
-			policy_mgr_set_dbs_cap_ut(hdd_ctx->psoc, 0);
-		else
-			policy_mgr_set_dbs_cap_ut(hdd_ctx->psoc, 1);
-
-		wma_enable_dbs_service_ut();
-		if (apps_args[1] >= PM_THROUGHPUT &&
-			apps_args[1] <= PM_LATENCY) {
-			hdd_debug("setting system pref to [%d]\n",
-				  apps_args[1]);
-			ucfg_policy_mgr_set_sys_pref(hdd_ctx->psoc,
-						     apps_args[1]);
-		}
-	}
-	break;
-
-	case WE_POLICY_MANAGER_PCL_CMD:
-	{
-		uint32_t pcl[NUM_CHANNELS] = {0};
-		uint8_t weight_list[NUM_CHANNELS] = {0};
-		uint32_t pcl_len = 0, i = 0;
-
-		hdd_debug("<iwpriv wlan0 pm_pcl> is called");
-
-		if (apps_args[0] < 0) {
-			hdd_err("Invalid input param received for the IOCTL");
-			return 0;
-		}
-		policy_mgr_get_pcl(hdd_ctx->psoc, apps_args[0],
-				   pcl, &pcl_len,
-				   weight_list, QDF_ARRAY_SIZE(weight_list));
-		hdd_debug("PCL Freq list for role[%d] is {", apps_args[0]);
-		for (i = 0 ; i < pcl_len; i++)
-			hdd_debug(" %d, ", pcl[i]);
-		hdd_debug("}--------->\n");
-	}
-	break;
-
-	case WE_POLICY_SET_HW_MODE_CMD:
-	{
-		hdd_debug("pm_set_hw_mode cmd %d", apps_args[0]);
-		hdd_policy_mgr_set_hw_mode_ut(hdd_ctx, adapter, apps_args[0]);
-	}
-	break;
-
-	case WE_POLICY_MANAGER_QUERY_ACTION_CMD:
-	{
-		hdd_debug("<iwpriv wlan0 pm_query_action> is called");
-		if (apps_args[0] < 0) {
-			hdd_err("Invalid input params received for the IOCTL");
-			return 0;
-		}
-		policy_mgr_current_connections_update(
-			hdd_ctx->psoc, adapter->vdev_id,
-			wlan_reg_legacy_chan_to_freq(hdd_ctx->pdev,
-						     apps_args[0]),
-			POLICY_MGR_UPDATE_REASON_UT, POLICY_MGR_DEF_REQ_ID);
-	}
-	break;
-
-	case WE_POLICY_MANAGER_QUERY_ALLOW_CMD:
-	{
-		bool allow;
-
-		hdd_debug("<iwpriv wlan0 pm_query_allow> is called");
-		if ((apps_args[0] < 0) || (apps_args[1] < 0) ||
-		    (apps_args[2] < 0)) {
-			hdd_err("Invalid input params received for the IOCTL");
-			return 0;
-		}
-		allow = policy_mgr_allow_concurrency(
-				hdd_ctx->psoc, apps_args[0],
-				wlan_reg_legacy_chan_to_freq(hdd_ctx->pdev,
-							     apps_args[1]),
-				apps_args[2],
-				policy_mgr_get_conc_ext_flags(adapter->vdev,
-							      false));
-		hdd_debug("allow %d {0 = don't allow, 1 = allow}", allow);
-	}
-	break;
-
-	case WE_POLICY_MANAGER_SCENARIO_CMD:
-	{
-#define FREQ_2G_A 2437
-#define FREQ_2G_B 2462
-#define FREQ_5G_LOW 5180
-#define FREQ_5G_HIGH 5745
-#define FREQ_6G_A 5975
-#define FREQ_6G_B 6135
-		clean_report(hdd_ctx);
-		if (apps_args[0] == 1) {
-			wlan_hdd_one_connection_scenario(hdd_ctx);
-		} else if (apps_args[0] == 2) {
-			wlan_hdd_two_connections_scenario(
-				hdd_ctx, FREQ_2G_A, POLICY_MGR_TWO_TWO);
-			wlan_hdd_two_connections_scenario(
-				hdd_ctx, FREQ_2G_A, POLICY_MGR_ONE_ONE);
-			wlan_hdd_two_connections_scenario(
-				hdd_ctx, FREQ_5G_LOW, POLICY_MGR_ONE_ONE);
-			wlan_hdd_two_connections_scenario(
-				hdd_ctx, FREQ_5G_LOW, POLICY_MGR_TWO_TWO);
-			wlan_hdd_two_connections_scenario(
-				hdd_ctx, FREQ_5G_HIGH, POLICY_MGR_ONE_ONE);
-			wlan_hdd_two_connections_scenario(
-				hdd_ctx, FREQ_5G_HIGH, POLICY_MGR_TWO_TWO);
-			wlan_hdd_two_connections_scenario(
-				hdd_ctx, FREQ_6G_A, POLICY_MGR_ONE_ONE);
-			wlan_hdd_two_connections_scenario(
-				hdd_ctx, FREQ_6G_A, POLICY_MGR_TWO_TWO);
-		} else if (apps_args[0] == 3) {
-			/* PM_STA_SAP_SCC_24_1x1 */
-			wlan_hdd_three_connections_scenario(
-				hdd_ctx, FREQ_2G_A, FREQ_2G_A,
-				POLICY_MGR_ONE_ONE, 1);
-			/* PM_STA_SAP_SCC_24_2x2 */
-			wlan_hdd_three_connections_scenario(
-				hdd_ctx, FREQ_2G_A, FREQ_2G_A,
-				POLICY_MGR_TWO_TWO, 1);
-			/* PM_STA_SAP_MCC_24_1x1 */
-			wlan_hdd_three_connections_scenario(
-				hdd_ctx, FREQ_2G_A, FREQ_2G_B,
-				POLICY_MGR_ONE_ONE, 1);
-			/* PM_STA_SAP_MCC_24_2x2 */
-			wlan_hdd_three_connections_scenario(
-				hdd_ctx, FREQ_2G_A, FREQ_2G_B,
-				POLICY_MGR_TWO_TWO, 1);
-			/* PM_STA_SAP_SCC_5_1x1 */
-			wlan_hdd_three_connections_scenario(
-				hdd_ctx, FREQ_5G_LOW, FREQ_5G_LOW,
-				POLICY_MGR_ONE_ONE, 1);
-			wlan_hdd_three_connections_scenario(
-				hdd_ctx, FREQ_5G_HIGH, FREQ_5G_HIGH,
-				POLICY_MGR_ONE_ONE, 1);
-			wlan_hdd_three_connections_scenario(
-				hdd_ctx, FREQ_6G_A, FREQ_6G_A,
-				POLICY_MGR_ONE_ONE, 1);
-			/* PM_STA_SAP_SCC_5_2x2 */
-			wlan_hdd_three_connections_scenario(
-				hdd_ctx, FREQ_5G_LOW, FREQ_5G_LOW,
-				POLICY_MGR_TWO_TWO, 1);
-			wlan_hdd_three_connections_scenario(
-				hdd_ctx, FREQ_5G_HIGH, FREQ_5G_HIGH,
-				POLICY_MGR_TWO_TWO, 1);
-			wlan_hdd_three_connections_scenario(
-				hdd_ctx, FREQ_6G_A, FREQ_6G_A,
-				POLICY_MGR_TWO_TWO, 1);
-			/* PM_STA_SAP_MCC_5_1x1 */
-			wlan_hdd_three_connections_scenario(
-				hdd_ctx, FREQ_5G_LOW, FREQ_5G_HIGH,
-				POLICY_MGR_ONE_ONE, 1);
-			wlan_hdd_three_connections_scenario(
-				hdd_ctx, FREQ_5G_LOW, FREQ_6G_A,
-				POLICY_MGR_ONE_ONE, 1);
-			wlan_hdd_three_connections_scenario(
-				hdd_ctx, FREQ_6G_A, FREQ_6G_B,
-				POLICY_MGR_ONE_ONE, 1);
-			/* PM_STA_SAP_MCC_5_2x2 */
-			wlan_hdd_three_connections_scenario(
-				hdd_ctx, FREQ_5G_LOW, FREQ_5G_HIGH,
-				POLICY_MGR_TWO_TWO, 1);
-			wlan_hdd_three_connections_scenario(
-				hdd_ctx, FREQ_5G_LOW, FREQ_6G_A,
-				POLICY_MGR_TWO_TWO, 1);
-			wlan_hdd_three_connections_scenario(
-				hdd_ctx, FREQ_6G_A, FREQ_6G_B,
-				POLICY_MGR_TWO_TWO, 1);
-			/* PM_STA_SAP_MCC_24_5_1x1 */
-			wlan_hdd_three_connections_scenario(
-				hdd_ctx, FREQ_2G_A, FREQ_5G_HIGH,
-				POLICY_MGR_ONE_ONE, 1);
-			wlan_hdd_three_connections_scenario(
-				hdd_ctx, FREQ_2G_A, FREQ_6G_A,
-				POLICY_MGR_ONE_ONE, 1);
-			/* PM_STA_SAP_MCC_24_5_2x2 */
-			wlan_hdd_three_connections_scenario(
-				hdd_ctx, FREQ_2G_A, FREQ_5G_HIGH,
-				POLICY_MGR_TWO_TWO, 1);
-			wlan_hdd_three_connections_scenario(
-				hdd_ctx, FREQ_2G_A, FREQ_6G_A,
-				POLICY_MGR_TWO_TWO, 1);
-			/* PM_STA_SAP_DBS_1x1 */
-			wlan_hdd_three_connections_scenario(
-				hdd_ctx, FREQ_2G_A, FREQ_5G_HIGH,
-				POLICY_MGR_ONE_ONE, 0);
-			wlan_hdd_three_connections_scenario(
-				hdd_ctx, FREQ_2G_A, FREQ_6G_A,
-				POLICY_MGR_ONE_ONE, 0);
-			/* PM_STA_SAP_DBS_2x2 */
-			wlan_hdd_three_connections_scenario(
-				hdd_ctx, FREQ_2G_A, FREQ_5G_HIGH,
-				POLICY_MGR_TWO_TWO, 0);
-			wlan_hdd_three_connections_scenario(
-				hdd_ctx, FREQ_2G_A, FREQ_6G_A,
-				POLICY_MGR_TWO_TWO, 0);
-			/* PM_STA_SAP_SBS_5_1x1 or PM_STA_SAP_SBS_5_2x2 */
-			wlan_hdd_three_connections_scenario(
-				hdd_ctx, FREQ_5G_LOW, FREQ_5G_HIGH,
-				POLICY_MGR_ONE_ONE, 0);
-			wlan_hdd_three_connections_scenario(
-				hdd_ctx, FREQ_5G_LOW, FREQ_6G_A,
-				POLICY_MGR_ONE_ONE, 0);
-		}
-		print_report(hdd_ctx);
-	}
-	break;
-	}
-	return 0;
-}
-#else
-static int iw_get_policy_manager_ut_ops(struct hdd_context *hdd_ctx,
-			struct hdd_adapter *adapter, int sub_cmd, int *apps_args)
-{
-	return 0;
-}
-#endif
-
 /**
  * hdd_ch_avoid_unit_cmd - unit test ch avoidance
  * @hdd_ctx: hdd_context
@@ -7304,24 +6731,6 @@ static int __iw_set_var_ints_getnone(struct net_device *dev,
 		}
 	}
 	break;
-	case WE_POLICY_MANAGER_CLIST_CMD:
-	case WE_POLICY_MANAGER_DLIST_CMD:
-	case WE_POLICY_MANAGER_ULIST_CMD:
-	case WE_POLICY_MANAGER_DBS_CMD:
-	case WE_POLICY_MANAGER_PCL_CMD:
-	case WE_POLICY_SET_HW_MODE_CMD:
-	case WE_POLICY_MANAGER_QUERY_ACTION_CMD:
-	case WE_POLICY_MANAGER_QUERY_ALLOW_CMD:
-	case WE_POLICY_MANAGER_SCENARIO_CMD:
-	{
-		if (!hdd_ctx->config->is_unit_test_framework_enabled) {
-			hdd_warn_rl("UT framework is disabled");
-			return -EINVAL;
-		}
-		iw_get_policy_manager_ut_ops(hdd_ctx, adapter,
-				sub_cmd, apps_args);
-	}
-	break;
 	case WE_SET_CHAN_AVOID:
 	{
 		hdd_ch_avoid_unit_cmd(hdd_ctx, num_args, apps_args);
@@ -10028,52 +9437,6 @@ static const struct iw_priv_args we_private_args[] = {
 	 0,
 	 "pm_cinfo"},
 
-#ifdef MPC_UT_FRAMEWORK
-	{WE_POLICY_MANAGER_CLIST_CMD,
-	 IW_PRIV_TYPE_INT | MAX_VAR_ARGS,
-	 0,
-	 "pm_clist"},
-
-	{WE_POLICY_MANAGER_DLIST_CMD,
-	 IW_PRIV_TYPE_INT | MAX_VAR_ARGS,
-	 0,
-	 "pm_dlist"},
-
-	{WE_POLICY_MANAGER_DBS_CMD,
-	 IW_PRIV_TYPE_INT | MAX_VAR_ARGS,
-	 0,
-	 "pm_dbs"},
-
-	{WE_POLICY_MANAGER_PCL_CMD,
-	 IW_PRIV_TYPE_INT | MAX_VAR_ARGS,
-	 0,
-	 "pm_pcl"},
-
-	{WE_POLICY_MANAGER_ULIST_CMD,
-	 IW_PRIV_TYPE_INT | MAX_VAR_ARGS,
-	 0,
-	 "pm_ulist"},
-
-	{WE_POLICY_MANAGER_QUERY_ACTION_CMD,
-	 IW_PRIV_TYPE_INT | MAX_VAR_ARGS,
-	 0,
-	 "pm_query_action"},
-
-	{WE_POLICY_MANAGER_QUERY_ALLOW_CMD,
-	 IW_PRIV_TYPE_INT | MAX_VAR_ARGS,
-	 0,
-	 "pm_query_allow"},
-
-	{WE_POLICY_MANAGER_SCENARIO_CMD,
-	 IW_PRIV_TYPE_INT | MAX_VAR_ARGS,
-	 0,
-	 "pm_run_scenario"},
-
-	{WE_POLICY_SET_HW_MODE_CMD,
-	 IW_PRIV_TYPE_INT | MAX_VAR_ARGS,
-	 0,
-	 "pm_set_hw_mode"},
-#endif
 	{WE_UNIT_TEST_CMD,
 	 IW_PRIV_TYPE_INT | MAX_VAR_ARGS,
 	 0,

+ 0 - 14
core/wma/src/wma_main.c

@@ -9642,20 +9642,6 @@ QDF_STATUS wma_get_rx_chainmask(uint8_t pdev_id, uint32_t *chainmask_2g,
 	return QDF_STATUS_SUCCESS;
 }
 
-#ifdef MPC_UT_FRAMEWORK
-void wma_enable_dbs_service_ut(void)
-{
-	tp_wma_handle wma;
-
-	wma = cds_get_context(QDF_MODULE_ID_WMA);
-	if (!wma)
-		return;
-
-	WMI_SERVICE_ENABLE(wma->wmi_service_bitmap,
-			   WMI_SERVICE_DUAL_BAND_SIMULTANEOUS_SUPPORT);
-}
-#endif
-
 #ifdef FEATURE_ANI_LEVEL_REQUEST
 QDF_STATUS wma_send_ani_level_request(tp_wma_handle wma_handle,
 				      uint32_t *freqs, uint8_t num_freqs)