[rdkb][common][bsp][Refactor and sync wifi from openwrt]
[Description]
b354486f [MAC80211][misc][Formal 2024-01-12 Filogic 880 Non-MLO SDK Release.]
fe2d295e [MAC80211][WiFi7][misc][Revert mac80211.sh settings]
bf24f3b8 [MAC80211][wifi7][mt76][fix HIF_TXD_V2_1 value]
8de467cc [MAC80211][WiFi6][hostapd][Update Wide Bandwidth Channel Switch Element]
09d4e2fe [MAC80211][misc][Add Filogic 880 Non-MLO SDK Release. Update Readme.md]
[Release-log]
Change-Id: I16f2787c2b2d86bd03e25bec36df20511cde2c42
diff --git a/recipes-wifi/hostapd/files/patches/mtk-0051-hostapd-mtk-Update-Wide-Bandwidth-Channel-Switch-element.patch b/recipes-wifi/hostapd/files/patches/mtk-0051-hostapd-mtk-Update-Wide-Bandwidth-Channel-Switch-element.patch
new file mode 100644
index 0000000..57ee527
--- /dev/null
+++ b/recipes-wifi/hostapd/files/patches/mtk-0051-hostapd-mtk-Update-Wide-Bandwidth-Channel-Switch-element.patch
@@ -0,0 +1,87 @@
+From b08463cf3f68a3a5ba7fef6dacb77dff239ffd48 Mon Sep 17 00:00:00 2001
+From: Yuvarani V <quic_yuvarani@quicinc.com>
+Date: Wed, 27 Sep 2023 12:52:03 +0530
+Subject: hostapd: mtk: Update Wide Bandwidth Channel Switch element
+
+This patch is from hostapd upstream
+(https://w1.fi/cgit/hostap/commit/src/ap/ieee802_11.c?id=ef8d48c4cfe673420dcec2879cbc8c84b16e041d)
+
+Original commit message:
+Update Wide Bandwidth Channel Switch element as per IEEE
+P802.11-REVme/D4.0, 9.4.2.159 (Wide Bandwidth Channel Switch element)
+and Table 9-314 (VHT Operation Information subfields).
+
+Update New Channel Width, New Channel Center Frequency Segment 0, and
+New Channel Center Frequency Segment 1 fields as per IEEE
+P802.11-REVme/D4.0 for 160 MHz and 80+80 MHz bandwidth. This replaces
+the use of now deprecated Channel Width 2 and 3 values with a more
+backwards compatible design.
+
+Signed-off-by: Yuvarani V <quic_yuvarani@quicinc.com>
+---
+ src/ap/ieee802_11.c | 28 ++++++++++++++++++++--------
+ 1 file changed, 20 insertions(+), 8 deletions(-)
+
+diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c
+index dd477fd..8a5fd20 100644
+--- a/src/ap/ieee802_11.c
++++ b/src/ap/ieee802_11.c
+@@ -7176,7 +7176,7 @@ u8 * hostapd_eid_txpower_envelope(struct hostapd_data *hapd, u8 *eid)
+
+ u8 * hostapd_eid_wb_chsw_wrapper(struct hostapd_data *hapd, u8 *eid)
+ {
+- u8 bw, chan1, chan2 = 0;
++ u8 bw, chan1 = 0, chan2 = 0;
+ int freq1;
+
+ if (!hapd->cs_freq_params.channel ||
+@@ -7185,20 +7185,17 @@ u8 * hostapd_eid_wb_chsw_wrapper(struct hostapd_data *hapd, u8 *eid)
+ !hapd->cs_freq_params.eht_enabled))
+ return eid;
+
+- /* bandwidth: 0: 40, 1: 80, 2: 160, 3: 80+80 */
++ /* bandwidth: 0: 40, 1: 80, 160, 80+80, 4: 320 as per
++ * IEEE P802.11-REVme/D4.0, 9.4.2.159 and Table 9-314. */
+ switch (hapd->cs_freq_params.bandwidth) {
+ case 40:
+ bw = 0;
+ break;
+ case 80:
+- /* check if it's 80+80 */
+- if (!hapd->cs_freq_params.center_freq2)
+- bw = 1;
+- else
+- bw = 3;
++ bw = 1;
+ break;
+ case 160:
+- bw = 2;
++ bw = 1;
+ break;
+ default:
+ /* not valid VHT bandwidth or not in CSA */
+@@ -7222,6 +7219,21 @@ u8 * hostapd_eid_wb_chsw_wrapper(struct hostapd_data *hapd, u8 *eid)
+ *eid++ = WLAN_EID_VHT_WIDE_BW_CHSWITCH;
+ *eid++ = 3; /* Length of Wide Bandwidth Channel Switch element */
+ *eid++ = bw; /* New Channel Width */
++ if (hapd->cs_freq_params.bandwidth == 160) {
++ /* Update the CCFS0 and CCFS1 values in the element based on
++ * IEEE P802.11-REVme/D4.0, Table 9-314 */
++
++ /* CCFS1 - The channel center frequency index of the 160 MHz
++ * channel. */
++ chan2 = chan1;
++
++ /* CCFS0 - The channel center frequency index of the 80 MHz
++ * channel segment that contains the primary channel. */
++ if (hapd->cs_freq_params.channel < chan1)
++ chan1 -= 8;
++ else
++ chan1 += 8;
++ }
+ *eid++ = chan1; /* New Channel Center Frequency Segment 0 */
+ *eid++ = chan2; /* New Channel Center Frequency Segment 1 */
+
+--
+2.25.1
+
diff --git a/recipes-wifi/hostapd/files/patches/patches.inc b/recipes-wifi/hostapd/files/patches/patches.inc
index b7af618..5268b34 100644
--- a/recipes-wifi/hostapd/files/patches/patches.inc
+++ b/recipes-wifi/hostapd/files/patches/patches.inc
@@ -116,4 +116,5 @@
file://mtk-0048-hostapd-mtk-add-support-for-channel-switching-with-c.patch \
file://mtk-0049-hostapd-mtk-Add-DFS-offchan-channel-switch.patch \
file://mtk-0050-hostapd-mtk-Add-txpower-vendor-command.patch \
+ file://mtk-0051-hostapd-mtk-Update-Wide-Bandwidth-Channel-Switch-element.patch \
"
diff --git a/recipes-wifi/linux-mt76/files/patches-3.x/0026-mtk-wifi-mt76-mt7996-fix-HIF_TXD_V2_1-value.patch b/recipes-wifi/linux-mt76/files/patches-3.x/0026-mtk-wifi-mt76-mt7996-fix-HIF_TXD_V2_1-value.patch
new file mode 100644
index 0000000..6f56bd7
--- /dev/null
+++ b/recipes-wifi/linux-mt76/files/patches-3.x/0026-mtk-wifi-mt76-mt7996-fix-HIF_TXD_V2_1-value.patch
@@ -0,0 +1,27 @@
+From d65f2368dd8a59c378384c620732c3b9735752e6 Mon Sep 17 00:00:00 2001
+From: Benjamin Lin <benjamin-jw.lin@mediatek.com>
+Date: Thu, 11 Jan 2024 17:32:26 +0800
+Subject: [PATCH] mtk: wifi: mt76: mt7996: fix HIF_TXD_V2_1 value
+
+Signed-off-by: Benjamin Lin <benjamin-jw.lin@mediatek.com>
+Signed-off-by: Peter Chiu <chui-hao.chiu@mediatek.com>
+---
+ mt7996/init.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/mt7996/init.c b/mt7996/init.c
+index 193904bc..90f3a417 100644
+--- a/mt7996/init.c
++++ b/mt7996/init.c
+@@ -499,7 +499,7 @@ static void mt7996_mac_init_basic_rates(struct mt7996_dev *dev)
+
+ void mt7996_mac_init(struct mt7996_dev *dev)
+ {
+-#define HIF_TXD_V2_1 4
++#define HIF_TXD_V2_1 0x21
+ int i;
+
+ mt76_clear(dev, MT_MDP_DCR2, MT_MDP_DCR2_RX_TRANS_SHORT);
+--
+2.18.0
+
diff --git a/recipes-wifi/linux-mt76/files/patches-3.x/patches.inc b/recipes-wifi/linux-mt76/files/patches-3.x/patches.inc
index 083cb42..f21645b 100644
--- a/recipes-wifi/linux-mt76/files/patches-3.x/patches.inc
+++ b/recipes-wifi/linux-mt76/files/patches-3.x/patches.inc
@@ -25,6 +25,7 @@
file://0023-mtk-wifi-mt76-mt7996-add-firmware-WA-s-coredump.patch \
file://0024-mtk-wifi-mt76-mt7996-add-preamble-puncture-support-f.patch \
file://0025-mtk-wifi-mt76-mt7996-enable-hw-cso-module.patch \
+ file://0026-mtk-wifi-mt76-mt7996-fix-HIF_TXD_V2_1-value.patch \
file://0999-mtk-wifi-mt76-mt7996-for-build-pass.patch \
file://1000-mtk-wifi-mt76-mt7996-add-debug-tool.patch \
file://1001-mtk-wifi-mt76-mt7996-support-record-muru-algo-log-wh.patch \
diff --git a/recipes-wifi/wpa-supplicant/files/patches/mtk-0051-hostapd-mtk-Update-Wide-Bandwidth-Channel-Switch-element.patch b/recipes-wifi/wpa-supplicant/files/patches/mtk-0051-hostapd-mtk-Update-Wide-Bandwidth-Channel-Switch-element.patch
new file mode 100644
index 0000000..57ee527
--- /dev/null
+++ b/recipes-wifi/wpa-supplicant/files/patches/mtk-0051-hostapd-mtk-Update-Wide-Bandwidth-Channel-Switch-element.patch
@@ -0,0 +1,87 @@
+From b08463cf3f68a3a5ba7fef6dacb77dff239ffd48 Mon Sep 17 00:00:00 2001
+From: Yuvarani V <quic_yuvarani@quicinc.com>
+Date: Wed, 27 Sep 2023 12:52:03 +0530
+Subject: hostapd: mtk: Update Wide Bandwidth Channel Switch element
+
+This patch is from hostapd upstream
+(https://w1.fi/cgit/hostap/commit/src/ap/ieee802_11.c?id=ef8d48c4cfe673420dcec2879cbc8c84b16e041d)
+
+Original commit message:
+Update Wide Bandwidth Channel Switch element as per IEEE
+P802.11-REVme/D4.0, 9.4.2.159 (Wide Bandwidth Channel Switch element)
+and Table 9-314 (VHT Operation Information subfields).
+
+Update New Channel Width, New Channel Center Frequency Segment 0, and
+New Channel Center Frequency Segment 1 fields as per IEEE
+P802.11-REVme/D4.0 for 160 MHz and 80+80 MHz bandwidth. This replaces
+the use of now deprecated Channel Width 2 and 3 values with a more
+backwards compatible design.
+
+Signed-off-by: Yuvarani V <quic_yuvarani@quicinc.com>
+---
+ src/ap/ieee802_11.c | 28 ++++++++++++++++++++--------
+ 1 file changed, 20 insertions(+), 8 deletions(-)
+
+diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c
+index dd477fd..8a5fd20 100644
+--- a/src/ap/ieee802_11.c
++++ b/src/ap/ieee802_11.c
+@@ -7176,7 +7176,7 @@ u8 * hostapd_eid_txpower_envelope(struct hostapd_data *hapd, u8 *eid)
+
+ u8 * hostapd_eid_wb_chsw_wrapper(struct hostapd_data *hapd, u8 *eid)
+ {
+- u8 bw, chan1, chan2 = 0;
++ u8 bw, chan1 = 0, chan2 = 0;
+ int freq1;
+
+ if (!hapd->cs_freq_params.channel ||
+@@ -7185,20 +7185,17 @@ u8 * hostapd_eid_wb_chsw_wrapper(struct hostapd_data *hapd, u8 *eid)
+ !hapd->cs_freq_params.eht_enabled))
+ return eid;
+
+- /* bandwidth: 0: 40, 1: 80, 2: 160, 3: 80+80 */
++ /* bandwidth: 0: 40, 1: 80, 160, 80+80, 4: 320 as per
++ * IEEE P802.11-REVme/D4.0, 9.4.2.159 and Table 9-314. */
+ switch (hapd->cs_freq_params.bandwidth) {
+ case 40:
+ bw = 0;
+ break;
+ case 80:
+- /* check if it's 80+80 */
+- if (!hapd->cs_freq_params.center_freq2)
+- bw = 1;
+- else
+- bw = 3;
++ bw = 1;
+ break;
+ case 160:
+- bw = 2;
++ bw = 1;
+ break;
+ default:
+ /* not valid VHT bandwidth or not in CSA */
+@@ -7222,6 +7219,21 @@ u8 * hostapd_eid_wb_chsw_wrapper(struct hostapd_data *hapd, u8 *eid)
+ *eid++ = WLAN_EID_VHT_WIDE_BW_CHSWITCH;
+ *eid++ = 3; /* Length of Wide Bandwidth Channel Switch element */
+ *eid++ = bw; /* New Channel Width */
++ if (hapd->cs_freq_params.bandwidth == 160) {
++ /* Update the CCFS0 and CCFS1 values in the element based on
++ * IEEE P802.11-REVme/D4.0, Table 9-314 */
++
++ /* CCFS1 - The channel center frequency index of the 160 MHz
++ * channel. */
++ chan2 = chan1;
++
++ /* CCFS0 - The channel center frequency index of the 80 MHz
++ * channel segment that contains the primary channel. */
++ if (hapd->cs_freq_params.channel < chan1)
++ chan1 -= 8;
++ else
++ chan1 += 8;
++ }
+ *eid++ = chan1; /* New Channel Center Frequency Segment 0 */
+ *eid++ = chan2; /* New Channel Center Frequency Segment 1 */
+
+--
+2.25.1
+
diff --git a/recipes-wifi/wpa-supplicant/files/patches/patches.inc b/recipes-wifi/wpa-supplicant/files/patches/patches.inc
index b7af618..5268b34 100644
--- a/recipes-wifi/wpa-supplicant/files/patches/patches.inc
+++ b/recipes-wifi/wpa-supplicant/files/patches/patches.inc
@@ -116,4 +116,5 @@
file://mtk-0048-hostapd-mtk-add-support-for-channel-switching-with-c.patch \
file://mtk-0049-hostapd-mtk-Add-DFS-offchan-channel-switch.patch \
file://mtk-0050-hostapd-mtk-Add-txpower-vendor-command.patch \
+ file://mtk-0051-hostapd-mtk-Update-Wide-Bandwidth-Channel-Switch-element.patch \
"