linux-mediatek.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Lorenzo Bianconi <lorenzo@kernel.org>
To: Shayne Chen <shayne.chen@mediatek.com>
Cc: Felix Fietkau <nbd@nbd.name>,
	linux-wireless <linux-wireless@vger.kernel.org>,
	Ryder Lee <ryder.lee@mediatek.com>,
	Evelyn Tsai <evelyn.tsai@mediatek.com>,
	linux-mediatek <linux-mediatek@lists.infradead.org>
Subject: Re: [PATCH mt76 05/12] wifi: mt76: mt7996: fix several fields in mt7996_mcu_bss_basic_tlv()
Date: Wed, 5 Nov 2025 11:04:40 +0100	[thread overview]
Message-ID: <aQshODZaMJSUoWPd@lore-desk> (raw)
In-Reply-To: <20251105093100.541408-5-shayne.chen@mediatek.com>

[-- Attachment #1: Type: text/plain, Size: 2935 bytes --]

> Fix several fields in mt7996_mcu_bss_basic_tlv() that were not obtained
> from the correct link. Without this patch, the MLD station interface
> does not function properly.
> 
> Fixes: 34a41bfbcb71 ("wifi: mt76: mt7996: prepare mt7996_mcu_add_dev/bss_info for MLO support")
> Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>

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

> ---
>  .../net/wireless/mediatek/mt76/mt7996/mcu.c   | 21 ++++++++++---------
>  1 file changed, 11 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c
> index 82dd34a8780f..f1892aaf6a91 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c
> @@ -1037,7 +1037,6 @@ mt7996_mcu_bss_basic_tlv(struct sk_buff *skb,
>  	struct mt76_connac_bss_basic_tlv *bss;
>  	u32 type = CONNECTION_INFRA_AP;
>  	u16 sta_wlan_idx = wlan_idx;
> -	struct ieee80211_sta *sta;
>  	struct tlv *tlv;
>  	int idx;
>  
> @@ -1048,14 +1047,18 @@ mt7996_mcu_bss_basic_tlv(struct sk_buff *skb,
>  		break;
>  	case NL80211_IFTYPE_STATION:
>  		if (enable) {
> +			struct ieee80211_sta *sta;
> +
>  			rcu_read_lock();
> -			sta = ieee80211_find_sta(vif, vif->bss_conf.bssid);
> -			/* TODO: enable BSS_INFO_UAPSD & BSS_INFO_PM */
> +			sta = ieee80211_find_sta(vif, link_conf->bssid);
>  			if (sta) {
> -				struct mt76_wcid *wcid;
> +				struct mt7996_sta *msta = (void *)sta->drv_priv;
> +				struct mt7996_sta_link *msta_link;
> +				int link_id = link_conf->link_id;
>  
> -				wcid = (struct mt76_wcid *)sta->drv_priv;
> -				sta_wlan_idx = wcid->idx;
> +				msta_link = rcu_dereference(msta->link[link_id]);
> +				if (msta_link)
> +					sta_wlan_idx = msta_link->wcid.idx;
>  			}
>  			rcu_read_unlock();
>  		}
> @@ -1072,8 +1075,6 @@ mt7996_mcu_bss_basic_tlv(struct sk_buff *skb,
>  	tlv = mt7996_mcu_add_uni_tlv(skb, UNI_BSS_INFO_BASIC, sizeof(*bss));
>  
>  	bss = (struct mt76_connac_bss_basic_tlv *)tlv;
> -	bss->bcn_interval = cpu_to_le16(link_conf->beacon_int);
> -	bss->dtim_period = link_conf->dtim_period;
>  	bss->bmc_tx_wlan_idx = cpu_to_le16(wlan_idx);
>  	bss->sta_idx = cpu_to_le16(sta_wlan_idx);
>  	bss->conn_type = cpu_to_le32(type);
> @@ -1093,10 +1094,10 @@ mt7996_mcu_bss_basic_tlv(struct sk_buff *skb,
>  
>  	memcpy(bss->bssid, link_conf->bssid, ETH_ALEN);
>  	bss->bcn_interval = cpu_to_le16(link_conf->beacon_int);
> -	bss->dtim_period = vif->bss_conf.dtim_period;
> +	bss->dtim_period = link_conf->dtim_period;
>  	bss->phymode = mt76_connac_get_phy_mode(phy, vif,
>  						chandef->chan->band, NULL);
> -	bss->phymode_ext = mt76_connac_get_phy_mode_ext(phy, &vif->bss_conf,
> +	bss->phymode_ext = mt76_connac_get_phy_mode_ext(phy, link_conf,
>  							chandef->chan->band);
>  
>  	return 0;
> -- 
> 2.51.0
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  reply	other threads:[~2025-11-05 10:04 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-05  9:30 [PATCH mt76 01/12] wifi: mt76: mt7996: fix max nss value when getting rx chainmask Shayne Chen
2025-11-05  9:30 ` [PATCH mt76 02/12] wifi: mt76: mt7996: no need to wait ACK event for SDO command Shayne Chen
2025-11-05  9:30 ` [PATCH mt76 03/12] wifi: mt76: mt7996: fix implicit beamforming support for mt7992 Shayne Chen
2025-11-05  9:30 ` [PATCH mt76 04/12] wifi: mt76: mt7996: support fixed rate for link station Shayne Chen
2025-11-05  9:30 ` [PATCH mt76 05/12] wifi: mt76: mt7996: fix several fields in mt7996_mcu_bss_basic_tlv() Shayne Chen
2025-11-05 10:04   ` Lorenzo Bianconi [this message]
2025-11-05  9:30 ` [PATCH mt76 06/12] wifi: mt76: mt7996: fix teardown command for an MLD peer Shayne Chen
2025-11-05 10:09   ` Lorenzo Bianconi
2025-11-05  9:30 ` [PATCH mt76 07/12] wifi: mt76: mt7996: set link_valid field when initializing wcid Shayne Chen
2025-11-05 10:15   ` Lorenzo Bianconi
2025-11-05  9:30 ` [PATCH mt76 08/12] wifi: mt76: mt7996: use correct link_id when filling TXD and TXP Shayne Chen
2025-11-05 10:34   ` Lorenzo Bianconi
2025-11-05  9:30 ` [PATCH mt76 09/12] wifi: mt76: mt7996: fix MLD group index assignment Shayne Chen
2025-11-05 10:42   ` Lorenzo Bianconi
2025-11-05  9:30 ` [PATCH mt76 10/12] wifi: mt76: mt7996: fix MLO set key and group key issues Shayne Chen
2025-11-05  9:30 ` [PATCH mt76 11/12] wifi: mt76: mt7996: fix using wrong phy to start in mt7996_mac_restart() Shayne Chen
2025-11-05 10:45   ` Lorenzo Bianconi
2025-11-05  9:31 ` [PATCH mt76 12/12] wifi: mt76: mt7996: fix EMI rings for RRO Shayne Chen
2025-11-05 10:57   ` Lorenzo Bianconi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aQshODZaMJSUoWPd@lore-desk \
    --to=lorenzo@kernel.org \
    --cc=evelyn.tsai@mediatek.com \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=nbd@nbd.name \
    --cc=ryder.lee@mediatek.com \
    --cc=shayne.chen@mediatek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).