[rdkb][common][bsp][Refactor and sync wifi from openwrt]
[Description]
9403fa9 [[MAC80211][misc] increase beacon loss count from 7 to 20]
b11c297 [MAC80211][mt76][Change panther's prek info encoded mask to be compatible with eagle]
9e0f9b9 [MAC80211][app][Add atenl prek support in eagle]
e9aefca [[MAC80211][misc] add CONFIG option in wpa_supplicant config files]
822c722 [MAC80211][mt76][Disable SW-ACI by default]
b792365 [MAC80211][misc][Add autofill EHT BF config in netifd script]
a3776b8 [MAC80211][hostapd][Add vendor command for certification]
[Release-log]
Change-Id: I117d597ff9068fdd0fee4cdcca699c8d610e945e
diff --git a/recipes-wifi/linux-mt76/files/patches/1011-wifi-mt76-testmode-add-pre-cal-support.patch b/recipes-wifi/linux-mt76/files/patches/1011-wifi-mt76-testmode-add-pre-cal-support.patch
index 82a210f..54a0f22 100644
--- a/recipes-wifi/linux-mt76/files/patches/1011-wifi-mt76-testmode-add-pre-cal-support.patch
+++ b/recipes-wifi/linux-mt76/files/patches/1011-wifi-mt76-testmode-add-pre-cal-support.patch
@@ -559,10 +559,10 @@
+static int
+mt7915_tm_dump_precal(struct mt76_phy *mphy, struct sk_buff *msg, int flag, int type)
+{
-+#define DPD_PER_CHAN_SIZE_MASK GENMASK(31, 24)
-+#define DPD_CHAN_NUM_2G_MASK GENMASK(23, 16)
-+#define DPD_CHAN_NUM_5G_MASK GENMASK(15, 8)
-+#define DPD_CHAN_NUM_6G_MASK GENMASK(7, 0)
++#define DPD_PER_CHAN_SIZE_MASK GENMASK(31, 30)
++#define DPD_CHAN_NUM_2G_MASK GENMASK(29, 20)
++#define DPD_CHAN_NUM_5G_MASK GENMASK(19, 10)
++#define DPD_CHAN_NUM_6G_MASK GENMASK(9, 0)
+ struct mt7915_phy *phy = mphy->priv;
+ struct mt7915_dev *dev = phy->dev;
+ u32 i, group_size, dpd_size, total_size, dpd_per_chan_size, dpd_info = 0;
diff --git a/recipes-wifi/linux-mt76/files/patches/1135-mt76-mt7915-disable-SW-ACI-by-default.patch b/recipes-wifi/linux-mt76/files/patches/1135-mt76-mt7915-disable-SW-ACI-by-default.patch
new file mode 100644
index 0000000..6c465e9
--- /dev/null
+++ b/recipes-wifi/linux-mt76/files/patches/1135-mt76-mt7915-disable-SW-ACI-by-default.patch
@@ -0,0 +1,104 @@
+From 3ef36d16305af80f400ef6ee3d087cd75c195191 Mon Sep 17 00:00:00 2001
+From: Howard Hsu <howard-yh.hsu@mediatek.com>
+Date: Fri, 24 Feb 2023 16:29:42 +0800
+Subject: [PATCH] mt76: mt7915: disable SW-ACI by default
+
+Support to enable/disable SW-ACI by module parameter "sw_aci_enable".
+SW-ACI feature is disable by default.
+---
+ mt7915/main.c | 8 ++++++++
+ mt7915/mcu.c | 15 +++++++++++++++
+ mt7915/mt7915.h | 1 +
+ mt7915/mtk_debugfs.c | 14 +++++---------
+ 4 files changed, 29 insertions(+), 9 deletions(-)
+
+diff --git a/mt7915/main.c b/mt7915/main.c
+index 99ae9e86..81fd6742 100644
+--- a/mt7915/main.c
++++ b/mt7915/main.c
+@@ -8,6 +8,10 @@
+ #include "mt7915.h"
+ #include "mcu.h"
+
++static bool sw_aci_enable = false;
++module_param(sw_aci_enable, bool, 0644);
++MODULE_PARM_DESC(sw_aci_enable, "Enable the feature of Adjacent Channel Interference Detection");
++
+ static bool mt7915_dev_running(struct mt7915_dev *dev)
+ {
+ struct mt7915_phy *phy;
+@@ -41,6 +45,10 @@ int mt7915_run(struct ieee80211_hw *hw)
+ goto out;
+
+ mt7915_mac_enable_nf(dev, dev->phy.mt76->band_idx);
++
++ ret = mt7915_mcu_sw_aci_set(dev, sw_aci_enable);
++ if (ret)
++ goto out;
+ }
+
+ if (phy != &dev->phy) {
+diff --git a/mt7915/mcu.c b/mt7915/mcu.c
+index 5790fc60..deefb558 100644
+--- a/mt7915/mcu.c
++++ b/mt7915/mcu.c
+@@ -4780,3 +4780,18 @@ int mt7915_mcu_get_edcca(struct mt7915_phy *phy, u8 mode, s8 *value)
+
+ return 0;
+ }
++
++int mt7915_mcu_sw_aci_set(struct mt7915_dev *dev, bool val)
++{
++#define SWLNA_ENABLE 6
++ struct {
++ u32 subcmd;
++ u8 enable;
++ } req = {
++ .subcmd = SWLNA_ENABLE,
++ .enable = val ? 1 : 0,
++ };
++
++ return mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD(SWLNA_ACI_CTRL), &req,
++ sizeof(req), NULL);
++}
+diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h
+index 36593a2e..1885b906 100644
+--- a/mt7915/mt7915.h
++++ b/mt7915/mt7915.h
+@@ -774,6 +774,7 @@ int mt7915_vendor_amnt_sta_remove(struct mt7915_phy *phy,
+ #endif
+ int mt7915_mcu_set_edcca(struct mt7915_phy *phy, int mode, u8 *value, s8 compensation);
+ int mt7915_mcu_get_edcca(struct mt7915_phy *phy, u8 mode, s8 *value);
++int mt7915_mcu_sw_aci_set(struct mt7915_dev *dev, bool val);
+ int mt7915_mcu_ipi_hist_ctrl(struct mt7915_phy *phy, void *data, u8 cmd, bool wait_resp);
+ int mt7915_mcu_ipi_hist_scan(struct mt7915_phy *phy, void *data, u8 mode, bool wait_resp);
+
+diff --git a/mt7915/mtk_debugfs.c b/mt7915/mtk_debugfs.c
+index 6f74caff..2e24a371 100644
+--- a/mt7915/mtk_debugfs.c
++++ b/mt7915/mtk_debugfs.c
+@@ -3043,16 +3043,12 @@ static int mt7915_show_eeprom_mode(struct seq_file *s, void *data)
+ static int
+ mt7915_sw_aci_set(void *data, u64 val)
+ {
+-#define SWLNA_ENABLE 6
+ struct mt7915_dev *dev = data;
+- struct {
+- u32 subcmd;
+- u8 enable;
+- } req = {
+- .subcmd = SWLNA_ENABLE,
+- .enable = (u8) val,
+- };
+- return mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD(SWLNA_ACI_CTRL), &req, sizeof(req), NULL);
++
++ if (val > 1)
++ return -EINVAL;
++
++ return mt7915_mcu_sw_aci_set(dev, !!val);
+ }
+
+
+--
+2.18.0
+
diff --git a/recipes-wifi/linux-mt76/files/patches/patches.inc b/recipes-wifi/linux-mt76/files/patches/patches.inc
index 8f9eeda..e55fc75 100644
--- a/recipes-wifi/linux-mt76/files/patches/patches.inc
+++ b/recipes-wifi/linux-mt76/files/patches/patches.inc
@@ -37,6 +37,7 @@
file://1030-wifi-mt76-mt7915-Add-vendor-command-attribute-for-RT.patch \
file://1031-wifi-mt76-mt7915-add-vendor-cmd-to-get-available-col.patch \
file://110-wifi-mt76-ignore-key-disable-commands.patch \
+ file://1135-mt76-mt7915-disable-SW-ACI-by-default.patch \
file://3000-wifi-mt76-mt7915-wed-add-wed-tx-support.patch \
file://3001-wifi-mt76-mt7915-wed-add-wds-support-when-wed-is-ena.patch \
file://3002-wifi-mt76-mt7915-wed-add-fill-receive-path-to-report.patch \