[][MAC80211][regdb][Change to new version]

[Description]
Change regdb to 2022.04.08 for WiFi6E well support.

[Release-log]
N/A

Change-Id: I692e6bb8677be5faa23f412b082544e8893aa338
Reviewed-on: https://gerrit.mediatek.inc/c/openwrt/feeds/mtk_openwrt_feeds/+/6063741
diff --git a/autobuild_mac80211_release/0004-master-wireless-regdb-makefile-for-6E.patch b/autobuild_mac80211_release/0004-master-wireless-regdb-makefile-for-6E.patch
new file mode 100644
index 0000000..87f9cc9
--- /dev/null
+++ b/autobuild_mac80211_release/0004-master-wireless-regdb-makefile-for-6E.patch
@@ -0,0 +1,22 @@
+diff --git a/package/firmware/wireless-regdb/Makefile b/package/firmware/wireless-regdb/Makefile
+index 2346de8..9b3963d 100644
+--- a/package/firmware/wireless-regdb/Makefile
++++ b/package/firmware/wireless-regdb/Makefile
+@@ -1,12 +1,12 @@
+ include $(TOPDIR)/rules.mk
+ 
+ PKG_NAME:=wireless-regdb
+-PKG_VERSION:=2021.08.28
++PKG_VERSION:=2022.04.08
+ PKG_RELEASE:=1
+ 
+ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+ PKG_SOURCE_URL:=@KERNEL/software/network/wireless-regdb/
+-PKG_HASH:=cff370c410d1e6d316ae0a7fa8ac6278fdf1efca5d3d664aca7cfd2aafa54446
++PKG_HASH:=884ba2e3c1e8b98762b6dc25ff60b5ec75c8d33a39e019b3ed4aa615491460d3
+ 
+ PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
+ 
+-- 
+2.29.2
+
diff --git a/autobuild_mac80211_release/lede-build-sanity.sh b/autobuild_mac80211_release/lede-build-sanity.sh
index 89d7590..f60c126 100755
--- a/autobuild_mac80211_release/lede-build-sanity.sh
+++ b/autobuild_mac80211_release/lede-build-sanity.sh
@@ -109,6 +109,7 @@
 	patch -f -p1 -i ${MTK_FEED_DIR}/autobuild_mac80211_release/0001-master-mac80211-generate-hostapd-setting-from-ap-cap.patch
 	patch -f -p1 -i ${MTK_FEED_DIR}/autobuild_mac80211_release/0002-master-hostapd-makefile-for-utils.patch
 	patch -f -p1 -i ${MTK_FEED_DIR}/autobuild_mac80211_release/0003-master-mt76-makefile-for-new-chip.patch
+	patch -f -p1 -i ${MTK_FEED_DIR}/autobuild_mac80211_release/0004-master-wireless-regdb-makefile-for-6E.patch
 	cp -rfa ${MTK_FEED_DIR}/autobuild_mac80211_release/package/ ${BUILD_DIR}
 	cp -rfa ${MTK_FEED_DIR}/autobuild_mac80211_release/target/ ${BUILD_DIR}
 }
diff --git a/autobuild_mac80211_release/package/firmware/wireless-regdb/patches/001-Regulatory-update-for-6-GHz-operation-in-Canada-CA.patch b/autobuild_mac80211_release/package/firmware/wireless-regdb/patches/001-Regulatory-update-for-6-GHz-operation-in-Canada-CA.patch
new file mode 100644
index 0000000..9c2773c
--- /dev/null
+++ b/autobuild_mac80211_release/package/firmware/wireless-regdb/patches/001-Regulatory-update-for-6-GHz-operation-in-Canada-CA.patch
@@ -0,0 +1,78 @@
+From e3f03f9236c25c3270aa3807ce5dcc315395ee83 Mon Sep 17 00:00:00 2001
+From: Dennis Bland <dennis@dbperformance.com>
+Date: Wed, 20 Apr 2022 20:40:51 -0600
+Subject: [PATCH 1/5] Regulatory update for 6 GHz operation in Canada (CA)
+
+With the 6 GHz band (U-NII-5, U-NII-6, U-NII-7, U-NII-8) in Canada, ISED
+introduces the concept of a fixed PSD (Power Spectral Density) for all
+supported 6 GHz channel widths.  Wider channel widths have a higher noise
+floor, therefore specifying a fixed PSD allows wider channels to
+operate at a higher EIRP to maintain the same S/N ratio as smaller
+channel widths.
+
+Clause 4.6.2 requires non-client (AP devices to have a maximum PSD of 5
+dBm/MHz and a maximum EIRP of 30 dBm.  Clause 4.6.3 requires client (STA)
+devices to have a maximum PSD of -1 dBm/MHz.  Clause 4.4 specifies a
+maximum channel width of 320 MHz.  Clause 4.9 specifies indoor use only.
+Operation on oil platforms, vehicles, boats, trains, and drones is
+prohibited except on commercial aircraft above 10,000 feet altitude.
+There is no IR (Initiate Radiation) restriction mentioned in the 6 GHz
+specification.
+
+The following equation is used to calculate the EIRP from the PSD and
+channel width:
+
+EIRP = PSD + 10*log(channel width in MHz)
+
+Using the maximum PSD values of 5 and -1 for APs and STAs respectively,
+the EIRP in dBm for a given channel width can be calculated:
+
+Channel Width (MHz)     AP            STA
+------------------------------------------------
+20                      18            12
+40                      21            15
+80                      24            18
+160                     27            21
+320                     31 (max 30)   25 (max 24)
+
+For channel widths up to 160 MHz, the maximum PSD is the limiting factor.
+For the 320 MHz channel width, the maximum EIRP is the limiting factor.
+
+Unfortunately, because there is currently no mechanism to specify
+different power levels for AP and STA modes, and for different channel
+widths, the smallest value has to be selected, which is 12 dBm.  This
+will likely cause connectivity problems with larger channel widths until
+these additional parameters can be added.
+
+Signed-off-by: Dennis Bland <dennis@dbperformance.com>
+Signed-off-by: Seth Forshee <sforshee@kernel.org>
+---
+ db.txt | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/db.txt b/db.txt
+index 41f94f8..062ad8a 100644
+--- a/db.txt
++++ b/db.txt
+@@ -298,8 +298,9 @@ country BZ: DFS-JP
+ 	(2402 - 2482 @ 40), (30)
+ 	(5735 - 5835 @ 80), (30)
+ 
+-# Source:
++# Sources:
+ # https://www.ic.gc.ca/eic/site/smt-gst.nsf/vwapj/rss-247-i2-e.pdf/$file/rss-247-i2-e.pdf
++# https://www.ic.gc.ca/eic/site/smt-gst.nsf/eng/sf11750.html (6 GHz operation)
+ country CA: DFS-FCC
+ 	(2402 - 2472 @ 40), (30)
+ 	(5150 - 5250 @ 80), (23), NO-OUTDOOR, AUTO-BW
+@@ -307,6 +308,7 @@ country CA: DFS-FCC
+ 	(5470 - 5600 @ 80), (24), DFS
+ 	(5650 - 5730 @ 80), (24), DFS
+ 	(5735 - 5835 @ 80), (30)
++	(5925 - 7125 @ 320), (12), NO-OUTDOOR
+ 
+ # Source:
+ # http://www.art-rca.org
+-- 
+2.29.2
+
diff --git a/autobuild_mac80211_release/package/firmware/wireless-regdb/patches/002-Regulatory-update-for-6-GHz-operation-in-United-Stat.patch b/autobuild_mac80211_release/package/firmware/wireless-regdb/patches/002-Regulatory-update-for-6-GHz-operation-in-United-Stat.patch
new file mode 100644
index 0000000..e480a7e
--- /dev/null
+++ b/autobuild_mac80211_release/package/firmware/wireless-regdb/patches/002-Regulatory-update-for-6-GHz-operation-in-United-Stat.patch
@@ -0,0 +1,76 @@
+From 888da5f48030e45ce14f43a2bf7be07ec79b60d4 Mon Sep 17 00:00:00 2001
+From: Dennis Bland <dennis@dbperformance.com>
+Date: Wed, 20 Apr 2022 20:56:38 -0600
+Subject: [PATCH 2/5] Regulatory update for 6 GHz operation in United States
+ (US)
+
+With the 6 GHz band (U-NII-5, U-NII-6, U-NII-7, U-NII-8) in USA, the FCC
+introduces the concept of a fixed PSD (Power Spectral Density) for all
+supported 6 GHz channel widths for LPI (Low Power Indoor) environments.
+Wider channel widths have a higher noise floor, therefore specifying a
+fixed PSD allows wider channels to operate at a higher EIRP to maintain
+the same S/N ratio as smaller channel widths.
+
+While the 6 GHz specification also allows a "Standard" power mode with
+higher EIRP and PSD limits, these devices are also required to employ
+AFC (Automatic Frequency Coordination) which normally requires GNSS.
+Currently there is no way to specify different EIRP and PSD levels for
+APC and non-APC devices.  Therefore, only LPI mode is considered here.
+
+LPI requires non-client (AP) devices to have a maximum PSD of 5 dBm/MHz
+and a maximum EIRP of 30 dBm.  LPI requires client (STA) devices to have
+a maximum PSD of -1 dBm/MHz.  The maximum channel width is 320 MHz.
+
+The following equation is used to calculate the EIRP from the PSD and
+channel width:
+
+EIRP = PSD + 10*log(channel width in MHz)
+
+Using the maximum PSD values of 5 and -1 for APs and STAs respectively,
+the EIRP in dBm for a given channel width can be calculated:
+
+Channel Width (MHz)     AP            STA
+------------------------------------------------
+20                      18            12
+40                      21            15
+80                      24            18
+160                     27            21
+320                     31 (max 30)   25 (max 24)
+
+For channel widths up to 160 MHz, the maximum PSD is the limiting factor.
+For the 320 MHz channel width, the maximum EIRP is the limiting factor.
+
+Unfortunately, because there is currently no mechanism to specify
+different power levels for AP and STA modes, and for different channel
+widths, the smallest value has to be selected, which is 12 dBm.  This
+will likely cause connectivity problems with larger channel widths until
+these additional parameters can be added.
+
+6 GHz operation on oil platforms, vehicles, boats, trains, and drones is
+prohibited except on commercial aircraft above 10,000 feet altitude.
+An IR (Initiate Radiation) restriction is mentioned in the 6 GHz
+specification.
+
+Signed-off-by: Dennis Bland <dennis@dbperformance.com>
+Signed-off-by: Seth Forshee <sforshee@kernel.org>
+---
+ db.txt | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/db.txt b/db.txt
+index 062ad8a..fcdc74a 100644
+--- a/db.txt
++++ b/db.txt
+@@ -1649,6 +1649,9 @@ country US: DFS-FCC
+ 	# https://www.federalregister.gov/documents/2021/05/03/2021-08802/use-of-the-5850-5925-ghz-band
+ 	# max. 33 dBm AP @ 20MHz, 36 dBm AP @ 40Mhz+, 6 dB less for clients
+ 	(5850 - 5895 @ 40), (27), NO-OUTDOOR, AUTO-BW, NO-IR
++	# 6g band
++	# https://www.federalregister.gov/documents/2020/05/26/2020-11236/unlicensed-use-of-the-6ghz-band
++	(5925 - 7125 @ 320), (12), NO-OUTDOOR, NO-IR
+ 	# 60g band
+ 	# reference: section IV-D https://docs.fcc.gov/public/attachments/FCC-16-89A1.pdf
+ 	# channels 1-6 EIRP=40dBm(43dBm peak)
+-- 
+2.29.2
+
diff --git a/autobuild_mac80211_release/package/firmware/wireless-regdb/patches/003-Regulatory-update-for-6-GHz-operation-in-FI.patch b/autobuild_mac80211_release/package/firmware/wireless-regdb/patches/003-Regulatory-update-for-6-GHz-operation-in-FI.patch
new file mode 100644
index 0000000..6f8fd96
--- /dev/null
+++ b/autobuild_mac80211_release/package/firmware/wireless-regdb/patches/003-Regulatory-update-for-6-GHz-operation-in-FI.patch
@@ -0,0 +1,49 @@
+From 647bcaa958866e8f66a0a027daa4d8b3af6ff6dd Mon Sep 17 00:00:00 2001
+From: Dennis Bland <dennis@dbperformance.com>
+Date: Tue, 26 Apr 2022 21:52:31 -0600
+Subject: [PATCH 3/5] Regulatory update for 6 GHz operation in FI
+
+Add 6 GHz operation for FI:
+
+https://eur-lex.europa.eu/legal-content/EN/TXT/PDF/?uri=CELEX:32021D1067&from=EN
+
+Signed-off-by: Dennis Bland <dennis@dbperformance.com>
+Signed-off-by: Seth Forshee <sforshee@kernel.org>
+---
+ db.txt | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/db.txt b/db.txt
+index fcdc74a..cf35883 100644
+--- a/db.txt
++++ b/db.txt
+@@ -572,6 +572,7 @@ country ET: DFS-ETSI
+ # and 2006/771/EC (amended by 2008/432/EC, Short-Range Devices, EN 300 440)
+ #  EU decision 2005/513/EC: https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:02005D0513-20070213
+ #  EU decision 2006/771/EC: https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:02008D0432-20080611
++#  EU decision 2021/1067/EC: https://eur-lex.europa.eu/legal-content/EN/TXT/PDF/?uri=CELEX:32021D1067&from=EN
+ # Harmonized CEPT countries (July 2019): https://www.ecodocdb.dk/download/25c41779-cd6e/Rec7003e.pdf
+ country FI: DFS-ETSI
+ 	(2400 - 2483.5 @ 40), (100 mW)
+@@ -580,7 +581,9 @@ country FI: DFS-ETSI
+ 	(5470 - 5725 @ 160), (500 mW), DFS, wmmrule=ETSI
+ 	# short range devices (ETSI EN 300 440-1)
+ 	(5725 - 5875 @ 80), (25 mW)
+-	# 60 GHz band channels 1-4 (ETSI EN 302 567)
++	# 6 GHz band
++	(5945 - 6425 @ 160), (23), NO-OUTDOOR, AUTO-BW, wmmrule=ETSI
++        # 60 GHz band channels 1-4 (ETSI EN 302 567)
+ 	(57000 - 66000 @ 2160), (40)
+ 
+ country FM: DFS-FCC
+@@ -623,6 +626,7 @@ country GB: DFS-ETSI
+ 	(5470 - 5730 @ 160), (500 mW), DFS, wmmrule=ETSI
+ 	# short range devices (ETSI EN 300 440-1)
+ 	(5725 - 5850 @ 80), (200 mW), NO-OUTDOOR
++	(5925 - 6425 @ 160), (250 mW), NO-OUTDOOR, wmmrule=ETSI
+ 	# 60 GHz band channels 1-6
+ 	(57000 - 71000 @ 2160), (40)
+ 
+-- 
+2.29.2
+
diff --git a/autobuild_mac80211_release/package/firmware/wireless-regdb/patches/004-wireless-regdb-update-regulatory-rules-for-Bulgaria-.patch b/autobuild_mac80211_release/package/firmware/wireless-regdb/patches/004-wireless-regdb-update-regulatory-rules-for-Bulgaria-.patch
new file mode 100644
index 0000000..bcaed3c
--- /dev/null
+++ b/autobuild_mac80211_release/package/firmware/wireless-regdb/patches/004-wireless-regdb-update-regulatory-rules-for-Bulgaria-.patch
@@ -0,0 +1,40 @@
+From c6b079d6ff61dec725e64c3319cbb572d63486ca Mon Sep 17 00:00:00 2001
+From: Stijn Tintel <stijn@linux-ipv6.be>
+Date: Wed, 25 May 2022 16:36:09 +0300
+Subject: [PATCH 4/5] wireless-regdb: update regulatory rules for Bulgaria (BG)
+ on 6GHz
+
+Reviewed-by: Petko Bordjukov <bordjukov@gmail.com>
+Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
+Signed-off-by: Seth Forshee <sforshee@kernel.org>
+---
+ db.txt | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/db.txt b/db.txt
+index cf35883..10367af 100644
+--- a/db.txt
++++ b/db.txt
+@@ -219,6 +219,10 @@ country BF: DFS-FCC
+ # Harmonized CEPT countries (July 2019): https://www.ecodocdb.dk/download/25c41779-cd6e/Rec7003e.pdf
+ # BG: https://crc.bg/files/_en/Electronic_Communications_Revised_EN1.pdf
+ # BG: acceptance of 2006/771/EC https://crc.bg/files/Pravila_06_12_2018.pdf
++#
++# Amendment of the rules for free use of radio frequency spectrum
++# (Изменение и допълнение на Правилата за свободно използване на радиочестотния спектър)
++# https://dv.parliament.bg/DVWeb/showMaterialDV.jsp?idMat=168250
+ country BG: DFS-ETSI
+ 	# Wideband data transmission systems (WDTS) in the 2.4GHz ISM band, ref:
+ 	# I.22 of the List, BDS EN 300 328
+@@ -232,6 +236,8 @@ country BG: DFS-ETSI
+ 	# short range devices (ETSI EN 300 440-1)
+ 	# I.43 of the List, BDS EN 300 440-2, BDS EN 300 440-1
+ 	(5725 - 5875 @ 80), (25 mW)
++	# WiFi 6E
++	(5945 - 6425 @ 160), (23), NO-OUTDOOR, wmmrule=ETSI
+ 	# 60 GHz band channels 1-4 (ETSI EN 302 567)
+ 	# II.H03 of the List, BDS EN 302 567-2
+ 	(57000 - 66000 @ 2160), (40)
+-- 
+2.29.2
+
diff --git a/autobuild_mac80211_release/package/firmware/wireless-regdb/patches/005-Update-for-6-GHz-operation-in-Default-World.patch b/autobuild_mac80211_release/package/firmware/wireless-regdb/patches/005-Update-for-6-GHz-operation-in-Default-World.patch
new file mode 100644
index 0000000..fcddcf6
--- /dev/null
+++ b/autobuild_mac80211_release/package/firmware/wireless-regdb/patches/005-Update-for-6-GHz-operation-in-Default-World.patch
@@ -0,0 +1,26 @@
+From 8d7b8f7426a613b0513f61eb4b9575dcc4b0bf1d Mon Sep 17 00:00:00 2001
+From: Evelyn Tsai <evelyn.tsai@mediatek.com>
+Date: Wed, 1 Jun 2022 23:44:26 +0800
+Subject: [PATCH 5/5] Update for 6 GHz operation in Default (World)
+
+Signed-off-by: Evelyn Tsai <evelyn.tsai@mediatek.com>
+---
+ db.txt | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/db.txt b/db.txt
+index 10367af..a485af2 100644
+--- a/db.txt
++++ b/db.txt
+@@ -28,6 +28,8 @@ country 00:
+ 	(5735 - 5835 @ 80), (20), NO-IR
+ 	# IEEE 802.11ad (60GHz), channels 1..3
+ 	(57240 - 63720 @ 2160), (0)
++	# WiFi 6E
++	(5925 - 7125 @ 320), (12), NO-OUTDOOR
+ 
+ # AD as part of CEPT accepted decisions 2005/513/EC (5GHz RLAN, EN 301 893)
+ # and 2006/771/EC (amended by 2008/432/EC, Short-Range Devices, EN 300 440)
+-- 
+2.29.2
+