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

Commit 4b643656 authored by Jyoti Kumari's avatar Jyoti Kumari Committed by Pragaspathi Thilagaraj
Browse files

qcacld-3.0: Skip STA connect on 6 GHz or 5 GHz indoor chan if SAP is up

Currently STA can scan and come up on 6 GHz or 5 GHz indoor channel
if hardware is non-dbs and SAP is present

As part of this change, do not allow STA to connect on 6 GHz and
5 GHz indoor channel for non-dbs hardware if SAP is present

Change-Id: I48ed8483225e35d8b898b0325eee398f74e41c97
CRs-Fixed: 3196247
parent abfe5f57
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
/*
 * Copyright (c) 2020-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
@@ -32,6 +33,7 @@
#include "wlan_vdev_mgr_utils_api.h"
#include "wni_api.h"
#include "wlan_mlme_vdev_mgr_interface.h"
#include "wlan_scan_api.h"

static void if_mgr_enable_roaming_on_vdev(struct wlan_objmgr_pdev *pdev,
					  void *object, void *arg)
@@ -744,6 +746,24 @@ QDF_STATUS if_mgr_validate_candidate(struct wlan_objmgr_vdev *vdev,
	if (!psoc)
		return QDF_STATUS_E_FAILURE;

	/*
	 * 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",
			    QDF_MAC_ADDR_REF(candidate_info->peer_addr.bytes),
			    chan_freq,
			    wlan_reg_is_freq_indoor(pdev, chan_freq));
		return QDF_STATUS_E_INVAL;
	}

	/*
	 * Ignore the BSS if any other vdev is already connected to it.
	 */