* [PATCH v2] iw: display allowable channel bandwidth information
@ 2015-03-04 7:04 Ashok Raj Nagarajan
2015-03-17 10:18 ` Johannes Berg
0 siblings, 1 reply; 2+ messages in thread
From: Ashok Raj Nagarajan @ 2015-03-04 7:04 UTC (permalink / raw)
To: johannes; +Cc: linux-wireless, rmanohar, vthiagar, Ashok Raj Nagarajan
We already have allowable channel bandwidth information at userspace.
Display this information with 'iw list'. Excerpt of iw list command
Frequencies:
* 5180 MHz [36] (17.0 dBm)
(10MHZ, 20MHZ, HT40+, VHT80, VHT160)
* 5200 MHz [40] (17.0 dBm)
(10MHZ, 20MHZ, HT40-, HT40+, VHT80, VHT160)
Signed-off-by: Ashok Raj Nagarajan <arnagara@qti.qualcomm.com>
---
v2:
Display channel bw information in separate line (Johannes)
Updated commit log to reflect above change.
info.c | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/info.c b/info.c
index 1df503f..728cb87 100644
--- a/info.c
+++ b/info.c
@@ -189,6 +189,31 @@ next:
printf(")");
printf("\n");
+ if (!tb_freq[NL80211_FREQUENCY_ATTR_DISABLED]) {
+ open = 0;
+ printf("\t\t\t ");
+ if (!tb_freq[NL80211_FREQUENCY_ATTR_NO_10MHZ])
+ print_flag("10MHz", &open);
+
+ if (!tb_freq[NL80211_FREQUENCY_ATTR_NO_20MHZ])
+ print_flag("20MHz", &open);
+
+ if (!tb_freq[NL80211_FREQUENCY_ATTR_NO_HT40_MINUS])
+ print_flag("HT40-", &open);
+
+ if (!tb_freq[NL80211_FREQUENCY_ATTR_NO_HT40_PLUS])
+ print_flag("HT40+", &open);
+
+ if (!tb_freq[NL80211_FREQUENCY_ATTR_NO_80MHZ])
+ print_flag("VHT80", &open);
+
+ if (!tb_freq[NL80211_FREQUENCY_ATTR_NO_160MHZ])
+ print_flag("VHT160", &open);
+ if (open)
+ printf(")");
+ printf("\n");
+ }
+
if (!tb_freq[NL80211_FREQUENCY_ATTR_DISABLED] && 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;
--
1.9.1
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH v2] iw: display allowable channel bandwidth information
2015-03-04 7:04 [PATCH v2] iw: display allowable channel bandwidth information Ashok Raj Nagarajan
@ 2015-03-17 10:18 ` Johannes Berg
0 siblings, 0 replies; 2+ messages in thread
From: Johannes Berg @ 2015-03-17 10:18 UTC (permalink / raw)
To: Ashok Raj Nagarajan; +Cc: linux-wireless, rmanohar, vthiagar
On Wed, 2015-03-04 at 12:34 +0530, Ashok Raj Nagarajan wrote:
> We already have allowable channel bandwidth information at userspace.
> Display this information with 'iw list'. Excerpt of iw list command
>
> Frequencies:
> * 5180 MHz [36] (17.0 dBm)
> (10MHZ, 20MHZ, HT40+, VHT80, VHT160)
> * 5200 MHz [40] (17.0 dBm)
> (10MHZ, 20MHZ, HT40-, HT40+, VHT80, VHT160)
>
> Signed-off-by: Ashok Raj Nagarajan <arnagara@qti.qualcomm.com>
> ---
> v2:
> Display channel bw information in separate line (Johannes)
> Updated commit log to reflect above change.
Thanks for the changes.
I was going to apply this, but then I realized that the above example is
probably incorrect, since I'm guessing it was done on a driver that
doesn't actually support 10 MHz? And if it was then it probably also
supported 5 MHz...
Now, the annoying thing is that to display the possible bandwidth we
need to parse a lot more information - i.e. the "supports 5 MHz" and
"supports 10 MHz" flags, along with the HT/VHT information.
The even more annoying thing is that we get that information only in
later nl80211 messages while printing this, so we can no longer parse
things in the right order.
One technical alternative would be to print exactly the attributes, i.e.
"no 5 MHz", "no 10 MHz", etc. instead of inverting and printing what's
supported, but that's perhaps a little too unfriendly for users?
I guess we can first collect all messages and print all the data later,
parsing them first for the capabilities and then the channels, but that
seems like a pretty big code change?
Additionally, the channel display information in "iw list" is getting
pretty big these days. Perhaps we should have a separate command that
prints the channel list with all the detail information, and then that
command can do all of the above?
johannes
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-03-17 10:18 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-04 7:04 [PATCH v2] iw: display allowable channel bandwidth information Ashok Raj Nagarajan
2015-03-17 10:18 ` Johannes Berg
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).