Skip to contentSkip to conversation

dell-laptop: Fix rfkill state queries

PATCH In review Matthew Garrett 4 participants 4 messages Jul 31, 2009 – Dec 10, 2009 2 messages not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dell-laptop: Fix rfkill state queries

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

---
 drivers/platform/x86/dell-laptop.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/platform/x86/dell-laptop.c +2 -2
index 74909c4..9061111 100644
@@ -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 = {
Signature · 1 line
1.6.2.5
Tested-by
#2 lore raw
In reply to a message not in the archive
Quoted 13 lines · 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.

---
 drivers/platform/x86/dell-laptop.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/platform/x86/dell-laptop.c +0 -0
index 74909c4..9061111 100644

drivers/platform/x86/dell-laptop.c static void dell_rfkill_query(struct rfkill *rfkill, void *data) · line 204

Quoted 10 lines
drivers/platform/x86/dell-laptop.c +2 -2
@@ -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,

rtg

Signature · 6 lines
Tim Gardner [email protected] www.tpi.com
OR 503-601-0234 x102 MT 406-443-5357
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#4 lore raw
In reply to a message not in the archive
Quoted 5 lines · Tim Gardner

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.

Signature · 5 lines
Matthew Garrett | [email protected]
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html