Lines Matching refs:state

42 	unsigned long		state;
107 "Default initial state for all radio types, 0 = radio off");
126 if (rfkill->state & RFKILL_BLOCK_ANY)
181 if (!(rfkill->state & RFKILL_BLOCK_ANY)) {
265 ev->hard = !!(rfkill->state & RFKILL_BLOCK_HW);
266 ev->soft = !!(rfkill->state & (RFKILL_BLOCK_SW |
303 * @blocked: the new software state
319 * _hard_ kill state -- whenever something tries to change the
320 * current software state query the hardware state too.
326 prev = rfkill->state & RFKILL_BLOCK_SW;
329 rfkill->state |= RFKILL_BLOCK_SW_PREV;
331 rfkill->state &= ~RFKILL_BLOCK_SW_PREV;
334 rfkill->state |= RFKILL_BLOCK_SW;
336 rfkill->state &= ~RFKILL_BLOCK_SW;
338 rfkill->state |= RFKILL_BLOCK_SW_SETCALL;
350 if (rfkill->state & RFKILL_BLOCK_SW_PREV)
351 rfkill->state |= RFKILL_BLOCK_SW;
353 rfkill->state &= ~RFKILL_BLOCK_SW;
355 rfkill->state &= ~RFKILL_BLOCK_SW_SETCALL;
356 rfkill->state &= ~RFKILL_BLOCK_SW_PREV;
357 curr = rfkill->state & RFKILL_BLOCK_SW;
384 * __rfkill_switch_all - Toggle state of all switches of given type
386 * @blocked: the new state
388 * This function sets the state of all switches of given type,
407 * rfkill_switch_all - Toggle state of all switches of given type
409 * @blocked: the new state
411 * Acquires rfkill_global_mutex and calls __rfkill_switch_all(@type, @state).
435 * The global state before the EPO is saved and can be restored later
463 * Restore (and sync switches to) the global state from the
483 * rfkill_remove_epo_lock - unlock state changes
485 * Used by rfkill-input manually unlock state changes, when
513 * rfkill_get_global_sw_state - returns global state for a type
514 * @type: the type to get the global state of
516 * Returns the current global state for a given wireless
533 prev = !!(rfkill->state & RFKILL_BLOCK_HW);
535 rfkill->state |= RFKILL_BLOCK_HW;
537 rfkill->state &= ~RFKILL_BLOCK_HW;
538 ret = !!(rfkill->state & RFKILL_BLOCK_ANY);
556 if (rfkill->state & RFKILL_BLOCK_SW_SETCALL)
560 rfkill->state |= bit;
562 rfkill->state &= ~bit;
573 prev = !!(rfkill->state & RFKILL_BLOCK_SW);
575 hwblock = !!(rfkill->state & RFKILL_BLOCK_HW);
619 swprev = !!(rfkill->state & RFKILL_BLOCK_SW);
620 hwprev = !!(rfkill->state & RFKILL_BLOCK_HW);
623 rfkill->state |= RFKILL_BLOCK_HW;
625 rfkill->state &= ~RFKILL_BLOCK_HW;
710 return sprintf(buf, "%d\n", (rfkill->state & RFKILL_BLOCK_HW) ? 1 : 0 );
719 return sprintf(buf, "%d\n", (rfkill->state & RFKILL_BLOCK_SW) ? 1 : 0 );
726 unsigned long state;
732 err = kstrtoul(buf, 0, &state);
736 if (state > 1 )
740 rfkill_set_block(rfkill, state);
747 static u8 user_state_from_blocked(unsigned long state)
749 if (state & RFKILL_BLOCK_HW)
751 if (state & RFKILL_BLOCK_SW)
762 return sprintf(buf, "%d\n", user_state_from_blocked(rfkill->state));
769 unsigned long state;
775 err = kstrtoul(buf, 0, &state);
779 if (state != RFKILL_USER_STATE_SOFT_BLOCKED &&
780 state != RFKILL_USER_STATE_UNBLOCKED)
784 rfkill_set_block(rfkill, state == RFKILL_USER_STATE_SOFT_BLOCKED);
789 static DEVICE_ATTR_RW(state);
814 u32 state;
825 state = rfkill->state;
828 user_state_from_blocked(state));
883 cur = !!(rfkill->state & RFKILL_BLOCK_SW);
911 u32 state;
914 state = rfkill->state;
917 return !!(state & RFKILL_BLOCK_ANY);
970 * Poll hardware state -- driver will use one of the
1052 bool soft_blocked = !!(rfkill->state & RFKILL_BLOCK_SW);