# Wireless switch via function key

## nicolaevladescu

Hello,

I have a Dell XPS L502X that uses the Function Key + F2 to enable or disable bluetooth and/org wireless.

The rfkill list tells me that the interface is hard blocked, wich is true, because i had it off before installing gentoo, and also i have a led above the keyboard that is lit when the wireless and bluetooth are turned on.

The problem is that i cannot turn it on, since FN + F2 have no effect.

Is this a kernel issue or userspace?

I have the RF kill subsystem in the kernel, also hid devices.

P.S. the brightness and volume function keys work.

Thanks.

----------

## khayyam

nicolaevladescu ...

A hard block will require the hardware switch to toggle the current state. My guess is that your 'fnmode' key is the issue, as the keys may be set to not require the fn (in my case I had to set this via /sys so that by defualt they would work as F1-F12 but media keys were accessed with fn), I'd suggest looking under sys for 'fnmode' eg:

```
# find /sys -name "fnmode" -print
```

You would then 'echo 2 > /path/to/fnmode' (assuming the particular driver for the Dell is similarly configured to my own).

If my assumption is correct, you may be able to toggle the card without the fn key (as the media keys would be default), if this is not the case then there may be something missing wrt HID, but not having a Dell I'm not entirely sure what should be enabled.

best ... khay

----------

## nicolaevladescu

 *khayyam wrote:*   

> nicolaevladescu ...
> 
> A hard block will require the hardware switch to toggle the current state. My guess is that your 'fnmode' key is the issue, as the keys may be set to not require the fn (in my case I had to set this via /sys so that by defualt they would work as F1-F12 but media keys were accessed with fn), I'd suggest looking under sys for 'fnmode' eg:
> 
> ```
> ...

 

No relevant file found, just /sys/module/hid_apple/parameters/fnmode which i doubt it refers to my hardware.

----------

## mbar

I have Dell Studio 17 (model 1747) which also uses Fn+F2 to disable/enable radio. Unfortunately this problem is only "solved" when you boot Windows and then use Fn+F2 to enable radio, afterwards reboot to Gentoo.

----------

## BillWho

I've been trying to get my function keys to work properly on a dell laptop, but strangely I can only get the brightness fn+f4 and fn+f5 to work. 

I checked the keycodes with  xev and they appear to be OK. Stranger yet they all work fine in lmde. So, if for some strange reason I loose the wireless, I have to boot lmde to turn it back on   :Confused: 

I googled around and couldn't find a way to to toggle it from the cl like you can the brightness.

Also find /sys -name "fnmode" -print returns nothing at all for me.

----------

## nicolaevladescu

I was using xfce4 with xfwm4 and after swtiched to compiz.

In both scenarios i could not use FN+F2 to enable wireless and bluetooth.

However, i switched to razor qt with kwin, and i could see log info in /var/log/messages when i pressed FN+F2 and it worked, rfkill reported the hard lock as off.

Don't know if this is a window manager or desktop environment issue, or just coincidence and something i did after enabled this. ( kernel upgrade to 3.6.0 ruled out, because i did it yesterday, after i got this to work )

P.S. the info led above the keyboard does not turn on ( lit ) like when you toggle this wireless switch on windows, even though i can enable the wireless now.

Hope it helps somebody else, as oppose to using windows to turn it on, at least it's a workaround that worked for me.

P.P.S i do not suggest somebody should change his DE or WM just to get this hardware switch via FN+F2 combination to work, but giving a hint to what might be one possible scenario to search for solutions or other workarounds, fixes or what not related to this problem.

----------

## BillWho

I looked into this a little further today and I was able to bring wlan0 down via fn+f2.

However when I hit the key combo again it didn't come back up as it does in lmde. But, when I executed /etc/init.d/net.wlan0 restart it came back up.

Also I could shut it off with echo "0" >/sys/devices/pci0000:00/0000:00:1c.3/0000:09:00.0/ieee80211/phy0/rfkill2/state, but echoing "1" didn't bring it back up. However it did start after /etc/init.d/net.wlan0 restart

I think part of my problem was not having CONFIG_RFKILL and CONFIG_RFKILL_INPUT  enabled.  After enabling them I got it partly working    :Confused: 

Hope this helps a little   :Smile: 

----------

