linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bruno Randolf <br1@einfach.org>
To: johannes@sipsolutions.net, linville@tuxdriver.com
Cc: nbd@openwrt.org, linux-wireless@vger.kernel.org
Subject: [PATCH 2/4] iw: Add channel busy time to survey
Date: Fri, 07 Jan 2011 15:00:31 +0900	[thread overview]
Message-ID: <20110107060031.21507.10327.stgit@localhost6.localdomain6> (raw)
In-Reply-To: <20110107060025.21507.11061.stgit@localhost6.localdomain6>

Print channel busy time in survey dump.

This patch comes from OpenWRT. Original author: Felix Fietkau.
Fixed up for unsigned values.

Cc: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Bruno Randolf <br1@einfach.org>
---
 survey.c |   19 +++++++++++++++++--
 1 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/survey.c b/survey.c
index 83c54b3..e71d21b 100644
--- a/survey.c
+++ b/survey.c
@@ -44,12 +44,27 @@ static int print_survey_handler(struct nl_msg *msg, void *arg)
 	}
 
 	if (sinfo[NL80211_SURVEY_INFO_FREQUENCY])
-		printf("\tfrequency:\t%u MHz%s\n",
+		printf("\tfrequency:\t\t\t%u MHz%s\n",
 			nla_get_u32(sinfo[NL80211_SURVEY_INFO_FREQUENCY]),
 			sinfo[NL80211_SURVEY_INFO_IN_USE] ? " [in use]" : "");
 	if (sinfo[NL80211_SURVEY_INFO_NOISE])
-		printf("\tnoise:\t\t%d dBm\n",
+		printf("\tnoise:\t\t\t\t%d dBm\n",
 			(int8_t)nla_get_u8(sinfo[NL80211_SURVEY_INFO_NOISE]));
+	if (sinfo[NL80211_SURVEY_INFO_CHANNEL_TIME])
+		printf("\tchannel active time:\t\t%llu ms\n",
+			(uint64_t)nla_get_u64(sinfo[NL80211_SURVEY_INFO_CHANNEL_TIME]));
+	if (sinfo[NL80211_SURVEY_INFO_CHANNEL_TIME_BUSY])
+		printf("\tchannel busy time:\t\t%llu ms\n",
+			(uint64_t)nla_get_u64(sinfo[NL80211_SURVEY_INFO_CHANNEL_TIME_BUSY]));
+	if (sinfo[NL80211_SURVEY_INFO_CHANNEL_TIME_EXT_BUSY])
+		printf("\textension channel busy time:\t%llu ms\n",
+			(uint64_t)nla_get_u64(sinfo[NL80211_SURVEY_INFO_CHANNEL_TIME_EXT_BUSY]));
+	if (sinfo[NL80211_SURVEY_INFO_CHANNEL_TIME_RX])
+		printf("\tchannel receive time:\t\t%llu ms\n",
+			(uint64_t)nla_get_u64(sinfo[NL80211_SURVEY_INFO_CHANNEL_TIME_RX]));
+	if (sinfo[NL80211_SURVEY_INFO_CHANNEL_TIME_TX])
+		printf("\tchannel transmit time:\t\t%llu ms\n",
+			(uint64_t)nla_get_u64(sinfo[NL80211_SURVEY_INFO_CHANNEL_TIME_TX]));
 	return NL_SKIP;
 }
 


  reply	other threads:[~2011-01-07  5:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-07  6:00 [PATCH 1/4] iw: survey: Mark frequency in use Bruno Randolf
2011-01-07  6:00 ` Bruno Randolf [this message]
2011-01-07  6:00 ` [PATCH 3/4] iw: add multicast rates to IBSS join Bruno Randolf
2011-01-07  6:00 ` [PATCH 4/4] iw: Add signal average to station dump information Bruno Randolf
2011-01-07 11:00 ` [PATCH 1/4] iw: survey: Mark frequency in use Johannes Berg
2011-01-08  3:44   ` Bruno Randolf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110107060031.21507.10327.stgit@localhost6.localdomain6 \
    --to=br1@einfach.org \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=nbd@openwrt.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).