Changeset View
Changeset View
Standalone View
Standalone View
sys/net80211/ieee80211.c
Show First 20 Lines • Show All 1,812 Lines • ▼ Show 20 Lines | ieee80211_lookup_channel_rxstatus(struct ieee80211vap *vap, | ||||
* Strictly speaking we only use freq for now, | * Strictly speaking we only use freq for now, | ||||
* however later on we may wish to just store | * however later on we may wish to just store | ||||
* the ieee for verification. | * the ieee for verification. | ||||
*/ | */ | ||||
if ((rxs->r_flags & IEEE80211_R_FREQ) == 0) | if ((rxs->r_flags & IEEE80211_R_FREQ) == 0) | ||||
return (NULL); | return (NULL); | ||||
if ((rxs->r_flags & IEEE80211_R_IEEE) == 0) | if ((rxs->r_flags & IEEE80211_R_IEEE) == 0) | ||||
return (NULL); | return (NULL); | ||||
if ((rxs->r_flags & IEEE80211_R_BAND) == 0) | |||||
return (NULL); | |||||
/* | /* | ||||
* If the rx status contains a valid ieee/freq, then | * If the rx status contains a valid ieee/freq, then | ||||
* ensure we populate the correct channel information | * ensure we populate the correct channel information | ||||
* in rxchan before passing it up to the scan infrastructure. | * in rxchan before passing it up to the scan infrastructure. | ||||
* Offload NICs will pass up beacons from all channels | * Offload NICs will pass up beacons from all channels | ||||
* during background scans. | * during background scans. | ||||
*/ | */ | ||||
/* Determine a band */ | /* Determine a band */ | ||||
/* XXX should be done by the driver? */ | switch (rxs->c_band) { | ||||
case IEEE80211_CHAN_2GHZ: | |||||
flags = IEEE80211_CHAN_G; | |||||
break; | |||||
case IEEE80211_CHAN_5GHZ: | |||||
flags = IEEE80211_CHAN_A; | |||||
break; | |||||
default: | |||||
if (rxs->c_freq < 3000) { | if (rxs->c_freq < 3000) { | ||||
flags = IEEE80211_CHAN_G; | flags = IEEE80211_CHAN_G; | ||||
} else { | } else { | ||||
flags = IEEE80211_CHAN_A; | flags = IEEE80211_CHAN_A; | ||||
} | |||||
break; | |||||
} | } | ||||
/* Channel lookup */ | /* Channel lookup */ | ||||
c = ieee80211_find_channel(ic, rxs->c_freq, flags); | c = ieee80211_find_channel(ic, rxs->c_freq, flags); | ||||
IEEE80211_DPRINTF(vap, IEEE80211_MSG_INPUT, | IEEE80211_DPRINTF(vap, IEEE80211_MSG_INPUT, | ||||
"%s: freq=%d, ieee=%d, flags=0x%08x; c=%p\n", | "%s: freq=%d, ieee=%d, flags=0x%08x; c=%p\n", | ||||
__func__, (int) rxs->c_freq, (int) rxs->c_ieee, flags, c); | __func__, (int) rxs->c_freq, (int) rxs->c_ieee, flags, c); | ||||
▲ Show 20 Lines • Show All 791 Lines • Show Last 20 Lines |