Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=46.4.11.11 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795980702; b=0LSeOm8zC/VV6rIsHJfRSGdr/Jua51eoJptTQl+SZheYv0Vc9kQh52BY4vki19xc9TbL Jz/ZZiRtnqchnu8jaInv1F8Qua0Ut60BqJFb3A8em8LaeAvXPyPWmnzoR83JI5Sh5UMHj 2YacD1ojkOTkBSLzfTrIgg2yVIFWeVTs67FqatFaq4c5olAq+7Nhosv23J56CI/nd2qfO DX8VekJoFD9h6Kt6rnxH3zU+R8jj+KDfc/tgCEQCq6RsuiOkok0+gugJj0C1G0oeNXY09 yVDlrxd3y1hPNxlOCBxUyW2dygmQzPb2nSdcM7PlFc+NoYUrhivkJkX///nEGw022NA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795980702; h=DMARC-Filter:DKIM-Signature:Received:From:To:Subject:Date:Message-ID: X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding; bh=+VPmIZY2aff+uC2fD3NV1ymYqTlPudxD0WrMKVtMgXk=; b=jSRgUP+01tcBnfTdU+fhCfDSkOCPCfEJWm5c5d91QcBUMBaddRlIYyvxlG340Uh/f9YT ORhJxu4Ah6tN3CF+PRC1OJ5ahzxNgaOH6PF5nHaCppwTyE2QY+5HmSyxEwtdNCIv0gxWY ak0jAYPHcBSVkATFZTxfOWJzBKQihowawrmtUDc/b5g2vZjZEOSpijEXM0wxxzXmKuO5I 4MCr+XhXiNrSCJ1wyTsmnzk5RufCbhIy9bxdFf3QamlpynbHXWrKiy6i86CxIdnUTrFpW ImMfMbK1kjFX6o0+B/igX91uqFBOKGvSLnWLgAbhVSyGKyRvc2rty5UerGlL9L3q7SA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=nbd.name; spf=pass smtp.mailfrom=nbd.name; dkim=pass header.d=nbd.name header.i=@nbd.name header.a=rsa-sha256 header.s=20160729 header.b=QluOGqu7; arc=none smtp.remote-ip=46.4.11.11 Received: from nbd.name (nbd.name [46.4.11.11]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3D223606A32C for ; Sun, 29 Nov 2026 19:31:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 3D223606A32C Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nbd.name Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nbd.name Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nbd.name header.i=@nbd.name header.a=rsa-sha256 header.s=20160729 header.b=QluOGqu7 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=+VPmIZY2aff+uC2fD3NV1ymYqTlPudxD0WrMKVtMgXk=; b=QluOGqu7IRlOQ/XipkCLSFgs7T +lvEK7Cx9iz4yriCO+PKj4uKCHIsj1T/Bx/jNFjcYkOVFm6YewIEvU4rxFrCf/JAtQkAGeJM4EY/7 IhaBId0gqmgqBR4qMIvM/tZEXojJbBTzckCVNegCKsz4Ys1vvqyHzGCeS+ABorpMeGDs=; Received: from p200300cadf03580000000000000005bb.dip0.t-ipconnect.de ([2003:ca:df03:5800::5bb] helo=localhost.localdomain) by ds12 with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1xXkcY-009vfL-1s for linux-wireless@vger.kernel.org; Sun, 29 Nov 2026 20:31:34 +0100 From: Felix Fietkau To: linux-wireless@vger.kernel.org Subject: [PATCH mt76-next 08/20] wifi: mt76: mt7925: mask the LDPC capabilities of an AP peer Date: Sun, 29 Nov 2026 20:31:18 +0100 Message-ID: <20261129193131.3367661-8-nbd@nbd.name> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261129193131.3367661-1-nbd@nbd.name> References: <20261129193131.3367661-1-nbd@nbd.name> X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit mt7925_mcu_sta_ht_tlv(), mt7925_mcu_sta_vht_tlv() and mt7925_mcu_sta_he_tlv() send the capabilities of the peer link unchanged. mac80211 keeps the AP's own setting in ht_ldpc, vht_ldpc and he_ldpc of the link conf alone. An AP configured without LDPC can thus send LDPC frames to an LDPC peer. On an AP, clear each LDPC bit where the conf of the peer's link has no LDPC for that mode. mt7996 does the same. Other interface types keep the peer's bits, since mac80211 sets these link conf fields for an AP alone. Fixes: c948b5da6bbe ("wifi: mt76: mt7925: add Mediatek Wi-Fi7 driver for mt7925 chips") Signed-off-by: Felix Fietkau --- .../net/wireless/mediatek/mt76/mt7925/mcu.c | 34 ++++++++++++++----- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c index a1c0633b9a4f..5eb6a2047045 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c @@ -1921,12 +1921,14 @@ mt7925_mcu_set_bss_pm(struct mt792x_dev *dev, } static void -mt7925_mcu_sta_he_tlv(struct sk_buff *skb, struct ieee80211_link_sta *link_sta) +mt7925_mcu_sta_he_tlv(struct sk_buff *skb, struct ieee80211_bss_conf *link_conf, + struct ieee80211_link_sta *link_sta) { if (!link_sta->he_cap.has_he) return; - mt76_connac_mcu_sta_he_tlv_v2(skb, link_sta, true); + mt76_connac_mcu_sta_he_tlv_v2(skb, link_sta, + mt76_connac_mcu_he_ldpc(link_conf)); } static void @@ -1975,23 +1977,30 @@ mt7925_mcu_sta_eht_tlv(struct sk_buff *skb, struct ieee80211_link_sta *link_sta) } static void -mt7925_mcu_sta_ht_tlv(struct sk_buff *skb, struct ieee80211_link_sta *link_sta) +mt7925_mcu_sta_ht_tlv(struct sk_buff *skb, struct ieee80211_bss_conf *link_conf, + struct ieee80211_link_sta *link_sta) { + u16 cap = link_sta->ht_cap.cap; struct sta_rec_ht *ht; struct tlv *tlv; if (!link_sta->ht_cap.ht_supported) return; + if (!mt76_connac_mcu_ht_ldpc(link_conf)) + cap &= ~IEEE80211_HT_CAP_LDPC_CODING; + tlv = mt76_connac_mcu_add_tlv(skb, STA_REC_HT, sizeof(*ht)); ht = (struct sta_rec_ht *)tlv; - ht->ht_cap = cpu_to_le16(link_sta->ht_cap.cap); + ht->ht_cap = cpu_to_le16(cap); } static void -mt7925_mcu_sta_vht_tlv(struct sk_buff *skb, struct ieee80211_link_sta *link_sta) +mt7925_mcu_sta_vht_tlv(struct sk_buff *skb, struct ieee80211_bss_conf *link_conf, + struct ieee80211_link_sta *link_sta) { + u32 cap = link_sta->vht_cap.cap; struct sta_rec_vht *vht; struct tlv *tlv; @@ -1999,10 +2008,13 @@ mt7925_mcu_sta_vht_tlv(struct sk_buff *skb, struct ieee80211_link_sta *link_sta) if (!link_sta->he_6ghz_capa.capa && !link_sta->vht_cap.vht_supported) return; + if (!mt76_connac_mcu_vht_ldpc(link_conf)) + cap &= ~IEEE80211_VHT_CAP_RXLDPC; + tlv = mt76_connac_mcu_add_tlv(skb, STA_REC_VHT, sizeof(*vht)); vht = (struct sta_rec_vht *)tlv; - vht->vht_cap = cpu_to_le32(link_sta->vht_cap.cap); + vht->vht_cap = cpu_to_le32(cap); vht->vht_rx_mcs_map = link_sta->vht_cap.vht_mcs.rx_mcs_map; vht->vht_tx_mcs_map = link_sta->vht_cap.vht_mcs.tx_mcs_map; } @@ -2310,6 +2322,7 @@ mt7925_mcu_sta_cmd(struct mt76_phy *phy, struct mt792x_link_sta *pending) { struct mt792x_vif *mvif = (struct mt792x_vif *)info->vif->drv_priv; + struct ieee80211_bss_conf *link_conf; struct mt76_dev *dev = phy->dev; struct mt792x_bss_conf *mconf; struct mt792x_link_sta *mlink; @@ -2328,15 +2341,18 @@ mt7925_mcu_sta_cmd(struct mt76_phy *phy, CONN_STATE_DISCONNECT; if (info->enable && info->link_sta) { + link_conf = mt792x_vif_to_bss_conf(info->vif, + info->link_sta->link_id); + mt76_connac_mcu_sta_basic_tlv(dev, skb, info->link_conf, info->link_sta, conn_state, info->newly); mt7925_mcu_sta_phy_tlv(skb, info->vif, info->link_sta); - mt7925_mcu_sta_ht_tlv(skb, info->link_sta); - mt7925_mcu_sta_vht_tlv(skb, info->link_sta); + mt7925_mcu_sta_ht_tlv(skb, link_conf, info->link_sta); + mt7925_mcu_sta_vht_tlv(skb, link_conf, info->link_sta); mt76_connac_mcu_sta_uapsd(skb, info->vif, info->link_sta->sta); mt7925_mcu_sta_amsdu_tlv(skb, info->vif, info->link_sta, mlink); - mt7925_mcu_sta_he_tlv(skb, info->link_sta); + mt7925_mcu_sta_he_tlv(skb, link_conf, info->link_sta); mt7925_mcu_sta_he_6g_tlv(skb, info->link_sta); mt7925_mcu_sta_eht_tlv(skb, info->link_sta); mt7925_mcu_sta_rate_ctrl_tlv(skb, info->vif, -- 2.47.3