From patchwork Wed Mar 2 14:08:57 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: 8480921 Return-Path: X-Original-To: patchwork-ath10k@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 7318BC0554 for ; Wed, 2 Mar 2016 14:10:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F35042035E for ; Wed, 2 Mar 2016 14:09:54 +0000 (UTC) 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.kernel.org (Postfix) with ESMTPS id 123262038E for ; Wed, 2 Mar 2016 14:09:54 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ab7Sy-0002Ln-Ad; Wed, 02 Mar 2016 14:09:28 +0000 Received: from wolverine01.qualcomm.com ([199.106.114.254]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ab7Sw-0002AT-Px for ath10k@lists.infradead.org; Wed, 02 Mar 2016 14:09:27 +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=1456927766; x=1488463766; h=from:to:cc:subject:date:message-id:mime-version; bh=aG7mn/EB2R6OFQ1tULaPLGSI4KSpO5JTqhjkdbnAKD4=; b=Q3rVKauSyf3GwAYFBd4NyQvnF0pQ3LpP+qeB7VmOBYBn2Y3NfFzpftGk +Z4M0zQ0TA4YWQrVNchPaC063QS0yHQ0qxXcv1Pisnuze75YJY6Pyu2ct oB0p909LF/wKIfRmCCkok0Eu3NLOOrOObHiB8WXGm+NCjy2wrL5T3i71g 4=; X-IronPort-AV: E=Sophos;i="5.22,529,1449561600"; d="scan'208";a="173422281" Received: from ironmsg04-l-new.qualcomm.com (HELO Ironmsg04-L.qualcomm.com) ([10.53.140.111]) by wolverine01.qualcomm.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 02 Mar 2016 06:09:26 -0800 From: Mohammed Shafi Shajakhan X-IronPort-AV: E=McAfee;i="5700,7163,8091"; a="1074579433" Received: from nasanexm01h.na.qualcomm.com ([10.85.0.34]) by Ironmsg04-L.qualcomm.com with ESMTP/TLS/RC4-SHA; 02 Mar 2016 06:09:26 -0800 Received: from aphydexm01b.ap.qualcomm.com (10.252.127.11) by NASANEXM01H.na.qualcomm.com (10.85.0.34) with Microsoft SMTP Server (TLS) id 15.0.1130.7; Wed, 2 Mar 2016 06:09:24 -0800 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; Wed, 2 Mar 2016 19:39:15 +0530 Received: by qcmail1.qualcomm.com (sSMTP sendmail emulation); Wed, 02 Mar 2016 19:38:58 +0530 To: Subject: [PATCH] iw: Add support for NL80211_STA_INFO_RX_DURATION netlink attribute Date: Wed, 2 Mar 2016 19:38:57 +0530 Message-ID: <1456927737-32111-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: NASANEXM01F.na.qualcomm.com (10.85.0.32) To aphydexm01b.ap.qualcomm.com (10.252.127.11) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160302_060926_998987_D2DF1E9C X-CRM114-Status: UNSURE ( 8.19 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -7.0 (-------) 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: mohammed@codeaurora.org, johannes@sipsolutions.net, kvalo@codeaurora.org, ath10k@lists.infradead.org, Mohammed Shafi Shajakhan Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,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 parsing per station rx-duration (usecs) via adding support for new netlink attribute NL80211_STA_INFO_RX_DURATION rx_duration is total air time(usecs) for unicast data/management frames from the connected client. This will get dumped as part ofi iw dev wlan#N station dump Signed-off-by: Mohammed Shafi Shajakhan --- nl80211.h | 3 +++ station.c | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/nl80211.h b/nl80211.h index 5b7b5eb..f510206 100644 --- a/nl80211.h +++ b/nl80211.h @@ -2464,6 +2464,8 @@ enum nl80211_sta_bss_param { * TID+1 and the special TID 16 (i.e. value 17) is used for non-QoS frames; * each one of those is again nested with &enum nl80211_tid_stats * attributes carrying the actual values. + * @NL80210_STA_INFO_RX_DURATION: total rx time(usecs) spent for receiving data + * frames from this peer. This is driver/firmware implementation specific * @__NL80211_STA_INFO_AFTER_LAST: internal * @NL80211_STA_INFO_MAX: highest possible station info attribute */ @@ -2500,6 +2502,7 @@ enum nl80211_sta_info { NL80211_STA_INFO_BEACON_RX, NL80211_STA_INFO_BEACON_SIGNAL_AVG, NL80211_STA_INFO_TID_STATS, + NL80211_STA_INFO_RX_DURATION, /* keep last */ __NL80211_STA_INFO_AFTER_LAST, diff --git a/station.c b/station.c index b5ccf4a..a730db1 100644 --- a/station.c +++ b/station.c @@ -147,6 +147,7 @@ static int print_sta_handler(struct nl_msg *msg, void *arg) [NL80211_STA_INFO_NONPEER_PM] = { .type = NLA_U32}, [NL80211_STA_INFO_CHAIN_SIGNAL] = { .type = NLA_NESTED }, [NL80211_STA_INFO_CHAIN_SIGNAL_AVG] = { .type = NLA_NESTED }, + [NL80211_STA_INFO_RX_DURATION] = { .type = NLA_U64 }, }; char *chain; @@ -226,6 +227,10 @@ static int print_sta_handler(struct nl_msg *msg, void *arg) printf("\n\trx bitrate:\t%s", buf); } + if (sinfo[NL80211_STA_INFO_RX_DURATION]) + printf("\n\trx duration:\t%lld us", + (unsigned long long)nla_get_u64(sinfo[NL80211_STA_INFO_RX_DURATION])); + if (sinfo[NL80211_STA_INFO_EXPECTED_THROUGHPUT]) { uint32_t thr;