Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 149836
b: refs/heads/master
c: fd7fbb1
h: refs/heads/master
v: v3
  • Loading branch information
Johannes Berg authored and John W. Linville committed Apr 22, 2009
1 parent 7d338dc commit 09a4e5e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 70 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 621cac85297de5ba655e3430b007dd2e0da91da6
refs/heads/master: fd7fbb17bec7b055fafec4d0ae3bfb4ed60cad8b
69 changes: 0 additions & 69 deletions trunk/net/rfkill/rfkill-input.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,6 @@ enum rfkill_global_sched_op {
RFKILL_GLOBAL_OP_UNBLOCK,
};

/*
* Currently, the code marked with RFKILL_NEED_SWSET is inactive.
* If handling of EV_SW SW_WLAN/WWAN/BLUETOOTH/etc is needed in the
* future, when such events are added, that code will be necessary.
*/

struct rfkill_task {
struct delayed_work dwork;

Expand All @@ -65,14 +59,6 @@ struct rfkill_task {
/* pending regular switch operations (1=pending) */
unsigned long sw_pending[BITS_TO_LONGS(RFKILL_TYPE_MAX)];

#ifdef RFKILL_NEED_SWSET
/* set operation pending (1=pending) */
unsigned long sw_setpending[BITS_TO_LONGS(RFKILL_TYPE_MAX)];

/* desired state for pending set operation (1=unblock) */
unsigned long sw_newstate[BITS_TO_LONGS(RFKILL_TYPE_MAX)];
#endif

/* should the state be complemented (1=yes) */
unsigned long sw_togglestate[BITS_TO_LONGS(RFKILL_TYPE_MAX)];

Expand Down Expand Up @@ -111,24 +97,6 @@ static void __rfkill_handle_global_op(enum rfkill_global_sched_op op)
}
}

#ifdef RFKILL_NEED_SWSET
static void __rfkill_handle_normal_op(const enum rfkill_type type,
const bool sp, const bool s, const bool c)
{
enum rfkill_state state;

if (sp)
state = (s) ? RFKILL_STATE_UNBLOCKED :
RFKILL_STATE_SOFT_BLOCKED;
else
state = rfkill_get_global_state(type);

if (c)
state = rfkill_state_complement(state);

rfkill_switch_all(type, state);
}
#else
static void __rfkill_handle_normal_op(const enum rfkill_type type,
const bool c)
{
Expand All @@ -140,7 +108,6 @@ static void __rfkill_handle_normal_op(const enum rfkill_type type,

rfkill_switch_all(type, state);
}
#endif

static void rfkill_task_handler(struct work_struct *work)
{
Expand Down Expand Up @@ -171,21 +138,11 @@ static void rfkill_task_handler(struct work_struct *work)
i < RFKILL_TYPE_MAX) {
if (test_and_clear_bit(i, task->sw_pending)) {
bool c;
#ifdef RFKILL_NEED_SWSET
bool sp, s;
sp = test_and_clear_bit(i,
task->sw_setpending);
s = test_bit(i, task->sw_newstate);
#endif
c = test_and_clear_bit(i,
task->sw_togglestate);
spin_unlock_irq(&task->lock);

#ifdef RFKILL_NEED_SWSET
__rfkill_handle_normal_op(i, sp, s, c);
#else
__rfkill_handle_normal_op(i, c);
#endif

spin_lock_irq(&task->lock);
}
Expand Down Expand Up @@ -238,32 +195,6 @@ static void rfkill_schedule_global_op(enum rfkill_global_sched_op op)
spin_unlock_irqrestore(&rfkill_task.lock, flags);
}

#ifdef RFKILL_NEED_SWSET
/* Use this if you need to add EV_SW SW_WLAN/WWAN/BLUETOOTH/etc handling */

static void rfkill_schedule_set(enum rfkill_type type,
enum rfkill_state desired_state)
{
unsigned long flags;

if (rfkill_is_epo_lock_active())
return;

spin_lock_irqsave(&rfkill_task.lock, flags);
if (!rfkill_task.global_op_pending) {
set_bit(type, rfkill_task.sw_pending);
set_bit(type, rfkill_task.sw_setpending);
clear_bit(type, rfkill_task.sw_togglestate);
if (desired_state)
set_bit(type, rfkill_task.sw_newstate);
else
clear_bit(type, rfkill_task.sw_newstate);
rfkill_schedule_ratelimited();
}
spin_unlock_irqrestore(&rfkill_task.lock, flags);
}
#endif

static void rfkill_schedule_toggle(enum rfkill_type type)
{
unsigned long flags;
Expand Down

0 comments on commit 09a4e5e

Please sign in to comment.