[rdkb][common][bsp][Refactor and sync wifi from openwrt]
[Description]
ac60b1ff [MAC80211][misc][Add Filogic 880/860/830/820/630 Release Information]
7eb946a0 [MAC80211][WiFi7][hostapd][sync hostapd patches]
91638fc9 [MAC80211][WiFi7][mac80211][sync backports code]
8e45746b [MAC80211][WiFi7][mt76][sync mt76 patches]
1c564afa [MAC80211][WiFi7][mt76][Add Eagle BE19000 ifem default bin]
[Release-log]
Change-Id: I1d4218d3b1211700acb5937fe310cbd0bf219968
diff --git a/recipes-wifi/linux-mt76/files/patches-3.x/0054-mtk-wifi-mt76-mt7996-add-background-radar-hw-cap-che.patch b/recipes-wifi/linux-mt76/files/patches-3.x/0054-mtk-wifi-mt76-mt7996-add-background-radar-hw-cap-che.patch
new file mode 100644
index 0000000..4668cc9
--- /dev/null
+++ b/recipes-wifi/linux-mt76/files/patches-3.x/0054-mtk-wifi-mt76-mt7996-add-background-radar-hw-cap-che.patch
@@ -0,0 +1,82 @@
+From c7587ccb5403436628fa4568c4f1aadeb322cb81 Mon Sep 17 00:00:00 2001
+From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
+Date: Fri, 22 Dec 2023 17:27:10 +0800
+Subject: [PATCH 054/116] mtk: wifi: mt76: mt7996: add background radar hw cap
+ check
+
+CR-Id: WCNCR00274293
+Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
+---
+ mt7996/debugfs.c | 5 +++++
+ mt7996/init.c | 7 ++++---
+ mt7996/mt7996.h | 20 ++++++++++++++++++++
+ 3 files changed, 29 insertions(+), 3 deletions(-)
+
+diff --git a/mt7996/debugfs.c b/mt7996/debugfs.c
+index f3a520bef..6c5fbc78c 100644
+--- a/mt7996/debugfs.c
++++ b/mt7996/debugfs.c
+@@ -262,6 +262,11 @@ mt7996_rdd_monitor(struct seq_file *s, void *data)
+
+ mutex_lock(&dev->mt76.mutex);
+
++ if (!mt7996_get_background_radar_cap(dev)) {
++ seq_puts(s, "no background radar capability\n");
++ goto out;
++ }
++
+ if (!cfg80211_chandef_valid(chandef)) {
+ ret = -EINVAL;
+ goto out;
+diff --git a/mt7996/init.c b/mt7996/init.c
+index cb0032290..6430bfa46 100644
+--- a/mt7996/init.c
++++ b/mt7996/init.c
+@@ -404,9 +404,10 @@ mt7996_init_wiphy(struct ieee80211_hw *hw, struct mtk_wed_device *wed)
+
+ wiphy_ext_feature_set(wiphy, NL80211_EXT_FEATURE_OPERATING_CHANNEL_VALIDATION);
+ wiphy_ext_feature_set(wiphy, NL80211_EXT_FEATURE_BEACON_PROTECTION);
+- if (!mdev->dev->of_node ||
+- !of_property_read_bool(mdev->dev->of_node,
+- "mediatek,disable-radar-background"))
++ if (mt7996_get_background_radar_cap(phy->dev) &&
++ (!mdev->dev->of_node ||
++ !of_property_read_bool(mdev->dev->of_node,
++ "mediatek,disable-radar-background")))
+ wiphy_ext_feature_set(wiphy,
+ NL80211_EXT_FEATURE_RADAR_BACKGROUND);
+
+diff --git a/mt7996/mt7996.h b/mt7996/mt7996.h
+index 72865c8ef..c73701df1 100644
+--- a/mt7996/mt7996.h
++++ b/mt7996/mt7996.h
+@@ -605,6 +605,26 @@ mt7996_band_valid(struct mt7996_dev *dev, u8 band)
+ return band == MT_BAND0 || band == MT_BAND2;
+ }
+
++static inline bool
++mt7996_get_background_radar_cap(struct mt7996_dev *dev)
++{
++ switch (mt76_chip(&dev->mt76)) {
++ case 0x7990:
++ if (dev->chip_sku == MT7996_SKU_233)
++ return 0;
++ break;
++ case 0x7992:
++ if (dev->chip_sku == MT7992_SKU_23 ||
++ dev->chip_sku == MT7992_SKU_24)
++ return 0;
++ break;
++ default:
++ break;
++ }
++
++ return 1;
++}
++
+ extern const struct ieee80211_ops mt7996_ops;
+ extern struct pci_driver mt7996_pci_driver;
+ extern struct pci_driver mt7996_hif_driver;
+--
+2.39.2
+