Bug 86260

Summary: systemd-rfkill does not consider hard blocking
Product: systemd Reporter: Erik Karlsson <pilo>
Component: generalAssignee: systemd-bugs
Status: RESOLVED NOTABUG QA Contact: systemd-bugs
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: All   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

Description Erik Karlsson 2014-11-13 18:01:48 UTC
I have the following wlan adapter:
  03:00.0 Network controller [0280]: Intel Corporation Ultimate N WiFi Link 5300 [8086:4236]

The kernel locks this via rfkill on boot:
  iwlwifi 0000:03:00.0: RF_KILL bit toggled to disable radio.

And rfkill lists the following:
  # rfkill list
  0: phy0:t Wireless LAN
          Soft blocked: no
          Hard blocked: yes
  ...  
  # pwd
  /sys/devices/pci0000:00/0000:00:1c.1/0000:03:00.0/ieee80211/phy0/rfkill0
  # cat soft hard
  0
  1

Wireless does not work in this state.

To fix, I have to run "rfkill unblock wifi" or similar, manually. After unblock, i get the following output:
  # rfkill list
  0: phy0:t Wireless LAN
          Soft blocked: no
          Hard blocked: no
  ...
  # pwd
  /sys/devices/pci0000:00/0000:00:1c.1/0000:03:00.0/ieee80211/phy0/rfkill0
  # cat soft hard
  0
  0

According to the source in src/rfkill/rfkill.c only the state in the file "soft" is saved and restored. But "hard" should also be handled.
Comment 1 Erik Karlsson 2014-11-13 21:06:00 UTC
OK, so this is probably a quirk in the driver, because the rfkill program doesn't touch the hard switch, but "rfkill unblock wifi" works for unblocking the hard switch for me. Feel free to close this.
Comment 2 Lennart Poettering 2014-12-02 23:35:42 UTC
The "hard" block is a hardware switch, i.e. a physical, mechanical switch. Software cannot alter that, it can only read it. This is different from "soft" blocks, which are software switches, that software maintains, reads and sets. Hence systemd-rfkill cannot really be involved with setting the hard block, as that is technically simply not possible.

Closing.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.