summaryrefslogtreecommitdiffstats
path: root/sys/net80211
diff options
context:
space:
mode:
authorsam <sam@FreeBSD.org>2005-12-12 18:38:20 +0000
committersam <sam@FreeBSD.org>2005-12-12 18:38:20 +0000
commit85817ec3681b80bb53262e834ecd34682be232fe (patch)
tree5940fd7f244a11ac80db929ca87af4a20e36489e /sys/net80211
parent2911d079c2167e81ddbbf13a22438cb4afd104c9 (diff)
downloadFreeBSD-src-85817ec3681b80bb53262e834ecd34682be232fe.zip
FreeBSD-src-85817ec3681b80bb53262e834ecd34682be232fe.tar.gz
o correct auto mode logic for avoiding turbo channels
o correct assumption that a static turbo channel is also usable in 11a; the opposite is true MFC after: 1 week
Diffstat (limited to 'sys/net80211')
-rw-r--r--sys/net80211/ieee80211.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/sys/net80211/ieee80211.c b/sys/net80211/ieee80211.c
index 5bd64a4..9b1fa0b 100644
--- a/sys/net80211/ieee80211.c
+++ b/sys/net80211/ieee80211.c
@@ -807,9 +807,11 @@ 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 (c->ic_flags == 0)
+ continue;
if (mode == IEEE80211_MODE_AUTO) {
/* ignore turbo channels for autoselect */
- if ((c->ic_flags &~ IEEE80211_CHAN_TURBO) != 0)
+ if ((c->ic_flags & IEEE80211_CHAN_TURBO) == 0)
break;
} else {
if ((c->ic_flags & modeflags) == modeflags)
@@ -828,9 +830,11 @@ 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 (c->ic_flags == 0)
+ continue;
if (mode == IEEE80211_MODE_AUTO) {
/* take anything but pure turbo channels */
- if ((c->ic_flags &~ IEEE80211_CHAN_TURBO) != 0)
+ if ((c->ic_flags & IEEE80211_CHAN_TURBO) == 0)
setbit(ic->ic_chan_active, i);
} else {
if ((c->ic_flags & modeflags) == modeflags)
@@ -905,13 +909,9 @@ ieee80211_setmode(struct ieee80211com *ic, enum ieee80211_phymode mode)
enum ieee80211_phymode
ieee80211_chan2mode(struct ieee80211com *ic, struct ieee80211_channel *chan)
{
- if (IEEE80211_IS_CHAN_5GHZ(chan)) {
- /*
- * This assumes all 11a turbo channels are also
- * usable withut turbo, which is currently true.
- */
- if (ic->ic_curmode == IEEE80211_MODE_TURBO_A)
- return IEEE80211_MODE_TURBO_A;
+ if (IEEE80211_IS_CHAN_T(chan)) {
+ return IEEE80211_MODE_TURBO_A;
+ } else if (IEEE80211_IS_CHAN_5GHZ(chan)) {
return IEEE80211_MODE_11A;
} else if (IEEE80211_IS_CHAN_FHSS(chan))
return IEEE80211_MODE_FH;
OpenPOWER on IntegriCloud