linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: linux-wireless@vger.kernel.org
Cc: Jan Fuchs <jf@simonwunderlich.de>,
	Johannes Berg <johannes.berg@intel.com>
Subject: [PATCH] iw: survey: add support for radio stats
Date: Fri, 29 Oct 2021 09:29:39 +0200	[thread overview]
Message-ID: <20211029072939.15767-1-johannes@sipsolutions.net> (raw)

From: Johannes Berg <johannes.berg@intel.com>

Add a --radio argument to "survey dump" to support the global
radio statistics.

Change-Id: I16e615434607d982e9cf690f03148738eca25cde
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 survey.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/survey.c b/survey.c
index 9325353e4ba1..7f5385e30ba5 100644
--- a/survey.c
+++ b/survey.c
@@ -71,10 +71,20 @@ static int handle_survey_dump(struct nl80211_state *state,
 			      int argc, char **argv,
 			      enum id_input id)
 {
+	if (argc > 1)
+		return HANDLER_RET_USAGE;
+
+	if (argc) {
+		if (!strcmp(argv[0], "--radio"))
+			nla_put_flag(msg, NL80211_ATTR_SURVEY_RADIO_STATS);
+		else
+			return HANDLER_RET_USAGE;
+	}
+
 	register_handler(print_survey_handler, NULL);
 	return 0;
 }
-COMMAND(survey, dump, NULL,
+COMMAND(survey, dump, "[--radio]",
 	NL80211_CMD_GET_SURVEY, NLM_F_DUMP, CIB_NETDEV, handle_survey_dump,
 	"List all gathered channel survey data");
 
-- 
2.31.1


             reply	other threads:[~2021-10-29  7:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-29  7:29 Johannes Berg [this message]
2021-10-29  8:46 ` [PATCH] iw: survey: add support for radio stats Sven Eckelmann

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=20211029072939.15767-1-johannes@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=jf@simonwunderlich.de \
    --cc=johannes.berg@intel.com \
    --cc=linux-wireless@vger.kernel.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).