diff options
author | Marcus Glocker <mglocker@cvs.openbsd.org> | 2007-12-22 11:16:41 +0000 |
---|---|---|
committer | Marcus Glocker <mglocker@cvs.openbsd.org> | 2007-12-22 11:16:41 +0000 |
commit | e60cf4ec4a4a8460d530bc904a1542cf5a516f5a (patch) | |
tree | 1f4ff03eff062508f44a97749e6f68e296dd4f02 /sys | |
parent | 603c0a1865d4f2d569f9064e2657595961f4896c (diff) |
Reset the MAC filter if we stop the device, so no frames are accepted
anymore.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/usb/if_upgt.c | 11 | ||||
-rw-r--r-- | sys/dev/usb/if_upgtvar.h | 3 |
2 files changed, 12 insertions, 2 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)); diff --git a/sys/dev/usb/if_upgtvar.h b/sys/dev/usb/if_upgtvar.h index 405fd232406..cfd8a398fac 100644 --- a/sys/dev/usb/if_upgtvar.h +++ b/sys/dev/usb/if_upgtvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: if_upgtvar.h,v 1.1 2007/12/16 09:05:53 mglocker Exp $ */ +/* $OpenBSD: if_upgtvar.h,v 1.2 2007/12/22 11:16:40 mglocker Exp $ */ /* * Copyright (c) 2007 Marcus Glocker <mglocker@openbsd.org> @@ -239,6 +239,7 @@ struct upgt_lmac_eeprom { #define UPGT_FILTER_TYPE_IBSS 0x0002 #define UPGT_FILTER_TYPE_HOSTAP 0x0004 #define UPGT_FILTER_TYPE_MONITOR 0x0010 +#define UPGT_FILTER_TYPE_RESET 0x0020 #define UPGT_FILTER_UNKNOWN2_STA 0x0000015f #define UPGT_FILTER_UNKNOWN5_V2 0x0620 #define UPGT_FILTER_UNKNOWN6_STA 0x01f4 |