[rdkb][common][bsp][Refactor and sync wifi from openwrt]
[Description]
1dacd97b [MAC80211][WiFi6][Misc][Fix patch fail]
7c02334a [MAC80211][WiFi7][Misc][Fix build fail because of mt76 version upgradation]
7a073097 [MAC80211][WiFi7][misc][ensure the first MLD bss is bss[0]]
27e2304c [MAC80211][WiFi6][mt76][Refactor due to atenl change]
1e1eb98e [MAC80211][WiFi6/7][app][Add single wiphy support for atenl & iwpriv wrapper]
d4101c33 [MAC80211][WiFi7][mt76][enable lftp for wifi7 r1 cert]
55f5732f [MAC80211][WiFi7][hostapd][set ctrl_interface for all bss]
[Release-log]
Change-Id: I9cad01561c310576a9e5bdc9f1b8eec3025e51d9
diff --git a/recipes-wifi/linux-mt76/files/patches-3.x/0053-mtk-wifi-mt76-mt7996-add-background-radar-hw-cap-che.patch b/recipes-wifi/linux-mt76/files/patches-3.x/0053-mtk-wifi-mt76-mt7996-add-background-radar-hw-cap-che.patch
new file mode 100644
index 0000000..12d06e6
--- /dev/null
+++ b/recipes-wifi/linux-mt76/files/patches-3.x/0053-mtk-wifi-mt76-mt7996-add-background-radar-hw-cap-che.patch
@@ -0,0 +1,81 @@
+From 189d4baa960d2202e518c3e15c9959524cafc3d0 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 053/116] mtk: wifi: mt76: mt7996: add background radar hw cap
+ check
+
+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 f3a520b..6c5fbc7 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 cb00322..6430bfa 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 72865c8..c73701d 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.18.0
+