From patchwork Sat Feb 20 12:50:53 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Jenkins X-Patchwork-Id: 80937 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o1KCnV67014476 for ; Sat, 20 Feb 2010 12:50:59 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754884Ab0BTMu6 (ORCPT ); Sat, 20 Feb 2010 07:50:58 -0500 Received: from mail-ew0-f228.google.com ([209.85.219.228]:36814 "EHLO mail-ew0-f228.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754639Ab0BTMu6 (ORCPT ); Sat, 20 Feb 2010 07:50:58 -0500 Received: by ewy28 with SMTP id 28so1122784ewy.28 for ; Sat, 20 Feb 2010 04:50:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:content-type :content-transfer-encoding; bh=xAfgVAtMqaScKvyOOzdVlqxQwDdZu6D1aZLu4WsNfyQ=; b=M2XaHF0RVzPJt35b8S6R1KKyaivy1bDWUKCCX9A9ZDsUeS6B477yULGobtclsWRu1W N6dms+kJr8Z+g6z7xjtv+va7WpPlS9k2oEMt8cgdruW8VO2K8bDQ+jb27U9yT0+yMA3n MxSU3ciHnW1pfuYlupDaOQKtR0IzCpyPLTxHM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :content-type:content-transfer-encoding; b=Q67kH44kr1eYzlGUQoRVqahcDw78ng501nWOKLtu6z4Nu23fme0V0JiEjnJec9d3Vt uj4e6NEtxyLEZsY60+x2825b2J6uLL7Itd/2SeyL6ttOcabmksztYQsbFPgoYUizVxom mWbaObEJvwGyB88HCX8rRWIOInCa1jJFM7xRw= Received: by 10.213.109.214 with SMTP id k22mr2007990ebp.83.1266670255949; Sat, 20 Feb 2010 04:50:55 -0800 (PST) Received: from ?192.168.0.4? ([86.53.68.233]) by mx.google.com with ESMTPS id 14sm766876ewy.7.2010.02.20.04.50.54 (version=SSLv3 cipher=RC4-MD5); Sat, 20 Feb 2010 04:50:55 -0800 (PST) Message-ID: <4B7FDAAD.1040704@tuffmail.co.uk> Date: Sat, 20 Feb 2010 12:50:53 +0000 From: Alan Jenkins User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Matthew Garrett CC: Corentin Chary , linux-pci@vger.kernel.org, linux acpi Subject: disabling "rfkill hotplug" on newer eeepc-laptop models Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Sat, 20 Feb 2010 12:50:59 +0000 (UTC) diff --git a/drivers/platform/x86/eeepc-laptop.c b/drivers/platform/x86/eeepc-laptop.c index 6a47bb7..9a844ca 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) struct pci_dev *dev; struct pci_bus *bus; bool blocked = eeepc_wlan_rfkill_blocked(eeepc); + bool absent; + u32 l; if (eeepc->wlan_rfkill) rfkill_set_sw_state(eeepc->wlan_rfkill, blocked); @@ -591,6 +593,22 @@ static void eeepc_rfkill_hotplug(struct eeepc_laptop *eeepc) goto out_unlock; } + if (pci_bus_read_config_dword(bus, 0, PCI_VENDOR_ID, &l)) { + pr_err("Unable to read PCI config space?\n"); + goto out_unlock; + } + absent = (l == 0xffffffff); + + if (blocked != absent) { + pr_warning("BIOS says wireless lan is %s, " + "but the pci device is %s\n", + blocked ? "blocked" : "unblocked", + absent ? "absent" : "present"); + pr_warning("skipped wireless hotplug as probably " + "inappropriate for this model\n"); + goto out_unlock; + } + if (!blocked) { dev = pci_get_slot(bus, 0); if (dev) {