summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenrique de Moraes Holschuh <hmh@hmh.eng.br>2008-10-09 23:15:32 +0200
committerJohn W. Linville <linville@tuxdriver.com>2008-11-01 00:00:10 +0100
commit176707997bc3da2c4e32715c35cfebba0334ed68 (patch)
tree17999628a3586c7bf656c83e61f77b7da0d06e46
parentrfkill: add master_switch_mode and EPO lock to rfkill and rfkill-input (diff)
downloadlinux-176707997bc3da2c4e32715c35cfebba0334ed68.tar.xz
linux-176707997bc3da2c4e32715c35cfebba0334ed68.zip
rfkill: honour EPO state when resuming a rfkill controller
rfkill_resume() would always restore the rfkill controller state to its pre-suspend state. Now that we know when we are under EPO, kick the rfkill controller to SOFT_BLOCKED state instead of to its pre-suspend state when it is resumed while EPO mode is active. Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br> Cc: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--net/rfkill/rfkill.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/net/rfkill/rfkill.c b/net/rfkill/rfkill.c
index e348eab756f3..c9180c8771c6 100644
--- a/net/rfkill/rfkill.c
+++ b/net/rfkill/rfkill.c
@@ -581,8 +581,17 @@ static int rfkill_resume(struct device *dev)
dev->power.power_state.event = PM_EVENT_ON;
- /* restore radio state AND notify everybody */
- rfkill_toggle_radio(rfkill, rfkill->state, 1);
+ /*
+ * If we are under EPO, kick transmitter offline,
+ * otherwise restore to pre-suspend state.
+ *
+ * Issue a notification in any case
+ */
+ rfkill_toggle_radio(rfkill,
+ rfkill_epo_lock_active ?
+ RFKILL_STATE_SOFT_BLOCKED :
+ rfkill->state,
+ 1);
mutex_unlock(&rfkill->mutex);
}