]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
wifi: mt76: mt7925: Fix incorrect MLO mode in firmware control
authorLeon Yen <leon.yen@mediatek.com>
Thu, 11 Dec 2025 12:38:36 +0000 (20:38 +0800)
committerFelix Fietkau <nbd@nbd.name>
Mon, 23 Mar 2026 09:21:25 +0000 (09:21 +0000)
The selection of MLO mode should depend on the capabilities of the STA
rather than those of the peer AP to avoid compatibility issues with
certain APs, such as Xiaomi BE5000 WiFi7 router.

Fixes: 69acd6d910b0c ("wifi: mt76: mt7925: add mt7925_change_vif_links")
Signed-off-by: Leon Yen <leon.yen@mediatek.com>
Link: https://patch.msgid.link/20251211123836.4169436-1-leon.yen@mediatek.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt7925/main.c
drivers/net/wireless/mediatek/mt76/mt7925/mcu.c
drivers/net/wireless/mediatek/mt76/mt7925/mt7925.h

index 9861c1fde1ae9998f4800f9f3a6c0c8f6cfa4636..1fea2e807f779400731c04d11f0f534c6e48bff0 100644 (file)
@@ -545,7 +545,7 @@ static int mt7925_set_mlo_roc(struct mt792x_phy *phy,
 
        phy->roc_grant = false;
 
-       err = mt7925_mcu_set_mlo_roc(mconf, sel_links, 5, ++phy->roc_token_id);
+       err = mt7925_mcu_set_mlo_roc(phy, mconf, sel_links, 5, ++phy->roc_token_id);
        if (err < 0) {
                clear_bit(MT76_STATE_ROC, &phy->mt76->state);
                goto out;
index cf0fdea45cf735c1e910352e0d394c0441500d4c..8d9d2c1b83acaf589dce06f744de9281203f8ca4 100644 (file)
@@ -1294,8 +1294,8 @@ int mt7925_mcu_add_key(struct mt76_dev *dev, struct ieee80211_vif *vif,
        return mt76_mcu_skb_send_msg(dev, skb, mcu_cmd, true);
 }
 
-int mt7925_mcu_set_mlo_roc(struct mt792x_bss_conf *mconf, u16 sel_links,
-                          int duration, u8 token_id)
+int mt7925_mcu_set_mlo_roc(struct mt792x_phy *phy, struct mt792x_bss_conf *mconf,
+                          u16 sel_links, int duration, u8 token_id)
 {
        struct mt792x_vif *mvif = mconf->vif;
        struct ieee80211_vif *vif = container_of((void *)mvif,
@@ -1330,6 +1330,8 @@ int mt7925_mcu_set_mlo_roc(struct mt792x_bss_conf *mconf, u16 sel_links,
                        .roc[1].len = cpu_to_le16(sizeof(struct roc_acquire_tlv))
        };
 
+       struct wiphy *wiphy = phy->mt76->hw->wiphy;
+
        if (!mconf || hweight16(vif->valid_links) < 2 ||
            hweight16(sel_links) != 2)
                return -EPERM;
@@ -1352,7 +1354,8 @@ int mt7925_mcu_set_mlo_roc(struct mt792x_bss_conf *mconf, u16 sel_links,
                is_AG_band |= links[i].chan->band == NL80211_BAND_2GHZ;
        }
 
-       if (vif->cfg.eml_cap & IEEE80211_EML_CAP_EMLSR_SUPP)
+       if (!(wiphy->iftype_ext_capab[0].mld_capa_and_ops &
+             IEEE80211_MLD_CAP_OP_MAX_SIMUL_LINKS))
                type = is_AG_band ? MT7925_ROC_REQ_MLSR_AG :
                                    MT7925_ROC_REQ_MLSR_AA;
        else
index 5030d7714bcf2fe1d95e1f505f42a0a6754ef9a8..0f0eff748bb779d623ba7812304bbcc02186afe7 100644 (file)
@@ -350,8 +350,8 @@ int mt7925_set_tx_sar_pwr(struct ieee80211_hw *hw,
 int mt7925_mcu_regval(struct mt792x_dev *dev, u32 regidx, u32 *val, bool set);
 int mt7925_mcu_set_clc(struct mt792x_dev *dev, u8 *alpha2,
                       enum environment_cap env_cap);
-int mt7925_mcu_set_mlo_roc(struct mt792x_bss_conf *mconf, u16 sel_links,
-                          int duration, u8 token_id);
+int mt7925_mcu_set_mlo_roc(struct mt792x_phy *phy, struct mt792x_bss_conf *mconf,
+                          u16 sel_links, int duration, u8 token_id);
 int mt7925_mcu_set_roc(struct mt792x_phy *phy, struct mt792x_bss_conf *mconf,
                       struct ieee80211_channel *chan, int duration,
                       enum mt7925_roc_req type, u8 token_id);