Commit ac03e5b8 authored by Ming Yen Hsieh's avatar Ming Yen Hsieh Committed by Felix Fietkau
Browse files

wifi: mt76: mt7925: Enhance mt7925_mac_link_bss_add to support MLO



In mt7925_mac_link_bss_add(), the mt76_connac_mcu_uni_add_dev() function
must be executed only after all parameters have been properly initialized.

Fixes: 86c051f2 ("wifi: mt76: mt7925: enabling MLO when the firmware supports it")
Signed-off-by: default avatarMing Yen Hsieh <mingyen.hsieh@mediatek.com>
Signed-off-by: default avatarSean Wang <sean.wang@mediatek.com>
Link: https://patch.msgid.link/20241211011926.5002-8-sean.wang@kernel.org


Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent 4a596010
Loading
Loading
Loading
Loading
+8 −6
Original line number Diff line number Diff line
@@ -365,18 +365,14 @@ static int mt7925_mac_link_bss_add(struct mt792x_dev *dev,
	mconf->mt76.omac_idx = ieee80211_vif_is_mld(vif) ?
			       0 : mconf->mt76.idx;
	mconf->mt76.band_idx = 0xff;
	mconf->mt76.wmm_idx = mconf->mt76.idx % MT76_CONNAC_MAX_WMM_SETS;
	mconf->mt76.wmm_idx = ieee80211_vif_is_mld(vif) ?
			      0 : mconf->mt76.idx % MT76_CONNAC_MAX_WMM_SETS;

	if (mvif->phy->mt76->chandef.chan->band != NL80211_BAND_2GHZ)
		mconf->mt76.basic_rates_idx = MT792x_BASIC_RATES_TBL + 4;
	else
		mconf->mt76.basic_rates_idx = MT792x_BASIC_RATES_TBL;

	ret = mt76_connac_mcu_uni_add_dev(&dev->mphy, link_conf, &mconf->mt76,
					  &mlink->wcid, true);
	if (ret)
		goto out;

	dev->mt76.vif_mask |= BIT_ULL(mconf->mt76.idx);
	mvif->phy->omac_mask |= BIT_ULL(mconf->mt76.omac_idx);

@@ -395,6 +391,12 @@ static int mt7925_mac_link_bss_add(struct mt792x_dev *dev,
	ewma_rssi_init(&mconf->rssi);

	rcu_assign_pointer(dev->mt76.wcid[idx], &mlink->wcid);

	ret = mt76_connac_mcu_uni_add_dev(&dev->mphy, link_conf, &mconf->mt76,
					  &mlink->wcid, true);
	if (ret)
		goto out;

	if (vif->txq) {
		mtxq = (struct mt76_txq *)vif->txq->drv_priv;
		mtxq->wcid = idx;