diff --git a/sys/dev/pci/if_wpi.c b/sys/dev/pci/if_wpi.c index 53e9a1b5bf6f..5a412264b57e 100644 --- a/sys/dev/pci/if_wpi.c +++ b/sys/dev/pci/if_wpi.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_wpi.c,v 1.30 2007/11/23 22:27:02 plunky Exp $ */ +/* $NetBSD: if_wpi.c,v 1.31 2007/11/28 22:51:49 degroote Exp $ */ /*- * Copyright (c) 2006, 2007 @@ -18,7 +18,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_wpi.c,v 1.30 2007/11/23 22:27:02 plunky Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_wpi.c,v 1.31 2007/11/28 22:51:49 degroote Exp $"); /* * Driver for Intel PRO/Wireless 3945ABG 802.11 network adapters. @@ -3063,6 +3063,17 @@ wpi_init(struct ifnet *ifp) goto fail1; } + /* Check the status of the radio switch */ + wpi_mem_lock(sc); + tmp = wpi_mem_read(sc, WPI_MEM_RFKILL); + wpi_mem_unlock(sc); + + if (!(tmp & 0x01)) { + aprint_error_dev(sc->sc_dev, "Radio is disabled by hardware switch\n"); + error = EPERM; // XXX + goto fail1; + } + /* wait for thermal sensors to calibrate */ for (ntries = 0; ntries < 1000; ntries++) { if ((sc->temp = (int)WPI_READ(sc, WPI_TEMPERATURE)) != 0) diff --git a/sys/dev/pci/if_wpireg.h b/sys/dev/pci/if_wpireg.h index e682bf566f8b..b461b4f73b38 100644 --- a/sys/dev/pci/if_wpireg.h +++ b/sys/dev/pci/if_wpireg.h @@ -1,4 +1,4 @@ -/* $NetBSD: if_wpireg.h,v 1.7 2007/10/21 16:47:27 degroote Exp $ */ +/* $NetBSD: if_wpireg.h,v 1.8 2007/11/28 22:51:49 degroote Exp $ */ /*- * Copyright (c) 2006 @@ -87,6 +87,7 @@ #define WPI_MEM_CLOCK2 0x3008 #define WPI_MEM_POWER 0x300c #define WPI_MEM_PCIDEV 0x3010 +#define WPI_MEM_RFKILL 0x3014 #define WPI_MEM_UCODE_CTL 0x3400 #define WPI_MEM_UCODE_SRC 0x3404 #define WPI_MEM_UCODE_DST 0x3408