[OpenWrt-Devel] iwinfo: DFS channels are not listed

Martin Matějek martin.matejek at gmx.com
Thu Jun 11 11:55:22 EDT 2020


Hi,

DFS channels are not marked as DFS, even though iw will detect that just
fine.

Getting frequencies list through ubus/iwinfo will result in this output

# iwinfo wlan0 freqlist
  2.412 GHz (Channel 1)
  2.417 GHz (Channel 2)
  2.422 GHz (Channel 3)
  2.427 GHz (Channel 4)
  2.432 GHz (Channel 5)
  2.437 GHz (Channel 6)
  2.442 GHz (Channel 7)
  2.447 GHz (Channel 8)
  2.452 GHz (Channel 9)
  2.457 GHz (Channel 10)
  2.462 GHz (Channel 11)
  5.180 GHz (Channel 36)
  5.200 GHz (Channel 40)
  5.220 GHz (Channel 44)
  5.240 GHz (Channel 48)
  5.260 GHz (Channel 52)
  5.280 GHz (Channel 56)
  5.300 GHz (Channel 60)
  5.320 GHz (Channel 64)
  5.500 GHz (Channel 100)
  5.520 GHz (Channel 104)
  5.540 GHz (Channel 108)
  5.560 GHz (Channel 112)
  5.580 GHz (Channel 116)
  5.600 GHz (Channel 120)
  5.620 GHz (Channel 124)
  5.640 GHz (Channel 128)
  5.660 GHz (Channel 132)
  5.680 GHz (Channel 136)
  5.700 GHz (Channel 140)
  5.720 GHz (Channel 144)
  5.745 GHz (Channel 149)
  5.765 GHz (Channel 153)
  5.785 GHz (Channel 157)
  5.805 GHz (Channel 161)
  5.825 GHz (Channel 165)

However iw will correctly return DFS flags

# iw list

Frequencies:
 * 5180 MHz [36] (23.0 dBm)
 * 5200 MHz [40] (23.0 dBm)
 * 5220 MHz [44] (23.0 dBm)
 * 5240 MHz [48] (23.0 dBm)
 * 5260 MHz [52] (23.0 dBm) (radar detection)
 * 5280 MHz [56] (23.0 dBm) (radar detection)
 * 5300 MHz [60] (23.0 dBm) (radar detection)
 * 5320 MHz [64] (23.0 dBm) (radar detection)
 * 5500 MHz [100] (23.0 dBm) (radar detection)
 * 5520 MHz [104] (23.0 dBm) (radar detection)
 * 5540 MHz [108] (23.0 dBm) (radar detection)
 * 5560 MHz [112] (23.0 dBm) (radar detection)
 * 5580 MHz [116] (23.0 dBm) (radar detection)
 * 5600 MHz [120] (23.0 dBm) (radar detection)
 * 5620 MHz [124] (23.0 dBm) (radar detection)
 * 5640 MHz [128] (23.0 dBm) (radar detection)
 * 5660 MHz [132] (23.0 dBm) (radar detection)
 * 5680 MHz [136] (23.0 dBm) (radar detection)
 * 5700 MHz [140] (23.0 dBm) (radar detection)
 * 5720 MHz [144] (23.0 dBm) (radar detection)
 * 5745 MHz [149] (30.0 dBm)
 * 5765 MHz [153] (30.0 dBm)
 * 5785 MHz [157] (30.0 dBm)
 * 5805 MHz [161] (30.0 dBm)
 * 5825 MHz [165] (30.0 dBm)
 * 5845 MHz [169] (disabled)
 * 5865 MHz [173] (disabled)

This is probably due to certain condition in iwinfo/src/iwinfo_nl80211.c
line 2757

e->restricted = (
	freqs[NL80211_FREQUENCY_ATTR_NO_IR] &&
	!freqs[NL80211_FREQUENCY_ATTR_RADAR]
) ? 1 : 0;


I'm not entirely sure what restricted is supposed to mean in this context.
Perhaps it could be handy to add radar boolean flag (or something
similar) to struct iwinfo_freqlist_entry, that would be independent of
NL80211_FREQUENCY_ATTR_NO_IR.
That would of course mean breaking/extending ABI and I'm not sure if
that won't break other code as well.

I have already prepared such changes and I can send a patch, but I would
like to know first if this is the correct way to address this.

Regards
Martin

_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list