Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp855705ybz; Wed, 22 Apr 2020 09:08:58 -0700 (PDT) X-Google-Smtp-Source: APiQypL6K0eS8RFXWLGm8IPbMgwJno+h743a/9ayIPk1w5X7xARW9jioy7UU46odqSn1f2AQ+okj X-Received: by 2002:a50:cf4d:: with SMTP id d13mr24486920edk.175.1587571737925; Wed, 22 Apr 2020 09:08:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587571737; cv=none; d=google.com; s=arc-20160816; b=u8y74I5oIrL/hZnxYTQ3nx4HVKB644QceReMFViuDF1cG3dPzvpnleBlFhajHLZQ0O LcQF8xvr7rNebPisnXEPTU/aE3SJ+eVL7+UhCrDBJspOzn/G5ZODeZX9JQeR5J06231F Fz9VUrgne+DYG3c7CAWOJwk3NPnNpWmefTnBG7iOAH9tzQox0KxgGly5MCo9K45gUVEG lBuuk8+MswdBD9t9ZPXn+wcYctcl/C7UwT0eqCNFAzr15DPA3lkTJ50gihllmMMk5B/X BM9/8LvmFckKiHMlmqClhrcDKNXoKbZo8zRSF+jYhyhiuvoiXC60ff3OVBgsdU7WfYx+ PUdQ== 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 :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=MLVyKSueW3g8Ghtf0CERdlKOYJQk5qx2Ro/KWEtTQxs=; b=YQi4WL0J9tFEKPGFJ8toGwJmeEPJqOfmu8tAhpOYGPaHnGgyEyTmvtPtQux9kYwHCV iPaEdYGIp8MDdMPKQiGqEFqRrV8wQW4CiAnE592Ie8iQzlcR4OujAREZhcvhyz/uNzcs v9xxzEpmZhBatmMnqd4twPN8rBmxwfemzdJk6Ut+MTRG9mBr7UevU+G7aizmf6hrtdRR 2+UxRJI5abysfKAIYRfvRt6mg3MKdbyV9mHPNgDbgFDLwHYtv3HOIaH2G6fB7eM6P2+O Yi1GdGiO+iEDF9X6WQeAUwvtkJT2Plpg7sJMaHtOs7vLsLuekEAsUbX5Uuzqzo1Pkv9h qvGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=uEZ+K5RN; 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 f5si3748754edm.270.2020.04.22.09.08.32; Wed, 22 Apr 2020 09:08:57 -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=uEZ+K5RN; 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 S1726918AbgDVQE4 (ORCPT + 99 others); Wed, 22 Apr 2020 12:04:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726824AbgDVQEm (ORCPT ); Wed, 22 Apr 2020 12:04:42 -0400 Received: from nbd.name (nbd.name [IPv6:2a01:4f8:221:3d45::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 23D7FC03C1AB 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: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=MLVyKSueW3g8Ghtf0CERdlKOYJQk5qx2Ro/KWEtTQxs=; b=uEZ+K5RNsKlb7kt1Uj6+05NC/W 6biVDcmfXCAluQkTsvPQi/Z9zaza6WYWx4ZNJOFJXsfeYfgUjA8uHunzxiZHnyvwLE9ZuIjC2+6OR DbtAvuqZ+nHyITp0G/RG1pKQnCmp27/gGTj+zc8jRC1WbZIbxYeizbsU2wRE5MLFE4hQ=; 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-00054m-7v for linux-wireless@vger.kernel.org; Wed, 22 Apr 2020 18:04:39 +0200 Received: by maeck.lan (Postfix, from userid 501) id 9E6EB841962B; Wed, 22 Apr 2020 18:04:38 +0200 (CEST) From: Felix Fietkau To: linux-wireless@vger.kernel.org Subject: [PATCH 8/9] mt76: mt7615: fix tx status rate index calculation Date: Wed, 22 Apr 2020 18:04:36 +0200 Message-Id: <20200422160437.99466-8-nbd@nbd.name> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20200422160437.99466-1-nbd@nbd.name> References: <20200422160437.99466-1-nbd@nbd.name> 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 A switch from one rate index to the next only happens when tx count from the current slot is greater than MT7615_RATE_RETRY, which is 1 has to be subtracted from count, instead of added to it. Signed-off-by: Felix Fietkau --- drivers/net/wireless/mediatek/mt76/mt7615/mac.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mac.c b/drivers/net/wireless/mediatek/mt76/mt7615/mac.c index 89aed6d67de0..e7a76032caff 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7615/mac.c +++ b/drivers/net/wireless/mediatek/mt76/mt7615/mac.c @@ -1148,7 +1148,7 @@ static bool mt7615_fill_txs(struct mt7615_dev *dev, struct mt7615_sta *sta, if (ampdu || (info->flags & IEEE80211_TX_CTL_AMPDU)) info->flags |= IEEE80211_TX_STAT_AMPDU | IEEE80211_TX_CTL_AMPDU; - first_idx = max_t(int, 0, last_idx - (count + 1) / MT7615_RATE_RETRY); + first_idx = max_t(int, 0, last_idx - (count - 1) / MT7615_RATE_RETRY); if (fixed_rate && !probe) { info->status.rates[0].count = count; -- 2.24.0