[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/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 \
"