kernel-module-atheros: Remove atheros wireless before suspend.

By removing the driver on ifdown and loading it on ifup we workaround some
problems found in long run suspend stability testing.

https://jira.digi.com/browse/DEL-1084

Signed-off-by: Alex Gonzalez <alex.gonzalez@digi.com>
This commit is contained in:
Alex Gonzalez 2014-08-04 16:06:33 +02:00
parent 01f7230481
commit f0222aba8d
4 changed files with 33 additions and 11 deletions

View File

@ -20,7 +20,8 @@ SRC_URI_external = "${DIGI_GITHUB_GIT}/atheros.git;protocol=git;nobranch=1"
SRC_URI_internal = "${DIGI_GIT}linux-modules/atheros.git;protocol=git;nobranch=1" SRC_URI_internal = "${DIGI_GIT}linux-modules/atheros.git;protocol=git;nobranch=1"
SRC_URI = "${@base_conditional('DIGI_INTERNAL_GIT', '1' , '${SRC_URI_internal}', '${SRC_URI_external}', d)}" SRC_URI = "${@base_conditional('DIGI_INTERNAL_GIT', '1' , '${SRC_URI_internal}', '${SRC_URI_external}', d)}"
SRC_URI += " \ SRC_URI += " \
file://atheros \ file://atheros-pre-up \
file://atheros-post-down \
file://Makefile \ file://Makefile \
${@base_conditional('IS_KERNEL_2X', '1' , '', 'file://0001-atheros-convert-NLA_PUT-macros.patch', d)} \ ${@base_conditional('IS_KERNEL_2X', '1' , '', 'file://0001-atheros-convert-NLA_PUT-macros.patch', d)} \
${@base_conditional('IS_KERNEL_2X', '1' , '', 'file://0002-atheros-update-renamed-struct-members.patch', d)} \ ${@base_conditional('IS_KERNEL_2X', '1' , '', 'file://0002-atheros-update-renamed-struct-members.patch', d)} \
@ -42,8 +43,9 @@ do_configure_prepend_ccimx6() {
} }
do_install_append() { do_install_append() {
install -d ${D}${sysconfdir}/network/if-pre-up.d install -d ${D}${sysconfdir}/network/if-pre-up.d ${D}${sysconfdir}/network/if-post-down.d
install -m 0755 ${WORKDIR}/atheros ${D}${sysconfdir}/network/if-pre-up.d/ install -m 0755 ${WORKDIR}/atheros-pre-up ${D}${sysconfdir}/network/if-pre-up.d/atheros
install -m 0755 ${WORKDIR}/atheros-post-down ${D}${sysconfdir}/network/if-post-down.d/atheros
install -d ${D}${sysconfdir}/modprobe.d install -d ${D}${sysconfdir}/modprobe.d
cat >> ${D}${sysconfdir}/modprobe.d/atheros.conf <<-_EOF_ cat >> ${D}${sysconfdir}/modprobe.d/atheros.conf <<-_EOF_
install ath6kl_sdio true install ath6kl_sdio true

View File

@ -0,0 +1,24 @@
#!/bin/sh
#===============================================================================
#
# atheros-post-down
#
# Copyright (C) 2014 by Digi International Inc.
# All rights reserved.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 as published by
# the Free Software Foundation.
#
#
# !Description: Unload Atheros' wireless driver
#
#===============================================================================
set -e
[ "${IFACE}" != "wlan0" ] && exit 0
if grep -qs ath6kl_sdio /proc/modules; then
rmmod ath6kl_sdio > /dev/null
fi

View File

@ -36,10 +36,8 @@ suspend_interfaces() {
# has problems on suspend-resume, so we workaround it by bringing the # has problems on suspend-resume, so we workaround it by bringing the
# interface down before suspend and bring it up again after resume. # interface down before suspend and bring it up again after resume.
# (#35777, #40082) # (#35777, #40082)
if grep -qs 'wlan0' /proc/net/dev; then if grep -qs '^wlan0' /var/run/ifstate; then
if grep -qs '^wlan0' /var/run/ifstate; then ifdown wlan0 && up_wlan_on_resume="1"
ifdown wlan0 && up_wlan_on_resume="1"
fi
fi fi
} }
@ -48,10 +46,8 @@ resume_interfaces() {
# has problems on suspend-resume, so we workaround it by bringing the # has problems on suspend-resume, so we workaround it by bringing the
# interface down before suspend and bring it up again after resume. # interface down before suspend and bring it up again after resume.
# (#35777, #40082) # (#35777, #40082)
if grep -qs 'wlan0' /proc/net/dev; then if ! grep -qs '^wlan0' /var/run/ifstate; then
if ! grep -qs '^wlan0' /var/run/ifstate; then [ -n "${up_wlan_on_resume}" ] && ifup wlan0
[ -n "${up_wlan_on_resume}" ] && ifup wlan0
fi
fi fi
} }