All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Wunderlich <simon.wunderlich@s2003.tu-chemnitz.de>
To: linux-wireless@vger.kernel.org
Cc: johannes@sipsolutions.net, victorg@ti.com,
	linville@tuxdriver.com, kgiori@qca.qualcomm.com,
	zefir.kurtisi@neratec.com, adrian@freebsd.org, j@w1.fi,
	coelho@ti.com, igalc@ti.com, nbd@nbd.name,
	mathias.kretschmer@fokus.fraunhofer.de,
	Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Subject: [PATCH 2/2] iw: print DFS states for channels if available
Date: Mon,  4 Feb 2013 13:50:00 +0100	[thread overview]
Message-ID: <1359982200-2321-6-git-send-email-siwu@hrz.tu-chemnitz.de> (raw)
In-Reply-To: <1359982200-2321-1-git-send-email-siwu@hrz.tu-chemnitz.de>

Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
---
 info.c |   25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/info.c b/info.c
index 14db37f..bcf36d7 100644
--- a/info.c
+++ b/info.c
@@ -49,6 +49,20 @@ static char *cipher_name(__u32 c)
 	}
 }
 
+static char *dfs_state_name(enum nl80211_dfs_state state)
+{
+	switch (state) {
+	case NL80211_DFS_USABLE:
+		return "usable";
+	case NL80211_DFS_AVAILABLE:
+		return "available";
+	case NL80211_DFS_UNAVAILABLE:
+		return "unavailable";
+	default:
+		return "unknown";
+	}
+}
+
 static int print_phy_handler(struct nl_msg *msg, void *arg)
 {
 	struct nlattr *tb_msg[NL80211_ATTR_MAX + 1];
@@ -147,6 +161,17 @@ static int print_phy_handler(struct nl_msg *msg, void *arg)
  next:
 			if (open)
 				printf(")");
+			if (tb_freq[NL80211_FREQUENCY_ATTR_DFS_STATE]) {
+				enum nl80211_dfs_state state = nla_get_u32(tb_freq[NL80211_FREQUENCY_ATTR_DFS_STATE]);
+				unsigned long time;
+
+				printf(" DFS state: %s", dfs_state_name(state));
+				if (tb_freq[NL80211_FREQUENCY_ATTR_DFS_TIME]) {
+					time = nla_get_u32(tb_freq[NL80211_FREQUENCY_ATTR_DFS_TIME]);
+					printf(" (for %lu sec)", time/1000);
+				}
+			}
+
 			printf("\n");
 		}
 
-- 
1.7.10.4


  parent reply	other threads:[~2013-02-04 12:50 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-04 12:49 [PATCHv8 0/3] Add DFS master ability Simon Wunderlich
2013-02-04 12:49 ` [PATCHv8 1/3] nl80211/cfg80211: add radar detection command/event Simon Wunderlich
2013-02-06 17:24   ` Johannes Berg
2013-02-07 11:00     ` Simon Wunderlich
2013-02-07 11:07       ` Johannes Berg
2013-02-04 12:49 ` [PATCHv8 2/3] mac80211: " Simon Wunderlich
2013-02-06 17:33   ` Johannes Berg
2013-02-07 11:08     ` Simon Wunderlich
2013-02-06 17:36   ` Johannes Berg
2013-02-07 11:10     ` Simon Wunderlich
2013-02-04 12:49 ` [PATCHv8 3/3] nl80211: allow DFS in start_ap Simon Wunderlich
2013-02-06 17:36   ` Johannes Berg
2013-02-07 11:11     ` Simon Wunderlich
2013-02-04 12:49 ` [PATCH 1/2] iw: add radar detect widths to phy info Simon Wunderlich
2013-02-04 12:50 ` Simon Wunderlich [this message]
2013-02-07 18:38 [PATCHv9 0/3] Add DFS master ability Simon Wunderlich
2013-02-07 18:38 ` [PATCH 2/2] iw: print DFS states for channels if available Simon Wunderlich
2013-02-08 17:16 [PATCHv10 0/2] Add DFS master ability Simon Wunderlich
2013-02-08 17:16 ` [PATCH 2/2] iw: print DFS states for channels if available Simon Wunderlich

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=1359982200-2321-6-git-send-email-siwu@hrz.tu-chemnitz.de \
    --to=simon.wunderlich@s2003.tu-chemnitz.de \
    --cc=adrian@freebsd.org \
    --cc=coelho@ti.com \
    --cc=igalc@ti.com \
    --cc=j@w1.fi \
    --cc=johannes@sipsolutions.net \
    --cc=kgiori@qca.qualcomm.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=mathias.kretschmer@fokus.fraunhofer.de \
    --cc=nbd@nbd.name \
    --cc=siwu@hrz.tu-chemnitz.de \
    --cc=victorg@ti.com \
    --cc=zefir.kurtisi@neratec.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.