Skip to contentSkip to conversation

eeepc-laptop: fix wlan rfkill state change during init

PATCH Corentin Chary 2 participants 3 messages Mar 29, 2009 – Mar 30, 2009 2 messages not in the archive ACPI

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive
Quoted 42 lines · Alan Jenkins

When an rfkill device is registered, the rfkill core will change its state to the system default. So we need to prepare for state changes *before* we register it. That means installing the eeepc-specific ACPI callback which handles the hotplug of the wireless network adaptor.

This problem doesn't occur during normal operation.  You have to

1) Boot with wireless enabled. eeepc-laptop should load automatically.
2) modprobe -r eeepc-laptop
3) modprobe eeepc-laptop

On boot, the default rfkill state will be set to enabled. With the current core code, step 2) will disable the wireless. Therefore in step 3), the wireless will change state during registration, from disabled to enabled.  But without this fix, the PCI device for the wireless adaptor will not appear.

drivers/platform/x86/eeepc-laptop.c +3 -3
index 786ed86..b8951b9 100644
@@ -645,6 +645,9 @@ static int eeepc_hotk_add(struct acpi_device *device)
        if (ACPI_FAILURE(status))
                printk(EEEPC_ERR "Error installing notify handler\n");
 
+       eeepc_register_rfkill_notifier("\\_SB.PCI0.P0P6");
+       eeepc_register_rfkill_notifier("\\_SB.PCI0.P0P7");
+
        if (get_acpi(CM_ASL_WLAN) != -1) {
                ehotk->eeepc_wlan_rfkill = rfkill_allocate(&device->dev,
                                                           RFKILL_TYPE_WLAN);
@@ -700,9 +703,6 @@ static int eeepc_hotk_add(struct acpi_device *device)
                        goto bluetooth_fail;
        }
 
-       eeepc_register_rfkill_notifier("\\_SB.PCI0.P0P6");
-       eeepc_register_rfkill_notifier("\\_SB.PCI0.P0P7");
-
        return 0;
 
Quoted 4 lines

 bluetooth_fail:

Hi,
Cc'd linux-acpi to get more review about that.
I'm not very familiar with rfkill interface.

Signature · 6 lines
Corentin Chary
http://xf.iksaif.net
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#3 lore raw
In reply to a message not in the archive
Quoted 44 lines · Corentin Chary
Quoted 42 lines · Alan Jenkins

When an rfkill device is registered, the rfkill core will change its state to the system default. So we need to prepare for state changes *before* we register it. That means installing the eeepc-specific ACPI callback which handles the hotplug of the wireless network adaptor.

This problem doesn't occur during normal operation.  You have to

1) Boot with wireless enabled. eeepc-laptop should load automatically.
2) modprobe -r eeepc-laptop
3) modprobe eeepc-laptop

On boot, the default rfkill state will be set to enabled. With the current core code, step 2) will disable the wireless. Therefore in step 3), the wireless will change state during registration, from disabled to enabled.  But without this fix, the PCI device for the wireless adaptor will not appear.

drivers/platform/x86/eeepc-laptop.c +3 -3
index 786ed86..b8951b9 100644
@@ -645,6 +645,9 @@ static int eeepc_hotk_add(struct acpi_device *device)
        if (ACPI_FAILURE(status))
                printk(EEEPC_ERR "Error installing notify handler\n");
 
+       eeepc_register_rfkill_notifier("\\_SB.PCI0.P0P6");
+       eeepc_register_rfkill_notifier("\\_SB.PCI0.P0P7");
+
        if (get_acpi(CM_ASL_WLAN) != -1) {
                ehotk->eeepc_wlan_rfkill = rfkill_allocate(&device->dev,
                                                           RFKILL_TYPE_WLAN);
@@ -700,9 +703,6 @@ static int eeepc_hotk_add(struct acpi_device *device)
                        goto bluetooth_fail;
        }
 
-       eeepc_register_rfkill_notifier("\\_SB.PCI0.P0P6");
-       eeepc_register_rfkill_notifier("\\_SB.PCI0.P0P7");
-
        return 0;
 
Quoted 8 lines
Quoted 4 lines

 bluetooth_fail:

Hi,
Cc'd linux-acpi to get more review about that.
I'm not very familiar with rfkill interface.

Looks fine to me.

Signature · 3 lines
Matthew Garrett | [email protected]

------------------------------------------------------------------------------