Setting DFS channels causes the transmit power setting to be ignored and no SSID to be assigned

Hello,

While experimenting with OpenWrt, I noticed a peculiar behavuiour when selecting 5 GHz channels where DFS is enabled.
I'm using OpenWrt 18.06.2, together with a Compex WLE600VX WNIC (802.11a/b/g/n/ac - supported by ath10k).

In particular, when selecting any 5 GHz channel on which DFS is enabled, I very often observe that the "Transmit Power" setting is ignored (txpower remains 20 dBm) and no SSID is assigned, preventing me from connecting to the Access Point.

I could set the transmit power manually (usingiw dev wlan0 set txpower fixed <value in mBm>), but not from LuCI nor by editing the /etc/config/network file and I could not solve the problem of the SSID not displaying/AP not being properly created.

Only very few times this kind of configuration went fine and I could connect.
In one case, I was automatically switched from channel 52 to channel 100 and I could continue connecting, but it happened only once. In few other cases I even had to reboot OpenWrt, as it started to claim, when looking at dmesg, that no wlan0 interface was available, both from the terminal and when using LuCI.

If I try to select any of the DFS channels with iw dev wlan0 set channel I get instead:
command failed: Invalid argument (-22)

If I use 2.4 GHz channels (802.11n) or 5 GHz channels (802.11n/ac) with no DFS, everything seems to be fine.

Do you know why this is happening? Is it due to other devices (radars?) almost constantly being detected by my WNIC?

Moreover, connected to this: is there a way to avoid clients being temporarily disconnected when changing the transmit power with LuCI?

Thank you very much in advance (and sorry if I opened two questions in such a small time, but they are related to two different issues I am experiencing)!

Edit: this is the output of iw phy phy0 info:

Wiphy phy0
        max # scan SSIDs: 16
        max scan IEs length: 195 bytes
        max # sched scan SSIDs: 0
        max # match sets: 0
        max # scan plans: 1
        max scan plan interval: -1
        max scan plan iterations: 0
        Retry short limit: 7
        Retry long limit: 4
        Coverage class: 0 (up to 0m)
        Device supports RSN-IBSS.
        Device supports AP-side u-APSD.
        Supported Ciphers:
                * WEP40 (00-0f-ac:1)
                * WEP104 (00-0f-ac:5)
                * TKIP (00-0f-ac:2)
                * CCMP-128 (00-0f-ac:4)
                * CMAC (00-0f-ac:6)
                * CMAC-256 (00-0f-ac:13)
                * GMAC-128 (00-0f-ac:11)
                * GMAC-256 (00-0f-ac:12)
        Available Antennas: TX 0x3 RX 0x3
        Configured Antennas: TX 0x3 RX 0x3
        Supported interface modes:
                 * managed
                 * AP
                 * AP/VLAN
                 * monitor
                 * mesh point
        Band 1:
                Capabilities: 0x19ef
                        RX LDPC
                        HT20/HT40
                        SM Power Save disabled
                        RX HT20 SGI
                        RX HT40 SGI
                        TX STBC
                        RX STBC 1-stream
                        Max AMSDU length: 7935 bytes
                        DSSS/CCK HT40
                Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
                Minimum RX AMPDU time spacing: 8 usec (0x06)
                HT TX/RX MCS rate indexes supported: 0-15
                Bitrates (non-HT):
                        * 1.0 Mbps
                        * 2.0 Mbps (short preamble supported)
                        * 5.5 Mbps (short preamble supported)
                        * 11.0 Mbps (short preamble supported)
                        * 6.0 Mbps
                        * 9.0 Mbps
                        * 12.0 Mbps
                        * 18.0 Mbps
                        * 24.0 Mbps
                        * 36.0 Mbps
                        * 48.0 Mbps
                        * 54.0 Mbps
                Frequencies:
                        * 2412 MHz [1] (20.0 dBm)
                        * 2417 MHz [2] (20.0 dBm)
                        * 2422 MHz [3] (20.0 dBm)
                        * 2427 MHz [4] (20.0 dBm)
                        * 2432 MHz [5] (20.0 dBm)
                        * 2437 MHz [6] (20.0 dBm)
                        * 2442 MHz [7] (20.0 dBm)
                        * 2447 MHz [8] (20.0 dBm)
                        * 2452 MHz [9] (20.0 dBm)
                        * 2457 MHz [10] (20.0 dBm)
                        * 2462 MHz [11] (20.0 dBm)
                        * 2467 MHz [12] (20.0 dBm)
                        * 2472 MHz [13] (20.0 dBm)
                        * 2484 MHz [14] (disabled)
        Band 2:
                Capabilities: 0x19ef
                        RX LDPC
                        HT20/HT40
                        SM Power Save disabled
                        RX HT20 SGI
                        RX HT40 SGI
                        TX STBC
                        RX STBC 1-stream
                        Max AMSDU length: 7935 bytes
                        DSSS/CCK HT40
                Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
                Minimum RX AMPDU time spacing: 8 usec (0x06)
                HT TX/RX MCS rate indexes supported: 0-15
                VHT Capabilities (0x338001b2):
                        Max MPDU length: 11454
                        Supported Channel Width: neither 160 nor 80+80
                        RX LDPC
                        short GI (80 MHz)
                        TX STBC
                        RX antenna pattern consistency
                        TX antenna pattern consistency
                VHT RX MCS set:
                        1 streams: MCS 0-9
                        2 streams: MCS 0-9
                        3 streams: not supported
                        4 streams: not supported
                        5 streams: not supported
                        6 streams: not supported
                        7 streams: not supported
                        8 streams: not supported
                VHT RX highest supported: 0 Mbps
                VHT TX MCS set:
                        1 streams: MCS 0-9
                        2 streams: MCS 0-9
                        3 streams: not supported
                        4 streams: not supported
                        5 streams: not supported
                        6 streams: not supported
                        7 streams: not supported
                        8 streams: not supported
                VHT TX highest supported: 0 Mbps
                Bitrates (non-HT):
                        * 6.0 Mbps
                        * 9.0 Mbps
                        * 12.0 Mbps
                        * 18.0 Mbps
                        * 24.0 Mbps
                        * 36.0 Mbps
                        * 48.0 Mbps
                        * 54.0 Mbps
                Frequencies:
                        * 5180 MHz [36] (20.0 dBm)
                        * 5200 MHz [40] (20.0 dBm)
                        * 5220 MHz [44] (20.0 dBm)
                        * 5240 MHz [48] (20.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] (27.0 dBm) (radar detection)
                        * 5620 MHz [124] (27.0 dBm) (radar detection)
                        * 5640 MHz [128] (27.0 dBm) (radar detection)
                        * 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] (disabled)
                        * 5745 MHz [149] (disabled)
                        * 5765 MHz [153] (disabled)
                        * 5785 MHz [157] (disabled)
                        * 5805 MHz [161] (disabled)
                        * 5825 MHz [165] (disabled)
                        * 5845 MHz [169] (disabled)
        Supported commands:
                 * new_interface
                 * set_interface
                 * new_key
                 * start_ap
                 * new_station
                 * new_mpath
                 * set_mesh_config
                 * set_bss
                 * authenticate
                 * associate
                 * deauthenticate
                 * disassociate
                 * join_ibss
                 * join_mesh
                 * remain_on_channel
                 * set_tx_bitrate_mask
                 * frame
                 * frame_wait_cancel
                 * set_wiphy_netns
                 * set_channel
                 * set_wds_peer
                 * probe_client
                 * set_noack_map
                 * register_beacons
                 * start_p2p_device
                 * set_mcast_rate
                 * testmode
                 * connect
                 * disconnect
                 * channel_switch
                 * set_qos_map
                 * set_multicast_to_unicast
        Supported TX frame types:
                 * IBSS: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
                 * managed: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
                 * AP: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
                 * AP/VLAN: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
                 * mesh point: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
                 * P2P-client: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
                 * P2P-GO: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
                 * P2P-device: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
        Supported RX frame types:
                 * IBSS: 0x40 0xb0 0xc0 0xd0
                 * managed: 0x40 0xd0
                 * AP: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
                 * AP/VLAN: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
                 * mesh point: 0xb0 0xc0 0xd0
                 * P2P-client: 0x40 0xd0
                 * P2P-GO: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
                 * P2P-device: 0x40 0xd0
        software interface modes (can always be added):
                 * AP/VLAN
                 * monitor
        valid interface combinations:
                 * #{ AP, mesh point } <= 8, #{ managed } <= 1,
                   total <= 8, #channels <= 1, STA/AP BI must match, radar detect widths: { 20 MHz (no HT), 20   MHz, 40 MHz, 80 MHz }

        HT Capability overrides:
                 * MCS: ff ff ff ff ff ff ff ff ff ff
                 * maximum A-MSDU length
                 * supported channel width
                 * short GI for 40 MHz
                 * max A-MPDU length exponent
                 * min MPDU start spacing
        Device supports TX status socket option.
        Device supports HT-IBSS.
        Device supports SAE with AUTHENTICATE command
        Device supports scan flush.
        Device supports AP scan.
        Device supports per-vif TX power setting
        Driver supports full state transitions for AP/GO clients
        Driver supports a userspace MPM
        Driver/device bandwidth changes during BSS lifetime (AP/GO mode)
        Device supports static SMPS
        Device supports configuring vdev MAC-addr on create.
        Device supports VHT-IBSS.

Edit: this is instad the output of hostapd when a failed channel set occurs (gathered through logread | grep "hostapd"). This is the situation after which I'm forced to reboot and which causes IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready messages to be generated on dmesg).

Wed May 29 14:17:21 2019 daemon.notice hostapd: wlan0: DFS-CAC-COMPLETED success=0 freq=5600 ht_enabled=0 chan_offset=0 chan_width=3 cf1=5610 cf2=0
Wed May 29 14:17:21 2019 daemon.notice hostapd: wlan0: INTERFACE-DISABLED
Wed May 29 14:17:22 2019 daemon.err hostapd: Configuration file: /var/run/hostapd-phy0.conf
Wed May 29 14:17:23 2019 daemon.notice hostapd: wlan0: INTERFACE-ENABLED
Wed May 29 14:17:23 2019 daemon.notice hostapd: wlan0: INTERFACE-DISABLED
Wed May 29 14:17:23 2019 daemon.err hostapd: nl80211: Could not configure driver mode
Wed May 29 14:17:23 2019 daemon.notice hostapd: nl80211: deinit ifname=wlan0 disabled_11b_rates=0
Wed May 29 14:17:23 2019 daemon.err hostapd: nl80211 driver initialization failed.
Wed May 29 14:17:23 2019 daemon.notice hostapd: wlan0: interface state UNINITIALIZED->DISABLED
Wed May 29 14:17:23 2019 daemon.notice hostapd: wlan0: AP-DISABLED
Wed May 29 14:17:23 2019 daemon.notice hostapd: wlan0: CTRL-EVENT-TERMINATING
Wed May 29 14:17:23 2019 daemon.err hostapd: hostapd_free_hapd_data: Interface wlan0 wasn't started
Wed May 29 14:17:23 2019 daemon.notice netifd: radio0 (6419): WARNING (wireless_add_process): executable path /usr/sbin/hostapd does not match process 5597 path ()

Is the country code set? The default of no country will not allow DFS operation.

1 Like

It should be.
In fact, iw reg get reports:
global

country IT: DFS-ETSI
        (2402 - 2482 @ 40), (N/A, 20), (N/A)
        (5170 - 5250 @ 80), (N/A, 20), (N/A), AUTO-BW
        (5250 - 5330 @ 80), (N/A, 20), (0 ms), DFS, AUTO-BW
        (5490 - 5710 @ 160), (N/A, 27), (0 ms), DFS
        (57000 - 66000 @ 2160), (N/A, 40), (N/A)

By the way, I have an important update: I just discovered that the txpower setting is ignored only when the DFS procedure is running. After a while, when hostapd reports DFS-CAC-COMPLETED success=1, the power is successfully set and the AP is started with the proper SSID.

The biggest issue which is still present is the fact that, sometimes, channels fail to be set, generating DFS-CAC-COMPLETED success=0 in the hostapd log (as reported above), and when that occurs I can do nothing than reboot my device...

Makes sense to me.

That makes sense, although your rebooting only causes the DFS check to occur again.

You are aware of what DFS is, correct?

Thank you!

Yes, I should be aware.
What seems a bit strange is that, when the problem I was mentioning occurs (and it seems to occur, sometimes, when I try to change channel after a DFS channel was set), there's nothing that works rather than a reboot.
If I try to select another non-DFS (or DFS) channel, change txpower, do wifi down - wifi up... nothing happens (other than the generation of wlan0: link is not ready messages on dmesg), I'm just out of the wireless network and I can't generate an access point with hostapd anymore.
When I reboot, the DFS procedure probably restarts, as you pointed me, and everything is fine.

This issue, by the way, seems to be related to this one.

  • Are you changing a channel or cutting power before DFS stops?
  • How long are you waiting?
  • What happens when you use no DFS channels?
  • What issue (you haven't described a drop)?
1 Like

Do configuration through the UCI system; do not directly run iw or hostapd to set up a radio.

That means change the channel number in /etc/config/wireless then run wifi (with no options) to restart the wifi. You will of course have to wait for the DFS scan to complete on the new channel before the radio comes up.

2 Likes

Thank you very much for your replies!

After reading them, I experimented a bit more and I discovered that, when the issue occurred, I was trying to change the current channel before the DFS scan procedure stopped with DFS-CAC-COMPLETED in the hostapd log.

If, after setting up a DFS channel, I wait for this (1 minute long?) procedure to complete, I can successfully switch to any other allowed channel.

Probably the driver was busy doing the DFS procedure, and could not handle the channel switch request, causing the nl80211 driver initialization failed. error I was seeing, causing the radio interface to enter a disabled state until a reboot occurred.
Could this be a valid explanation?

I will also try to work, in this context, as much as possible with UCI rather than directly calling iw or hostapd. Thank you!

1 Like

That makes sense - the Wireless NIC will need to do the scan and DFS checks first, and that's in the firmware on many wireless NIC's...

They'll clamp the Tx power until conditions are met. Not sure how the FOSS drivers, but the closed source drivers supplied by QCA are going to be fairly strict there when going into DFS space (but they're pretty quick once they're asked to do it).

In previous experience*, some vendors will pop OTP's to disable DFS completely, just to avoid the testing cost overhead for DFS compliance. And there, some drivers will say "OK" but not actually go there, much like other out of range params.

  • it's been a couple of years since I really jumped into this, mostly on investigation of the FCC lockdown stuff.
2 Likes

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.