diff options
-rw-r--r-- | drivers/platform/x86/eeepc-laptop.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/platform/x86/eeepc-laptop.c b/drivers/platform/x86/eeepc-laptop.c index 6a47bb7066d8..9a844caa3756 100644 --- a/drivers/platform/x86/eeepc-laptop.c +++ b/drivers/platform/x86/eeepc-laptop.c | |||
@@ -578,6 +578,8 @@ static void eeepc_rfkill_hotplug(struct eeepc_laptop *eeepc) | |||
578 | struct pci_dev *dev; | 578 | struct pci_dev *dev; |
579 | struct pci_bus *bus; | 579 | struct pci_bus *bus; |
580 | bool blocked = eeepc_wlan_rfkill_blocked(eeepc); | 580 | bool blocked = eeepc_wlan_rfkill_blocked(eeepc); |
581 | bool absent; | ||
582 | u32 l; | ||
581 | 583 | ||
582 | if (eeepc->wlan_rfkill) | 584 | if (eeepc->wlan_rfkill) |
583 | rfkill_set_sw_state(eeepc->wlan_rfkill, blocked); | 585 | rfkill_set_sw_state(eeepc->wlan_rfkill, blocked); |
@@ -591,6 +593,22 @@ static void eeepc_rfkill_hotplug(struct eeepc_laptop *eeepc) | |||
591 | goto out_unlock; | 593 | goto out_unlock; |
592 | } | 594 | } |
593 | 595 | ||
596 | if (pci_bus_read_config_dword(bus, 0, PCI_VENDOR_ID, &l)) { | ||
597 | pr_err("Unable to read PCI config space?\n"); | ||
598 | goto out_unlock; | ||
599 | } | ||
600 | absent = (l == 0xffffffff); | ||
601 | |||
602 | if (blocked != absent) { | ||
603 | pr_warning("BIOS says wireless lan is %s, " | ||
604 | "but the pci device is %s\n", | ||
605 | blocked ? "blocked" : "unblocked", | ||
606 | absent ? "absent" : "present"); | ||
607 | pr_warning("skipped wireless hotplug as probably " | ||
608 | "inappropriate for this model\n"); | ||
609 | goto out_unlock; | ||
610 | } | ||
611 | |||
594 | if (!blocked) { | 612 | if (!blocked) { |
595 | dev = pci_get_slot(bus, 0); | 613 | dev = pci_get_slot(bus, 0); |
596 | if (dev) { | 614 | if (dev) { |