diff options
author | sephe <sephe@FreeBSD.org> | 2007-07-20 11:38:12 +0000 |
---|---|---|
committer | sephe <sephe@FreeBSD.org> | 2007-07-20 11:38:12 +0000 |
commit | 9adf8173c285ed87519bc3c52de307e10928c875 (patch) | |
tree | 76532f46b48f9d6f3be6f431aa9aa12dc36bd54e /sys/net80211/ieee80211_scan_sta.c | |
parent | f1da927af0f5b18310d9d34039a24690f10faa0e (diff) | |
download | FreeBSD-src-9adf8173c285ed87519bc3c52de307e10928c875.zip FreeBSD-src-9adf8173c285ed87519bc3c52de307e10928c875.tar.gz |
In add_channel(), search 11g channels if mode is AUTO and corresponding
11b channel is not found, e.g. Atheros 5211.
Reported by: matteo
Problem outlined by: thompsa
Reviewed by: sam, thompsa
Approved by: re (kensmith), sam (mentor)
Tested by: matteo (an early version)
Diffstat (limited to 'sys/net80211/ieee80211_scan_sta.c')
-rw-r--r-- | sys/net80211/ieee80211_scan_sta.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/sys/net80211/ieee80211_scan_sta.c b/sys/net80211/ieee80211_scan_sta.c index fee5cab..4fbaf64 100644 --- a/sys/net80211/ieee80211_scan_sta.c +++ b/sys/net80211/ieee80211_scan_sta.c @@ -376,17 +376,23 @@ add_channels(struct ieee80211com *ic, break; c = ieee80211_find_channel(ic, freq[i], modeflags); - if (c == NULL || isexcluded(ic, c)) + if (c != NULL && isexcluded(ic, c)) continue; if (mode == IEEE80211_MODE_AUTO) { /* * XXX special-case 11b/g channels so we select - * the g channel if both are present. + * the g channel if both are present or there + * are only g channels. */ - if (IEEE80211_IS_CHAN_B(c) && - (cg = find11gchannel(ic, i, c->ic_freq)) != NULL) - c = cg; + if (c == NULL || IEEE80211_IS_CHAN_B(c)) { + cg = find11gchannel(ic, i, freq[i]); + if (cg != NULL) + c = cg; + } } + if (c == NULL) + continue; + ss->ss_chans[ss->ss_last++] = c; } #undef N |