Showing DFS channels in iwinfo and LuCI

I'd like to add support to iwinfo and LuCI to show which 5GHz wifi channels are DFS. I was thinking it would be appropriate to show it in iwinfo freqlist, and have (DFS) show up beside the channel name in the dropdown list in LuCI. Any tips? Tagging @jow, since I noticed you are the author of iwinfo :grin:

I noticed we can already get DFS channels for the current regulatory domain from iw, so this shouldn't be impossible to do, right? iw phy1 info pulls this

		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] (20.0 dBm) (radar detection)
			* 5280 MHz [56] (20.0 dBm) (radar detection)
			* 5300 MHz [60] (20.0 dBm) (radar detection)
			* 5320 MHz [64] (20.0 dBm) (radar detection)
			* 5500 MHz [100] (27.0 dBm) (radar detection)
			* 5520 MHz [104] (27.0 dBm) (radar detection)
			* 5540 MHz [108] (27.0 dBm) (radar detection)
			* 5560 MHz [112] (27.0 dBm) (radar detection)
			* 5580 MHz [116] (27.0 dBm) (radar detection)
			* 5600 MHz [120] (disabled)
			* 5620 MHz [124] (disabled)
			* 5640 MHz [128] (disabled)
			* 5660 MHz [132] (27.0 dBm) (radar detection)
			* 5680 MHz [136] (27.0 dBm) (radar detection)
			* 5700 MHz [140] (27.0 dBm) (radar detection)
			* 5720 MHz [144] (27.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)

DFS channels are predefined, we already know what they are (52-144).
You don't need to interpret any rules for this.

The reg rules only dictate whether a country is allowed to use them or not. And if they're not allowed to use them, they don't show up in the output of freqlist.

Unless I'm missing the point?

That is not quite true. The channels you are actually allowed and able to use, is the intersection of channels allowed by the regulatory domain burned into all of their OTP/ (E)EPROM information (in case you have cards made for differing regions in one system), the OS default configuration and your current location (the later expecting you to change it, if you're traveling). As a result, one wireless card with a chinese regulatory domain and another with a US one[0] leaves you with basically no 5 GHz channels at your disposal.

As a result you can't really tell in advance what channels are possible to select in advance, given the hardware regdom and the configured software regdom.

--
[0] yes, wrongly programmed has been a major issue in many routers OpenWrt has been dealing with, that's why OpenWrt reluctantly defaults to a custom patch making it possible to override/ ignore the hardware's regdom settings for ath9k/ ath10k/ ath10k-ct (not for other hardware), as with was a major issue before.

1 Like