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

Commit 0b62d7f8 authored by Gururaj Pandurangi's avatar Gururaj Pandurangi Committed by Madan Koyyalamudi
Browse files

qcacmn: Allow scan/connection if RF test mode/Safe mode enabled

Currently if AP and STA have different ctry codes, STA should
operate in VLP mode. And if STA ctry code is US, then scan and
connection are not allowed as US VLP is not supported yet.
However, if RF test mode or Wi-Fi Safe Mode is enabled, allow
scan and connection on this AP and STA can operate in LPI mode.

Change-Id: I513657b8e274ef07eb9e9b5fc265722cb01525de
CRs-Fixed: 3079537
parent 5a4270c9
Loading
Loading
Loading
Loading
+12 −2
Original line number Diff line number Diff line
/*
 * Copyright (c) 2014-2020 The Linux Foundation. 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
@@ -36,6 +37,7 @@
#include <qdf_platform.h>
#include "reg_services_common.h"
#include "reg_build_chan_list.h"
#include "wlan_cm_bss_score_param.h"

#define DEFAULT_WORLD_REGDMN 0x60

@@ -323,7 +325,8 @@ QDF_STATUS reg_get_domain_from_country_code(v_REGDOMAIN_t *reg_domain_ptr,

#ifdef CONFIG_REG_CLIENT
QDF_STATUS
reg_get_6g_power_type_for_ctry(uint8_t *ap_ctry, uint8_t *sta_ctry,
reg_get_6g_power_type_for_ctry(struct wlan_objmgr_psoc *psoc,
			       uint8_t *ap_ctry, uint8_t *sta_ctry,
			       enum reg_6g_ap_type *pwr_type_6g,
			       bool *ctry_code_match)
{
@@ -334,7 +337,14 @@ reg_get_6g_power_type_for_ctry(uint8_t *ap_ctry, uint8_t *sta_ctry,
			  ap_ctry[1], sta_ctry[0], sta_ctry[1]);
		*ctry_code_match = false;

		if (wlan_reg_is_us(sta_ctry)) {
		/**
		 * Do not return if Wi-Fi safe mode or RF test mode is
		 * enabled, rather STA should operate in LPI mode.
		 * wlan_cm_get_check_6ghz_security API returns true if
		 * neither Safe mode nor RF test mode are enabled.
		 */
		if (wlan_reg_is_us(sta_ctry) &&
		    wlan_cm_get_check_6ghz_security(psoc)) {
			reg_err("US VLP not in place yet, connection not allowed");
			return QDF_STATUS_E_NOSUPPORT;
		}
+3 −1
Original line number Diff line number Diff line
/*
 * Copyright (c) 2017-2021 The Linux Foundation. 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
@@ -320,7 +321,8 @@ QDF_STATUS reg_get_domain_from_country_code(v_REGDOMAIN_t *reg_domain_ptr,
 * Return: QDF_STATUS
 */
QDF_STATUS
reg_get_6g_power_type_for_ctry(uint8_t *ap_ctry, uint8_t *sta_ctry,
reg_get_6g_power_type_for_ctry(struct wlan_objmgr_psoc *psoc,
			       uint8_t *ap_ctry, uint8_t *sta_ctry,
			       enum reg_6g_ap_type *pwr_type_6g,
			       bool *ctry_code_match);
#endif
+3 −1
Original line number Diff line number Diff line
/*
 * Copyright (c) 2017-2021 The Linux Foundation. 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
@@ -550,7 +551,8 @@ QDF_STATUS wlan_reg_read_current_country(struct wlan_objmgr_psoc *psoc,
 * Return: QDF_STATUS
 */
QDF_STATUS
wlan_reg_get_6g_power_type_for_ctry(uint8_t *ap_ctry, uint8_t *sta_ctry,
wlan_reg_get_6g_power_type_for_ctry(struct wlan_objmgr_psoc *psoc,
				    uint8_t *ap_ctry, uint8_t *sta_ctry,
				    enum reg_6g_ap_type *pwr_type_6g,
				    bool *ctry_code_match);
#endif
+5 −3
Original line number Diff line number Diff line
/*
 * Copyright (c) 2017-2021 The Linux Foundation. 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
@@ -86,12 +87,13 @@ QDF_STATUS wlan_reg_get_max_5g_bw_from_regdomain(uint16_t regdmn,

#ifdef CONFIG_REG_CLIENT
QDF_STATUS
wlan_reg_get_6g_power_type_for_ctry(uint8_t *ap_ctry, uint8_t *sta_ctry,
wlan_reg_get_6g_power_type_for_ctry(struct wlan_objmgr_psoc *psoc,
				    uint8_t *ap_ctry, uint8_t *sta_ctry,
				    enum reg_6g_ap_type *pwr_type_6g,
				    bool *ctry_code_match)
{
	return reg_get_6g_power_type_for_ctry(ap_ctry, sta_ctry, pwr_type_6g,
					      ctry_code_match);
	return reg_get_6g_power_type_for_ctry(psoc, ap_ctry, sta_ctry,
					      pwr_type_6g, ctry_code_match);
}
#endif

+11 −4
Original line number Diff line number Diff line
@@ -1106,8 +1106,15 @@ QDF_STATUS __scm_handle_bcn_probe(struct scan_bcn_probe_event *bcn)
		if (scan_obj->cb.update_beacon)
			scan_obj->cb.update_beacon(pdev, scan_entry);

		if (!scm_is_bss_allowed_for_country(psoc, scan_entry)) {
			scm_info("Drop frame from "QDF_MAC_ADDR_FMT
		/**
		 * Do not drop the frame if Wi-Fi safe mode or RF test mode is
		 * enabled. wlan_cm_get_check_6ghz_security API returns true if
		 * neither Safe mode nor RF test mode are enabled.
		 */
		if (!scm_is_bss_allowed_for_country(psoc, scan_entry) &&
		    wlan_cm_get_check_6ghz_security(psoc)) {
			scm_info_rl(
				"Drop frame from "QDF_MAC_ADDR_FMT
				": AP in VLP mode not supported for US",
				QDF_MAC_ADDR_REF(scan_entry->bssid.bytes));
			util_scan_free_cache_entry(scan_entry);