···150/* The actual device the driver binds to */151static struct eeepc_hotk *ehotk;15200153/* Platform device/driver */154static int eeepc_hotk_thaw(struct device *device);155static int eeepc_hotk_restore(struct device *device);···345static int eeepc_rfkill_set(void *data, bool blocked)346{347 unsigned long asl = (unsigned long)data;348- return set_acpi(asl, !blocked);000000000349}350351static const struct rfkill_ops eeepc_rfkill_ops = {352 .set_block = eeepc_rfkill_set,353};354355-static void __init eeepc_enable_camera(void)356{357 /*358 * If the following call to set_acpi() fails, it's because there's no···654 return 0;655}656657-static void eeepc_rfkill_hotplug(void)658{659 struct pci_dev *dev;660 struct pci_bus *bus;661- bool blocked = eeepc_wlan_rfkill_blocked();662663- if (ehotk->wlan_rfkill)664 rfkill_set_sw_state(ehotk->wlan_rfkill, blocked);665666 mutex_lock(&ehotk->hotplug_lock);···703 if (event != ACPI_NOTIFY_BUS_CHECK)704 return;705706- eeepc_rfkill_hotplug();707}708709static void eeepc_hotk_notify(struct acpi_device *device, u32 event)···861{862 /* Refresh both wlan rfkill state and pci hotplug */863 if (ehotk->wlan_rfkill)864- eeepc_rfkill_hotplug();865866 if (ehotk->bluetooth_rfkill)867 rfkill_set_sw_state(ehotk->bluetooth_rfkill,···1004 * Refresh pci hotplug in case the rfkill state was changed after1005 * eeepc_unregister_rfkill_notifier()1006 */1007- eeepc_rfkill_hotplug();1008 if (ehotk->hotplug_slot)1009 pci_hp_deregister(ehotk->hotplug_slot);1010···1120 * Refresh pci hotplug in case the rfkill state was changed during1121 * setup.1122 */1123- eeepc_rfkill_hotplug();11241125exit:1126 if (result && result != -ENODEV)···1200 return 0;1201}12021203-static int eeepc_hotk_add(struct acpi_device *device)1204{1205 struct device *dev;1206 int result;
···150/* The actual device the driver binds to */151static struct eeepc_hotk *ehotk;152153+static void eeepc_rfkill_hotplug(bool real);154+155/* Platform device/driver */156static int eeepc_hotk_thaw(struct device *device);157static int eeepc_hotk_restore(struct device *device);···343static int eeepc_rfkill_set(void *data, bool blocked)344{345 unsigned long asl = (unsigned long)data;346+ int ret;347+348+ if (asl != CM_ASL_WLAN)349+ return set_acpi(asl, !blocked);350+351+ /* hack to avoid panic with rt2860sta */352+ if (blocked)353+ eeepc_rfkill_hotplug(false);354+ ret = set_acpi(asl, !blocked);355+ return ret;356}357358static const struct rfkill_ops eeepc_rfkill_ops = {359 .set_block = eeepc_rfkill_set,360};361362+static void __devinit eeepc_enable_camera(void)363{364 /*365 * If the following call to set_acpi() fails, it's because there's no···643 return 0;644}645646+static void eeepc_rfkill_hotplug(bool real)647{648 struct pci_dev *dev;649 struct pci_bus *bus;650+ bool blocked = real ? eeepc_wlan_rfkill_blocked() : true;651652+ if (real && ehotk->wlan_rfkill)653 rfkill_set_sw_state(ehotk->wlan_rfkill, blocked);654655 mutex_lock(&ehotk->hotplug_lock);···692 if (event != ACPI_NOTIFY_BUS_CHECK)693 return;694695+ eeepc_rfkill_hotplug(true);696}697698static void eeepc_hotk_notify(struct acpi_device *device, u32 event)···850{851 /* Refresh both wlan rfkill state and pci hotplug */852 if (ehotk->wlan_rfkill)853+ eeepc_rfkill_hotplug(true);854855 if (ehotk->bluetooth_rfkill)856 rfkill_set_sw_state(ehotk->bluetooth_rfkill,···993 * Refresh pci hotplug in case the rfkill state was changed after994 * eeepc_unregister_rfkill_notifier()995 */996+ eeepc_rfkill_hotplug(true);997 if (ehotk->hotplug_slot)998 pci_hp_deregister(ehotk->hotplug_slot);999···1109 * Refresh pci hotplug in case the rfkill state was changed during1110 * setup.1111 */1112+ eeepc_rfkill_hotplug(true);11131114exit:1115 if (result && result != -ENODEV)···1189 return 0;1190}11911192+static int __devinit eeepc_hotk_add(struct acpi_device *device)1193{1194 struct device *dev;1195 int result;