Changeset View
Changeset View
Standalone View
Standalone View
head/sys/net80211/ieee80211.c
Show First 20 Lines • Show All 1,162 Lines • ▼ Show 20 Lines | struct vht_chan_range vht80_chan_ranges[] = { | ||||
{ 0, 0, } | { 0, 0, } | ||||
}; | }; | ||||
static int | static int | ||||
set_vht_extchan(struct ieee80211_channel *c) | set_vht_extchan(struct ieee80211_channel *c) | ||||
{ | { | ||||
int i; | int i; | ||||
if (! IEEE80211_IS_CHAN_VHT(c)) { | if (! IEEE80211_IS_CHAN_VHT(c)) | ||||
return (0); | return (0); | ||||
} | |||||
if (IEEE80211_IS_CHAN_VHT20(c)) { | if (IEEE80211_IS_CHAN_VHT80P80(c)) { | ||||
c->ic_vht_ch_freq1 = c->ic_ieee; | printf("%s: TODO VHT80+80 channel (ieee=%d, flags=0x%08x)\n", | ||||
return (1); | __func__, c->ic_ieee, c->ic_flags); | ||||
} | } | ||||
if (IEEE80211_IS_CHAN_VHT40(c)) { | if (IEEE80211_IS_CHAN_VHT160(c)) { | ||||
if (IEEE80211_IS_CHAN_HT40U(c)) | printf("%s: TODO VHT160 channel (ieee=%d, flags=0x%08x)\n", | ||||
c->ic_vht_ch_freq1 = c->ic_ieee + 2; | __func__, c->ic_ieee, c->ic_flags); | ||||
else if (IEEE80211_IS_CHAN_HT40D(c)) | |||||
c->ic_vht_ch_freq1 = c->ic_ieee - 2; | |||||
else | |||||
return (0); | |||||
return (1); | |||||
} | } | ||||
if (IEEE80211_IS_CHAN_VHT80(c)) { | if (IEEE80211_IS_CHAN_VHT80(c)) { | ||||
for (i = 0; vht80_chan_ranges[i].freq_start != 0; i++) { | for (i = 0; vht80_chan_ranges[i].freq_start != 0; i++) { | ||||
if (c->ic_freq >= vht80_chan_ranges[i].freq_start && | if (c->ic_freq >= vht80_chan_ranges[i].freq_start && | ||||
c->ic_freq < vht80_chan_ranges[i].freq_end) { | c->ic_freq < vht80_chan_ranges[i].freq_end) { | ||||
int midpoint; | int midpoint; | ||||
midpoint = vht80_chan_ranges[i].freq_start + 40; | midpoint = vht80_chan_ranges[i].freq_start + 40; | ||||
c->ic_vht_ch_freq1 = | c->ic_vht_ch_freq1 = | ||||
ieee80211_mhz2ieee(midpoint, c->ic_flags); | ieee80211_mhz2ieee(midpoint, c->ic_flags); | ||||
c->ic_vht_ch_freq2 = 0; | c->ic_vht_ch_freq2 = 0; | ||||
#if 0 | #if 0 | ||||
printf("%s: %d, freq=%d, midpoint=%d, freq1=%d, freq2=%d\n", | printf("%s: %d, freq=%d, midpoint=%d, freq1=%d, freq2=%d\n", | ||||
__func__, c->ic_ieee, c->ic_freq, midpoint, | __func__, c->ic_ieee, c->ic_freq, midpoint, | ||||
c->ic_vht_ch_freq1, c->ic_vht_ch_freq2); | c->ic_vht_ch_freq1, c->ic_vht_ch_freq2); | ||||
#endif | #endif | ||||
return (1); | return (1); | ||||
} | } | ||||
} | } | ||||
return (0); | return (0); | ||||
} | |||||
if (IEEE80211_IS_CHAN_VHT40(c)) { | |||||
if (IEEE80211_IS_CHAN_HT40U(c)) | |||||
c->ic_vht_ch_freq1 = c->ic_ieee + 2; | |||||
else if (IEEE80211_IS_CHAN_HT40D(c)) | |||||
c->ic_vht_ch_freq1 = c->ic_ieee - 2; | |||||
else | |||||
return (0); | |||||
return (1); | |||||
} | |||||
if (IEEE80211_IS_CHAN_VHT20(c)) { | |||||
c->ic_vht_ch_freq1 = c->ic_ieee; | |||||
return (1); | |||||
} | } | ||||
printf("%s: unknown VHT channel type (ieee=%d, flags=0x%08x)\n", | printf("%s: unknown VHT channel type (ieee=%d, flags=0x%08x)\n", | ||||
__func__, c->ic_ieee, c->ic_flags); | __func__, c->ic_ieee, c->ic_flags); | ||||
return (0); | return (0); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 1,312 Lines • Show Last 20 Lines |