summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAleksander Jan Bajkowski2025-03-15 14:00:32 +0000
committerRobert Marko2025-11-07 11:21:23 +0000
commit40563018dc8792239b2e903e514d9b8bc9528d30 (patch)
treea7fbc3b331885d9f3b232952ef9cc518da92b2ff
parent904f114548bac1e21f49f0bf1e16ebd8ac907885 (diff)
downloadiwinfo-40563018dc8792239b2e903e514d9b8bc9528d30.tar.gz
iwinfo: print HT operation only if present
HT Operation is empty in the 6GHz band, where only 802.11 ax (HE) and 802.11 be (EHT) are allowed, and in 802.11 legacy modes. Example: Cell 19 - Address: xx:xx:xx:xx:xx:xx ESSID: "OpenWrt" Mode: Master Frequency: 5.955 GHz Band: 6 GHz Channel: 1 Signal: -20 dBm Quality: 70/70 Encryption: WPA3 SAE (CCMP) HT Operation: Primary Channel: 0 Secondary Channel Offset: no secondary Channel Width: 20 MHz HE Operation: Center Frequency 1: 7 Center Frequency 2: 15 Channel Width: 160 MHz EHT Operation: Center Frequency 1: 15 Center Frequency 2: 31 Channel Width: 320 MHz Fixes: ea28dfb5f957 ("iwinfo: export ht and vht operation in scan results") Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl> Link: https://github.com/openwrt/iwinfo/pull/21 Signed-off-by: Robert Marko <robimarko@gmail.com>
-rw-r--r--iwinfo_cli.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/iwinfo_cli.c b/iwinfo_cli.c
index 6f87d98..0966d1b 100644
--- a/iwinfo_cli.c
+++ b/iwinfo_cli.c
@@ -700,13 +700,15 @@ static void print_scanlist(const struct iwinfo_ops *iw, const char *ifname)
format_quality_max(e->quality_max));
printf(" Encryption: %s\n",
format_encryption(&e->crypto));
- printf(" HT Operation:\n");
- printf(" Primary Channel: %d\n",
- e->ht_chan_info.primary_chan);
- printf(" Secondary Channel Offset: %s\n",
- ht_secondary_offset[e->ht_chan_info.secondary_chan_off]);
- printf(" Channel Width: %s\n",
- format_chan_width(false, e->ht_chan_info.chan_width));
+ if (e->ht_chan_info.primary_chan) {
+ printf(" HT Operation:\n");
+ printf(" Primary Channel: %d\n",
+ e->ht_chan_info.primary_chan);
+ printf(" Secondary Channel Offset: %s\n",
+ ht_secondary_offset[e->ht_chan_info.secondary_chan_off]);
+ printf(" Channel Width: %s\n",
+ format_chan_width(false, e->ht_chan_info.chan_width));
+ }
if (e->vht_chan_info.center_chan_1) {
printf(" VHT Operation:\n");