From f24feee5d61380c133d9971e959dab07cc46d5d2 Mon Sep 17 00:00:00 2001 From: Damien Bergamini Date: Sun, 20 Aug 2006 14:01:08 +0000 Subject: - turn the interface down if the user press the radio kill button while the interface is up. - undef WPI_DEBUG. --- sys/dev/pci/if_wpi.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'sys/dev/pci') diff --git a/sys/dev/pci/if_wpi.c b/sys/dev/pci/if_wpi.c index f8b412e6ba8..b5a8cd315b8 100644 --- a/sys/dev/pci/if_wpi.c +++ b/sys/dev/pci/if_wpi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_wpi.c,v 1.29 2006/08/18 16:04:56 damien Exp $ */ +/* $OpenBSD: if_wpi.c,v 1.30 2006/08/20 14:01:07 damien Exp $ */ /*- * Copyright (c) 2006 @@ -149,8 +149,6 @@ void wpi_amrr_timeout(void *); void wpi_newassoc(struct ieee80211com *, struct ieee80211_node *, int); -#define WPI_DEBUG - #ifdef WPI_DEBUG #define DPRINTF(x) do { if (wpi_debug > 0) printf x; } while (0) #define DPRINTFN(n, x) do { if (wpi_debug >= (n)) printf x; } while (0) @@ -1324,6 +1322,10 @@ wpi_notif_intr(struct wpi_softc *sc) /* the radio button has to be pushed */ printf("%s: Radio transmitter is off\n", sc->sc_dev.dv_xname); + /* turn the interface down */ + ifp->if_flags &= ~IFF_UP; + wpi_stop(ifp, 1); + return; /* no further processing */ } break; } @@ -1401,7 +1403,8 @@ wpi_intr(void *arg) wakeup(sc); /* re-enable interrupts */ - WPI_WRITE(sc, WPI_MASK, WPI_INTR_MASK); + if (ifp->if_flags & IFF_UP) + WPI_WRITE(sc, WPI_MASK, WPI_INTR_MASK); return 1; } -- cgit v1.2.3