diff options
author | Johannes Berg | 2009-06-02 13:01:40 +0200 |
---|---|---|
committer | John W. Linville | 2009-06-03 20:06:14 +0200 |
commit | 6081162e2ed78dfcf149b076b047078ab1445cc2 (patch) | |
tree | aef1cf51ee0a8f77f562defe1fe8ec75812474b7 /include/linux | |
parent | cfg80211: move txpower wext from mac80211 (diff) | |
download | kernel-qcow2-linux-6081162e2ed78dfcf149b076b047078ab1445cc2.tar.gz kernel-qcow2-linux-6081162e2ed78dfcf149b076b047078ab1445cc2.tar.xz kernel-qcow2-linux-6081162e2ed78dfcf149b076b047078ab1445cc2.zip |
rfkill: add function to query state
Sometimes it is necessary to know how the state is,
and it is easier to query rfkill than keep track of
it somewhere else, so add a function for that. This
could later be expanded to return hard/soft block,
but so far that isn't necessary.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/rfkill.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/linux/rfkill.h b/include/linux/rfkill.h index 7c116f6631b8..ee3eddea8568 100644 --- a/include/linux/rfkill.h +++ b/include/linux/rfkill.h @@ -261,6 +261,13 @@ void rfkill_set_states(struct rfkill *rfkill, bool sw, bool hw); * registered drivers? */ void rfkill_set_global_sw_state(const enum rfkill_type type, bool blocked); + +/** + * rfkill_blocked - query rfkill block + * + * @rfkill: rfkill struct to query + */ +bool rfkill_blocked(struct rfkill *rfkill); #else /* !RFKILL */ static inline struct rfkill * __must_check rfkill_alloc(const char *name, @@ -313,6 +320,11 @@ static inline void rfkill_set_global_sw_state(const enum rfkill_type type, bool blocked) { } + +static inline bool rfkill_blocked(struct rfkill *rfkill) +{ + return false; +} #endif /* RFKILL || RFKILL_MODULE */ |