lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1286422207-14248-1-git-send-email-keng-yu.lin@canonical.com>
Date:	Thu,  7 Oct 2010 11:30:07 +0800
From:	Keng-Yu Lin <keng-yu.lin@...onical.com>
To:	mjg59@...f.ucam.org, len.brown@...el.com,
	alan-jenkins@...fmail.co.uk, superm1@...ntu.com,
	platform-driver-x86@...r.kernel.org, linux-kernel@...r.kernel.org
Cc:	Keng-Yu Lin <keng-yu.lin@...onical.com>
Subject: [PATCH] dell-laptop: Add hwswitch_only module parameter

Some BIOS does not report the correct state of the wireless killswitch
in the return value of SMI Class 17, Select 11.

This causes the killswitch to always stay as soft-blocked once the rfkill
hotkey is pressed.

This patch adds a module parameter to work around this by disregarding
the software rfkill and using only Bit 16 in the return value of
SMI Class 17, Select 11 as the hardware killswitch.

Signed-off-by: Keng-Yu Lin <keng-yu.lin@...onical.com>
---
 drivers/platform/x86/dell-laptop.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

 This patch is intended to work around the buggy BIOS.

diff --git a/drivers/platform/x86/dell-laptop.c b/drivers/platform/x86/dell-laptop.c
index 4413975..a105d7e 100644
--- a/drivers/platform/x86/dell-laptop.c
+++ b/drivers/platform/x86/dell-laptop.c
@@ -74,6 +74,8 @@ static struct rfkill *wifi_rfkill;
 static struct rfkill *bluetooth_rfkill;
 static struct rfkill *wwan_rfkill;
 
+static bool hwswitch_only;
+
 static const struct dmi_system_id __initdata dell_device_table[] = {
 	{
 		.ident = "Dell laptop",
@@ -314,7 +316,8 @@ static void dell_rfkill_query(struct rfkill *rfkill, void *data)
 	status = buffer->output[1];
 	release_buffer();
 
-	rfkill_set_sw_state(rfkill, !!(status & BIT(bit)));
+	if (!hwswitch_only)
+		rfkill_set_sw_state(rfkill, !!(status & BIT(bit)));
 
 	if (hwswitch_state & (BIT(hwswitch_bit)))
 		rfkill_set_hw_state(rfkill, !(status & BIT(16)));
@@ -630,6 +633,9 @@ static void __exit dell_exit(void)
 module_init(dell_init);
 module_exit(dell_exit);
 
+module_param(hwswitch_only, bool, 0644);
+MODULE_PARM_DESC(hwswitch_only, "Use the hardware rfkill only");
+
 MODULE_AUTHOR("Matthew Garrett <mjg@...hat.com>");
 MODULE_DESCRIPTION("Dell laptop driver");
 MODULE_LICENSE("GPL");
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ