diff --git a/package/network/config/wifi-scripts/files-ucode/usr/bin/iwinfo b/package/network/config/wifi-scripts/files-ucode/usr/bin/iwinfo index d36268b06e9..8bda0bd15f5 100755 --- a/package/network/config/wifi-scripts/files-ucode/usr/bin/iwinfo +++ b/package/network/config/wifi-scripts/files-ucode/usr/bin/iwinfo @@ -95,23 +95,32 @@ function print_scan(cells) { if (cell.vht) { printf('\t VHT Operation:\n'); - printf('\t\tCenter Frequency 1: %d\n', cell.vht.center_chan_1); - printf('\t\tCenter Frequency 2: %s\n', cell.vht.center_chan_2); - printf('\t\tChannel Width: %s\n', cell.vht.chan_width); + if (cell.vht.center_chan_1) + printf('\t\tCenter Frequency 1: %d\n', cell.vht.center_chan_1); + if (cell.vht.center_chan_2) + printf('\t\tCenter Frequency 2: %d\n', cell.vht.center_chan_2); + if (cell.vht.chan_width) + printf('\t\tChannel Width: %s\n', cell.vht.chan_width); } if (cell.he) { printf('\t HE Operation:\n'); - printf('\t\tCenter Frequency 1: %d\n', cell.he.center_chan_1); - printf('\t\tCenter Frequency 2: %s\n', cell.he.center_chan_2); - printf('\t\tChannel Width: %s\n', cell.he.chan_width); + if (cell.he.center_chan_1) + printf('\t\tCenter Frequency 1: %d\n', cell.he.center_chan_1); + if (cell.he.center_chan_2) + printf('\t\tCenter Frequency 2: %d\n', cell.he.center_chan_2); + if (cell.he.chan_width) + printf('\t\tChannel Width: %s\n', cell.he.chan_width); } if (cell.eht) { printf('\t EHT Operation:\n'); - printf('\t\tCenter Frequency 1: %d\n', cell.eht.center_chan_1); - printf('\t\tCenter Frequency 2: %s\n', cell.eht.center_chan_2); - printf('\t\tChannel Width: %s\n', cell.eht.chan_width); + if (cell.eht.center_chan_1) + printf('\t\tCenter Frequency 1: %d\n', cell.eht.center_chan_1); + if (cell.eht.center_chan_2) + printf('\t\tCenter Frequency 2: %d\n', cell.eht.center_chan_2); + if (cell.eht.chan_width) + printf('\t\tChannel Width: %s\n', cell.eht.chan_width); } printf('\n');