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

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

Merge d1bd8e66 on remote branch

Change-Id: I2c0d004cc51d0ce7b262875f00c34c6a98c01cb3
parents c1561f66 d1bd8e66
Loading
Loading
Loading
Loading
+4 −8
Original line number Diff line number Diff line
@@ -750,14 +750,10 @@ QDF_STATUS if_mgr_validate_candidate(struct wlan_objmgr_vdev *vdev,
	 * Do not allow STA to connect on 6Ghz or indoor channel for non dbs
	 * hardware if SAP and skip_6g_and_indoor_freq_scan ini are present
	 */
	if (wlan_scan_cfg_skip_6g_and_indoor_freq(psoc) &&
	    !policy_mgr_is_hw_dbs_capable(psoc) &&
	    (WLAN_REG_IS_6GHZ_CHAN_FREQ(chan_freq) ||
	    wlan_reg_is_freq_indoor(pdev, chan_freq)) &&
	    op_mode == QDF_STA_MODE &&
	    policy_mgr_mode_specific_connection_count(
				psoc, PM_SAP_MODE, NULL)) {
		ifmgr_debug("STA connection not allowed on bssid: "QDF_MAC_ADDR_FMT" with freq: %d (6Ghz or indoor(%d)), as SAP is present",
	if (op_mode == QDF_STA_MODE &&
	    !policy_mgr_is_sta_chan_valid_for_connect_and_roam(pdev,
							       chan_freq)) {
		ifmgr_debug("STA connection not allowed on bssid: "QDF_MAC_ADDR_FMT" with freq: %d (6Ghz or indoor(%d)), as not valid for connection",
			    QDF_MAC_ADDR_REF(candidate_info->peer_addr.bytes),
			    chan_freq,
			    wlan_reg_is_freq_indoor(pdev, chan_freq));
+13 −0
Original line number Diff line number Diff line
/*
 * Copyright (c) 2012-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
@@ -3729,4 +3730,16 @@ bool policy_mgr_is_sta_mon_concurrency(struct wlan_objmgr_psoc *psoc);
 *
 */
QDF_STATUS policy_mgr_check_mon_concurrency(struct wlan_objmgr_psoc *psoc);

/**
 * policy_mgr_is_sta_chan_valid_for_connect_and_roam  - Check if given
 * channel is valid for STA connection/roam pcl channels
 * @pdev: pdev
 * @freq: frequency
 *
 * Return: true if channel is valid else false
 */
bool policy_mgr_is_sta_chan_valid_for_connect_and_roam(
				struct wlan_objmgr_pdev *pdev,
				qdf_freq_t freq);
#endif /* __WLAN_POLICY_MGR_API_H */
+1 −0
Original line number Diff line number Diff line
/*
 * Copyright (c) 2012-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
+1 −0
Original line number Diff line number Diff line
/*
 * Copyright (c) 2012-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
+32 −0
Original line number Diff line number Diff line
@@ -35,6 +35,7 @@
#include "wlan_utility.h"
#include "wlan_mlme_ucfg_api.h"
#include "csr_neighbor_roam.h"
#include "wlan_scan_api.h"

/**
 * first_connection_pcl_table - table which provides PCL for the
@@ -2755,3 +2756,34 @@ QDF_STATUS policy_mgr_filter_passive_ch(struct wlan_objmgr_pdev *pdev,

	return QDF_STATUS_SUCCESS;
}

bool policy_mgr_is_sta_chan_valid_for_connect_and_roam(
					struct wlan_objmgr_pdev *pdev,
					qdf_freq_t freq)
{
	struct wlan_objmgr_psoc *psoc;
	uint32_t sap_count;
	bool skip_6g_and_indoor_freq;

	psoc = wlan_pdev_get_psoc(pdev);
	if (!psoc)
		return true;

	skip_6g_and_indoor_freq =
		wlan_scan_cfg_skip_6g_and_indoor_freq(psoc);
	sap_count =
		policy_mgr_mode_specific_connection_count(psoc, PM_SAP_MODE,
							  NULL);
	/*
	 * Do not allow STA to connect/roam on 6Ghz or indoor channel for
	 * non-dbs hardware if SAP is present and skip_6g_and_indoor_freq_scan
	 * ini is enabled
	 */
	if (skip_6g_and_indoor_freq && sap_count &&
	    !policy_mgr_is_hw_dbs_capable(psoc) &&
	    (WLAN_REG_IS_6GHZ_CHAN_FREQ(freq) ||
	     wlan_reg_is_freq_indoor(pdev, freq)))
		return false;

	return true;
}
Loading