[Debian-eeepc-devel] Fix for 2.6.26 PCI hotplug error when enabling wireless
oz
oz at bluemonk.de
Sat Aug 30 13:51:16 UTC 2008
On Sat, 30 Aug 2008 13:17:44 +0100
"Phil Endecott" <phil_dlhbb_endecott at chezphil.org> wrote:
> Can anyone explain why the existing code is like it is? Why do we need
> to remove and re-load the pciehp module at all?
Good question. Pciehp (hotplug-module) seems to be unnecessary on the
901. I deleted those entries in the toggle-on section, and wireless.sh
work as good as before for me and is pretty simple now:
#!/bin/sh
. /usr/share/eeepc-acpi-scripts/functions.sh
wlan_control=/sys/devices/platform/eeepc/wlan
[ -e $wlan_control ] || wlan_control=/proc/acpi/asus/wlan # pre-2.6.26
case $1 in
on|enable)
if [ $(cat $wlan_control) = 0 ]; then
echo 1 > $wlan_control
fi
;;
off|disable)
if [ $(cat $wlan_control) = 1 ]; then
detect_wlan
ifdown --force $WLAN_IF
modprobe -r $WLAN_MOD
echo 0 > $wlan_control
fi
;;
*)
echo "Usage: $0 [on|off]"
exit 1
;;
esac
I read in the manpage, how to provide a patch. That's it:
/etc/acpi/actions# diff -Naur /mnt/old/wireless.sh wireless.sh
--- /mnt/old/wireless.sh 2008-08-30 14:34:18.000000000 +0200
+++ wireless.sh 2008-08-30 15:21:48.000000000 +0200
@@ -8,15 +8,7 @@
case $1 in
on|enable)
if [ $(cat $wlan_control) = 0 ]; then
- modprobe -r pciehp
- modprobe pciehp pciehp_force=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)
> Why the explicit "modprobe $WLAN_MOD"? Surely after you do "echo 1 >
> $wlan_control" the pcie hotplug system will detect the newly-enabled
> device and the kernel (with the help of udev) will load the module (if
> it's not already loaded) and it will associate itself with the device.
Ack. Maybe these script entries were made for previous models of the
eee (700, 900).
> > Because ra0 is already up at that time, 'ifconfig $WLAN_IF up' has to fail
>
> No, I think that "ifconfig up" on an interface that's already up will succeed.
hm, I thougt, I tested it. But I'm not 100% sure, so I tried it again a
few minutes ago while ra0 was present:
ra0 Link encap:Ethernet HWaddr 00:15:af:e7:39:56
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:6104 errors:0 dropped:0 overruns:0 frame:0
TX packets:5416 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:756575 (738.8 KiB) TX bytes:0 (0.0 B)
Interrupt:19
ebony:/etc/acpi/actions# ifconfig ra0 up
ebony:/etc/acpi/actions# echo $?
0
...so, exit-code 0, no problem with the ifconfig-command - you're right.
> In summary, to make this work with the 901 I've found that it's only
> necessary to add the "pciehp_slot_with_bus=1" option. oz has made more
> changes (above) but I've not found them necessary. But I don't see why
> this script needs to be as complicated as it is.
Could you please check, if my further simplified version works for you
also?
Do you use any kind of network-manager?
Thanks,
oz
More information about the Debian-eeepc-devel
mailing list