From 4e22953eb171d432afd394af03423cee70ec8858 Mon Sep 17 00:00:00 2001 From: Ansuel Smith Date: Sun, 6 Dec 2020 02:11:16 +0100 Subject: 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 --- iwinfo_cli.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'iwinfo_cli.c') 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), -- cgit v1.2.1