Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/ic don't transmit while in a key change is in progress
details: https://anonhg.NetBSD.org/src/rev/ad3d0d2c34ff
branches: trunk
changeset: 784381:ad3d0d2c34ff
user: jmcneill <jmcneill%NetBSD.org@localhost>
date: Sun Jan 27 12:48:56 2013 +0000
description:
don't transmit while in a key change is in progress
diffstat:
sys/dev/ic/ath.c | 12 ++++++++----
sys/dev/ic/ath_netbsd.h | 5 +----
sys/dev/ic/athvar.h | 3 ++-
3 files changed, 11 insertions(+), 9 deletions(-)
diffs (83 lines):
diff -r bf211ce67bc4 -r ad3d0d2c34ff sys/dev/ic/ath.c
--- a/sys/dev/ic/ath.c Sun Jan 27 12:25:13 2013 +0000
+++ b/sys/dev/ic/ath.c Sun Jan 27 12:48:56 2013 +0000
@@ -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 @@
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 @@
#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 @@
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 -r bf211ce67bc4 -r ad3d0d2c34ff sys/dev/ic/ath_netbsd.h
--- a/sys/dev/ic/ath_netbsd.h Sun Jan 27 12:25:13 2013 +0000
+++ b/sys/dev/ic/ath_netbsd.h Sun Jan 27 12:48:56 2013 +0000
@@ -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 @@
#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 -r bf211ce67bc4 -r ad3d0d2c34ff sys/dev/ic/athvar.h
--- a/sys/dev/ic/athvar.h Sun Jan 27 12:25:13 2013 +0000
+++ b/sys/dev/ic/athvar.h Sun Jan 27 12:48:56 2013 +0000
@@ -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 @@
#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))
Home |
Main Index |
Thread Index |
Old Index