[Debian-eeepc-devel] Fix for 2.6.26 PCI hotplug error when enabling wireless

oz oz at bluemonk.de
Sun Aug 31 21:20:29 UTC 2008


On Sun, 31 Aug 2008 16:27:26 -0400
Eric Cooper <ecc at cmu.edu> wrote:

> I think I was the one who originally contributed this script, and Nico
> later checked it in as part of the eeepc-acpi-scripts package.
> 
> I based it on various "black magic" solutions that had been posted on
> the eeeusers forum, and made it as simple as I could through trial and
> error.

Yes, after thinking all is easy, I met that "black magic" on my 901
today. The simplified version works for a while flawless, but somehow
it was disturbed and the unload/load of ra0  produced errors. I just
could initialize it again with the longer version of wireless.sh:

case $1 in
    on|enable)
        if [ $(cat $wlan_control) = 0 ]; then
            modprobe -r pciehp
            modprobe pciehp pciehp_force=1 pciehp_slot_with_bus=1
            echo 1 > $wlan_control
            #detect_wlan
            #modprobe $WLAN_MOD
            # adding a sleep here, due to some bug the driver loading
is not atomic here # and could cause ifconfig to fail
            #sleep 1
            #if ! ifconfig $WLAN_IF up; then exec $0 off; fi
        fi
        ;;
    off|disable)
        if [ $(cat $wlan_control) = 1 ]; then
            detect_wlan
            ifdown --force $WLAN_IF
            modprobe -r $WLAN_MOD
            echo 0 > $wlan_control
        fi
        ;;
    *)

Once the system is out of chaos with the upper script, I can revert to:

case $1 in
    on|enable)
        if [ $(cat $wlan_control) = 0 ]; then
            echo 1 > $wlan_control
        fi
        ;;
    off|disable)
        if [ $(cat $wlan_control) = 1 ]; then
            echo 0 > $wlan_control
        fi
        ;;


My conlusion is, that I now take the upper version with modprobe -r
and pciehp to have a predictable system.

> Without the module unloading, etc., it still does not work on my 701,
> BIOS 1101, running kernel 2.6.26.  For example, if you just load
> pciehp, then toggle the wlan sys variable, the kernel does not see any
> new device.  If you just load the ath-pci module without first
> unloading/reloading pciehp, the wifi0 and ath0 interfaces don't get
> created.

Yes, the same effects here with 901 and ra0, when the script is not
appropriate.

Cheers



More information about the Debian-eeepc-devel mailing list