From patchwork Tue Oct 18 09:31:25 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: akolli@qti.qualcomm.com X-Patchwork-Id: 9381693 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 8B6F3607D0 for ; Tue, 18 Oct 2016 09:33:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7AB1128F2B for ; Tue, 18 Oct 2016 09:33:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6D8DD28F6C; Tue, 18 Oct 2016 09:33:05 +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 AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 019B928F2B for ; Tue, 18 Oct 2016 09:33:05 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bwQlX-0002gH-2n; Tue, 18 Oct 2016 09:32:59 +0000 Received: from wolverine02.qualcomm.com ([199.106.114.251]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bwQl1-0002TN-PT for ath10k@lists.infradead.org; Tue, 18 Oct 2016 09:32:28 +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=1476783147; x=1508319147; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=5dL/jpPXwf/Ii5lrPYhMdxFZC5GU5RllK0B++r5DRi0=; b=f/gBleMzI8hVqH2UTsET+o8uQ3IF1cSnkL8Io9FT4lZOtxglhQn7wU24 QQcQwaMnqRJrSU7mUga0mXBcCHlhDDWAB3dhcw1KxGq3NEdpKlIikw+0R MCA+PiTU3WSdryMmsWCW0/9n5ksgF/F/AyE1eGgmnXu+mhswSc75Y1/8T o=; X-IronPort-AV: E=Sophos;i="5.31,361,1473145200"; d="scan'208";a="327909329" Received: from unknown (HELO Ironmsg03-L.qualcomm.com) ([10.53.140.110]) by wolverine02.qualcomm.com with ESMTP; 18 Oct 2016 02:32:07 -0700 X-IronPort-AV: E=McAfee;i="5700,7163,8321"; a="1244325311" Received: from nasanexm01d.na.qualcomm.com ([10.85.0.84]) by Ironmsg03-L.qualcomm.com with ESMTP/TLS/RC4-SHA; 18 Oct 2016 02:32:06 -0700 Received: from aphydexm01a.ap.qualcomm.com (10.252.127.10) by NASANEXM01D.na.qualcomm.com (10.85.0.84) with Microsoft SMTP Server (TLS) id 15.0.1178.4; Tue, 18 Oct 2016 02:32:05 -0700 Received: from localhost (10.80.80.8) by aphydexm01a.ap.qualcomm.com (10.252.127.10) with Microsoft SMTP Server (TLS) id 15.0.1178.4; Tue, 18 Oct 2016 15:01:59 +0530 From: To: Subject: [PATCHv2 2/2] ath10k: add support for per sta tx bitrate Date: Tue, 18 Oct 2016 15:01:25 +0530 Message-ID: <1476783085-10724-3-git-send-email-akolli@qti.qualcomm.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1476783085-10724-1-git-send-email-akolli@qti.qualcomm.com> References: <1476783085-10724-1-git-send-email-akolli@qti.qualcomm.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanexm01a.na.qualcomm.com (10.85.0.81) To aphydexm01a.ap.qualcomm.com (10.252.127.10) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161018_023228_017132_33C8E92C X-CRM114-Status: UNSURE ( 6.68 ) X-CRM114-Notice: Please train this message. X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Anilkumar Kolli , akolli@codeaurora.org, linux-wireless@vger.kernel.org Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Anilkumar Kolli Per STA tx bitrate info is filled from peer stats. Export per sta txrate info to cfg80211/nl80211 Signed-off-by: Anilkumar Kolli --- v2: * addressed kalle's comments drivers/net/wireless/ath/ath10k/debugfs_sta.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/net/wireless/ath/ath10k/debugfs_sta.c b/drivers/net/wireless/ath/ath10k/debugfs_sta.c index 9955fea0802a..fce6f8137d33 100644 --- a/drivers/net/wireless/ath/ath10k/debugfs_sta.c +++ b/drivers/net/wireless/ath/ath10k/debugfs_sta.c @@ -77,6 +77,19 @@ void ath10k_sta_statistics(struct ieee80211_hw *hw, struct ieee80211_vif *vif, sinfo->rx_duration = arsta->rx_duration; sinfo->filled |= 1ULL << NL80211_STA_INFO_RX_DURATION; + + if (!arsta->txrate.legacy && !arsta->txrate.nss) + return; + + if (arsta->txrate.legacy) { + sinfo->txrate.legacy = arsta->txrate.legacy; + } else { + sinfo->txrate.mcs = arsta->txrate.mcs; + sinfo->txrate.nss = arsta->txrate.nss; + sinfo->txrate.bw = arsta->txrate.bw; + } + sinfo->txrate.flags = arsta->txrate.flags; + sinfo->filled |= 1ULL << NL80211_STA_INFO_TX_BITRATE; } static ssize_t ath10k_dbg_sta_read_aggr_mode(struct file *file,