From 601666356842d9e348fd0e66ac45b38733ed9c30 Mon Sep 17 00:00:00 2001 From: "sleffler@google.com" Date: Fri, 16 Oct 2009 17:07:56 +0000 Subject: [PATCH] Temporary workaround for wireless suspend/resume. Mark the wlan0 interface down on suspend and back up on resume to prod connman into action. The result isn't exactly what we want as connman won't return to the previous ap if another, previously visited ap, is found with higher signal strength. Also this is very heavyweight, the better behaviour is to simulate a beacon miss on resume and try to reassociate to the same ap; then roam if that fails--but getting that behaviour will take more work so add this for now. Review URL: http://chromereview.prom.corp.google.com/1175077 git-svn-id: svn://chrome-svn/chromeos/trunk@57 06c00378-0e64-4dae-be16-12b19f9950a1 --- customize_rootfs.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/customize_rootfs.sh b/customize_rootfs.sh index 36c029efb8..56723e7cf3 100755 --- a/customize_rootfs.sh +++ b/customize_rootfs.sh @@ -217,7 +217,7 @@ cat < /etc/acpi/events/lidbtn event=button[ /]lid action=/etc/acpi/lid.sh EOF -cat < /etc/acpi/lid.sh +cat <<'EOF' > /etc/acpi/lid.sh #!/bin/sh # On lid close: # - lock the screen @@ -228,9 +228,16 @@ export HOME=/home/chronos #CRYPTOHOME=/dev/mapper/cryptohome #/usr/bin/test -b $CRYPTOHOME && /sbin/dmsetup suspend $CRYPTOHOME +# - stop wireless if UP +wlan0isup=`/sbin/ifconfig wlan0 2>/dev/null | /bin/grep UP` +test "$wlan0isup" && /sbin/ifconfig wlan0 down + # - suspend to ram echo -n mem > /sys/power/state +# - restore wireless state +test "$wlan0isup" && /sbin/ifconfig wlan0 up + # On lid open: # - resume cryptohome device #/usr/bin/test -b $CRYPTOHOME && /sbin/dmsetup resume $CRYPTOHOME