==== //depot/projects/wifi/sys/net80211/ieee80211_scan_sta.c#24 - /opt/sam_wifi/sys/net80211/ieee80211_scan_sta.c ==== --- /tmp/tmp.682.52 2007-07-17 20:58:18.000000000 +0800 +++ /opt/sam_wifi/sys/net80211/ieee80211_scan_sta.c 2007-07-17 20:57:50.000000000 +0800 @@ -376,17 +376,20 @@ 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. */ - if (IEEE80211_IS_CHAN_B(c) && - (cg = find11gchannel(ic, i, c->ic_freq)) != NULL) + if ((c == NULL || IEEE80211_IS_CHAN_B(c)) && + (cg = find11gchannel(ic, i, freq[i])) != NULL) c = cg; } + if (c == NULL) + continue; + ss->ss_chans[ss->ss_last++] = c; } #undef N