eeebuntu tip: unloading/reloading the wifi drivers
There's a particular sequence of rmmod/insmod calls that will force the system to rediscover the wifi, and (for me at least) fixes all the various b0rked states it can get into. I call it the "Magic Wifi Dance," because it's a ritual that I don't completely understand.
My control script is below. You'll need the Atheros drivers and the ASUS ACPI module.
# The sequence here *may* be important.
# (It seems to fail intermittently if you deviate.)
# At least this one's straightforward.
# Force PCI Express Hotplug to reinit
# pciehp_force may be unnecessary; Xandros did it.
modprobe pciehp pciehp_force=1
# Switch on the hardware
echo 1 >/proc/acpi/asus/wlan
echo 0 >/proc/acpi/asus/wlan
case $1 in
if [ "$STAT" = "1" ];
When executed on an "eeebuntu" machine with ASUS's binary modules, that script should be capable of shutting down and bringing up the Atheros wifi card. The
offarguments do what their names imply; the
toggleargument checks the card's status in proc and responds appropriately. (I use
toggleto make the keyboard's wifi key work, which I'll demonstrate in my upcoming post on ACPI events.)
For those playing along at home, this resulting control script is a good one to call from
onarguments, respectively. (Just make sure it's called after the interfaces are shut down on suspend, and before they're brought up on resume. On default Ubuntu, calling the suspend script "56-eee-wifi-off" and the resume script "60-eee-wifi-on" gets the order right.)