From patchwork Thu Apr 7 14:30:20 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: 8773501 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: X-Original-To: patchwork-linux-wireless@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 7FBFCC0553 for ; Thu, 7 Apr 2016 14:30:57 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 90CCA20251 for ; Thu, 7 Apr 2016 14:30:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A537620172 for ; Thu, 7 Apr 2016 14:30:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756074AbcDGOay (ORCPT ); Thu, 7 Apr 2016 10:30:54 -0400 Received: from wolverine02.qualcomm.com ([199.106.114.251]:54937 "EHLO wolverine02.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753684AbcDGOax (ORCPT ); Thu, 7 Apr 2016 10:30:53 -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=1460039453; x=1491575453; h=from:to:cc:subject:date:message-id:mime-version; bh=ToaZgMc8PajN8dJMbeCNBvnEXEUyqQeSeFXwuFo1oSM=; b=Bjt3XeesryzyRrsRhEwZsjzW1dxiD1zgp2rleu/PLJ+4e7+ztQV13iqK 2uXtZBH6ZjBsuyMiGzlHpAbziF133D1hCiTm1QWe/GlwzS6xcWfEMBxK8 wL5B3RSthax2Wdy5Ftp/aA9wvGkQX2V8XwIy9fOKf6hgI9rABU2s6CBcj k=; X-IronPort-AV: E=Sophos;i="5.24,449,1455004800"; d="scan'208";a="278137718" Received: from ironmsg03-r-new.qualcomm.com (HELO Ironmsg03-R.qualcomm.com) ([10.53.140.107]) by wolverine02.qualcomm.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 07 Apr 2016 07:30:52 -0700 X-IronPort-AV: E=McAfee;i="5700,7163,8128"; a="1117661517" Received: from nasanexm01b.na.qualcomm.com ([10.85.0.82]) by Ironmsg03-R.qualcomm.com with ESMTP/TLS/RC4-SHA; 07 Apr 2016 07:30:52 -0700 Received: from aphydexm01b.ap.qualcomm.com (10.252.127.11) by NASANEXM01B.na.qualcomm.com (10.85.0.82) with Microsoft SMTP Server (TLS) id 15.0.1130.7; Thu, 7 Apr 2016 07:30:48 -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; Thu, 7 Apr 2016 20:00:34 +0530 Received: by qcmail1.qualcomm.com (sSMTP sendmail emulation); Thu, 07 Apr 2016 20:00:21 +0530 From: Mohammed Shafi Shajakhan To: Johannes Berg CC: , Mohammed Shafi Shajakhan Subject: [PATCH v4] iw: Add support for NL80211_STA_INFO_RX_DURATION netlink attribute Date: Thu, 7 Apr 2016 20:00:20 +0530 Message-ID: <1460039420-5418-1-git-send-email-mohammed@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: NASANEXM01G.na.qualcomm.com (10.85.0.33) 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 Add support for new netlink attribute 'NL80211_STA_INFO_RX_DURATION'. 'NL80211_STA_INFO_RX_DURATION' accounts for aggregate PPDU duration in microseconds for all the frames from a peer. Drivers can fill 'rx_duration' field and set the flag 'NL80211_STA_INFO_RX_DURATION'. 'rx_duration' will give an idea about the total time spent by our peer with each of its connected peers. This will get dumped as part of '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..991b3ce 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: aggregate PPDU duration(usecs) for all the + * frames from a peer * @__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;