]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
wifi: mt76: mt792x: Limit the concurrent STA and SoftAP to operate on the same channel
authorLeon Yen <leon.yen@mediatek.com>
Wed, 25 Jun 2025 07:37:20 +0000 (15:37 +0800)
committerFelix Fietkau <nbd@nbd.name>
Mon, 7 Jul 2025 16:07:43 +0000 (18:07 +0200)
Due to the lack of NoA(Notice of Absence) mechanism in SoftAP mode, it is
inappropriate to allow concurrent SoftAP and STA to operate on the
different channels.

This patch restricts the concurrent SoftAP and STA to be setup on the same
channel only.

Signed-off-by: Leon Yen <leon.yen@mediatek.com>
Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com>
Link: https://patch.msgid.link/20250625073720.1385210-1-mingyen.hsieh@mediatek.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt792x_core.c

index a50c1723ca290e001bf31ed1f081684a2ca1b82c..05130ec1e5f7b345993ea36f46b54aea4d90b807 100644 (file)
@@ -28,7 +28,7 @@ static const struct ieee80211_iface_combination if_comb[] = {
        },
 };
 
-static const struct ieee80211_iface_limit if_limits_chanctx[] = {
+static const struct ieee80211_iface_limit if_limits_chanctx_mcc[] = {
        {
                .max = 2,
                .types = BIT(NL80211_IFTYPE_STATION) |
@@ -36,8 +36,23 @@ static const struct ieee80211_iface_limit if_limits_chanctx[] = {
        },
        {
                .max = 1,
-               .types = BIT(NL80211_IFTYPE_AP) |
-                        BIT(NL80211_IFTYPE_P2P_GO)
+               .types = BIT(NL80211_IFTYPE_P2P_GO)
+       },
+       {
+               .max = 1,
+               .types = BIT(NL80211_IFTYPE_P2P_DEVICE)
+       }
+};
+
+static const struct ieee80211_iface_limit if_limits_chanctx_scc[] = {
+       {
+               .max = 2,
+               .types = BIT(NL80211_IFTYPE_STATION) |
+                        BIT(NL80211_IFTYPE_P2P_CLIENT)
+       },
+       {
+               .max = 1,
+               .types = BIT(NL80211_IFTYPE_AP)
        },
        {
                .max = 1,
@@ -47,11 +62,18 @@ static const struct ieee80211_iface_limit if_limits_chanctx[] = {
 
 static const struct ieee80211_iface_combination if_comb_chanctx[] = {
        {
-               .limits = if_limits_chanctx,
-               .n_limits = ARRAY_SIZE(if_limits_chanctx),
+               .limits = if_limits_chanctx_mcc,
+               .n_limits = ARRAY_SIZE(if_limits_chanctx_mcc),
                .max_interfaces = 3,
                .num_different_channels = 2,
                .beacon_int_infra_match = false,
+       },
+       {
+               .limits = if_limits_chanctx_scc,
+               .n_limits = ARRAY_SIZE(if_limits_chanctx_scc),
+               .max_interfaces = 3,
+               .num_different_channels = 1,
+               .beacon_int_infra_match = false,
        }
 };