a241169
From patchwork Mon Jun 13 11:44:00 2016
a241169
Content-Type: text/plain; charset="utf-8"
a241169
MIME-Version: 1.0
a241169
Content-Transfer-Encoding: 7bit
a241169
Subject: hp-wmi: fix wifi cannot be hard-unblock
a241169
From: Alex Hung <alex.hung@canonical.com>
a241169
X-Patchwork-Id: 9172765
a241169
Message-Id: <1465818240-11994-1-git-send-email-alex.hung@canonical.com>
a241169
To: dvhart@infradead.org, platform-driver-x86@vger.kernel.org,
a241169
 alex.hung@canonical.com, david.ward@ll.mit.edu
a241169
Date: Mon, 13 Jun 2016 19:44:00 +0800
a241169
a241169
Several users reported wifi cannot be unblocked as discussed in [1].
a241169
This patch removes the useof 2009 flag by BIOS but uses the actual WMI
a241169
function calls - it will be skipped if WMI reports unsupported
a241169
a241169
[1] https://bugzilla.kernel.org/show_bug.cgi?id=69131
a241169
a241169
Signed-off-by: Alex Hung <alex.hung@canonical.com>
a241169
---
a241169
 drivers/platform/x86/hp-wmi.c | 7 ++++++-
a241169
 1 file changed, 6 insertions(+), 1 deletion(-)
a241169
a241169
diff --git a/drivers/platform/x86/hp-wmi.c b/drivers/platform/x86/hp-wmi.c
a241169
index 6f145f2..96ffda4 100644
a241169
--- a/drivers/platform/x86/hp-wmi.c
a241169
+++ b/drivers/platform/x86/hp-wmi.c
a241169
@@ -718,6 +718,11 @@ static int __init hp_wmi_rfkill_setup(struct platform_device *device)
a241169
 	if (err)
a241169
 		return err;
a241169
 
a241169
+	err = hp_wmi_perform_query(HPWMI_WIRELESS_QUERY, 1, &wireless,
a241169
+				   sizeof(wireless), 0);
a241169
+	if (err)
a241169
+		return err;
a241169
+
a241169
 	if (wireless & 0x1) {
a241169
 		wifi_rfkill = rfkill_alloc("hp-wifi", &device->dev,
a241169
 					   RFKILL_TYPE_WLAN,
a241169
@@ -882,7 +887,7 @@ static int __init hp_wmi_bios_setup(struct platform_device *device)
a241169
 	wwan_rfkill = NULL;
a241169
 	rfkill2_count = 0;
a241169
 
a241169
-	if (hp_wmi_bios_2009_later() || hp_wmi_rfkill_setup(device))
a241169
+	if (hp_wmi_rfkill_setup(device))
a241169
 		hp_wmi_rfkill2_setup(device);
a241169
 
a241169
 	err = device_create_file(&device->dev, &dev_attr_display);