openSUSE won't use USB adapter if switch is off; Windows will

openSUSE 13.2 64-bit KDE on laptop ThinkPad T61. If the wireless switch is off and a USB wireless adapter (Belkin F9L1101v2) plugged in, booting into Windows 7 can use the USB adapter and connect to the router. The switch disables the internal bluetooth and wireless cards. openSUSE will not use the USB adapter when the switch is off. Network Manager reports “Wireless disabled by hardware”. The Windows behavior shows the switch does not truly disable the USB adapter.

How can openSUSE be set to use the USB adapter even if the switch is off?

Thanks,
Howard

Hi
Install the package rfkill and run the following as root user;


rfkill list

Does the device show up as blocked?

Oops, this is 13.1, not 13.2.

The USB adapter works fine with openSUSE when the switch is on, but the internal card tries to connect, too, and sometimes seems to get garbled.

With switch on:

T61-os131:/home/howard # rfkill list
0: tpacpi_bluetooth_sw: Bluetooth
        Soft blocked: no
        Hard blocked: no
1: phy0: Wireless LAN
        Soft blocked: no
        Hard blocked: no
2: phy1: Wireless LAN
        Soft blocked: no
        Hard blocked: no
6: hci0: Bluetooth
        Soft blocked: no
        Hard blocked: no
T61-os131:/home/howard # 

With the switch off:

T61-os131:/home/howard # rfkill list
0: tpacpi_bluetooth_sw: Bluetooth
        Soft blocked: yes
        Hard blocked: yes
1: phy0: Wireless LAN
        Soft blocked: yes
        Hard blocked: yes
2: phy1: Wireless LAN
        Soft blocked: yes
        Hard blocked: no
T61-os131:/home/howard # 

On Tue 23 Jun 2015 05:16:01 AM CDT, crmrhm wrote:

2: phy1: Wireless LAN
Soft blocked: yes
Hard blocked: no

Hi
OK, so using rfkill command unblock 2;


rfkill unblock 2
rfkill list

Your wireless USB device should now be active…


Cheers Malcolm °¿° LFCS, SUSE Knowledge Partner (Linux Counter #276890)
SUSE Linux Enterprise Desktop 12 GNOME 3.10.1 Kernel
3.12.43-52.6-default If you find this post helpful and are logged into
the web interface, please show your appreciation and click on the star
below… Thanks!

I did the unblock 2, and now get

T61-os131:/home/howard # rfkill list
0: tpacpi_bluetooth_sw: Bluetooth
        Soft blocked: yes
        Hard blocked: yes
1: phy0: Wireless LAN
        Soft blocked: no
        Hard blocked: yes
2: phy1: Wireless LAN
        Soft blocked: no
        Hard blocked: no
T61-os131:/home/howard # 

but Network Manager still reports “Wireless disabled by hardware” and will not connect. I tried disabling/enabling Network Manager in YaST, logging off and back in, and rebooting. rfkill still showed 2 not blocked, but Network Manager remained unconvinced.
Any ideas?
Thanks,
Howard

That reads like a bug with Network Manager as you’ve described it. In any case it might be interesting to see who the USB wireless device behaves when plugged in from the kernel perspective

journalctl -f

This will show any driver bound to the device (although that might also be reported by the above)

usb-devices

Just look for the output section pertaining to the device.

I’d like to think we’d see a network interface too

ip addr

OK, all this is after I turned the hardware switch off, unplugged the USB adapter, then plugged it in again.

T61-os131:/home/howard # rfkill list
0: tpacpi_bluetooth_sw: Bluetooth
        Soft blocked: yes
        Hard blocked: yes
1: phy0: Wireless LAN
        Soft blocked: yes
        Hard blocked: yes
5: phy2: Wireless LAN
        Soft blocked: yes
        Hard blocked: no
T61-os131:/home/howard # rfkill unblock 5
T61-os131:/home/howard # 

For some reason, this code block is not working right.

T61-os131:/home/howard # rfkill list                                                                                                                                           
0: tpacpi_bluetooth_sw: Bluetooth                                                                                                                                                   
        Soft blocked: yes                                                                                                                                                           
        Hard blocked: yes                                                                                                                                                           
1: phy0: Wireless LAN                                                                                                                                                               
        Soft blocked: yes                                                                                                                                                           
        Hard blocked: yes                                                                                                                                                           
5: phy2: Wireless LAN                                                                                                                                                               
        Soft blocked: no                                                                                                                                                            
        Hard blocked: no                                                                                                                                                            
T61-os131:/home/howard # 

T61-os131:/home/howard # journalctl -f
-- Logs begin at Tue 2015-06-23 14:49:45 PDT. --
Jun 23 16:45:18 T61-os131.site systemd-udevd[13896]: renamed network interface wlan0 to wlp0s29f7u1
Jun 23 16:45:18 T61-os131.site ifup[13913]: Network is managed by 'NetworkManager.service' -> skipping
Jun 23 16:45:18 T61-os131.site NetworkManager[11149]: <info> (wlp0s29f7u1): using nl80211 for WiFi device control
Jun 23 16:45:18 T61-os131.site NetworkManager[11149]: <info> (wlp0s29f7u1): driver supports Access Point (AP) mode
Jun 23 16:45:18 T61-os131.site NetworkManager[11149]: <info> (wlp0s29f7u1): new 802.11 WiFi device (driver: 'rtl8192du' ifindex: 7)
Jun 23 16:45:18 T61-os131.site NetworkManager[11149]: <info> (wlp0s29f7u1): exported as /org/freedesktop/NetworkManager/Devices/3
Jun 23 16:45:18 T61-os131.site NetworkManager[11149]: <info> (wlp0s29f7u1): device state change: unmanaged -> unavailable (reason 'managed') [10 20 2]
Jun 23 16:45:18 T61-os131.site NetworkManager[11149]: <info> (wlp0s29f7u1): bringing up device.
Jun 23 16:45:18 T61-os131.site NetworkManager[11149]: <info> (wlp0s29f7u1): deactivating device (reason 'managed') [2]
Jun 23 16:45:21 T61-os131.site ModemManager[611]: <warn>  Couldn't find support for device at '/sys/devices/pci0000:00/0000:00:1d.7/usb2/2-1': not supported by any plugin
^C
T61-os131:/home/howard #

This is edited to show only the USB wireless adapter.

T61-os131:/home/howard # usb-devices

T:  Bus=02 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  3 Spd=480 MxCh= 0
D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=050d ProdID=110a Rev=00.00
S:  Manufacturer=Realtek
S:  Product=802.11n NIC
S:  SerialNumber=00e04c000001
C:  #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=500mA
I:  If#= 0 Alt= 0 #EPs= 4 Cls=ff(vend.) Sub=ff Prot=ff Driver=rtl8192du

T61-os131:/home/howard # 

T61-os131:/home/howard # ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 brd 127.255.255.255 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: enp0s25: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
    link/ether 00:1c:25:80:c1:d0 brd ff:ff:ff:ff:ff:ff
3: wlp3s0: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN qlen 1000
    link/ether 00:1f:3b:8b:89:4b brd ff:ff:ff:ff:ff:ff
7: wlp0s29f7u1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
    link/ether 94:10:3e:6a:fa:59 brd ff:ff:ff:ff:ff:ff
T61-os131:/home/howard # 

Do you need anything for when the switch is on?
Thanks,
Howard

Do you need anything for when the switch is on?
Thanks,
Howard

Yes, have a look at the kernel messaging when wireless switch is on. Already, the following tells us that NM is ‘mis-handling’…


Jun 23 16:45:18 T61-os131.site NetworkManager[11149]: <info> (wlp0s29f7u1): device state change: unmanaged -> unavailable (reason 'managed') [10 20 2]
Jun 23 16:45:18 T61-os131.site NetworkManager[11149]: <info> (wlp0s29f7u1): bringing up device.
Jun 23 16:45:18 T61-os131.site NetworkManager[11149]: <info> (wlp0s29f7u1): deactivating device (reason 'managed') [2]

With the hardware switch on I get

T61-os131:/home/howard # rfkill list
0: tpacpi_bluetooth_sw: Bluetooth
        Soft blocked: no
        Hard blocked: no
1: phy0: Wireless LAN
        Soft blocked: no
        Hard blocked: no
5: phy2: Wireless LAN
        Soft blocked: no
        Hard blocked: no
7: hci0: Bluetooth
        Soft blocked: no
        Hard blocked: no
T61-os131:/home/howard # journalctl -f
-- Logs begin at Tue 2015-06-23 14:49:45 PDT. --
Jun 23 19:37:37 T61-os131.site systemd[1]: Started Network Manager Script Dispatcher Service.
Jun 23 19:37:42 T61-os131.site kernel: SFW2-INext-ACC IN=wlp0s29f7u1 OUT= MAC= SRC=192.168.1.131 DST=224.0.0.251 LEN=64 TOS=0x00 PREC=0x00 TTL=255 ID=60868 DF PROTO=...5353 LEN=44 
Jun 23 19:38:03 T61-os131.site kernel: SFW2-INext-ACC IN=wlp0s29f7u1 OUT= MAC= SRC=fe80:0000:0000:0000:9610:3eff:fe6a:fa59 DST=ff02:0000:0000:0000:0000:0000:0000:00f...5353 LEN=44 
Jun 23 19:38:14 T61-os131.site kernel: SFW2-INext-ACC IN=wlp0s29f7u1 OUT= MAC= SRC=192.168.1.131 DST=224.0.0.251 LEN=64 TOS=0x00 PREC=0x00 TTL=255 ID=60869 DF PROTO=...5353 LEN=44 
Jun 23 19:39:07 T61-os131.site kernel: SFW2-INext-ACC IN=wlp0s29f7u1 OUT= MAC= SRC=fe80:0000:0000:0000:9610:3eff:fe6a:fa59 DST=ff02:0000:0000:0000:0000:0000:0000:00f...5353 LEN=44 
Jun 23 19:39:13 T61-os131.site kernel: SFW2-INext-ACC IN=wlp0s29f7u1 OUT= MAC=01:00:5e:00:00:fb:00:11:2f:51:65:6a:08:00 SRC=192.168.1.132 DST=224.0.0.251 LEN=64 TOS=...5353 LEN=44 
Jun 23 19:39:14 T61-os131.site kernel: SFW2-INext-ACC IN=wlp0s29f7u1 OUT= MAC=33:33:00:00:00:fb:00:11:2f:51:65:6a:86:dd SRC=fe80:0000:0000:0000:0211:2fff:fe51:656a D...5353 LEN=44 
Jun 23 19:39:18 T61-os131.site kernel: SFW2-INext-ACC IN=wlp0s29f7u1 OUT= MAC= SRC=192.168.1.131 DST=224.0.0.251 LEN=64 TOS=0x00 PREC=0x00 TTL=255 ID=60870 DF PROTO=...5353 LEN=44 
Jun 23 19:39:33 T61-os131.site su[15554]: (to howard) howard on none
Jun 23 19:39:33 T61-os131.site su[15554]: pam_unix(su:session): session opened for user root by howard(uid=1000)
^C
T61-os131:/home/howard # 


It looks like you didn’t quite catch the NM events this time. It was specifically NetworkManager events we were looking for. You could also do

sudo tail -f /var/log/NetworkManager

and that gives

T61-os131:/home/howard # tail -f /var/log/NetworkManager
2015-06-23T22:43:54.035770-07:00 T61-os131 NetworkManager[11149]: <info>   Forbid Default Route: no
2015-06-23T22:43:54.037189-07:00 T61-os131 NetworkManager[11149]: <info>   Internal DNS: 209.222.18.222
2015-06-23T22:43:54.037588-07:00 T61-os131 NetworkManager[11149]: <info>   Internal DNS: 209.222.18.218
2015-06-23T22:43:54.037918-07:00 T61-os131 NetworkManager[11149]: <info>   DNS Domain: '(none)'
2015-06-23T22:43:54.040340-07:00 T61-os131 NetworkManager[11149]: <info> No IPv6 configuration
2015-06-23T22:43:54.042831-07:00 T61-os131 nm-openvpn[17397]: Initialization Sequence Completed
2015-06-23T22:43:55.037395-07:00 T61-os131 NetworkManager[11149]: <info> VPN connection 'PIA California' (IP Config Get) complete.
2015-06-23T22:43:55.038433-07:00 T61-os131 NetworkManager[11149]: <info> Policy set 'PIA California' (tun0) as default for IPv4 routing and DNS.
2015-06-23T22:43:55.079037-07:00 T61-os131 NetworkManager[11149]: <info> VPN plugin state changed: started (4)
2015-06-23T22:43:55.079518-07:00 T61-os131 NetworkManager[11149]: <warn> /sys/devices/virtual/net/tun0: couldn't determine device driver; ignoring...                               
^C                                                                                                                                                                                  
T61-os131:/home/howard #

In NM, I unchecked “Enable wireless”, the checked it again, connected to the router and VPN, and get

T61-os131:/home/howard # journalctl -f
-- Logs begin at Tue 2015-06-23 14:49:45 PDT. --
Jun 23 22:53:41 T61-os131.site NetworkManager[11149]: <warn> /sys/devices/virtual/net/tun0: couldn't determine device driver; ignoring...
Jun 23 22:53:41 T61-os131.site systemd[1]: Starting Network Manager Script Dispatcher Service...
Jun 23 22:53:41 T61-os131.site dbus[615]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'
Jun 23 22:53:42 T61-os131.site systemd[1]: Started Network Manager Script Dispatcher Service.
Jun 23 22:53:45 T61-os131.site kernel: IPv4: martian source 192.168.1.131 from 198.8.80.212, on dev wlp0s29f7u2
Jun 23 22:53:45 T61-os131.site kernel: ll header: 00000000: 94 10 3e 6a fa 59 b0 c7 45 75 5a 30 08 00        ..>j.Y..EuZ0..
Jun 23 22:53:49 T61-os131.site kernel: SFW2-INext-ACC IN=wlp0s29f7u2 OUT= MAC= SRC=fe80:0000:0000:0000:9610:3eff:fe6a:fa59 DST=ff02:0000:0000:0000:0000:0000:0000:00f...5353 LEN=44 
Jun 23 22:53:53 T61-os131.site kernel: SFW2-INext-ACC IN=wlp0s29f7u2 OUT= MAC= SRC=192.168.1.131 DST=224.0.0.251 LEN=64 TOS=0x00 PREC=0x00 TTL=255 ID=60911 DF PROTO=...5353 LEN=44 
Jun 23 22:53:56 T61-os131.site su[18208]: (to howard) howard on none
Jun 23 22:53:56 T61-os131.site su[18208]: pam_unix(su:session): session opened for user root by howard(uid=1000)
Jun 23 22:54:21 T61-os131.site kernel: SFW2-INext-ACC IN=wlp0s29f7u2 OUT= MAC= SRC=fe80:0000:0000:0000:9610:3eff:fe6a:fa59 DST=ff02:0000:0000:0000:0000:0000:0000:00f...5353 LEN=44 
Jun 23 22:54:25 T61-os131.site kernel: SFW2-INext-ACC IN=wlp0s29f7u2 OUT= MAC= SRC=192.168.1.131 DST=224.0.0.251 LEN=64 TOS=0x00 PREC=0x00 TTL=255 ID=60912 DF PROTO=...5353 LEN=44 
^C
T61-os131:/home/howard # 


Not much can be done from a user perspective IMHO. I’d like to think wifi devices could be separately enabled/disabled, but rfkill doesn’t lend itself to this.

As a quick test, I plugged in my USB ‘Realtek Semiconductor Corp. RTL8188CUS 802.11n WLAN Adapter’ device, and disabled it

# rfkill list
0: hp-wifi: Wireless LAN
        Soft blocked: no
        Hard blocked: no
1: hp-bluetooth: Bluetooth
        Soft blocked: no
        Hard blocked: no
2: phy0: Wireless LAN
        Soft blocked: no
        Hard blocked: no
3: hp-wwan: Wireless WAN
        Soft blocked: yes
        Hard blocked: no
4: hp-gps: GPS
        Soft blocked: yes
        Hard blocked: yes
7: hci0: Bluetooth
        Soft blocked: no
        Hard blocked: no
8: phy1: Wireless LAN
        Soft blocked: no
        Hard blocked: no
linux-bbgi:/home/dean # rfkill block 8
 # rfkill list
0: hp-wifi: Wireless LAN
        Soft blocked: no
        Hard blocked: no
1: hp-bluetooth: Bluetooth
        Soft blocked: no
        Hard blocked: no
2: phy0: Wireless LAN
        Soft blocked: no
        Hard blocked: no
3: hp-wwan: Wireless WAN
        Soft blocked: yes
        Hard blocked: no
4: hp-gps: GPS
        Soft blocked: yes
        Hard blocked: yes
8: phy1: Wireless LAN
        Soft blocked: yes
        Hard blocked: no
9: hci0: Bluetooth
        Soft blocked: no
        Hard blocked: no


Even though my inbuilt (Broadcom) wireless device remains unblocked, rfkill kills all wireless interfaces, (so that would explain NM behaviour). If I hard block or soft block my Broadcom device, then I lose the network interface for the USB wireless device too. Definitely an all or nothing behaviour due to rfkill.

Something other than rfkill is blocking the USB adapter. It was blocked in openSUSE 13.1 when the hardware switch was off BEFORE I installed rfkill. I think that is why rfkill cannot successfully clear the block.

I turned off the wireless switch and got

T61-os131:/home/howard # rfkill list
0: tpacpi_bluetooth_sw: Bluetooth
        Soft blocked: yes
        Hard blocked: yes
1: phy0: Wireless LAN
        Soft blocked: yes
        Hard blocked: yes
9: phy3: Wireless LAN
        Soft blocked: yes
        Hard blocked: no
T61-os131:/home/howard # rfkill unblock all
T61-os131:/home/howard # rfkill list
0: tpacpi_bluetooth_sw: Bluetooth
        Soft blocked: no
        Hard blocked: yes
1: phy0: Wireless LAN
        Soft blocked: no
        Hard blocked: yes
9: phy3: Wireless LAN
        Soft blocked: no
        Hard blocked: no
T61-os131:/home/howard # 


with all the soft blocks shown as removed. I played around with YaST network settings and Network Manager, but could not get a connection with the switch off. Network Manager still reports “Wireless disabled by hardware”.

The ‘rfkill’ package only supplies the user space utility. The rfkill kernel module which provides the killswitch support for wireless devices, with /dev/rfkill as the user space device interface.

https://www.kernel.org/doc/Documentation/rfkill.txt

I played around with YaST network settings and Network Manager, but could not get a connection with the switch off. Network Manager still reports “Wireless disabled by hardware”.

I get the same. If the hardware switch is set to turn off the inbuilt radio, then it is hard blocked, and all USB/PCI-attached wifi devices will be seen as off. That’s the way rfkill works at a kernel level.

Oh, good explanation, thanks.
Reading the documentation, it sounds like what is happening at the kernel level cannot be adjusted, at least without knowledge that is way beyond mine.
Best regards,
Howard