From 3a9825b27d6fac698514b918ac916ad1788f8c37 Mon Sep 17 00:00:00 2001 From: Isaac Hermida Date: Mon, 8 Feb 2016 11:19:44 +0100 Subject: [PATCH] meta-digi-dey: Add wifi pre/post actions to suspend script It has been observed that the wireless interface ocassionally fails to resume from suspend on extensive long run validation testing, so we workaround it by bringing the interface down before suspend and bring it up again after resume This reverts commit a77cd1406d998ddcd1e8fcb3f504e017a35b9262. https://jira.digi.com/browse/DEL-2217 Signed-off-by: Isaac Hermida --- .../recipes-core/busybox/busybox-1.23.2/suspend | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/meta-digi-dey/recipes-core/busybox/busybox-1.23.2/suspend b/meta-digi-dey/recipes-core/busybox/busybox-1.23.2/suspend index 2f0df579a..84699c6d0 100755 --- a/meta-digi-dey/recipes-core/busybox/busybox-1.23.2/suspend +++ b/meta-digi-dey/recipes-core/busybox/busybox-1.23.2/suspend @@ -25,6 +25,18 @@ usage() { \n" } +suspend_interfaces() { + if grep -qs '^wlan0' /var/run/ifstate; then + ifdown wlan0 && up_wlan_on_resume="1" && sleep 0.5 && rmmod ath6kl_sdio + fi +} + +resume_interfaces() { + if ! grep -qs '^wlan0' /var/run/ifstate; then + [ -n "${up_wlan_on_resume}" ] && modprobe ath6kl_sdio && sleep 0.5 && ifup wlan0 + fi +} + while getopts "h" c; do case "${c}" in h) usage; exit;; @@ -33,12 +45,14 @@ done if [ -f "${syspower}" ]; then # Pre-suspend actions + suspend_interfaces # Suspend the device printf "mem" > ${syspower} sleep .5 # Post-resume actions + resume_interfaces else printf "\n[ERROR] File ${syspower} not found\n\n" fi