aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/rfkill/core.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/net/rfkill/core.c b/net/rfkill/core.c
index 2230aa6b14f3..91e9168b5447 100644
--- a/net/rfkill/core.c
+++ b/net/rfkill/core.c
@@ -773,6 +773,19 @@ static struct class rfkill_class = {
773 .resume = rfkill_resume, 773 .resume = rfkill_resume,
774}; 774};
775 775
776bool rfkill_blocked(struct rfkill *rfkill)
777{
778 unsigned long flags;
779 u32 state;
780
781 spin_lock_irqsave(&rfkill->lock, flags);
782 state = rfkill->state;
783 spin_unlock_irqrestore(&rfkill->lock, flags);
784
785 return !!(state & RFKILL_BLOCK_ANY);
786}
787EXPORT_SYMBOL(rfkill_blocked);
788
776 789
777struct rfkill * __must_check rfkill_alloc(const char *name, 790struct rfkill * __must_check rfkill_alloc(const char *name,
778 struct device *parent, 791 struct device *parent,