Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 150685
b: refs/heads/master
c: 6081162
h: refs/heads/master
i:
  150683: 7016b6f
v: v3
  • Loading branch information
Johannes Berg authored and John W. Linville committed Jun 3, 2009
1 parent 0735419 commit 086d4d4
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7643a2c3fcc13cd6fbd731f214463547383418ae
refs/heads/master: 6081162e2ed78dfcf149b076b047078ab1445cc2
12 changes: 12 additions & 0 deletions trunk/include/linux/rfkill.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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 */


Expand Down
13 changes: 13 additions & 0 deletions trunk/net/rfkill/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -773,6 +773,19 @@ static struct class rfkill_class = {
.resume = rfkill_resume,
};

bool rfkill_blocked(struct rfkill *rfkill)
{
unsigned long flags;
u32 state;

spin_lock_irqsave(&rfkill->lock, flags);
state = rfkill->state;
spin_unlock_irqrestore(&rfkill->lock, flags);

return !!(state & RFKILL_BLOCK_ANY);
}
EXPORT_SYMBOL(rfkill_blocked);


struct rfkill * __must_check rfkill_alloc(const char *name,
struct device *parent,
Expand Down

0 comments on commit 086d4d4

Please sign in to comment.