Bug 1321564 - NetworkManager doesn't respond to XF86WLAN and XF86Bluetooth on MSI GE60
Summary: NetworkManager doesn't respond to XF86WLAN and XF86Bluetooth on MSI GE60
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: gnome-shell
Version: 23
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Owen Taylor
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-03-28 12:16 UTC by Johan Heikkila
Modified: 2016-12-06 21:17 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-07-27 15:40:38 UTC
Type: Bug


Attachments (Terms of Use)

Description Johan Heikkila 2016-03-28 12:16:40 UTC
Description of problem:

Pressing Wifi and Bluetooth function keys (FN+F8 and Fn+F9) does not toggle Wifi and Bluetooth on the MSI GE60-0ND laptop. Turning on/off Wifi and Bluetooth in Gnome Status menu works, but Wifi and Bluetooth status LEDs on the front never light up. rfkill block/unblock from command line also turns off/on Wifi and Bluetooth.

Running xev and pressing Fn+F8 (Wifi) gives the following output:

KeyPress event, serial 36, synthetic NO, window 0x2a00001,
    root 0xd5, subw 0x0, time 2357636, (1370,782), root:(1420,896),
    state 0x10, keycode 246 (keysym 0x1008ff95, XF86WLAN), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 36, synthetic NO, window 0x2a00001,
    root 0xd5, subw 0x0, time 2357639, (1370,782), root:(1420,896),
    state 0x10, keycode 246 (keysym 0x1008ff95, XF86WLAN), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False


Running xev and pressing Fn+F9 (Bluetooth) gives the following output:

KeyPress event, serial 36, synthetic NO, window 0x2a00001,
    root 0xd5, subw 0x0, time 2358929, (1370,782), root:(1420,896),
    state 0x10, keycode 245 (keysym 0x1008ff94, XF86Bluetooth), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 36, synthetic NO, window 0x2a00001,
    root 0xd5, subw 0x0, time 2358932, (1370,782), root:(1420,896),
    state 0x10, keycode 245 (keysym 0x1008ff94, XF86Bluetooth), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False


The keybindings (XF86WLAN and XF86Bluetooth) look correct.


From xmodmap -pke:
keycode 245 = XF86Bluetooth NoSymbol XF86Bluetooth
keycode 246 = XF86WLAN NoSymbol XF86WLAN

showkey -k
keycode 237 press     (Fn+F8/Wifi)
keycode 237 release
keycode 238 press     (Fn+F9/Bluetooth)
keycode 238 release

showkey -s
0xe0 0x73 0xe0 0xf3   (Fn+F8/Wifi)
0xe0 0x72 0xe0 0xf2   (Fn+F9/Bluetooth)


With Wifi and Bluetooth enabled:

rfkill list
0: phy0: Wireless LAN
	Soft blocked: no
	Hard blocked: no
2: hci0: Bluetooth
	Soft blocked: no
	Hard blocked: no

When turning off Wifi and Bluetooth (in Gnome Status menu or with rfkill):

rfkill list
0: phy0: Wireless LAN
	Soft blocked: yes
	Hard blocked: no
2: hci0: Bluetooth
Soft blocked: yes
Hard blocked: no


rfkill block and unblock works as expected.


Function keys Fn+F8 and Fn+F9 never change the output of rfkill.




Version-Release number of selected component (if applicable):

rpm -qi NetworkManager
Name        : NetworkManager
Epoch       : 1
Version     : 1.0.10
Release     : 3.fc23
Architecture: x86_64


How reproducible:

Always

Comment 1 Johan Heikkila 2016-04-04 21:03:27 UTC
Found out that there is a msi-laptop and msi-wmi kernel module. By loading the msi-laptop module, msi-wmi is also loaded. Now the wlan and bluetooth status lights work, but the function keys still don't. There is now a message "msi_wmi: Unknown event received" from the msi-wmi module, but it says that for most of the other function keys that already work, so the module feels a bit redundant.

Comment 2 Johan Heikkila 2016-04-04 22:23:50 UTC
I made a custom script that toggles 

/sys/devices/platform/msi-laptop-pf/rfkill/rfkill0/state   (bluetooth)

and

/sys/devices/platform/msi-laptop-pf/rfkill/rfkill1/state   (wlan)

Then added the script to /etc/sudoers so that people have permissions to run this script. 

Then made custom shortcuts in Gnome so that Fn+F8 and Fn+F9 runs the script.

So for my part the keys are working now using the custom script. But how to make it work without custom scripts? Where should this functionality be?

Comment 3 Johan Heikkila 2016-07-27 13:17:41 UTC
The behavior has changed in Fedora 24 and now when pushing the Wifi button, Airplane mode is activated. Well, I guess this is good enough...

Comment 4 Dan Williams 2016-07-27 15:40:38 UTC
NM is a system service and thus it cannot listen for keyboard events unless they are intercepted by the kernel and processed through the rfkill framework.  In this case it seems those events are coming through Xorg so NM doesn't have access to them.

What might happen is that GNOME (or whatever DE a user happens to run) listens for those standard key names and when it receives them, it either explicitly blocks WiFi/BT or it tells NetworkManager to block WiFi.  But since NM cannot listen for those, something in the DE must do that.

I think GNOME has improved the rfkill support in F24 which is probably why this is now fixed...

Comment 5 Johan Heikkila 2016-07-27 23:03:10 UTC
Thanks. It is really hard to figure out which component to select when reporting bugs such as these.

Comment 6 Razor 2016-12-06 21:17:42 UTC
hello

I'm new to linux and i have quite similar problem with my hp 15-g207AX laptop.
Pressing F12 key enable/disable airplane mode but it's not enabling my WIFI.

..............................................................................
razor@kali:~$ sudo rfkill list
1: hci0: Bluetooth
	Soft blocked: no
	Hard blocked: no
.............................................................................

rfkill list only showing bluetooth and not showing Wireless Lan

Please tell me what more info to post for proper diagnose. 

Please help and Thank you.


Note You need to log in before you can comment on or make changes to this bug.