diff options
author | Ansuel Smith <ansuelsmth@gmail.com> | 2020-12-06 02:11:16 +0100 |
---|---|---|
committer | Daniel Golle <daniel@makrotopia.org> | 2021-01-05 22:19:43 +0000 |
commit | 4e22953eb171d432afd394af03423cee70ec8858 (patch) | |
tree | 804e898398d72d0e537f05559a4a4b5d22ceeef5 /iwinfo_cli.c | |
parent | ea28dfb5f9578294919ca4087f281cbdd45f68a9 (diff) | |
download | iwinfo-4e22953eb171d432afd394af03423cee70ec8858.tar.gz |
iwinfo: export center_chan info for local wifi
Iwinfo already export the htmode but there is no way to know where the
channel expan in case a 40Mhz+ channel width is used. Export the center
channels used by the driver to better know the channel utilizzation of
the wifi.
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
Diffstat (limited to 'iwinfo_cli.c')
-rw-r--r-- | iwinfo_cli.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/iwinfo_cli.c b/iwinfo_cli.c index ca003c4..35cc380 100644 --- a/iwinfo_cli.c +++ b/iwinfo_cli.c @@ -445,6 +445,24 @@ static char * print_channel(const struct iwinfo_ops *iw, const char *ifname) return format_channel(ch); } +static char * print_center_chan1(const struct iwinfo_ops *iw, const char *ifname) +{ + int ch; + if (iw->center_chan1(ifname, &ch)) + ch = -1; + + return format_channel(ch); +} + +static char * print_center_chan2(const struct iwinfo_ops *iw, const char *ifname) +{ + int ch; + if (iw->center_chan2(ifname, &ch)) + ch = -1; + + return format_channel(ch); +} + static char * print_frequency(const struct iwinfo_ops *iw, const char *ifname) { int freq; @@ -566,6 +584,11 @@ static void print_info(const struct iwinfo_ops *iw, const char *ifname) print_mode(iw, ifname), print_channel(iw, ifname), print_frequency(iw, ifname)); + if (iw->center_chan1 != NULL) { + printf(" Center Channel 1: %s", + print_center_chan1(iw, ifname)); + printf(" 2: %s\n", print_center_chan2(iw, ifname)); + } printf(" Tx-Power: %s Link Quality: %s/%s\n", print_txpower(iw, ifname), print_quality(iw, ifname), |