ccimx6ul: suspend: unload wireless module always before suspending

The suspend script was unloading the wireless module driver *only* if the
interface 'wlan0' was previously up. If the interface is down the module
does not unload and the system fails to suspend.

This patch removes the module always if it appears in the list of loaded
modules.

While on it, move the unloading of wireless after the unloading of
Bluetooth, to be in line with the reversed order in which they are loaded
on the resume_interfaces() call.

Signed-off-by: Hector Palacios <hector.palacios@digi.com>

https://jira.digi.com/browse/DEL-3241
This commit is contained in:
Hector Palacios 2016-11-30 12:01:04 +01:00
parent e441b6fec5
commit e7a21cdad0
1 changed files with 6 additions and 3 deletions

View File

@ -26,12 +26,15 @@ usage() {
} }
suspend_interfaces() { suspend_interfaces() {
if grep -qs '^wlan0' /var/run/ifstate; then
ifdown wlan0 && up_wlan_on_resume="1" && sleep 0.5 && rmmod wlan
fi
if hcitool -i hci0 dev >/dev/null 2>&1; then if hcitool -i hci0 dev >/dev/null 2>&1; then
hciconfig hci0 down && up_hci0_on_resume="1" && sleep 0.5 hciconfig hci0 down && up_hci0_on_resume="1" && sleep 0.5
fi fi
if grep -qs '^wlan0' /var/run/ifstate; then
ifdown wlan0 && up_wlan_on_resume="1" && sleep 0.5
fi
if grep -qs '^wlan' /proc/modules; then
rmmod wlan
fi
} }
resume_interfaces() { resume_interfaces() {