[Debian-eeepc-devel] Wifi toggling on '901 (again...)

Phil Endecott phil_dlhbb_endecott at chezphil.org
Sat Sep 13 21:57:56 UTC 2008


Dear All,

I just tried to toggle my wifi and it didn't work, despite me having 
claimed that I had it working smoothly with a very minimal script in wireless.sh.

The problem is this: the pciehp wasn't loaded, so the driver just 
crashed when the hardware went away rather than being unloaded by the 
kernel.  I suspect that when I was testing it before the module had 
been loaded by the earler more complex script and I had never unloaded 
it during testing.

I have now put pciehp in my /etc/modules along with options 
pciehp_force=1 pciehp_slot_with_bus=1.  Now I think it really does work 
with this minimal wireless.sh script:

wlan_control=/sys/devices/platform/eeepc/wlan

case $1 in
     on|enable)
         echo 1 > $wlan_control
	;;
     off|disable)
         echo 0 > $wlan_control
	;;
     *)
	echo "Usage: $0 [on|off]"
	exit 1
	;;
esac


I have also tracked down exactly what happens after you write 1 or 0 to 
$wlan_control.  The chip is "unplugged" or "plugged" in to the bus, 
which is detected by the pciehp module, and uevents are generated. You 
can see these by running "udevadm monitor".  The uevent goes to udevd 
which has a rule in /etc/udev/rules.d/80-drivers.rules that invokes 
/lib/udev/net.agent.  For add, this calls "ifup --allow=hotplug ra0".  
So, as long as you have a line in /etc/network/interfaces saying 
"allow-hotplug ra0", it will try to bring up the interface.  Similarly, 
removing it will run ifdown.

Most of you probably already understood all that, but I had never put 
all the pieces together.

Phil.







More information about the Debian-eeepc-devel mailing list