Skip to content

Commit 9aa3b49

Browse files
leon-yengregkh
authored andcommitted
wifi: mt76: mt7925: Fix incorrect MLO mode in firmware control
[ Upstream commit 1695f66 ] 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: 69acd6d ("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> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 3880639 commit 9aa3b49

3 files changed

Lines changed: 9 additions & 6 deletions

File tree

drivers/net/wireless/mediatek/mt76/mt7925/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ static int mt7925_set_mlo_roc(struct mt792x_phy *phy,
533533

534534
phy->roc_grant = false;
535535

536-
err = mt7925_mcu_set_mlo_roc(mconf, sel_links, 5, ++phy->roc_token_id);
536+
err = mt7925_mcu_set_mlo_roc(phy, mconf, sel_links, 5, ++phy->roc_token_id);
537537
if (err < 0) {
538538
clear_bit(MT76_STATE_ROC, &phy->mt76->state);
539539
goto out;

drivers/net/wireless/mediatek/mt76/mt7925/mcu.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1243,8 +1243,8 @@ int mt7925_mcu_add_key(struct mt76_dev *dev, struct ieee80211_vif *vif,
12431243
return mt76_mcu_skb_send_msg(dev, skb, mcu_cmd, true);
12441244
}
12451245

1246-
int mt7925_mcu_set_mlo_roc(struct mt792x_bss_conf *mconf, u16 sel_links,
1247-
int duration, u8 token_id)
1246+
int mt7925_mcu_set_mlo_roc(struct mt792x_phy *phy, struct mt792x_bss_conf *mconf,
1247+
u16 sel_links, int duration, u8 token_id)
12481248
{
12491249
struct mt792x_vif *mvif = mconf->vif;
12501250
struct ieee80211_vif *vif = container_of((void *)mvif,
@@ -1279,6 +1279,8 @@ int mt7925_mcu_set_mlo_roc(struct mt792x_bss_conf *mconf, u16 sel_links,
12791279
.roc[1].len = cpu_to_le16(sizeof(struct roc_acquire_tlv))
12801280
};
12811281

1282+
struct wiphy *wiphy = phy->mt76->hw->wiphy;
1283+
12821284
if (!mconf || hweight16(vif->valid_links) < 2 ||
12831285
hweight16(sel_links) != 2)
12841286
return -EPERM;
@@ -1301,7 +1303,8 @@ int mt7925_mcu_set_mlo_roc(struct mt792x_bss_conf *mconf, u16 sel_links,
13011303
is_AG_band |= links[i].chan->band == NL80211_BAND_2GHZ;
13021304
}
13031305

1304-
if (vif->cfg.eml_cap & IEEE80211_EML_CAP_EMLSR_SUPP)
1306+
if (!(wiphy->iftype_ext_capab[0].mld_capa_and_ops &
1307+
IEEE80211_MLD_CAP_OP_MAX_SIMUL_LINKS))
13051308
type = is_AG_band ? MT7925_ROC_REQ_MLSR_AG :
13061309
MT7925_ROC_REQ_MLSR_AA;
13071310
else

drivers/net/wireless/mediatek/mt76/mt7925/mt7925.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,8 +345,8 @@ int mt7925_set_tx_sar_pwr(struct ieee80211_hw *hw,
345345
int mt7925_mcu_regval(struct mt792x_dev *dev, u32 regidx, u32 *val, bool set);
346346
int mt7925_mcu_set_clc(struct mt792x_dev *dev, u8 *alpha2,
347347
enum environment_cap env_cap);
348-
int mt7925_mcu_set_mlo_roc(struct mt792x_bss_conf *mconf, u16 sel_links,
349-
int duration, u8 token_id);
348+
int mt7925_mcu_set_mlo_roc(struct mt792x_phy *phy, struct mt792x_bss_conf *mconf,
349+
u16 sel_links, int duration, u8 token_id);
350350
int mt7925_mcu_set_roc(struct mt792x_phy *phy, struct mt792x_bss_conf *mconf,
351351
struct ieee80211_channel *chan, int duration,
352352
enum mt7925_roc_req type, u8 token_id);

0 commit comments

Comments
 (0)