Update: Mandriva 2008.1RC2 Zelda Movie Trailer
Mar 23

Digg! this article.

This is a post from the eee User Forums (courtesy of delboy711) I’ve decided to link to. The biggest question I get has to do with wireless issues on Mandriva and Ubuntu. The below configuration is known to work on both Mandriva and Ubuntu. Hope this will help a number of you out there with wireless issues. I have tried it on my Mandriva install and I’ve noticed a number of issues are now resolved. The network interface now comes online and searches out the wireless network when resumed.

Step 1: Create a file “/etc/acpi/events/eee-wifi-on” containing

Code:

# ASUS eeePC Wifi Hotkey (Fn-F2)
event=hotkey ATKD 00000010
action=/etc/acpi/actions/eee-wifi-on-off.sh on

Step 2:Create a file “/etc/acpi/events/eee-wifi-off” containing

Code:
# ASUS eeePC Wifi Hotkey (Fn-F2)
event=hotkey ATKD 00000011
action=/etc/acpi/actions/eee-wifi-on-off.sh off

Step 3: Create a file “/etc/acpi/actions/eee-wifi-on-off.sh” containing

Code:

#!/bin/sh

#FILE: /etc/acpi/eee-wifi-on-off.sh
# main wifi toggle script (loads/unloads modules)

#. /usr/share/acpi-support/key-constants

# The sequence here *is* important.
unload_modules() {
rmmod ath_pci
rmmod ath_rate_sample
rmmod ath_hal
rmmod wlan_ccmp
rmmod wlan_tkip
rmmod wlan_wep
rmmod wlan_acl
rmmod wlan_scan_sta
rmmod wlan
}

# At least this one’s straightforward.
load_modules() {
modprobe ath_pci
}

wifi_on() {
# Force PCI Express Hotplug to reinit
rmmod pciehp
sleep 1
# pciehp_force may be unnecessary; Xandros did it.
modprobe pciehp pciehp_force=1
sleep 1
# Switch on the hardware
echo 1 >/proc/acpi/asus/wlan
sleep 1
load_modules
}

wifi_off() {
unload_modules
echo 0 >/proc/acpi/asus/wlan
}

case $1 in
on)
# acpi_fakekey $KEY_PROG1
wifi_on
;;
off)
# acpi_fakekey $KEY_PROG2
wifi_off
;;
toggle)
STAT=`cat /proc/acpi/asus/wlan`
if [ “$STAT” = “1″ ];
then wifi_off;
else wifi_on;
fi
;;
esac

Step 4: Make this file executable

Code:

chmod +x /etc/acpi/actions/eee-wifi-on-off.sh

Step 5: Thats it!. You should now be able to toggle wireless off and on.

The command:

service acpid restart

OR

reboot is required before it will do anything.

3 Responses to “Fixing Wireless Function Keys - Asus eee PC (Ubuntu and Mandriva)”

  1. Robert Michel Says:

    I just stopped by your blog and thought I would say hello. I like your site design. Looking forward to reading more down the road.

    Robert Michel

  2. swined Says:

    it didnt work on my debian sid. nothing happens if i press the key. if i run the script manually it says that it cant remove some non-existent modules. but anyway it works somehow :)

  3. robotii Says:

    Works for me on eee pc 900 ubuntu hardy

    Only one thing, had to change the last part to sudo /etc/init.d/acpid restart as it did not work to run services command.

Leave a Reply