Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp855696ybz; Wed, 22 Apr 2020 09:08:57 -0700 (PDT) X-Google-Smtp-Source: APiQypKhhCH5Pj2dW9ZgLGSiCz78wD+TXDA0hY8cIrlIin/+By8EHv0P/Not28IJW7hmERcdGK6V X-Received: by 2002:a17:906:b253:: with SMTP id ce19mr28120259ejb.341.1587571737594; 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=t2W/629Rjqw9hSwWJ68G2vwYn70TOZo7dvzt6FXsmHET8mzu9BmCRkJeB6ExNT+x91 KcEn9h373mPlOjws8j/XXsG2I3iA84K6aPb/7lYd5SykZQ6zrSKrtsAzSBqWu1rlJivI l0tM275iGmGcTUCjLQtuvcs1J0gA+3E3PpsUPYpxsHc7yCg8sUKeZyVWNN4066Dzb76j c1+OlwUAHPwlqBRu0qJEZgQPtWKr+VmYANO0Gwp2NbaDy21gAM2x53Jp9eVCKF066vS0 qzHOj64Cufw9g394cM/r5aXeu+QvKK3s/2fuwNfRncJ1zVbidiTrhm350aX7qcOT1Bak 5rZg== 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=O7OEWZz/V093YzEN6g78eygkdViNYsfwSl2F1NNMdDk=; b=cX5wjOBlHMDH12+TRkfqm6m19RUWQIxwK2EYHHpHsE5JWvnx7xN2HEMBR8jutVQtOb rdsWRTmZCqJ0UAQr6pJ3euk4KjOWTVWrxpuEjkz95k6otDTkgnQQ2DwzATs7EdA5Oi1F g3jasTNBhwGRX/N9+rCtNdl4rA9yWF5+UybA+p0VPF89AeF3qLQq8qMiew5ZbAfXt6at S704DKDmiZWQXXO82HMXuk6pl5/LPbmi1rEfXCyxY8Um+FHNsghC44ItTaOR7WRk2fZ6 2oyoUAdFgQNCFk/MZhNL9r2Rzzk3XWqGbhuyahlVMcB9iCK48OMoE/H9qkoNSj9cX2m+ 5JDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=S8hVauPr; 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 i24si3976222edy.602.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=S8hVauPr; 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 S1726896AbgDVQEy (ORCPT + 99 others); Wed, 22 Apr 2020 12:04:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60558 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726840AbgDVQEm (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 3A278C03C1AE 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=O7OEWZz/V093YzEN6g78eygkdViNYsfwSl2F1NNMdDk=; b=S8hVauPrDfWZLXaLCWj57HIXRp IT/F5jh8Kro7LdGjCcyGDT/C7SiMSTsWlbbDLwkdDiYGbS8PyaFjRqOBCgzvXUPr1RDaoSfGY7DH/ 9jA+8OgojY0+nZ6++ybzQO/0QkMJusUBUrnrNxGjcX37Oqd8jIprmh3Sd9p9PoNQ2av0=; 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-00054q-79 for linux-wireless@vger.kernel.org; Wed, 22 Apr 2020 18:04:39 +0200 Received: by maeck.lan (Postfix, from userid 501) id 9E05B841962A; Wed, 22 Apr 2020 18:04:38 +0200 (CEST) From: Felix Fietkau To: linux-wireless@vger.kernel.org Subject: [PATCH 9/9] mt76: mt7603: fix tx status rate index calculation Date: Wed, 22 Apr 2020 18:04:37 +0200 Message-Id: <20200422160437.99466-9-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/mt7603/mac.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7603/mac.c b/drivers/net/wireless/mediatek/mt76/mt7603/mac.c index d34828715e1c..f8c0c957ca01 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7603/mac.c +++ b/drivers/net/wireless/mediatek/mt76/mt7603/mac.c @@ -1103,7 +1103,7 @@ mt7603_fill_txs(struct mt7603_dev *dev, struct mt7603_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) / MT7603_RATE_RETRY); + first_idx = max_t(int, 0, last_idx - (count - 1) / MT7603_RATE_RETRY); if (fixed_rate && !probe) { info->status.rates[0].count = count; -- 2.24.0