[PATCH mt76 06/12] wifi: mt76: mt7996: fix teardown command for an MLD peer

Lorenzo Bianconi lorenzo at kernel.org
Wed Nov 5 02:09:09 PST 2025


> For an MLD peer, we only need to call the teardown command when removing
> the last link, and there's no need to call mt7996_mcu_add_sta() for the
> earlier links.
> 
> Fixes: c1d6dd5d03eb ("wifi: mt76: mt7996: Add mt7996_mcu_teardown_mld_sta rouine")
> Signed-off-by: Shayne Chen <shayne.chen at mediatek.com>

Acked-by: Lorenzo Bianconi <lorenzo at kernel.org>

> ---
>  drivers/net/wireless/mediatek/mt76/mt7996/main.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/main.c b/drivers/net/wireless/mediatek/mt76/mt7996/main.c
> index 5e0b57657e7e..685be98b9f27 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7996/main.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt7996/main.c
> @@ -1206,13 +1206,13 @@ mt7996_mac_sta_event(struct mt7996_dev *dev, struct ieee80211_vif *vif,
>  				mt7996_mac_twt_teardown_flow(dev, link,
>  							     msta_link, i);
>  
> -			if (sta->mlo && links == BIT(link_id)) /* last link */
> -				mt7996_mcu_teardown_mld_sta(dev, link,
> -							    msta_link);
> -			else
> +			if (!sta->mlo)
>  				mt7996_mcu_add_sta(dev, link_conf, link_sta,
>  						   link, msta_link,
>  						   CONN_STATE_DISCONNECT, false);
> +			else if (sta->mlo && links == BIT(link_id)) /* last link */
> +				mt7996_mcu_teardown_mld_sta(dev, link,
> +							    msta_link);
>  			msta_link->wcid.sta_disabled = 1;
>  			msta_link->wcid.sta = 0;
>  			links = links & ~BIT(link_id);
> -- 
> 2.51.0
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-mediatek/attachments/20251105/70143d45/attachment.sig>


More information about the Linux-mediatek mailing list