Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp853409ybz; Wed, 22 Apr 2020 09:06:55 -0700 (PDT) X-Google-Smtp-Source: APiQypIHOBDwGew3WFt81yocW0xL2ie6XjrrRG66OTunbnV1QYrwVpaNpFfYwnEprl9o5M05Mx7Q X-Received: by 2002:a17:906:1e47:: with SMTP id i7mr2517266ejj.61.1587571615266; Wed, 22 Apr 2020 09:06:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587571615; cv=none; d=google.com; s=arc-20160816; b=DWsWZ9SB9O83H2E6AVr9yVGkO806ZG3MKd/UdCUwnolDQcijBz8pH9Z5/vxFVggI/H Cqvf4NBG2meaMAJMNenZOAklPP/8D6mAqHObETpIG67rHx3hMOe7kKiFnFzSpq9pEgF/ At1zwWq3/Z9fvrzAXFTH/BCwgcxwEWjrVBhL3YE/H/IwwQlJvt4Sqi2PpteOeZBg+IZI dHKZ6AY5wGtdFW2IOxCg63gHUtD5Byw4XEQ0L/HQln0UuEdabtqES9KaU24RSQF1AuzC +Odxsv8PeQHN8A93f59KqwLR11wW7oXO82qNGL2JXDgxbUkVcxZgvDGgVvmmgUgBluiD XSIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:to:from:dkim-signature; bh=PD2DnRFiUh11u2brxoiZ+EAM/06AKtDIb0VtWF+o4qs=; b=ai22YwAc/OatSJ6LGPxw6QQ1Pc1ROjK/F+5anky9Otnt8d15ob7DPPG6ULtkwbyC8B dtDXn5o5PbNUI7KVkPa/a1f0I4rMNVeophyMr/iLmEbMgxXYW2Rpu1WoGhyJiieNeyuA CcU9y0LW++oTKjzWf8uQ4fb/fyMs6Q3bSxSKR8UgbkCk2he+f8cgDXnXPctmMXl6ROPL /7Yiaxl3pM5/ssOQMZJAmS7VRRw3sIKKt6v/vQlVzGGL7HCUv+U4qDuLC2uxIRaXDXE0 SO64OFmxXKpHMXpmlQj3j8z1kVAuuXXZI00L07ZQVlpWoi2pw/fex2ii7gICvhHGPotj YycQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=jlyz5ouj; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o19si3827172ejm.258.2020.04.22.09.06.30; Wed, 22 Apr 2020 09:06:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=jlyz5ouj; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726801AbgDVQEv (ORCPT + 99 others); Wed, 22 Apr 2020 12:04:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60562 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726850AbgDVQEn (ORCPT ); Wed, 22 Apr 2020 12:04:43 -0400 Received: from nbd.name (nbd.name [IPv6:2a01:4f8:221:3d45::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 47A00C08C5F2 for ; Wed, 22 Apr 2020 09:04:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=Content-Transfer-Encoding:MIME-Version: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: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=PD2DnRFiUh11u2brxoiZ+EAM/06AKtDIb0VtWF+o4qs=; b=jlyz5oujN2q2lMXdCd3Apx+h/x hSQwdjkcqzgSzUNBvf6Ptj8i6dfCAkq3d2Niboqq9RkXBU0wlqbTaz9Y3OdsPCGQHW8gh7t+vVCNg 6CUzjKv/jfA+DOXyAO/ihTtQGsUa0Lrv5pgDdLh7ydgTsYEcAOkyB7IEP6evnUQAyULQ=; Received: from p54ae965b.dip0.t-ipconnect.de ([84.174.150.91] helo=maeck.lan) by ds12 with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1jRHrb-00054p-5P for linux-wireless@vger.kernel.org; Wed, 22 Apr 2020 18:04:39 +0200 Received: by maeck.lan (Postfix, from userid 501) id 9F3F9841962D; Wed, 22 Apr 2020 18:04:38 +0200 (CEST) From: Felix Fietkau To: linux-wireless@vger.kernel.org Subject: [PATCH 1/9] mt76: mt7615: fix sta ampdu factor for VHT Date: Wed, 22 Apr 2020 18:04:29 +0200 Message-Id: <20200422160437.99466-1-nbd@nbd.name> X-Mailer: git-send-email 2.24.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org If VHT has a larger A-MPDU size limit, pass it to the MCU via the wtbl_ht TLV element. Signed-off-by: Felix Fietkau --- drivers/net/wireless/mediatek/mt76/mt7615/mcu.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c index dc297856b749..24b78d10d7f7 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c @@ -924,11 +924,10 @@ mt7615_mcu_wtbl_ht_tlv(struct sk_buff *skb, struct ieee80211_sta *sta, void *sta_wtbl, void *wtbl_tlv) { struct tlv *tlv; + struct wtbl_ht *ht = NULL; u32 flags = 0; if (sta->ht_cap.ht_supported) { - struct wtbl_ht *ht; - tlv = mt7615_mcu_add_nested_tlv(skb, WTBL_HT, sizeof(*ht), wtbl_tlv, sta_wtbl); ht = (struct wtbl_ht *)tlv; @@ -945,6 +944,7 @@ mt7615_mcu_wtbl_ht_tlv(struct sk_buff *skb, struct ieee80211_sta *sta, if (sta->vht_cap.vht_supported) { struct wtbl_vht *vht; + u8 af; tlv = mt7615_mcu_add_nested_tlv(skb, WTBL_VHT, sizeof(*vht), wtbl_tlv, sta_wtbl); @@ -952,6 +952,13 @@ mt7615_mcu_wtbl_ht_tlv(struct sk_buff *skb, struct ieee80211_sta *sta, vht->ldpc = sta->vht_cap.cap & IEEE80211_VHT_CAP_RXLDPC, vht->vht = 1; + af = (sta->vht_cap.cap & + IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_MASK) >> + IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_SHIFT; + + if (ht) + ht->af = max(ht->af, af); + if (sta->vht_cap.cap & IEEE80211_VHT_CAP_SHORT_GI_80) flags |= MT_WTBL_W5_SHORT_GI_80; if (sta->vht_cap.cap & IEEE80211_VHT_CAP_SHORT_GI_160) -- 2.24.0