From patchwork Tue Nov 15 16:38:49 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: 9430199 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 45F3760484 for ; Tue, 15 Nov 2016 16:38:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 34C9628590 for ; Tue, 15 Nov 2016 16:38:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 274F7284D9; Tue, 15 Nov 2016 16:38:01 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 A1D75284D9 for ; Tue, 15 Nov 2016 16:38:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752376AbcKOQh6 (ORCPT ); Tue, 15 Nov 2016 11:37:58 -0500 Received: from wolverine01.qualcomm.com ([199.106.114.254]:46657 "EHLO wolverine01.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751088AbcKOQh6 (ORCPT ); Tue, 15 Nov 2016 11:37:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=qti.qualcomm.com; i=@qti.qualcomm.com; q=dns/txt; s=qcdkim; t=1479227878; x=1510763878; h=from:to:cc:subject:date:message-id:mime-version; bh=r0sNTxK6FsdZ7pvuI3VkxjouIDQI8NY+p8oxuklYC4Q=; b=QFLR7HqnVL0RbuJG1OI5R7pO+hBXyB7YJjOLFaZ2Gli+1B0vMq47FRqQ vM68BJ/6urZdi7SWoxBjwZSlmr8G7x+U1P+Me0GSgO/GgJGZ0dW59judU EiBt6BHv5UGJnkjSphQ/NljSDCfGwbLVBY7U4W9jrCzEXlWOFNqJRYdlR 0=; X-IronPort-AV: E=Sophos;i="5.31,495,1473145200"; d="scan'208";a="240458053" Received: from unknown (HELO Ironmsg04-L.qualcomm.com) ([10.53.140.111]) by wolverine01.qualcomm.com with ESMTP; 15 Nov 2016 08:37:57 -0800 X-IronPort-AV: E=McAfee;i="5700,7163,8349"; a="1238524658" Received: from nasanexm01f.na.qualcomm.com ([10.85.0.32]) by Ironmsg04-L.qualcomm.com with ESMTP/TLS/RC4-SHA; 15 Nov 2016 08:37:57 -0800 Received: from aphydexm01f.ap.qualcomm.com (10.252.127.15) by NASANEXM01F.na.qualcomm.com (10.85.0.32) with Microsoft SMTP Server (TLS) id 15.0.1178.4; Tue, 15 Nov 2016 08:37:56 -0800 Received: from localhost (10.80.80.8) by aphydexm01f.ap.qualcomm.com (10.252.127.15) with Microsoft SMTP Server (TLS) id 15.0.1178.4; Tue, 15 Nov 2016 22:07:50 +0530 From: To: CC: , , Anilkumar Kolli Subject: [PATCHv3 2/2] ath10k: add support for per sta tx bitrate Date: Tue, 15 Nov 2016 22:08:49 +0530 Message-ID: <1479227929-10142-1-git-send-email-akolli@qti.qualcomm.com> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: NASANEXM01B.na.qualcomm.com (10.85.0.82) To aphydexm01f.ap.qualcomm.com (10.252.127.15) 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 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: * address 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,