Received: by 2002:ab2:7041:0:b0:1f4:bcc8:f211 with SMTP id x1csp91421lql; Fri, 12 Apr 2024 04:59:54 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV11nSHRxIeVfwp1WNUytV/kK0NUza4vqLjk/hHWW5XkvKxgXTIYINW+d2w0i6wjGwljXkPrc8zI5ZkZI055y7kLYBm8d8PrIFMbWCpZg== X-Google-Smtp-Source: AGHT+IGVlAZpl0sklJfieFHwDl79ONXDXI2vIKJpC0MQIikcWsU1tVIUyS99YCDILP6DOq46/jaI X-Received: by 2002:a17:90a:d306:b0:2a2:8065:899f with SMTP id p6-20020a17090ad30600b002a28065899fmr1975635pju.41.1712923193962; Fri, 12 Apr 2024 04:59:53 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712923193; cv=pass; d=google.com; s=arc-20160816; b=sYN2f4OsD40omMeiQELL8kYpkSNTiW4oRl0AgFNtHWYfpqtn5a81WnuDgvC9JElUkJ IJoez2Uxy6bf3iOAM1lr1J9WtdKtclt87w26CdNLN5yGLCKQRsXfW8ZZS3ecQnO4JgtW IW+92YXHG1AQKdnGMfYtXRFHQ0MC8VBUYiwWQOJXASIV74x0yLY3SSGqPjBTBchTqJA6 07c1+MNIVMg3pCAPHiYQGZ0uFb1yO1QDp+es4M0NR11PbFm8PyLXTT8ilh2VMB2pybvi mXduxOp/PNVHWM8JditwTa3PQISbEfcupEW4hmSmv1I+2719SmLwrJ2ZYFMys3XFra/k Ft9Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=5OfiEMbtoVbu+reAm+grgAO7un/y2cl/cMBBIyzRq74=; fh=HUg66QM+WrcYjhrjAZO9Io78soUV0XNx50nXI3Hf4XU=; b=bDVVSITnn29mRS6+z/xxgU1ckVrSiFOM2b9Y0a4yDOxv/BtQD9K5EIPQnNJEnw+/vK midn/5OWAUg9qGYdvy2T2YBRO7W5ZECSpMrxrLAfXG0ADx254FCzZrsSGg9M3j6Qi3bq JQepmcPVLC5Z3sWDjuQ3IHCwFPMM/NMtxDv80wLCxx3GbEwIm2u/kcTgaigq94CoCt7p qwwp1fTIDChSI2XcaWp5wnWgGusmDDoM3IxQb5jx/ichBzc/U6SO8OvFCYAhqWUC/5Xu qM8BSk438bCUI7XduJ31GDjqO693B53RG85wFu2p4wU2Jn+fmAFEnz1pcBRDxUGpVwZg Pv5A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=realtek.com); spf=pass (google.com: domain of linux-wireless+bounces-6247-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-wireless+bounces-6247-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id l1-20020a17090a49c100b002a63fd3c73csi3153775pjm.15.2024.04.12.04.59.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Apr 2024 04:59:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-6247-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=realtek.com); spf=pass (google.com: domain of linux-wireless+bounces-6247-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-wireless+bounces-6247-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 86070B229CA for ; Fri, 12 Apr 2024 11:59:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5E7AC3FE55; Fri, 12 Apr 2024 11:59:38 +0000 (UTC) X-Original-To: linux-wireless@vger.kernel.org Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4711B55792 for ; Fri, 12 Apr 2024 11:59:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=211.75.126.72 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712923178; cv=none; b=guVznPmfyq/JeFfERItE5JdSVMELxQsz9jf7m/eem9lZ2pBZFRq8xVCPeWrsnSSfYLuFEkF+sQkJDxTOLtIMjQ1iwn/3sKZKoiaRHVIjg8vjms20/NrbFwZuBjbeVv2tszNFEgRdi989Yi0b9JmcfvLVdAcTYQAHnKSx4qrCGqE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712923178; c=relaxed/simple; bh=qlajmsfa/oYqUJr45ILRjLYpxKoI0zmRB529GzeS7tk=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=c3Xnm0Lau736ptrGvMNAuRVuIZHwkNj/1TLfkOlQGqrfNgzMiz//SFqcC6bT9kyz2xJSCmcgu2hJOO1Y0RVu2ufvyEQhcaACydVEbdfl6qkBCXB2iNPjcxqhuWdM2jHcRH+nmeSnoSVgMIQDakepghbmLrMbENv9ao93yBfObJM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=realtek.com; spf=pass smtp.mailfrom=realtek.com; arc=none smtp.client-ip=211.75.126.72 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=realtek.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=realtek.com X-SpamFilter-By: ArmorX SpamTrap 5.78 with qID 43CBxYlrD2094295, This message is accepted by code: ctloc85258 Received: from mail.realtek.com (rtexh36506.realtek.com.tw[172.21.6.27]) by rtits2.realtek.com.tw (8.15.2/2.95/5.92) with ESMTPS id 43CBxYlrD2094295 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Fri, 12 Apr 2024 19:59:34 +0800 Received: from RTEXMBS04.realtek.com.tw (172.21.6.97) by RTEXH36506.realtek.com.tw (172.21.6.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Fri, 12 Apr 2024 19:59:34 +0800 Received: from [127.0.1.1] (172.16.17.25) by RTEXMBS04.realtek.com.tw (172.21.6.97) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Fri, 12 Apr 2024 19:59:33 +0800 From: Ping-Ke Shih To: CC: Subject: [PATCH 5/8] wifi: rtw89: regd: block 6 GHz by policy if not specific country Date: Fri, 12 Apr 2024 19:57:26 +0800 Message-ID: <20240412115729.8316-6-pkshih@realtek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240412115729.8316-1-pkshih@realtek.com> References: <20240412115729.8316-1-pkshih@realtek.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: RTEXMBS02.realtek.com.tw (172.21.6.95) To RTEXMBS04.realtek.com.tw (172.21.6.97) From: Zong-Zhe Yang We allow 6 GHz on target regd if and only if 1. it is a specific country, i.e. not any world-wide cases 2. its 6 GHz is not blocked So, for world-wide cases, their 6 GHz will be blocked now. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih --- drivers/net/wireless/realtek/rtw89/regd.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/realtek/rtw89/regd.c b/drivers/net/wireless/realtek/rtw89/regd.c index d0857ef60ea6..85a7f902ccf9 100644 --- a/drivers/net/wireless/realtek/rtw89/regd.c +++ b/drivers/net/wireless/realtek/rtw89/regd.c @@ -572,10 +572,8 @@ static void rtw89_regd_apply_policy_6ghz(struct rtw89_dev *rtwdev, int i; index = rtw89_regd_get_index(regd); - if (index == RTW89_REGD_MAX_COUNTRY_NUM) - return; - - if (!test_bit(index, regulatory->block_6ghz)) + if (index != RTW89_REGD_MAX_COUNTRY_NUM && + !test_bit(index, regulatory->block_6ghz)) return; rtw89_debug(rtwdev, RTW89_DBG_REGD, "%c%c 6 GHz is blocked by policy\n", -- 2.25.1