[rt2x00-users] [PATCH] Rt2x00 : Replace rfkill EV_SW by EV_KEY.
Gertjan van Wingerde
gwingerde at gmail.com
Wed Apr 22 07:00:46 CDT 2009
Hi Alban,
Could you post the oops that you experienced?
Best regards,
Gertjan.
On Wed, Apr 22, 2009 at 12:42 PM, Alban Browaeys <prahal at yahoo.com> wrote:
> I mixed the EV_SW fix and the resume from suspend fix in there .
>
> THe allocate move from probe_dev to initialize and clearing the allocate bit
> in suspend is
> a fix for the suspend and resume . WIthout this change I get an Oops on
> resume.
> With this change the suspend to ram works well from gnome-power-manager,
> pm-suspend and echo "mem" > /sys/power/state.
> But it still freeze with plain acpid scripts calling pm-suspend. Could well
> be a bug in acpid script.
>
>
>
> Alban Browaeys wrote:
>>
>> otherwise the pci device is left unstable after
>> input_registrer_polled_device.
>> This is a workaround: probably not good though I found not other way yet.
>>
>> Signed-off-by: Alban Browaeys <prahal at yahoo.com>
>> ---
>> drivers/net/wireless/rt2x00/rt2x00dev.c | 7 ++++++-
>> drivers/net/wireless/rt2x00/rt2x00rfkill.c | 8 ++++----
>> 2 files changed, 10 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c
>> b/drivers/net/wireless/rt2x00/rt2x00dev.c
>> index 29fb810..812a92c 100644
>> --- a/drivers/net/wireless/rt2x00/rt2x00dev.c
>> +++ b/drivers/net/wireless/rt2x00/rt2x00dev.c
>> @@ -754,6 +754,7 @@ static int rt2x00lib_initialize(struct rt2x00_dev
>> *rt2x00dev)
>> /*
>> * Register the extra components.
>> */
>> + rt2x00rfkill_allocate(rt2x00dev);
>> rt2x00rfkill_register(rt2x00dev);
>>
>> return 0;
>> @@ -870,7 +871,6 @@ int rt2x00lib_probe_dev(struct rt2x00_dev *rt2x00dev)
>> */
>> rt2x00link_register(rt2x00dev);
>> rt2x00leds_register(rt2x00dev);
>> - rt2x00rfkill_allocate(rt2x00dev);
>> rt2x00debug_register(rt2x00dev);
>>
>> set_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags);
>> @@ -937,6 +937,11 @@ int rt2x00lib_suspend(struct rt2x00_dev *rt2x00dev,
>> pm_message_t state)
>> return 0;
>>
>> /*
>> + * Schedule a new allocation of rfkill upon resume.
>> + */
>> + clear_bit(RFKILL_STATE_ALLOCATED, &rt2x00dev->rfkill_state);
>> +
>> + /*
>> * Cleanup as much as possible.
>> */
>> rt2x00lib_uninitialize(rt2x00dev);
>> diff --git a/drivers/net/wireless/rt2x00/rt2x00rfkill.c
>> b/drivers/net/wireless/rt2x00/rt2x00rfkill.c
>> index b6d4c67..e3d89c8 100644
>> --- a/drivers/net/wireless/rt2x00/rt2x00rfkill.c
>> +++ b/drivers/net/wireless/rt2x00/rt2x00rfkill.c
>> @@ -42,11 +42,11 @@ static void rt2x00rfkill_poll(struct input_polled_dev
>> *poll_dev)
>> * Poll latest state, if the state is different then the previous
>> state,
>> * we should generate an input event.
>> */
>> - state = !!rt2x00dev->ops->lib->rfkill_poll(rt2x00dev);
>> + state = !rt2x00dev->ops->lib->rfkill_poll(rt2x00dev);
>> old_state = !!test_bit(RFKILL_STATE_BLOCKED, &rt2x00dev->rfkill_state);
>>
>> if (old_state != state) {
>> - input_report_switch(poll_dev->input, SW_RFKILL_ALL, state);
>> + input_report_key(poll_dev->input, KEY_WLAN, state);
>> change_bit(RFKILL_STATE_BLOCKED, &rt2x00dev->rfkill_state);
>> }
>> }
>> @@ -108,8 +108,8 @@ void rt2x00rfkill_allocate(struct rt2x00_dev
>> *rt2x00dev)
>> poll_dev->input->id.product = rt2x00dev->chip.rt;
>> poll_dev->input->id.version = rt2x00dev->chip.rev;
>> poll_dev->input->dev.parent = wiphy_dev(rt2x00dev->hw->wiphy);
>> - poll_dev->input->evbit[0] = BIT(EV_SW);
>> - poll_dev->input->swbit[0] = BIT(SW_RFKILL_ALL);
>> + poll_dev->input->evbit[0] = BIT(EV_KEY);
>> + __set_bit(KEY_WLAN, poll_dev->input->keybit);
>>
>> rt2x00dev->rfkill_poll_dev = poll_dev;
>>
>
>
>
> _______________________________________________
> users mailing list
> users at rt2x00.serialmonkey.com
> http://rt2x00.serialmonkey.com/mailman/listinfo/users_rt2x00.serialmonkey.com
>
More information about the users
mailing list