Wednesday, October 29, 2014

Linux WiFi: operation not possible due to RF-kill

Often when I bring my laptop out of hibernation or suspension I am unable to enable wifi. This issue has been reported to have begun after an update that happened just before Christmas 2010. The problem seems to be a bug in a kernel module, which prevents the rfkill's soft and hard block from syncing correctly.

In practice that means you can press your laptop's WiFi button as often as you want, it doesn't change anything. Your wireless adapter will always appear as disabled. If you try to start the wireless interface manually you get the following error message:
sk@ubuntu:~# sudo ifconfig wlan0 up
SIOCSIFFLAGS: Operation not possible due to RF-kill
If you do a rfkill list all you should get an output similar to this:
sk@ubuntu:~$ sudo rfkill list all
0: hp-wifi: Wireless LAN
Soft blocked: yes
Hard blocked: no
1: phy0: Wireless LAN
Soft blocked: yes
Hard blocked: no
Depending on the state of your WiFi button the Hard blocked will either be yes or no. Press the WiFi button and run rfkill list all again to make sure the value for Hard blocked changes.

The actual problem is, that the Soft blocked value is always set to yes, because for some reason the syncing between the hardware block and the software block doesn't work as supposed. To override this behavior, you can just run rfkill unblock wifi and it should work again. Double check by entering rfkill list all again and make sure it looks like this, with all values set to no:
sk@ubuntu:~$ sudo rfkill list all
0: hp-wifi: Wireless LAN
Soft blocked: no
Hard blocked: no
1: phy0: Wireless LAN
Soft blocked: no
Hard blocked: no
If you then run ifconfig wlan0 up (or enable the wireless via your desktop's network manager) you should be able to connect to a wireless network again without any further issues.

The configuration, which I've been using:
  • Lenovo B575
  • Atheros ath9k AR9285 Wireless Network Adapter
  • Ubuntu 14.04.1 LTS
It's reported that by turning off the WiFi button during the boot process and switching it on again once the system is up and running may correct the issue. This didn't work for me as the button was still not functional. In the past I simply logged off and back which allowed me to enable wifi it with the button. However this was not the case today. 

  • suspend the system to RAM (either by hitting the SUSPEND-key or by using the Suspend entry in the Logout-menu at right of the upper panel)
  • wait for some seconds
  • press the power button to restart the system
After reboot:
.
The output to 'rfkill list all' finally shows

0: phy0: Wireless LAN
    Soft blocked: no
    Hard blocked: no
1: asus-wlan: Wireless LAN
    Soft blocked: no
    Hard blocked: no

The NetworkManager will activate the WIFI and should offer access points to connect to.

 It seems that the system expects the hard block to be set to off. This is still a bug, but it could explain why then the soft block didn't sync with the hard block any more.

No comments:

Post a Comment