# [solved, kinda] rfkill available but defunct (?) on 2.6.28

## lxg

On my EeePC, activating/deactivating WLAN/Bluetooth via /sys/class/rfkill/ doesn't work.

As opposed to 2.6.27-gentoo-r2, the /sys/class/rfkill interface is now no longer empty but appears to be functional. On my machine, rfkill0 is WLAN, while rfkill1 is Bluetooth (according to the ./name entries).

```
find /sys/class/rfkill/rfkill0/

/sys/class/rfkill/rfkill0/

/sys/class/rfkill/rfkill0/uevent

/sys/class/rfkill/rfkill0/subsystem

/sys/class/rfkill/rfkill0/device

/sys/class/rfkill/rfkill0/name

/sys/class/rfkill/rfkill0/type

/sys/class/rfkill/rfkill0/state

/sys/class/rfkill/rfkill0/claim

/sys/class/rfkill/rfkill0/power

/sys/class/rfkill/rfkill0/power/wakeup

```

According to the documentation, echoing 1 or 0 to /sys/class/rfkill/rfkillX/state should activate/deactivate the device in question. Toggling to userspace control via /sys/class/rfkill/rfkillX/claim appears to be required.

However, this does not work on my machine. No matter to which values I set the ./claim and ./state files to (tried all combinations), there is no effect. Bluetooth and WLAN are always functional (tested with hciconfig and iwconfig and by scanning with each device).

Another very weird error:

```
eeepc ~ # echo 0 > /sys/class/rfkill/rfkill0/state  # no problem

eeepc ~ # echo 1 > /sys/class/rfkill/rfkill0/state  # no problem

eeepc ~ # echo 0 > /sys/class/rfkill/rfkill1/state  # no problem

eeepc ~ # echo 1 > /sys/class/rfkill/rfkill1/state  # wtf?

-bash: echo: write error: No such device
```

(However, this may have to do with https://bugs.gentoo.org/show_bug.cgi?id=246401, although I was told this is not really a bug.)

Does somebody share my experience, or have a clue on what to do?

----------

## gringo

i dont have the hardware yet, i can just talk about what i´ve read here and there.

On the gentoo wiki are a few links around and one of them points to the debian wiki :

http://wiki.debian.org/DebianEeePC/Model/901#head-8387fe6d18409835f5543fe1ca03d6954f7b641b

 *Quote:*   

> Bluetooth works OK, but only if enabled from the BIOS.
> 
> With Linux kernels prior to 2.6.28 you need to patch the eeepc_laptop module (or eeepc_acpi in older kernels) to be able to control the power switch of the bluetooth module (it's an USB device, much like the webcam). Patch for the eeepc_acpi module can be found at [1]. Patch for the eeepc_laptop module can be found at [2]. Modules with this patch provide a control in /sys/devices/platform/eeepc/bt (or /proc/acpi/asus/bt) for the bluetooth module, that works just like controls for other Eee peripherals.
> 
> In 2.6.28, the kernel's rfkill subsystem is used for toggling bluetooth and wlan, and the settings for both appear not to be persistent. However, a patch is needed to allow bluetooth toggling to work, and eeepc-acpi-scripts 1.0.10 doesn't know about rfkill (this patch is needed). 

 

hope this helps, don´t know if those patches ar upstream or not, specially this one -> http://lkml.org/lkml/2008/12/3/254

cheers

----------

## lxg

 *gringo wrote:*   

>  *Quote:*   
> 
> In 2.6.28, the kernel's rfkill subsystem is used for toggling bluetooth and wlan, and the settings for both appear not to be persistent. However, a patch is needed to allow bluetooth toggling to work, and eeepc-acpi-scripts 1.0.10 doesn't know about rfkill (this patch is needed).  

 

Thank you!

That explains much of it. So, I guess we just have to wait till it's fixed in the kernel.

----------

## gringo

edit : i have just triple-checked current git and they have moved around all kind of stuff, i doubt patches from my latets post will apply to anything that got latest acpi patches applied.

cheers

----------

## lxg

Ok, thank you again.

I think I can wait until the release. I myself don't care too much about bluetooth anyway (would be nice to get it working perfect however). I just was more looking for a solution for the problem with eee-control. But requiring users to manually patch the kernel is not an option.  :Wink: 

----------

