[][MAC80211][rebase patches][Filogic 880 alpha release preparation update]
[Description]
Add default CONFIG_MEDIATEK_GE_PHY_SOC in kernel config to avoid human intervention during build time.
[Release-log]
N/A
Change-Id: I971ef508fb340ac6a97064fec64cdbbc7431f41f
Reviewed-on: https://gerrit.mediatek.inc/c/openwrt/feeds/mtk_openwrt_feeds/+/7318411
diff --git a/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/mtk-0010-mac80211-mtk-check-the-control-channel-before-downgr.patch b/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/mtk-0010-mac80211-mtk-check-the-control-channel-before-downgr.patch
new file mode 100644
index 0000000..c37aac7
--- /dev/null
+++ b/autobuild_mac80211_release/package/kernel/mac80211_dev/patches/subsys/mtk-0010-mac80211-mtk-check-the-control-channel-before-downgr.patch
@@ -0,0 +1,54 @@
+From f498afc5b130da3d23a2c86729368c64e487e6d8 Mon Sep 17 00:00:00 2001
+From: Evelyn Tsai <evelyn.tsai@mediatek.com>
+Date: Fri, 16 Dec 2022 03:31:06 +0800
+Subject: [PATCH 10/15] mac80211: mtk: check the control channel before
+ downgrading the bandwidth
+
+---
+ net/mac80211/mlme.c | 23 +++++++++++++++++++++++
+ 1 file changed, 23 insertions(+)
+
+diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
+index d8484cd..8ab5c52 100644
+--- a/net/mac80211/mlme.c
++++ b/net/mac80211/mlme.c
+@@ -4582,6 +4582,26 @@ ieee80211_verify_sta_he_mcs_support(struct ieee80211_sub_if_data *sdata,
+ return false;
+ }
+
++static bool ieee80211_check_same_ctrl_channel(struct ieee80211_sub_if_data *sdata,
++ const struct cfg80211_chan_def *chandef)
++{
++ struct ieee80211_local *local = sdata->local;
++ struct ieee80211_chanctx *ctx;
++
++ mutex_lock(&local->chanctx_mtx);
++ list_for_each_entry(ctx, &local->chanctx_list, list) {
++ if (ctx->replace_state == IEEE80211_CHANCTX_WILL_BE_REPLACED)
++ continue;
++ if (ctx->mode == IEEE80211_CHANCTX_EXCLUSIVE)
++ continue;
++ if (chandef->chan == ctx->conf.def.chan)
++ return true;
++ }
++
++ mutex_unlock(&local->chanctx_mtx);
++ return false;
++}
++
+ static int ieee80211_prep_channel(struct ieee80211_sub_if_data *sdata,
+ struct ieee80211_link_data *link,
+ struct cfg80211_bss *cbss,
+@@ -4808,6 +4828,9 @@ static int ieee80211_prep_channel(struct ieee80211_sub_if_data *sdata,
+ chandef.width == NL80211_CHAN_WIDTH_10)
+ goto out;
+
++ if (!ret || !ieee80211_check_same_ctrl_channel(sdata, &chandef))
++ goto out;
++
+ while (ret && chandef.width != NL80211_CHAN_WIDTH_20_NOHT) {
+ *conn_flags |=
+ ieee80211_chandef_downgrade(&chandef);
+--
+2.18.0
+