From patchwork Fri Jan 13 10:30:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mohammed Shafi Shajakhan X-Patchwork-Id: 9514989 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 66053601E5 for ; Fri, 13 Jan 2017 10:30:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5B8EF285CB for ; Fri, 13 Jan 2017 10:30:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4EF3D28607; Fri, 13 Jan 2017 10:30:48 +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=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E1347285CB for ; Fri, 13 Jan 2017 10:30:47 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cRz82-0003Hw-Mj; Fri, 13 Jan 2017 10:30:38 +0000 Received: from wolverine01.qualcomm.com ([199.106.114.254]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cRz7y-0002zr-JA for ath10k@lists.infradead.org; Fri, 13 Jan 2017 10:30:36 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=qti.qualcomm.com; i=@qti.qualcomm.com; q=dns/txt; s=qcdkim; t=1484303434; x=1515839434; h=from:to:cc:subject:date:message-id:mime-version; bh=0KV8e0wskxQhwKAlS2lxot+Q79U8VlfMsEzrNJyTE+Q=; b=iLVOWhBMv/injNx/4ylJYD8KBB5Zw64CydL1D5X8tC+7tiKO0+ITO83I fq04pCCk4yxEHqpjpHekAG24OeophNkImXul2zVp6/1caWS645IbB0uU2 U/JjnF1KYMhYBX8oMRN13tZSbATTZws8KoupKpRah4oKDYaMLrdtbgZJG M=; X-IronPort-AV: E=Sophos;i="5.33,221,1477983600"; d="scan'208";a="255256569" Received: from unknown (HELO Ironmsg03-L.qualcomm.com) ([10.53.140.110]) by wolverine01.qualcomm.com with ESMTP; 13 Jan 2017 02:30:13 -0800 From: Mohammed Shafi Shajakhan X-IronPort-AV: E=McAfee;i="5700,7163,8406"; a="1294325178" Received: from nasanexm01b.na.qualcomm.com ([10.85.0.82]) by Ironmsg03-L.qualcomm.com with ESMTP/TLS/RC4-SHA; 13 Jan 2017 02:30:11 -0800 Received: from APSANEXR01B.ap.qualcomm.com (10.85.0.37) by NASANEXM01B.na.qualcomm.com (10.85.0.82) with Microsoft SMTP Server (TLS) id 15.0.1178.4; Fri, 13 Jan 2017 02:30:10 -0800 Received: from qcmail1.qualcomm.com (10.80.80.8) by APSANEXR01B.ap.qualcomm.com (10.85.0.37) with Microsoft SMTP Server (TLS) id 15.0.1178.4; Fri, 13 Jan 2017 02:30:05 -0800 Received: by qcmail1.qualcomm.com (sSMTP sendmail emulation); Fri, 13 Jan 2017 16:00:05 +0530 To: Subject: [PATCH] ath10k: Fix per station tx bit rate reporting Date: Fri, 13 Jan 2017 16:00:03 +0530 Message-ID: <1484303403-8908-1-git-send-email-mohammed@qca.qualcomm.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: NASANEXM01E.na.qualcomm.com (10.85.0.31) To APSANEXR01B.ap.qualcomm.com (10.85.0.37) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170113_023034_751588_39A4497B X-CRM114-Status: UNSURE ( 8.56 ) X-CRM114-Notice: Please train this message. X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mohammed@codeaurora.org, linux-wireless@vger.kernel.org, Mohammed Shafi Shajakhan Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Mohammed Shafi Shajakhan Not clearing the previous tx bit rate status results in a ambigous tx bit rate reporting to mac80211/cfg80211, for example the previous bit rate status would have been marked as legacy rate , while the current rate would have been an HT/VHT rate with the tx bit rate flags set and this results in exporting tx bitrate as legacy rate but with HT/VHT rate flags set, fix this by clearing the tx bitrate status for each event. This also fixes the below warning when we do: iw dev wlan#N station dump WARNING: net/wireless/util.c:1222 cfg80211 [] (warn_slowpath_null) from [] (cfg80211_calculate_bitrate+0x110/0x1f4 [cfg80211]) [] (cfg80211_calculate_bitrate [cfg80211]) from [] (nl80211_put_sta_rate+0x44/0x1dc [cfg80211]) [] (nl80211_put_sta_rate [cfg80211]) from [] (nl80211_set_interface+0x724/0xd70 [cfg80211]) [] (nl80211_set_interface [cfg80211]) from [] (nl80211_dump_station+0xdc/0x100 [cfg80211]) [] (nl80211_dump_station [cfg80211]) Fixes: cec17c382140 ("ath10k: add per peer htt tx stats support for 10.4") Signed-off-by: Mohammed Shafi Shajakhan --- drivers/net/wireless/ath/ath10k/htt_rx.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/wireless/ath/ath10k/htt_rx.c b/drivers/net/wireless/ath/ath10k/htt_rx.c index 0bc7fe8..74b66e5 100644 --- a/drivers/net/wireless/ath/ath10k/htt_rx.c +++ b/drivers/net/wireless/ath/ath10k/htt_rx.c @@ -2231,6 +2231,8 @@ static inline bool is_valid_legacy_rate(u8 rate) return; } + memset(&arsta->txrate, 0, sizeof(arsta->txrate)); + if (txrate.flags == WMI_RATE_PREAMBLE_CCK || txrate.flags == WMI_RATE_PREAMBLE_OFDM) { rate = ATH10K_HW_LEGACY_RATE(peer_stats->ratecode);