Lines Matching refs:state
42 unsigned long state; member
129 if (rfkill->state & RFKILL_BLOCK_ANY) in rfkill_led_trigger_event()
184 if (!(rfkill->state & RFKILL_BLOCK_ANY)) { in rfkill_global_led_trigger_worker()
269 ev->hard = !!(rfkill->state & RFKILL_BLOCK_HW); in rfkill_fill_event()
270 ev->soft = !!(rfkill->state & (RFKILL_BLOCK_SW | in rfkill_fill_event()
331 prev = rfkill->state & RFKILL_BLOCK_SW; in rfkill_set_block()
334 rfkill->state |= RFKILL_BLOCK_SW_PREV; in rfkill_set_block()
336 rfkill->state &= ~RFKILL_BLOCK_SW_PREV; in rfkill_set_block()
339 rfkill->state |= RFKILL_BLOCK_SW; in rfkill_set_block()
341 rfkill->state &= ~RFKILL_BLOCK_SW; in rfkill_set_block()
343 rfkill->state |= RFKILL_BLOCK_SW_SETCALL; in rfkill_set_block()
355 if (rfkill->state & RFKILL_BLOCK_SW_PREV) in rfkill_set_block()
356 rfkill->state |= RFKILL_BLOCK_SW; in rfkill_set_block()
358 rfkill->state &= ~RFKILL_BLOCK_SW; in rfkill_set_block()
360 rfkill->state &= ~RFKILL_BLOCK_SW_SETCALL; in rfkill_set_block()
361 rfkill->state &= ~RFKILL_BLOCK_SW_PREV; in rfkill_set_block()
362 curr = rfkill->state & RFKILL_BLOCK_SW; in rfkill_set_block()
553 rfkill->state |= RFKILL_BLOCK_HW; in rfkill_set_hw_state_reason()
558 rfkill->state &= ~RFKILL_BLOCK_HW; in rfkill_set_hw_state_reason()
560 ret = !!(rfkill->state & RFKILL_BLOCK_ANY); in rfkill_set_hw_state_reason()
578 if (rfkill->state & RFKILL_BLOCK_SW_SETCALL) in __rfkill_set_sw_state()
582 rfkill->state |= bit; in __rfkill_set_sw_state()
584 rfkill->state &= ~bit; in __rfkill_set_sw_state()
595 prev = !!(rfkill->state & RFKILL_BLOCK_SW); in rfkill_set_sw_state()
597 hwblock = !!(rfkill->state & RFKILL_BLOCK_HW); in rfkill_set_sw_state()
641 swprev = !!(rfkill->state & RFKILL_BLOCK_SW); in rfkill_set_states()
642 hwprev = !!(rfkill->state & RFKILL_BLOCK_HW); in rfkill_set_states()
645 rfkill->state |= RFKILL_BLOCK_HW; in rfkill_set_states()
647 rfkill->state &= ~RFKILL_BLOCK_HW; in rfkill_set_states()
732 return sysfs_emit(buf, "%d\n", (rfkill->state & RFKILL_BLOCK_HW) ? 1 : 0); in hard_show()
745 return sysfs_emit(buf, "%d\n", (rfkill->state & RFKILL_BLOCK_SW) ? 1 : 0); in soft_show()
752 unsigned long state; in soft_store() local
758 err = kstrtoul(buf, 0, &state); in soft_store()
762 if (state > 1 ) in soft_store()
767 rfkill_set_block(rfkill, state); in soft_store()
784 static u8 user_state_from_blocked(unsigned long state) in user_state_from_blocked() argument
786 if (state & RFKILL_BLOCK_HW) in user_state_from_blocked()
788 if (state & RFKILL_BLOCK_SW) in user_state_from_blocked()
803 return sysfs_emit(buf, "%d\n", user_state_from_blocked(rfkill->state)); in state_show()
810 unsigned long state; in state_store() local
816 err = kstrtoul(buf, 0, &state); in state_store()
820 if (state != RFKILL_USER_STATE_SOFT_BLOCKED && in state_store()
821 state != RFKILL_USER_STATE_UNBLOCKED) in state_store()
826 rfkill_set_block(rfkill, state == RFKILL_USER_STATE_SOFT_BLOCKED); in state_store()
831 static DEVICE_ATTR_RW(state);
858 u32 state; in rfkill_dev_uevent() local
869 state = rfkill->state; in rfkill_dev_uevent()
873 user_state_from_blocked(state)); in rfkill_dev_uevent()
930 cur = !!(rfkill->state & RFKILL_BLOCK_SW); in rfkill_resume()
958 u32 state; in rfkill_blocked() local
961 state = rfkill->state; in rfkill_blocked()
964 return !!(state & RFKILL_BLOCK_ANY); in rfkill_blocked()
971 u32 state; in rfkill_soft_blocked() local
974 state = rfkill->state; in rfkill_soft_blocked()
977 return !!(state & RFKILL_BLOCK_SW); in rfkill_soft_blocked()
1108 bool soft_blocked = !!(rfkill->state & RFKILL_BLOCK_SW); in rfkill_register()