linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] dell-laptop: Fix rfkill state queries
@ 2009-07-31  2:25 Matthew Garrett
  2009-07-31 13:19 ` Tim Gardner
  2009-12-10  4:56 ` Len Brown
  0 siblings, 2 replies; 4+ messages in thread
From: Matthew Garrett @ 2009-07-31  2:25 UTC (permalink / raw)
  To: linux-acpi; +Cc: johannes, linux-wireless, timg, Matthew Garrett

The current code in dell-laptop is confused about the hardware rfkill
state. Fix it up such that it's always reported correctly.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
---
 drivers/platform/x86/dell-laptop.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/platform/x86/dell-laptop.c b/drivers/platform/x86/dell-laptop.c
index 74909c4..9061111 100644
--- a/drivers/platform/x86/dell-laptop.c
+++ b/drivers/platform/x86/dell-laptop.c
@@ -197,8 +197,8 @@ static void dell_rfkill_query(struct rfkill *rfkill, void *data)
 	dell_send_request(&buffer, 17, 11);
 	status = buffer.output[1];
 
-	if (status & BIT(bit))
-		rfkill_set_hw_state(rfkill, !!(status & BIT(16)));
+	rfkill_set_sw_state(rfkill, !!(status & BIT(bit)));
+	rfkill_set_hw_state(rfkill, !(status & BIT(16)));
 }
 
 static const struct rfkill_ops dell_rfkill_ops = {
-- 
1.6.2.5


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] dell-laptop: Fix rfkill state queries
  2009-07-31  2:25 [PATCH] dell-laptop: Fix rfkill state queries Matthew Garrett
@ 2009-07-31 13:19 ` Tim Gardner
  2009-07-31 13:36   ` Matthew Garrett
  2009-12-10  4:56 ` Len Brown
  1 sibling, 1 reply; 4+ messages in thread
From: Tim Gardner @ 2009-07-31 13:19 UTC (permalink / raw)
  To: Matthew Garrett; +Cc: linux-acpi, johannes, linux-wireless

Matthew Garrett wrote:
> The current code in dell-laptop is confused about the hardware rfkill
> state. Fix it up such that it's always reported correctly.
> 
> Signed-off-by: Matthew Garrett <mjg@redhat.com>
> ---
>  drivers/platform/x86/dell-laptop.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/platform/x86/dell-laptop.c b/drivers/platform/x86/dell-laptop.c
> index 74909c4..9061111 100644
> --- a/drivers/platform/x86/dell-laptop.c
> +++ b/drivers/platform/x86/dell-laptop.c
> @@ -197,8 +197,8 @@ static void dell_rfkill_query(struct rfkill *rfkill, void *data)
>  	dell_send_request(&buffer, 17, 11);
>  	status = buffer.output[1];
>  
> -	if (status & BIT(bit))
> -		rfkill_set_hw_state(rfkill, !!(status & BIT(16)));
> +	rfkill_set_sw_state(rfkill, !!(status & BIT(bit)));
> +	rfkill_set_hw_state(rfkill, !(status & BIT(16)));
>  }
>  
>  static const struct rfkill_ops dell_rfkill_ops = {

This works on an Inspiron 1420 and XPS1330 as far as I was able to test.
The physical rfkill switch sets 'Hard blocked: yes' for 'phy0: Wireless
LAN', and everything returns to normal 'blocked: no' when the switch is
disabled. I was not able to figure out how to get BIT(16) cleared. Is
that a keyboard function? Anyways,

Tested-by: Tim Gardner <tim.gardner@canonical.com>

rtg
-- 
Tim Gardner timg@tpi.com www.tpi.com
OR 503-601-0234 x102 MT 406-443-5357

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] dell-laptop: Fix rfkill state queries
  2009-07-31 13:19 ` Tim Gardner
@ 2009-07-31 13:36   ` Matthew Garrett
  0 siblings, 0 replies; 4+ messages in thread
From: Matthew Garrett @ 2009-07-31 13:36 UTC (permalink / raw)
  To: Tim Gardner; +Cc: linux-acpi, johannes, linux-wireless

On Fri, Jul 31, 2009 at 07:19:28AM -0600, Tim Gardner wrote:

> This works on an Inspiron 1420 and XPS1330 as far as I was able to test.
> The physical rfkill switch sets 'Hard blocked: yes' for 'phy0: Wireless
> LAN', and everything returns to normal 'blocked: no' when the switch is
> disabled. I was not able to figure out how to get BIT(16) cleared. Is
> that a keyboard function? Anyways,

Might be Fn+F2.

-- 
Matthew Garrett | mjg59@srcf.ucam.org

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] dell-laptop: Fix rfkill state queries
  2009-07-31  2:25 [PATCH] dell-laptop: Fix rfkill state queries Matthew Garrett
  2009-07-31 13:19 ` Tim Gardner
@ 2009-12-10  4:56 ` Len Brown
  1 sibling, 0 replies; 4+ messages in thread
From: Len Brown @ 2009-12-10  4:56 UTC (permalink / raw)
  To: Matthew Garrett; +Cc: linux-acpi, johannes, linux-wireless, timg

applied to acpi-test

thanks,
Len Brown, Intel Open Source Technology Center


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-12-10  4:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-31  2:25 [PATCH] dell-laptop: Fix rfkill state queries Matthew Garrett
2009-07-31 13:19 ` Tim Gardner
2009-07-31 13:36   ` Matthew Garrett
2009-12-10  4:56 ` Len Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).