Received: by 2002:ab2:7041:0:b0:1f4:bcc8:f211 with SMTP id x1csp17893lql; Fri, 12 Apr 2024 02:07:04 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXslsL8z5xtZq75Ny6XK70u/MRenZMYX5wHgQelQdZZiPanT9WshBMGYdUHud+tm6kpaKZQ3nVx1V5iZOvkVkIsf2aTvqb8pjiAEjmFcw== X-Google-Smtp-Source: AGHT+IG1SIaE1AmOc43xNarw6mIqblBzulAfgNtm8sxnEG1/lSOClFcchvsB+xL220ospba0J/nF X-Received: by 2002:a05:6a20:19a6:b0:1a9:5eb1:7f35 with SMTP id bz38-20020a056a2019a600b001a95eb17f35mr2151940pzb.46.1712912824290; Fri, 12 Apr 2024 02:07:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712912824; cv=pass; d=google.com; s=arc-20160816; b=kZFMT6OgFQaoutg8u4/171v72untALZlk3n9txZkTgi/KCz7Aj2d6lTWo80KBDO/j4 B2uMuUzy52giRVapi+946lOC/q5+SRZEadcOXj/hBz81bO/GLzaeqmkhf6Aj0ZK3AbpR H4ReLn5mSNGO11I9exhdlJZTTOzZQrcXtWZpllVwMJHurzsAmM/04JOBMsBzdGTSoPAZ 8VVwLmkgcpi/4dc9zVDXauUSw5uxhHjWsR490lR/aneWkkbik5k1UmKiC0Nq3/WUE7Jg dJsUNihFZH0pz143bLisaJ6Cj6mqe5uXgpW3d0CvvlEcOCDdMwbVP0SR6sLmbJhdl4Mj 60YQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :message-id:date:subject:cc:to:from:dkim-signature; bh=Oa0IHlTEkqm/Zd9yc51OmvWVeaF8/iRSN+iJu9U4MUM=; fh=KpY+V29pgthkJAVvEcqDr5Ug8kVz3d74zGgDlsPdnag=; b=feKf1CmsIH9Mzys7b3ew40tVpiC+vK6M8kjd/fAWSGOAWkPztbDhu7kKPwGNO9AJ23 WeHyeHzzEc//N9RAdl8MSq5jdkuo0jIRLy0ZkYP6FoMStUetZGkcg6bKlVJjtdkPjaRO n56RITlRBIDlVlX3aC7pGZtOmNVUBQSzcmWOJnoDPKDTdu5Cxs3FG+OrEFqoMdAjsqeQ AlVAj0n7MzcqPN753D+hy4S7P+lvwoz9fVkR99toHJcNzZ7v4ecqh8XliVcmwSSkOsud n/sencLyU0FVs+xvyPT+MpJWxKBU3IqzVBxeXf+Zo8uuXj0121NvIQBmTrBiVqZqvYGY vrKg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=ZEuztPpa; arc=pass (i=1 spf=pass spfdomain=mediatek.com dkim=pass dkdomain=mediatek.com dmarc=pass fromdomain=mediatek.com); spf=pass (google.com: domain of linux-wireless+bounces-6233-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-6233-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id fv18-20020a17090b0e9200b002a2d9b88dc1si5080064pjb.163.2024.04.12.02.07.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Apr 2024 02:07:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-6233-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=ZEuztPpa; arc=pass (i=1 spf=pass spfdomain=mediatek.com dkim=pass dkdomain=mediatek.com dmarc=pass fromdomain=mediatek.com); spf=pass (google.com: domain of linux-wireless+bounces-6233-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-6233-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 3D00728754B for ; Fri, 12 Apr 2024 09:05:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5830E5A104; Fri, 12 Apr 2024 08:54:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="ZEuztPpa" X-Original-To: linux-wireless@vger.kernel.org Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2942153E2B for ; Fri, 12 Apr 2024 08:54:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.61.82.184 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712912053; cv=none; b=lnZWiu9+khp6QVPEorJxdPm469d9sC/FqWlAuchTOjXehQ8z6xMsh3IgndSQg9Jq1bO2HgyjOL77TGjfySuGXjX6zU8teo90rMEGcN0k330d3XP9FCM4PVsc/6cj/RjesYKzmPWmkUKpzSE/qo4Y2n2n25P+HRk2qq5sTQ5r2YU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712912053; c=relaxed/simple; bh=gV6QO15hzr3rqH5uNZxNncGpQ09deA7YpjI/SJB8uIA=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=qrDq/I6YCqvkTDwO5l26J/nKFKJRAKTKaJ46Lr+XCeyCYqlTIFV6bb7b+/y/LwKIm+IUerkL98TSI086KfPQC451mLw1yVjtrBNtm9l80IkO62spwr+/ppj05s8TY4KgrIH4SRXsTEZgC5nKyObuAAKVAOfC7rrG1t4LsCKMeh0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=mediatek.com; spf=pass smtp.mailfrom=mediatek.com; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b=ZEuztPpa; arc=none smtp.client-ip=210.61.82.184 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=mediatek.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mediatek.com X-UUID: 360c1e34f8aa11ee935d6952f98a51a9-20240412 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:Message-ID:Date:Subject:CC:To:From; bh=Oa0IHlTEkqm/Zd9yc51OmvWVeaF8/iRSN+iJu9U4MUM=; b=ZEuztPpaoChX/gDOkSEkGkx2mMU3eNh9Y9IAjJCfOrsfS4IcEOpvqHp+lvhb8pNgHeLg68cM2T2iq9H0wnjOtoszVpTSXRddHNP7bUr5aRAV/6uAfmUw/zGfCOcvwfUGUqj+BtjG9YJ5VMFFN9AG1DMOU/y9a3CcqIQaZJyp5so=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.37,REQID:934bc3d7-6557-430b-acb6-a9fc0226f8b1,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION: release,TS:0 X-CID-META: VersionHash:6f543d0,CLOUDID:10b2d5fa-ed05-4274-9204-014369d201e8,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:0,File:nil,RT:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0,LES:1, SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0 X-CID-BVR: 0 X-CID-BAS: 0,_,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR X-UUID: 360c1e34f8aa11ee935d6952f98a51a9-20240412 Received: from mtkmbs14n2.mediatek.inc [(172.21.101.76)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1992218361; Fri, 12 Apr 2024 16:54:02 +0800 Received: from mtkmbs11n1.mediatek.inc (172.21.101.185) by mtkmbs13n1.mediatek.inc (172.21.101.193) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Fri, 12 Apr 2024 16:54:01 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs11n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.26 via Frontend Transport; Fri, 12 Apr 2024 16:54:01 +0800 From: Mingyen Hsieh To: , CC: , , , , , , , , , , , , , , Leon Yen , Ming Yen Hsieh Subject: [PATCH] wifi: mt76: mt7921: avoid undesired changes of the preset regulatory domain Date: Fri, 12 Apr 2024 16:53:57 +0800 Message-ID: <20240412085357.13756-1-mingyen.hsieh@mediatek.com> X-Mailer: git-send-email 2.18.0 Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain From: Leon Yen Some countries have strict RF restrictions where changing the regulatory domain dynamically based on the connected AP is not acceptable. This patch disables Beacon country IE hinting when a valid country code is set from usersland (e.g., by system using iw or CRDA). Signed-off-by: Leon Yen Signed-off-by: Ming Yen Hsieh --- drivers/net/wireless/mediatek/mt76/mt7921/init.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/init.c b/drivers/net/wireless/mediatek/mt76/mt7921/init.c index ef0c721d26e3..3c9a5fcd6924 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7921/init.c +++ b/drivers/net/wireless/mediatek/mt76/mt7921/init.c @@ -135,6 +135,13 @@ mt7921_regd_notifier(struct wiphy *wiphy, dev->mt76.region = request->dfs_region; dev->country_ie_env = request->country_ie_env; + if (request->initiator == NL80211_REGDOM_SET_BY_USER) { + if (dev->mt76.alpha2[0] == '0' && dev->mt76.alpha2[1] == '0') + wiphy->regulatory_flags &= ~REGULATORY_COUNTRY_IE_IGNORE; + else + wiphy->regulatory_flags |= REGULATORY_COUNTRY_IE_IGNORE; + } + if (pm->suspended) return; -- 2.18.0