[Refactor and sync wifi from Openwrt]

[Description]
Refactor and sync wifi from Openwrt
1.mt76/mac80211/hostapd

[Release-log]
N/A

diff --git a/recipes-kernel/linux-mac80211/files/patches/subsys/904-mac80211-correct-legacy-rates-check-in-ieee80211_cal.patch b/recipes-kernel/linux-mac80211/files/patches/subsys/904-mac80211-correct-legacy-rates-check-in-ieee80211_cal.patch
new file mode 100644
index 0000000..f5fbc82
--- /dev/null
+++ b/recipes-kernel/linux-mac80211/files/patches/subsys/904-mac80211-correct-legacy-rates-check-in-ieee80211_cal.patch
@@ -0,0 +1,32 @@
+From 3f85b72dca38f56b112505b79e7f8fc4841b3f3d Mon Sep 17 00:00:00 2001
+From: MeiChia Chiu <MeiChia.Chiu@mediatek.com>
+Date: Mon, 7 Mar 2022 15:18:00 +0800
+Subject: [PATCH] mac80211: correct legacy rates check in
+ ieee80211_calc_rx_airtime
+
+There are no legacy rates on 60GHz or sub-1Ghz band, so modify the check.
+
+Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
+Signed-off-by: MeiChia Chiu <MeiChia.Chiu@mediatek.com>
+---
+ net/mac80211/airtime.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/net/mac80211/airtime.c b/net/mac80211/airtime.c
+index 26d2f8ba7029..c0e58eb7c7fb 100644
+--- a/net/mac80211/airtime.c
++++ b/net/mac80211/airtime.c
+@@ -477,7 +477,9 @@ u32 ieee80211_calc_rx_airtime(struct ieee80211_hw *hw,
+ 		bool sp = status->enc_flags & RX_ENC_FLAG_SHORTPRE;
+ 		bool cck;
+ 
+-		if (WARN_ON_ONCE(status->band > NL80211_BAND_5GHZ))
++		/* on 60GHz or sub-1Ghz band, there are no legacy rates */
++		if (WARN_ON_ONCE(status->band == NL80211_BAND_60GHZ ||
++				 status->band == NL80211_BAND_S1GHZ))
+ 			return 0;
+ 
+ 		sband = hw->wiphy->bands[status->band];
+-- 
+2.18.0
+
diff --git a/recipes-kernel/linux-mac80211/files/patches/subsys/subsys.inc b/recipes-kernel/linux-mac80211/files/patches/subsys/subsys.inc
index 855289d..01fd587 100644
--- a/recipes-kernel/linux-mac80211/files/patches/subsys/subsys.inc
+++ b/recipes-kernel/linux-mac80211/files/patches/subsys/subsys.inc
@@ -32,4 +32,5 @@
     file://901-mac80211-check-twt-responder-when-setu-twt.patch \
     file://902-nl80211-internal-extend-CAC-time-for-weather-radar-c.patch \
     file://903-mac80211-it-s-invalid-case-when-frag_threshold-is-gr.patch \
+    file://904-mac80211-correct-legacy-rates-check-in-ieee80211_cal.patch \
     "