diff options
author | Henrique de Moraes Holschuh <hmh@hmh.eng.br> | 2008-10-09 23:15:30 +0200 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-11-01 00:00:09 +0100 |
commit | 68d2413bec7e1d97e906eafb05e78d925a5ca128 (patch) | |
tree | 8282f58381f95108bf891739a866bbe089bb4957 /net/rfkill/rfkill.c | |
parent | rfkill: use killable locks instead of interruptible (diff) | |
download | linux-68d2413bec7e1d97e906eafb05e78d925a5ca128.tar.xz linux-68d2413bec7e1d97e906eafb05e78d925a5ca128.zip |
rfkill: export global states to rfkill-input
Export the the global switch states to rfkill-input. This is needed to
properly implement KEY_* handling without disregarding the initial state.
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>
Diffstat (limited to '')
-rw-r--r-- | net/rfkill/rfkill.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/net/rfkill/rfkill.c b/net/rfkill/rfkill.c index 08be968f578d..fdf87d2ab25e 100644 --- a/net/rfkill/rfkill.c +++ b/net/rfkill/rfkill.c @@ -324,6 +324,19 @@ void rfkill_restore_states(void) EXPORT_SYMBOL_GPL(rfkill_restore_states); /** + * rfkill_get_global_state - returns global state for a type + * @type: the type to get the global state of + * + * Returns the current global state for a given wireless + * device type. + */ +enum rfkill_state rfkill_get_global_state(const enum rfkill_type type) +{ + return rfkill_global_states[type].current_state; +} +EXPORT_SYMBOL_GPL(rfkill_get_global_state); + +/** * rfkill_force_state - Force the internal rfkill radio state * @rfkill: pointer to the rfkill class to modify. * @state: the current radio state the class should be forced to. @@ -834,6 +847,7 @@ int rfkill_set_default(enum rfkill_type type, enum rfkill_state state) if (!test_and_set_bit(type, rfkill_states_lockdflt)) { rfkill_global_states[type].default_state = state; + rfkill_global_states[type].current_state = state; error = 0; } else error = -EPERM; |