From patchwork Wed Nov 1 20:01:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Lamparter X-Patchwork-Id: 10037035 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 83B2A6032D for ; Wed, 1 Nov 2017 20:02:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6E7CD28BA0 for ; Wed, 1 Nov 2017 20:02:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 634F028BA7; Wed, 1 Nov 2017 20:02:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B486F28BA0 for ; Wed, 1 Nov 2017 20:02:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755035AbdKAUCB (ORCPT ); Wed, 1 Nov 2017 16:02:01 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:55383 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751587AbdKAUCB (ORCPT ); Wed, 1 Nov 2017 16:02:01 -0400 Received: by mail-wm0-f67.google.com with SMTP id y83so6988814wmc.4 for ; Wed, 01 Nov 2017 13:02:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=XrjP8NWXD+L2Gk8n4/R6h0vzGV7BjWkujhnesGYEliU=; b=EWUD1hqozFHBynjpGXhbOZ/bGzmrAlgGdI+rpqoCRqYf53rxWWvc8hhJWqA1FgdCsG sfYPk3VN4VzpYwCut8eZww56WDAd9DvrDBSRM0WbB+dXAlIpliC8gHxPwLadAvg77L8g fgP8UafT9AVvK/J+LnAgh+jdOkyUTpmmfTEpVDqiqwgQbTZMAF//Wu3F60KHuaWNlCQ6 MTUWZfb0pzcbvyfRA3md0sKEpeijtthKTxqLF5sOfJfJbDovZEpXHJtb3OWMrdp6kXWJ uQc84VjQ36Mqaqq3RQ16qqTAiiG0K16wZ/Hfz7p3UhLplh6uYmC+nGRV+s1kRZwPR5dX 5vXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=XrjP8NWXD+L2Gk8n4/R6h0vzGV7BjWkujhnesGYEliU=; b=nj33bxw7u/rjUlqYo4ufcSJhvo/ZTxGTGS9xqSfwzE7JK0CJwouXdrvoXDzcWyq0K4 4pUfrGwb7cTA42PISDxfthpVqwexlDas4rkVkjv/w1qfSNkcO371fyE7sM8l3FK8iEuf hHmJoaYJQ+QR7E+AeeXXkNgd1XdVCF2+7WV5/Qg6dmfmL+7h5bcUrSck1GIxhrgDhXOx ZPXC5CbmbyMswALaSTOOKkG+/5COW+pGCx4NR7U2WIf4YinQXooCFyeOCtLMd9enJqcw eeieAxXEuiXsoDAFMD7XQtiF3xrK3rozD2BtpnrzLq8kKPi91IYaNqydnrrlOdeLF5mP lf0Q== X-Gm-Message-State: AMCzsaVRExUDVIByXBPBlv2IMLMUE/m9aHrSYDeos0YmZWk5fzewxI6E ax6OQejTKOJV0QwPbyjdvbYvVW7p X-Google-Smtp-Source: ABhQp+ShOHtx8TF2MyJl9AoxEh4RVC2sWwrJP5slZKFu5Rs0UIdjPLzrd51ZHKkT/saMsWrasas6hQ== X-Received: by 10.28.66.144 with SMTP id k16mr1105266wmi.35.1509566519381; Wed, 01 Nov 2017 13:01:59 -0700 (PDT) Received: from debian64.daheim (p5B0D7D2B.dip0.t-ipconnect.de. [91.13.125.43]) by smtp.gmail.com with ESMTPSA id 56sm906856wrx.2.2017.11.01.13.01.57 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2017 13:01:58 -0700 (PDT) Received: from chuck by debian64.daheim with local (Exim 4.89) (envelope-from ) id 1e9zD3-00073m-6x; Wed, 01 Nov 2017 21:01:57 +0100 From: Christian Lamparter To: linux-wireless@vger.kernel.org Cc: Kalle Valo Subject: [PATCH] ath10k: fix recent bandwidth conversion bug Date: Wed, 1 Nov 2017 21:01:57 +0100 Message-Id: <20171101200157.27096-1-chunkeey@gmail.com> X-Mailer: git-send-email 2.15.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The commit "cfg80211: make RATE_INFO_BW_20 the default" changed the index of RATE_INFO_BW_20, but the updates to ath10k missed the special bandwidth calculation case in ath10k_update_per_peer_tx_stats(). Fixes: 842be75c77cb ("cfg80211: make RATE_INFO_BW_20 the default") Signed-off-by: Christian Lamparter --- drivers/net/wireless/ath/ath10k/htt_rx.c | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/htt_rx.c b/drivers/net/wireless/ath/ath10k/htt_rx.c index a3f5dc78353f..26b0d201a698 100644 --- a/drivers/net/wireless/ath/ath10k/htt_rx.c +++ b/drivers/net/wireless/ath/ath10k/htt_rx.c @@ -592,6 +592,9 @@ struct amsdu_subframe_hdr { #define GROUP_ID_IS_SU_MIMO(x) ((x) == 0 || (x) == 63) +static const u8 ath10k_bw_to_mac80211[] = { RATE_INFO_BW_20, RATE_INFO_BW_40, + RATE_INFO_BW_80, RATE_INFO_BW_160 }; + static void ath10k_htt_rx_h_rates(struct ath10k *ar, struct ieee80211_rx_status *status, struct htt_rx_desc *rxd) @@ -694,23 +697,7 @@ static void ath10k_htt_rx_h_rates(struct ath10k *ar, if (sgi) status->enc_flags |= RX_ENC_FLAG_SHORT_GI; - switch (bw) { - /* 20MHZ */ - case 0: - break; - /* 40MHZ */ - case 1: - status->bw = RATE_INFO_BW_40; - break; - /* 80MHZ */ - case 2: - status->bw = RATE_INFO_BW_80; - break; - case 3: - status->bw = RATE_INFO_BW_160; - break; - } - + status->bw = ath10k_bw_to_mac80211[bw]; status->encoding = RX_ENC_VHT; break; default: @@ -2297,7 +2284,7 @@ ath10k_update_per_peer_tx_stats(struct ath10k *ar, arsta->txrate.flags |= RATE_INFO_FLAGS_SHORT_GI; arsta->txrate.nss = txrate.nss; - arsta->txrate.bw = txrate.bw + RATE_INFO_BW_20; + arsta->txrate.bw = ath10k_bw_to_mac80211[txrate.bw]; } static void ath10k_htt_fetch_peer_stats(struct ath10k *ar,