diff -Nru /tmp/KSs5rMXV4L/acpi-support-0.50/debian/changelog /tmp/5SZRFpLLX4/acpi-support-0.50/debian/changelog --- /tmp/KSs5rMXV4L/acpi-support-0.50/debian/changelog 2005-12-29 15:01:25.000000000 +0200 +++ /tmp/5SZRFpLLX4/acpi-support-0.50/debian/changelog 2006-01-16 02:54:50.000000000 +0200 @@ -1,3 +1,11 @@ +acpi-support (0.50-0ubuntu1) dapper; urgency=low + + * Grep '/proc/net/wireless' if '/sys/class/net/*/wireless' fails + * Work-around for ipw2200 to use 'rf_kill' instead of 'power/state' + * Both together hopefully close for ThinkPads (Ubuntu #26181) + + -- Paul Sladen Mon, 16 Jan 2006 02:49:23 +0200 + acpi-support (0.50) dapper; urgency=low * Load uinput module on boot (Ubuntu #21566) diff -Nru /tmp/KSs5rMXV4L/acpi-support-0.50/wireless.sh /tmp/5SZRFpLLX4/acpi-support-0.50/wireless.sh --- /tmp/KSs5rMXV4L/acpi-support-0.50/wireless.sh 2005-10-01 20:00:40.000000000 +0300 +++ /tmp/5SZRFpLLX4/acpi-support-0.50/wireless.sh 2006-01-16 02:41:38.000000000 +0200 @@ -2,16 +2,33 @@ # Find and enable/disable wireless devices for DEVICE in /sys/class/net/*; do - if [ -d $DEVICE/wireless ]; then -# $DEVICE is a wireless device. Check if it's powered on: - if [ `cat $DEVICE/device/power/state` = 0 ]; then -# It's powered on. Switch it off. - echo -n 3 > $DEVICE/device/power/state; + if [ -d $DEVICE/wireless ] || + # Handle old proc interface aswell + grep -qa "^ *$(basename $DEVICE): " /proc/net/wireless; then + + # Power control parameters + CONTROL=$DEVICE/device/power/state + OFF=3 + ON=0 + + # Paul Sladen 2006-01-15: ipw2200 currently hangs if we try to + # set 'power/state' so special case it and use the 'rf_kill' + # instead. + if readlink $DEVICE/device/driver | grep -qa 'ipw2200$' && + [ -w $DEVICE/device/rf_kill ]; then + CONTROL=$DEVICE/device/rf_kill + OFF=1 + fi + + # $DEVICE is a wireless device. Check if it's powered on: + if [ `cat $CONTROL` = 0 ]; then + # It's powered on. Switch it off. + echo -n $OFF > $CONTROL echo 0 else -# It's powered off. Switch it on. - echo -n 0 > $DEVICE/device/power/state; + # It's powered off. Switch it on. + echo -n $ON > $CONTROL echo 1 fi fi -done +done