Skip to content

Commit

Permalink
rfkill: honour EPO state when resuming a rfkill controller
Browse files Browse the repository at this point in the history
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 <[email protected]>
Cc: Ivo van Doorn <[email protected]>
Signed-off-by: John W. Linville <[email protected]>
  • Loading branch information
hmh authored and linvjw committed Oct 31, 2008
1 parent d003922 commit 1767079
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions net/rfkill/rfkill.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 1767079

Please sign in to comment.