summaryrefslogtreecommitdiff
path: root/iwinfo_cli.c
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2015-05-08 13:14:36 +0200
committerJo-Philipp Wich <jow@openwrt.org>2015-05-08 13:29:10 +0200
commit7b39bee1c62dc68c84938cda43115e4d30724d1e (patch)
treeaa0c1961e4320b6eeebf3c0169e984ef99a8c464 /iwinfo_cli.c
parent9842d2507fa19cdf7d0bfd76df73609d14473b49 (diff)
downloadiwinfo-7b39bee1c62dc68c84938cda43115e4d30724d1e.tar.gz
iwinfo: add support for querying available HT modes
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
Diffstat (limited to 'iwinfo_cli.c')
-rw-r--r--iwinfo_cli.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/iwinfo_cli.c b/iwinfo_cli.c
index d9a59e2..ed6be54 100644
--- a/iwinfo_cli.c
+++ b/iwinfo_cli.c
@@ -744,6 +744,23 @@ static void print_countrylist(const struct iwinfo_ops *iw, const char *ifname)
}
}
+static void print_htmodelist(const struct iwinfo_ops *iw, const char *ifname)
+{
+ int i, htmodes = 0;
+
+ if (iw->htmodelist(ifname, &htmodes))
+ {
+ printf("No HT mode information available\n");
+ return;
+ }
+
+ for (i = 0; i < ARRAY_SIZE(IWINFO_HTMODE_NAMES); i++)
+ if (htmodes & (1 << i))
+ printf("%s ", IWINFO_HTMODE_NAMES[i]);
+
+ printf("\n");
+}
+
static void lookup_phy(const struct iwinfo_ops *iw, const char *section)
{
char buf[IWINFO_BUFSIZE];
@@ -781,6 +798,7 @@ int main(int argc, char **argv)
" iwinfo <device> freqlist\n"
" iwinfo <device> assoclist\n"
" iwinfo <device> countrylist\n"
+ " iwinfo <device> htmodelist\n"
" iwinfo <backend> phyname <section>\n"
);
@@ -873,6 +891,10 @@ int main(int argc, char **argv)
print_countrylist(iw, argv[1]);
break;
+ case 'h':
+ print_htmodelist(iw, argv[1]);
+ break;
+
default:
fprintf(stderr, "Unknown command: %s\n", argv[i]);
rv = 1;