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
This commit is contained in:
sleffler@google.com 2009-10-16 17:07:56 +00:00
parent a763728b24
commit 6016663568

View File

@ -217,7 +217,7 @@ cat <<EOF > /etc/acpi/events/lidbtn
event=button[ /]lid event=button[ /]lid
action=/etc/acpi/lid.sh action=/etc/acpi/lid.sh
EOF EOF
cat <<EOF > /etc/acpi/lid.sh cat <<'EOF' > /etc/acpi/lid.sh
#!/bin/sh #!/bin/sh
# On lid close: # On lid close:
# - lock the screen # - lock the screen
@ -228,9 +228,16 @@ export HOME=/home/chronos
#CRYPTOHOME=/dev/mapper/cryptohome #CRYPTOHOME=/dev/mapper/cryptohome
#/usr/bin/test -b $CRYPTOHOME && /sbin/dmsetup suspend $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 # - suspend to ram
echo -n mem > /sys/power/state echo -n mem > /sys/power/state
# - restore wireless state
test "$wlan0isup" && /sbin/ifconfig wlan0 up
# On lid open: # On lid open:
# - resume cryptohome device # - resume cryptohome device
#/usr/bin/test -b $CRYPTOHOME && /sbin/dmsetup resume $CRYPTOHOME #/usr/bin/test -b $CRYPTOHOME && /sbin/dmsetup resume $CRYPTOHOME