summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorjmcneill <jmcneill@NetBSD.org>2013-01-27 12:48:56 +0000
committerjmcneill <jmcneill@NetBSD.org>2013-01-27 12:48:56 +0000
commit4c33dd4055b1ece14e42e1e2c4238f289feb403e (patch)
tree4495259351e116df4e7329c716ca77e203c4ca74 /sys
parent9fad7eef59e736cdcfa9053183fc2c9c35972cee (diff)
don't transmit while in a key change is in progress
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/ic/ath.c12
-rw-r--r--sys/dev/ic/ath_netbsd.h5
-rw-r--r--sys/dev/ic/athvar.h3
3 files changed, 11 insertions, 9 deletions
diff --git a/sys/dev/ic/ath.c b/sys/dev/ic/ath.c
index 090339d7bb6..c48d3b400b5 100644
--- a/sys/dev/ic/ath.c
+++ b/sys/dev/ic/ath.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ath.c,v 1.114 2012/11/08 20:43:55 dyoung Exp $ */
+/* $NetBSD: ath.c,v 1.115 2013/01/27 12:48:56 jmcneill Exp $ */
/*-
* Copyright (c) 2002-2005 Sam Leffler, Errno Consulting
@@ -41,7 +41,7 @@
__FBSDID("$FreeBSD: src/sys/dev/ath/if_ath.c,v 1.104 2005/09/16 10:09:23 ru Exp $");
#endif
#ifdef __NetBSD__
-__KERNEL_RCSID(0, "$NetBSD: ath.c,v 1.114 2012/11/08 20:43:55 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ath.c,v 1.115 2013/01/27 12:48:56 jmcneill Exp $");
#endif
/*
@@ -1278,6 +1278,10 @@ ath_start(struct ifnet *ifp)
if ((ifp->if_flags & IFF_RUNNING) == 0 ||
!device_is_active(sc->sc_dev))
return;
+
+ if (sc->sc_flags & ATH_KEY_UPDATING)
+ return;
+
for (;;) {
/*
* Grab a TX buffer and associated resources.
@@ -1887,7 +1891,7 @@ ath_key_update_begin(struct ieee80211com *ic)
#if 0
tasklet_disable(&sc->sc_rxtq);
#endif
- IF_LOCK(&ifp->if_snd); /* NB: doesn't block mgmt frames */
+ sc->sc_flags |= ATH_KEY_UPDATING;
}
static void
@@ -1897,7 +1901,7 @@ ath_key_update_end(struct ieee80211com *ic)
struct ath_softc *sc = ifp->if_softc;
DPRINTF(sc, ATH_DEBUG_KEYCACHE, "%s:\n", __func__);
- IF_UNLOCK(&ifp->if_snd);
+ sc->sc_flags &= ~ATH_KEY_UPDATING;
#if 0
tasklet_enable(&sc->sc_rxtq);
#endif
diff --git a/sys/dev/ic/ath_netbsd.h b/sys/dev/ic/ath_netbsd.h
index e9fe9f11a54..16a080a8e20 100644
--- a/sys/dev/ic/ath_netbsd.h
+++ b/sys/dev/ic/ath_netbsd.h
@@ -1,4 +1,4 @@
-/* $NetBSD: ath_netbsd.h,v 1.14 2012/11/08 20:43:55 dyoung Exp $ */
+/* $NetBSD: ath_netbsd.h,v 1.15 2013/01/27 12:48:56 jmcneill Exp $ */
/*-
* Copyright (c) 2003, 2004 David Young
@@ -62,9 +62,6 @@ typedef kmutex_t ath_txbuf_lock_t;
#define NET_LOCK_GIANT()
#define NET_UNLOCK_GIANT()
-#define IF_LOCK(__q)
-#define IF_UNLOCK(__q)
-
#define SYSCTL_INT_SUBR(__rw, __name, __descr) \
sysctl_createv(log, 0, &rnode, &cnode, CTLFLAG_PERMANENT|(__rw), \
CTLTYPE_INT, #__name, SYSCTL_DESCR(__descr), ath_sysctl_##__name,\
diff --git a/sys/dev/ic/athvar.h b/sys/dev/ic/athvar.h
index 10e0df678d0..2adb9a94fad 100644
--- a/sys/dev/ic/athvar.h
+++ b/sys/dev/ic/athvar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: athvar.h,v 1.35 2011/10/07 16:58:11 dyoung Exp $ */
+/* $NetBSD: athvar.h,v 1.36 2013/01/27 12:48:56 jmcneill Exp $ */
/*-
* Copyright (c) 2002-2005 Sam Leffler, Errno Consulting
@@ -309,6 +309,7 @@ struct ath_softc {
#define sc_rx_th u_rx_rt.th
#define ATH_ATTACHED 0x0001 /* attach has succeeded */
+#define ATH_KEY_UPDATING 0x0002 /* key change in progress */
#define ATH_TXQ_SETUP(sc, i) ((sc)->sc_txqsetup & (1<<i))