Wireless interface stays up after disabled, netdev LED control fails

Dear Developers,

I am noticing the same phenomena on two platforms already (ath9k and ath10k (mips and ipq4019):

When the device boots with the radio (phy0-ap0) disabled, the interface is down and the associated LED is off. If I enable the radio, the associated LED turns on. But once I turn the same radio off again, the radio goes down, but the phy0-ap0 interface stays up, and the netdev trigger fails to disable the associated LED.

This definitely worked on 5.10 before, now it fails on two platforms.

This is the LED config:

config led 'led_wlan'
        option name 'WLAN'
        option sysfs 'green:wlan'
        option trigger 'netdev'
        option mode 'link tx rx'
        option dev 'phy0-ap0'

Or maybe something changed and this needs to be configured differently?

Hi, can you give more info? Specific device?

I'm trying to repro this on ath10k with r7800 and with the netdev trigger led it does correctly turn off...
Also can't find a device on ipq4019 that use netdev trigger to handle wifi led.

Of course.

I reproduced this with two devices:

  1. GLI-NET MIFI, which is a MIPS based ath9k device (has mainline Openwrt support)
  2. Mikrotik Chateua 12LTE which does not have mainline support yet, I am "developing" it:

In both cases the same thing happens:

This is how the LED is set up:

system.@led[6]=led
system.@led[6].name='WLAN2'
system.@led[6].sysfs='green:ethernet'
system.@led[6].trigger='netdev'
system.@led[6].dev='phy0-ap0'
system.@led[6].mode='link tx rx'

  1. Default state is radio disabled, 'phy0-ap0' is in "DOWN" state.
  2. Turn on 'phy0-ap0' under Luci --> the LED turns on correctly, 'phy0-ap0' is in "UP state.
  3. Turn off 'phy0-ap0' under Luci --> the LED is still ON, 'phy0-ap0' is still in "UP state, BSSID broadcasted but cannot connect to it.
  4. If I restart the router in this state, it all goes back to normal after reboot (interafce disabled, LED is off, no BSSID broadcasted).

MOD: this is how logread looks like when I hit the "Disable" button under luci:

Mon Apr 24 11:26:54 2023 daemon.notice netifd: Wireless device 'radio1' is now up
Mon Apr 24 11:26:54 2023 daemon.notice netifd: Network device 'phy1-ap0' link is up
Mon Apr 24 11:26:54 2023 kern.info kernel: [  881.778597] br-lan: port 6(phy1-ap0) entered blocking state
Mon Apr 24 11:26:54 2023 kern.info kernel: [  881.778660] br-lan: port 6(phy1-ap0) entered disabled state
Mon Apr 24 11:26:54 2023 kern.info kernel: [  881.783690] device phy1-ap0 entered promiscuous mode
Mon Apr 24 11:26:54 2023 kern.info kernel: [  881.788901] br-lan: port 6(phy1-ap0) entered blocking state
Mon Apr 24 11:26:54 2023 kern.info kernel: [  881.793858] br-lan: port 6(phy1-ap0) entered forwarding state
Mon Apr 24 11:26:55 2023 daemon.info dnsmasq[1]: read /etc/hosts - 12 names
Mon Apr 24 11:26:55 2023 daemon.info dnsmasq[1]: read /tmp/hosts/dhcp.cfg01411c - 2 names
Mon Apr 24 11:26:55 2023 daemon.info dnsmasq-dhcp[1]: read /etc/ethers - 0 addresses
Mon Apr 24 11:27:26 2023 kern.info kernel: [  913.777410] device phy1-ap0 left promiscuous mode
Mon Apr 24 11:27:26 2023 kern.info kernel: [  913.777696] br-lan: port 6(phy1-ap0) entered disabled state
Mon Apr 24 11:27:26 2023 daemon.notice netifd: radio1 (4551): WARNING: Variable 'data' does not exist or is not an array/object
Mon Apr 24 11:27:26 2023 daemon.notice netifd: radio1 (4551): Bug: PHY is undefined for device 'radio1'
Mon Apr 24 11:27:26 2023 daemon.notice netifd: Wireless device 'radio1' is now down
Mon Apr 24 11:27:29 2023 daemon.info dnsmasq[1]: read /etc/hosts - 12 names
Mon Apr 24 11:27:29 2023 daemon.info dnsmasq[1]: read /tmp/hosts/dhcp.cfg01411c - 2 names
Mon Apr 24 11:27:29 2023 daemon.info dnsmasq-dhcp[1]: read /etc/ethers - 0 addresses

There is a netifd warning which might be related?

MOD2:

This is the radio config:

root@cpe00005:~# uci show wireless
wireless.radio0=wifi-device
wireless.radio0.type='mac80211'
wireless.radio0.path='platform/soc/a000000.wifi'
wireless.radio0.channel='auto'
wireless.radio0.band='2g'
wireless.radio0.htmode='HT20'
wireless.radio0.txpower='17'
wireless.radio0.country='NL'
wireless.radio0.cell_density='0'
wireless.radio0.disabled='1'
wireless.default_radio0=wifi-iface
wireless.default_radio0.device='radio0'
wireless.default_radio0.network='lan'
wireless.default_radio0.mode='ap'
wireless.default_radio0.ssid='mifi_default'
wireless.default_radio0.encryption='psk-mixed'
wireless.default_radio0.key='password'
wireless.default_radio0.disabled='1'
wireless.radio1=wifi-device
wireless.radio1.type='mac80211'
wireless.radio1.path='platform/soc/a800000.wifi'
wireless.radio1.channel='auto'
wireless.radio1.band='5g'
wireless.radio1.htmode='VHT20'
wireless.radio1.txpower='17'
wireless.radio1.country='NL'
wireless.radio1.cell_density='0'
wireless.radio1.disabled='1'
wireless.default_radio1=wifi-iface
wireless.default_radio1.device='radio1'
wireless.default_radio1.network='lan'
wireless.default_radio1.mode='ap'
wireless.default_radio1.ssid='mifi_default_5GHz'
wireless.default_radio1.encryption='psk-mixed'
wireless.default_radio1.key='password'
wireless.default_radio1.disabled='1'

MOD3:

The exact same netifd "BUG" is displayed on the GLI-MIFI as well:

Thu Mar 23 18:31:45 2023 daemon.notice netifd: radio0 (6905): WARNING: Variable 'data' does not exist or is not an array/object
Thu Mar 23 18:31:45 2023 daemon.notice netifd: radio0 (6905): Bug: PHY is undefined for device 'radio0'
Thu Mar 23 18:31:45 2023 daemon.notice netifd: Wireless device 'radio0' is now down

Interface is not down of course.

ip link output? if you use wifi down does the led turn off?

root@cpe00005:~# ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel master br-lan state UP qlen 1000
    link/ether e4:95:6e:43:f3:b7 brd ff:ff:ff:ff:ff:ff
3: eth1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel master br-lan state DOWN qlen 1000
    link/ether e4:95:6e:43:f3:b7 brd ff:ff:ff:ff:ff:ff
4: wwan0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
    link/ether ba:df:6e:13:2d:f9 brd ff:ff:ff:ff:ff:ff
6: br-lan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
    link/ether e4:95:6e:43:f3:b7 brd ff:ff:ff:ff:ff:ff
15: phy0-ap0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-lan state UP qlen 1000
    link/ether e4:95:6e:43:f3:b7 brd ff:ff:ff:ff:ff:ff
root@cpe00005:~#
root@cpe00005:~#
root@cpe00005:~# wifi down
root@cpe00005:~#
root@cpe00005:~# ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel master br-lan state UP qlen 1000
    link/ether e4:95:6e:43:f3:b7 brd ff:ff:ff:ff:ff:ff
3: eth1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel master br-lan state DOWN qlen 1000
    link/ether e4:95:6e:43:f3:b7 brd ff:ff:ff:ff:ff:ff
4: wwan0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
    link/ether ba:df:6e:13:2d:f9 brd ff:ff:ff:ff:ff:ff
6: br-lan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
    link/ether e4:95:6e:43:f3:b7 brd ff:ff:ff:ff:ff:ff
15: phy0-ap0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
    link/ether e4:95:6e:43:f3:b7 brd ff:ff:ff:ff:ff:ff

Even after "wifi down" the interface stays up.

  • logread -f
  • run wifi down
  • give output after the command

Something very wrong is happening here???? (netdev trigger react on interface put down so the real problem is the interface still UP)

Yeah, it is clear that it is not the LED trig where the problem is but the interface state handling.

This is the requested output:


Thu Mar 23 18:48:04 2023 daemon.notice netifd: radio0 (11231): WARNING: Variable 'data' does not exist or is not an array/object
Thu Mar 23 18:48:04 2023 daemon.notice netifd: radio0 (11231): Bug: PHY is undefined for device 'radio0'
Thu Mar 23 18:48:04 2023 daemon.notice netifd: Wireless device 'radio0' is now down
Thu Mar 23 18:48:04 2023 kern.info kernel: [  848.403022] device phy0-ap0 left promiscuous mode
Thu Mar 23 18:48:04 2023 kern.info kernel: [  848.406526] br-lan: port 3(phy0-ap0) entered disabled state

MOD: FYI, after "wifi down" this is how Luci looks like:

and the interface is not down of course.

As this seems to be a Netifd issue, lets see if @hauke or @nbd can join us, hopefully they can shed some lite on this.