]> Pileus Git - ~andy/linux/commitdiff
dell-laptop: Only enable rfkill functionality on laptops with a hw killswitch
authorHans de Goede <hdegoede@redhat.com>
Sun, 17 Nov 2013 13:00:27 +0000 (14:00 +0100)
committerMatthew Garrett <matthew.garrett@nebula.com>
Wed, 20 Nov 2013 23:50:49 +0000 (18:50 -0500)
All my testing has been on laptops with a hw killswitch, so to be on the
safe side disable rfkill functionality on models without a hw killswitch for
now. Once we gather some feedback on laptops without a hw killswitch this
decision maybe reconsidered.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
drivers/platform/x86/dell-laptop.c

index bd67c893ba078866c938b19f73f9876b433e1105..c608b1d33f4a60893a3bdc87b52773f872259f6d 100644 (file)
@@ -580,11 +580,18 @@ static int __init dell_setup_rfkill(void)
        buffer->input[0] = 0x2;
        dell_send_request(buffer, 17, 11);
        hwswitch_state = buffer->output[1];
-       /* If there is no hwswitch, then clear all hw-controlled bits */
-       if (!(status & BIT(0)))
-               hwswitch_state &= ~7;
        release_buffer();
 
+       if (!(status & BIT(0))) {
+               if (force_rfkill) {
+                       /* No hwsitch, clear all hw-controlled bits */
+                       hwswitch_state &= ~7;
+               } else {
+                       /* rfkill is only tested on laptops with a hwswitch */
+                       return 0;
+               }
+       }
+
        if ((status & (1<<2|1<<8)) == (1<<2|1<<8)) {
                wifi_rfkill = rfkill_alloc("dell-wifi", &platform_device->dev,
                                           RFKILL_TYPE_WLAN,