diff options
author | Stefan Sperling <stsp@cvs.openbsd.org> | 2016-01-13 14:33:08 +0000 |
---|---|---|
committer | Stefan Sperling <stsp@cvs.openbsd.org> | 2016-01-13 14:33:08 +0000 |
commit | 3597a476e3e9fa67c39ada3759a495c795895a7c (patch) | |
tree | 35c6cb6ab1821e9ad6792c194e2090df37367cd6 /sys | |
parent | bba00739f9d339e931831dc564fe126608c1934f (diff) |
Fix fallout from turbo mode removal commit: Channel initialization
was broken and lots of drivers ran into trouble as a result.
ok deraadt@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/net80211/ieee80211.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/sys/net80211/ieee80211.c b/sys/net80211/ieee80211.c index 7037051174f..e330f8ec954 100644 --- a/sys/net80211/ieee80211.c +++ b/sys/net80211/ieee80211.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ieee80211.c,v 1.57 2016/01/12 09:28:09 stsp Exp $ */ +/* $OpenBSD: ieee80211.c,v 1.58 2016/01/13 14:33:07 stsp Exp $ */ /* $NetBSD: ieee80211.c,v 1.19 2004/06/06 05:45:29 dyoung Exp $ */ /*- @@ -749,8 +749,10 @@ ieee80211_setmode(struct ieee80211com *ic, enum ieee80211_phymode mode) modeflags = chanflags[mode]; for (i = 0; i <= IEEE80211_CHAN_MAX; i++) { c = &ic->ic_channels[i]; - if (mode == IEEE80211_MODE_AUTO || - (c->ic_flags & modeflags) == modeflags) + if (mode == IEEE80211_MODE_AUTO) { + if (c->ic_flags != 0) + break; + } else if ((c->ic_flags & modeflags) == modeflags) break; } if (i > IEEE80211_CHAN_MAX) { @@ -764,8 +766,10 @@ ieee80211_setmode(struct ieee80211com *ic, enum ieee80211_phymode mode) memset(ic->ic_chan_active, 0, sizeof(ic->ic_chan_active)); for (i = 0; i <= IEEE80211_CHAN_MAX; i++) { c = &ic->ic_channels[i]; - if (mode == IEEE80211_MODE_AUTO || - (c->ic_flags & modeflags) == modeflags) + if (mode == IEEE80211_MODE_AUTO) { + if (c->ic_flags != 0) + setbit(ic->ic_chan_active, i); + } else if ((c->ic_flags & modeflags) == modeflags) setbit(ic->ic_chan_active, i); } /* |