From patchwork Tue Mar 29 08:54:01 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mohammed Shafi Shajakhan X-Patchwork-Id: 8684031 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 08A829F30C for ; Tue, 29 Mar 2016 08:54:31 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1FD1A201FE for ; Tue, 29 Mar 2016 08:54:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DC0A0201B9 for ; Tue, 29 Mar 2016 08:54:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756162AbcC2Iy2 (ORCPT ); Tue, 29 Mar 2016 04:54:28 -0400 Received: from wolverine01.qualcomm.com ([199.106.114.254]:25143 "EHLO wolverine01.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751368AbcC2Iy0 (ORCPT ); Tue, 29 Mar 2016 04:54:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=qti.qualcomm.com; i=@qti.qualcomm.com; q=dns/txt; s=qcdkim; t=1459241665; x=1490777665; h=from:to:cc:subject:date:message-id:mime-version; bh=CmOhF5D6LsrgQhocLINxoa/NSr4ugPNTrHasjA89IJ4=; b=QNTGD6x9Esi0oomrO2CEnEiNyU0nJbFcNo3Yd57807MtfaElMrmKZBMR X2mCladWhj/nrLncP4GKOPOCxji4hNHl27R2crFyVhwcw1bvVY/pJvz+b XkQzcDzWvHU2lZJYUyYM92N61OhMOodFtBhbA7TSksjz4Ifs2lIpyqP4Z g=; X-IronPort-AV: E=Sophos;i="5.24,410,1455004800"; d="scan'208";a="180537164" Received: from unknown (HELO Ironmsg04-L.qualcomm.com) ([10.53.140.111]) by wolverine01.qualcomm.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 29 Mar 2016 01:54:25 -0700 From: Mohammed Shafi Shajakhan X-IronPort-AV: E=McAfee;i="5700,7163,8118"; a="1091837842" Received: from nasanexm02h.na.qualcomm.com ([10.85.0.89]) by Ironmsg04-L.qualcomm.com with ESMTP/TLS/RC4-SHA; 29 Mar 2016 01:54:24 -0700 Received: from aphydexm01b.ap.qualcomm.com (10.252.127.11) by nasanexm02h.na.qualcomm.com (10.85.0.89) with Microsoft SMTP Server (TLS) id 15.0.1130.7; Tue, 29 Mar 2016 01:54:24 -0700 Received: from qcmail1.qualcomm.com (10.80.80.8) by aphydexm01b.ap.qualcomm.com (10.252.127.11) with Microsoft SMTP Server (TLS) id 15.0.1130.7; Tue, 29 Mar 2016 14:24:13 +0530 Received: by qcmail1.qualcomm.com (sSMTP sendmail emulation); Tue, 29 Mar 2016 14:24:07 +0530 To: CC: Kalle Valo , , , , "Mohammed Shafi Shajakhan" Subject: [PATCH v3 1/2] ath10k: Add support for ath10k_sta_statistics support Date: Tue, 29 Mar 2016 14:24:01 +0530 Message-ID: <1459241642-3730-1-git-send-email-mohammed@qca.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 aphydexm01b.ap.qualcomm.com (10.252.127.11) Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Mohammed Shafi Shajakhan Enable support for 'drv_sta_statistics' callback. Export rx_duration support if available to cfg80211/nl80211 This can also act as a placeholder for any new per STA stats support Signed-off-by: Mohammed Shafi Shajakhan --- [v3] removed conditions for ath10k state checks based on Michal's suggestion Dependencies: 1. cfg80211/nl80211: Add support for NL80211_STA_INFO_RX_DURATION (under review) 2. iw: Add support for NL80211_STA_INFO_RX_DURATION netlink attribute (under review) 3. ath10k: Enable debugfs provision to enable Peer Stats feature (merged in pending branch) drivers/net/wireless/ath/ath10k/debug.h | 4 ++++ drivers/net/wireless/ath/ath10k/debugfs_sta.c | 14 ++++++++++++++ drivers/net/wireless/ath/ath10k/mac.c | 1 + 3 files changed, 19 insertions(+) diff --git a/drivers/net/wireless/ath/ath10k/debug.h b/drivers/net/wireless/ath/ath10k/debug.h index 6206edd..01c500f 100644 --- a/drivers/net/wireless/ath/ath10k/debug.h +++ b/drivers/net/wireless/ath/ath10k/debug.h @@ -155,6 +155,10 @@ ath10k_debug_get_new_fw_crash_data(struct ath10k *ar) void ath10k_sta_add_debugfs(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_sta *sta, struct dentry *dir); void ath10k_sta_update_rx_duration(struct ath10k *ar, struct list_head *peer); +void ath10k_sta_statistics(struct ieee80211_hw *hw, struct ieee80211_vif *vif, + struct ieee80211_sta *sta, + struct station_info *sinfo); + #else static inline void ath10k_sta_update_rx_duration(struct ath10k *ar, struct list_head *peer) diff --git a/drivers/net/wireless/ath/ath10k/debugfs_sta.c b/drivers/net/wireless/ath/ath10k/debugfs_sta.c index 67ef75b..c5396bf 100644 --- a/drivers/net/wireless/ath/ath10k/debugfs_sta.c +++ b/drivers/net/wireless/ath/ath10k/debugfs_sta.c @@ -35,6 +35,20 @@ void ath10k_sta_update_rx_duration(struct ath10k *ar, struct list_head *head) rcu_read_unlock(); } +void ath10k_sta_statistics(struct ieee80211_hw *hw, struct ieee80211_vif *vif, + struct ieee80211_sta *sta, + struct station_info *sinfo) +{ + struct ath10k_sta *arsta = (struct ath10k_sta *)sta->drv_priv; + struct ath10k *ar = arsta->arvif->ar; + + if (!ath10k_peer_stats_enabled(ar)) + return; + + sinfo->rx_duration = arsta->rx_duration; + sinfo->filled |= 1ULL << NL80211_STA_INFO_RX_DURATION; +} + static ssize_t ath10k_dbg_sta_read_aggr_mode(struct file *file, char __user *user_buf, size_t count, loff_t *ppos) diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index 20d72e2..02edeff 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -7271,6 +7271,7 @@ static const struct ieee80211_ops ath10k_ops = { #endif #ifdef CONFIG_MAC80211_DEBUGFS .sta_add_debugfs = ath10k_sta_add_debugfs, + .sta_statistics = ath10k_sta_statistics, #endif };