summaryrefslogtreecommitdiff
path: root/sys/dev/usb/if_upgt.c
diff options
context:
space:
mode:
authorMarcus Glocker <mglocker@cvs.openbsd.org>2007-12-22 11:16:41 +0000
committerMarcus Glocker <mglocker@cvs.openbsd.org>2007-12-22 11:16:41 +0000
commite60cf4ec4a4a8460d530bc904a1542cf5a516f5a (patch)
tree1f4ff03eff062508f44a97749e6f68e296dd4f02 /sys/dev/usb/if_upgt.c
parent603c0a1865d4f2d569f9064e2657595961f4896c (diff)
Reset the MAC filter if we stop the device, so no frames are accepted
anymore.
Diffstat (limited to 'sys/dev/usb/if_upgt.c')
-rw-r--r--sys/dev/usb/if_upgt.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/sys/dev/usb/if_upgt.c b/sys/dev/usb/if_upgt.c
index 2f20f400e8c..1be2d8a207c 100644
--- a/sys/dev/usb/if_upgt.c
+++ b/sys/dev/usb/if_upgt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_upgt.c,v 1.7 2007/12/20 20:38:31 mglocker Exp $ */
+/* $OpenBSD: if_upgt.c,v 1.8 2007/12/22 11:16:40 mglocker Exp $ */
/*
* Copyright (c) 2007 Marcus Glocker <mglocker@openbsd.org>
@@ -1203,6 +1203,9 @@ upgt_stop(struct upgt_softc *sc)
struct ieee80211com *ic = &sc->sc_ic;
struct ifnet *ifp = &ic->ic_if;
+ /* do not accept any frames if the device is down */
+ upgt_set_macfilter(sc, IEEE80211_S_INIT);
+
/* device down */
ifp->if_timer = 0;
ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE);
@@ -1741,6 +1744,12 @@ upgt_set_macfilter(struct upgt_softc *sc, uint8_t state)
filter->header2.flags = 0;
switch (state) {
+ case IEEE80211_S_INIT:
+ DPRINTF(1, "%s: set MAC filter to INIT\n",
+ sc->sc_dev.dv_xname);
+
+ filter->type = htole16(UPGT_FILTER_TYPE_RESET);
+ break;
case IEEE80211_S_SCAN:
DPRINTF(1, "%s: set MAC filter to SCAN (bssid %s)\n",
sc->sc_dev.dv_xname, ether_sprintf(broadcast));