mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2024-11-28 18:28:23 -05:00
HE: Remove VHT_ prefix from CHANWITDH_* define
The bandwidth values are shared between VHT and HE mode so remove the VHT specific prefix. Signed-off-by: Shashidhar Lakkavalli <slakkavalli@datto.com> Signed-off-by: John Crispin <john@phrozen.org>
This commit is contained in:
parent
846e8396ab
commit
464dcfd030
14
src/ap/acs.c
14
src/ap/acs.c
@ -596,10 +596,10 @@ acs_find_ideal_chan(struct hostapd_iface *iface)
|
||||
|
||||
if (iface->conf->ieee80211ac) {
|
||||
switch (iface->conf->vht_oper_chwidth) {
|
||||
case VHT_CHANWIDTH_80MHZ:
|
||||
case CHANWIDTH_80MHZ:
|
||||
n_chans = 4;
|
||||
break;
|
||||
case VHT_CHANWIDTH_160MHZ:
|
||||
case CHANWIDTH_160MHZ:
|
||||
n_chans = 8;
|
||||
break;
|
||||
}
|
||||
@ -649,7 +649,7 @@ acs_find_ideal_chan(struct hostapd_iface *iface)
|
||||
if (iface->current_mode->mode == HOSTAPD_MODE_IEEE80211A &&
|
||||
iface->conf->ieee80211ac) {
|
||||
if (iface->conf->vht_oper_chwidth ==
|
||||
VHT_CHANWIDTH_80MHZ &&
|
||||
CHANWIDTH_80MHZ &&
|
||||
!acs_usable_vht80_chan(chan)) {
|
||||
wpa_printf(MSG_DEBUG,
|
||||
"ACS: Channel %d: not allowed as primary channel for VHT80",
|
||||
@ -658,7 +658,7 @@ acs_find_ideal_chan(struct hostapd_iface *iface)
|
||||
}
|
||||
|
||||
if (iface->conf->vht_oper_chwidth ==
|
||||
VHT_CHANWIDTH_160MHZ &&
|
||||
CHANWIDTH_160MHZ &&
|
||||
!acs_usable_vht160_chan(chan)) {
|
||||
wpa_printf(MSG_DEBUG,
|
||||
"ACS: Channel %d: not allowed as primary channel for VHT160",
|
||||
@ -790,13 +790,13 @@ static void acs_adjust_vht_center_freq(struct hostapd_iface *iface)
|
||||
wpa_printf(MSG_DEBUG, "ACS: Adjusting VHT center frequency");
|
||||
|
||||
switch (iface->conf->vht_oper_chwidth) {
|
||||
case VHT_CHANWIDTH_USE_HT:
|
||||
case CHANWIDTH_USE_HT:
|
||||
offset = 2 * iface->conf->secondary_channel;
|
||||
break;
|
||||
case VHT_CHANWIDTH_80MHZ:
|
||||
case CHANWIDTH_80MHZ:
|
||||
offset = 6;
|
||||
break;
|
||||
case VHT_CHANWIDTH_160MHZ:
|
||||
case CHANWIDTH_160MHZ:
|
||||
offset = 14;
|
||||
break;
|
||||
default:
|
||||
|
@ -932,12 +932,12 @@ int hostapd_drv_do_acs(struct hostapd_data *hapd)
|
||||
/* Note: VHT20 is defined by combination of ht_capab & vht_oper_chwidth
|
||||
*/
|
||||
if (hapd->iface->conf->ieee80211ac && params.ht40_enabled) {
|
||||
if (hapd->iface->conf->vht_oper_chwidth == VHT_CHANWIDTH_80MHZ)
|
||||
if (hapd->iface->conf->vht_oper_chwidth == CHANWIDTH_80MHZ)
|
||||
params.ch_width = 80;
|
||||
else if (hapd->iface->conf->vht_oper_chwidth ==
|
||||
VHT_CHANWIDTH_160MHZ ||
|
||||
CHANWIDTH_160MHZ ||
|
||||
hapd->iface->conf->vht_oper_chwidth ==
|
||||
VHT_CHANWIDTH_80P80MHZ)
|
||||
CHANWIDTH_80P80MHZ)
|
||||
params.ch_width = 160;
|
||||
}
|
||||
|
||||
|
22
src/ap/dfs.c
22
src/ap/dfs.c
@ -30,15 +30,15 @@ static int dfs_get_used_n_chans(struct hostapd_iface *iface, int *seg1)
|
||||
|
||||
if (iface->conf->ieee80211ac) {
|
||||
switch (iface->conf->vht_oper_chwidth) {
|
||||
case VHT_CHANWIDTH_USE_HT:
|
||||
case CHANWIDTH_USE_HT:
|
||||
break;
|
||||
case VHT_CHANWIDTH_80MHZ:
|
||||
case CHANWIDTH_80MHZ:
|
||||
n_chans = 4;
|
||||
break;
|
||||
case VHT_CHANWIDTH_160MHZ:
|
||||
case CHANWIDTH_160MHZ:
|
||||
n_chans = 8;
|
||||
break;
|
||||
case VHT_CHANWIDTH_80P80MHZ:
|
||||
case CHANWIDTH_80P80MHZ:
|
||||
n_chans = 4;
|
||||
*seg1 = 4;
|
||||
break;
|
||||
@ -247,7 +247,7 @@ static void dfs_adjust_vht_center_freq(struct hostapd_iface *iface,
|
||||
*vht_oper_centr_freq_seg1_idx = 0;
|
||||
|
||||
switch (iface->conf->vht_oper_chwidth) {
|
||||
case VHT_CHANWIDTH_USE_HT:
|
||||
case CHANWIDTH_USE_HT:
|
||||
if (secondary_channel == 1)
|
||||
*vht_oper_centr_freq_seg0_idx = chan->chan + 2;
|
||||
else if (secondary_channel == -1)
|
||||
@ -255,10 +255,10 @@ static void dfs_adjust_vht_center_freq(struct hostapd_iface *iface,
|
||||
else
|
||||
*vht_oper_centr_freq_seg0_idx = chan->chan;
|
||||
break;
|
||||
case VHT_CHANWIDTH_80MHZ:
|
||||
case CHANWIDTH_80MHZ:
|
||||
*vht_oper_centr_freq_seg0_idx = chan->chan + 6;
|
||||
break;
|
||||
case VHT_CHANWIDTH_160MHZ:
|
||||
case CHANWIDTH_160MHZ:
|
||||
*vht_oper_centr_freq_seg0_idx = chan->chan + 14;
|
||||
break;
|
||||
default:
|
||||
@ -291,17 +291,17 @@ static int dfs_get_start_chan_idx(struct hostapd_iface *iface, int *seg1_start)
|
||||
/* VHT */
|
||||
if (iface->conf->ieee80211ac) {
|
||||
switch (iface->conf->vht_oper_chwidth) {
|
||||
case VHT_CHANWIDTH_USE_HT:
|
||||
case CHANWIDTH_USE_HT:
|
||||
break;
|
||||
case VHT_CHANWIDTH_80MHZ:
|
||||
case CHANWIDTH_80MHZ:
|
||||
channel_no =
|
||||
iface->conf->vht_oper_centr_freq_seg0_idx - 6;
|
||||
break;
|
||||
case VHT_CHANWIDTH_160MHZ:
|
||||
case CHANWIDTH_160MHZ:
|
||||
channel_no =
|
||||
iface->conf->vht_oper_centr_freq_seg0_idx - 14;
|
||||
break;
|
||||
case VHT_CHANWIDTH_80P80MHZ:
|
||||
case CHANWIDTH_80P80MHZ:
|
||||
channel_no =
|
||||
iface->conf->vht_oper_centr_freq_seg0_idx - 6;
|
||||
chan_seg1 =
|
||||
|
@ -808,19 +808,19 @@ void hostapd_event_ch_switch(struct hostapd_data *hapd, int freq, int ht,
|
||||
|
||||
switch (width) {
|
||||
case CHAN_WIDTH_80:
|
||||
chwidth = VHT_CHANWIDTH_80MHZ;
|
||||
chwidth = CHANWIDTH_80MHZ;
|
||||
break;
|
||||
case CHAN_WIDTH_80P80:
|
||||
chwidth = VHT_CHANWIDTH_80P80MHZ;
|
||||
chwidth = CHANWIDTH_80P80MHZ;
|
||||
break;
|
||||
case CHAN_WIDTH_160:
|
||||
chwidth = VHT_CHANWIDTH_160MHZ;
|
||||
chwidth = CHANWIDTH_160MHZ;
|
||||
break;
|
||||
case CHAN_WIDTH_20_NOHT:
|
||||
case CHAN_WIDTH_20:
|
||||
case CHAN_WIDTH_40:
|
||||
default:
|
||||
chwidth = VHT_CHANWIDTH_USE_HT;
|
||||
chwidth = CHANWIDTH_USE_HT;
|
||||
break;
|
||||
}
|
||||
|
||||
@ -964,24 +964,24 @@ void hostapd_acs_channel_selected(struct hostapd_data *hapd,
|
||||
/* set defaults for backwards compatibility */
|
||||
hapd->iconf->vht_oper_centr_freq_seg1_idx = 0;
|
||||
hapd->iconf->vht_oper_centr_freq_seg0_idx = 0;
|
||||
hapd->iconf->vht_oper_chwidth = VHT_CHANWIDTH_USE_HT;
|
||||
hapd->iconf->vht_oper_chwidth = CHANWIDTH_USE_HT;
|
||||
if (acs_res->ch_width == 80) {
|
||||
hapd->iconf->vht_oper_centr_freq_seg0_idx =
|
||||
acs_res->vht_seg0_center_ch;
|
||||
hapd->iconf->vht_oper_chwidth = VHT_CHANWIDTH_80MHZ;
|
||||
hapd->iconf->vht_oper_chwidth = CHANWIDTH_80MHZ;
|
||||
} else if (acs_res->ch_width == 160) {
|
||||
if (acs_res->vht_seg1_center_ch == 0) {
|
||||
hapd->iconf->vht_oper_centr_freq_seg0_idx =
|
||||
acs_res->vht_seg0_center_ch;
|
||||
hapd->iconf->vht_oper_chwidth =
|
||||
VHT_CHANWIDTH_160MHZ;
|
||||
CHANWIDTH_160MHZ;
|
||||
} else {
|
||||
hapd->iconf->vht_oper_centr_freq_seg0_idx =
|
||||
acs_res->vht_seg0_center_ch;
|
||||
hapd->iconf->vht_oper_centr_freq_seg1_idx =
|
||||
acs_res->vht_seg1_center_ch;
|
||||
hapd->iconf->vht_oper_chwidth =
|
||||
VHT_CHANWIDTH_80P80MHZ;
|
||||
CHANWIDTH_80P80MHZ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3227,16 +3227,16 @@ static int hostapd_change_config_freq(struct hostapd_data *hapd,
|
||||
case 0:
|
||||
case 20:
|
||||
case 40:
|
||||
conf->vht_oper_chwidth = VHT_CHANWIDTH_USE_HT;
|
||||
conf->vht_oper_chwidth = CHANWIDTH_USE_HT;
|
||||
break;
|
||||
case 80:
|
||||
if (params->center_freq2)
|
||||
conf->vht_oper_chwidth = VHT_CHANWIDTH_80P80MHZ;
|
||||
conf->vht_oper_chwidth = CHANWIDTH_80P80MHZ;
|
||||
else
|
||||
conf->vht_oper_chwidth = VHT_CHANWIDTH_80MHZ;
|
||||
conf->vht_oper_chwidth = CHANWIDTH_80MHZ;
|
||||
break;
|
||||
case 160:
|
||||
conf->vht_oper_chwidth = VHT_CHANWIDTH_160MHZ;
|
||||
conf->vht_oper_chwidth = CHANWIDTH_160MHZ;
|
||||
break;
|
||||
default:
|
||||
return -1;
|
||||
@ -3271,15 +3271,15 @@ static int hostapd_fill_csa_settings(struct hostapd_data *hapd,
|
||||
switch (settings->freq_params.bandwidth) {
|
||||
case 80:
|
||||
if (settings->freq_params.center_freq2)
|
||||
vht_bandwidth = VHT_CHANWIDTH_80P80MHZ;
|
||||
vht_bandwidth = CHANWIDTH_80P80MHZ;
|
||||
else
|
||||
vht_bandwidth = VHT_CHANWIDTH_80MHZ;
|
||||
vht_bandwidth = CHANWIDTH_80MHZ;
|
||||
break;
|
||||
case 160:
|
||||
vht_bandwidth = VHT_CHANWIDTH_160MHZ;
|
||||
vht_bandwidth = CHANWIDTH_160MHZ;
|
||||
break;
|
||||
default:
|
||||
vht_bandwidth = VHT_CHANWIDTH_USE_HT;
|
||||
vht_bandwidth = CHANWIDTH_USE_HT;
|
||||
break;
|
||||
}
|
||||
|
||||
@ -3393,7 +3393,7 @@ void
|
||||
hostapd_switch_channel_fallback(struct hostapd_iface *iface,
|
||||
const struct hostapd_freq_params *freq_params)
|
||||
{
|
||||
int vht_seg0_idx = 0, vht_seg1_idx = 0, vht_bw = VHT_CHANWIDTH_USE_HT;
|
||||
int vht_seg0_idx = 0, vht_seg1_idx = 0, vht_bw = CHANWIDTH_USE_HT;
|
||||
|
||||
wpa_printf(MSG_DEBUG, "Restarting all CSA-related BSSes");
|
||||
|
||||
@ -3406,16 +3406,16 @@ hostapd_switch_channel_fallback(struct hostapd_iface *iface,
|
||||
case 0:
|
||||
case 20:
|
||||
case 40:
|
||||
vht_bw = VHT_CHANWIDTH_USE_HT;
|
||||
vht_bw = CHANWIDTH_USE_HT;
|
||||
break;
|
||||
case 80:
|
||||
if (freq_params->center_freq2)
|
||||
vht_bw = VHT_CHANWIDTH_80P80MHZ;
|
||||
vht_bw = CHANWIDTH_80P80MHZ;
|
||||
else
|
||||
vht_bw = VHT_CHANWIDTH_80MHZ;
|
||||
vht_bw = CHANWIDTH_80MHZ;
|
||||
break;
|
||||
case 160:
|
||||
vht_bw = VHT_CHANWIDTH_160MHZ;
|
||||
vht_bw = CHANWIDTH_160MHZ;
|
||||
break;
|
||||
default:
|
||||
wpa_printf(MSG_WARNING, "Unknown CSA bandwidth: %d",
|
||||
|
@ -331,7 +331,7 @@ static void ieee80211n_check_scan(struct hostapd_iface *iface)
|
||||
iface->conf->secondary_channel = 0;
|
||||
iface->conf->vht_oper_centr_freq_seg0_idx = 0;
|
||||
iface->conf->vht_oper_centr_freq_seg1_idx = 0;
|
||||
iface->conf->vht_oper_chwidth = VHT_CHANWIDTH_USE_HT;
|
||||
iface->conf->vht_oper_chwidth = CHANWIDTH_USE_HT;
|
||||
res = 1;
|
||||
wpa_printf(MSG_INFO, "Fallback to 20 MHz");
|
||||
}
|
||||
|
@ -242,7 +242,7 @@ u8 * hostapd_eid_txpower_envelope(struct hostapd_data *hapd, u8 *eid)
|
||||
return eid;
|
||||
|
||||
switch (iface->conf->vht_oper_chwidth) {
|
||||
case VHT_CHANWIDTH_USE_HT:
|
||||
case CHANWIDTH_USE_HT:
|
||||
if (iconf->secondary_channel == 0) {
|
||||
/* Max Transmit Power count = 0 (20 MHz) */
|
||||
tx_pwr_count = 0;
|
||||
@ -251,12 +251,12 @@ u8 * hostapd_eid_txpower_envelope(struct hostapd_data *hapd, u8 *eid)
|
||||
tx_pwr_count = 1;
|
||||
}
|
||||
break;
|
||||
case VHT_CHANWIDTH_80MHZ:
|
||||
case CHANWIDTH_80MHZ:
|
||||
/* Max Transmit Power count = 2 (20, 40, and 80 MHz) */
|
||||
tx_pwr_count = 2;
|
||||
break;
|
||||
case VHT_CHANWIDTH_80P80MHZ:
|
||||
case VHT_CHANWIDTH_160MHZ:
|
||||
case CHANWIDTH_80P80MHZ:
|
||||
case CHANWIDTH_160MHZ:
|
||||
/* Max Transmit Power count = 3 (20, 40, 80, 160/80+80 MHz) */
|
||||
tx_pwr_count = 3;
|
||||
break;
|
||||
|
@ -145,13 +145,13 @@ static enum nr_chan_width hostapd_get_nr_chan_width(struct hostapd_data *hapd,
|
||||
return NR_CHAN_WIDTH_20;
|
||||
if (!hapd->iconf->secondary_channel)
|
||||
return NR_CHAN_WIDTH_20;
|
||||
if (!vht || hapd->iconf->vht_oper_chwidth == VHT_CHANWIDTH_USE_HT)
|
||||
if (!vht || hapd->iconf->vht_oper_chwidth == CHANWIDTH_USE_HT)
|
||||
return NR_CHAN_WIDTH_40;
|
||||
if (hapd->iconf->vht_oper_chwidth == VHT_CHANWIDTH_80MHZ)
|
||||
if (hapd->iconf->vht_oper_chwidth == CHANWIDTH_80MHZ)
|
||||
return NR_CHAN_WIDTH_80;
|
||||
if (hapd->iconf->vht_oper_chwidth == VHT_CHANWIDTH_160MHZ)
|
||||
if (hapd->iconf->vht_oper_chwidth == CHANWIDTH_160MHZ)
|
||||
return NR_CHAN_WIDTH_160;
|
||||
if (hapd->iconf->vht_oper_chwidth == VHT_CHANWIDTH_80P80MHZ)
|
||||
if (hapd->iconf->vht_oper_chwidth == CHANWIDTH_80P80MHZ)
|
||||
return NR_CHAN_WIDTH_80P80;
|
||||
return NR_CHAN_WIDTH_20;
|
||||
}
|
||||
|
@ -377,14 +377,14 @@ int hostapd_set_freq_params(struct hostapd_freq_params *data,
|
||||
data->bandwidth = sec_channel_offset ? 40 : 20;
|
||||
|
||||
if (data->vht_enabled) switch (vht_oper_chwidth) {
|
||||
case VHT_CHANWIDTH_USE_HT:
|
||||
case CHANWIDTH_USE_HT:
|
||||
if (center_segment1 ||
|
||||
(center_segment0 != 0 &&
|
||||
5000 + center_segment0 * 5 != data->center_freq1 &&
|
||||
2407 + center_segment0 * 5 != data->center_freq1))
|
||||
return -1;
|
||||
break;
|
||||
case VHT_CHANWIDTH_80P80MHZ:
|
||||
case CHANWIDTH_80P80MHZ:
|
||||
if (!(vht_caps & VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ)) {
|
||||
wpa_printf(MSG_ERROR,
|
||||
"80+80 channel width is not supported!");
|
||||
@ -395,11 +395,11 @@ int hostapd_set_freq_params(struct hostapd_freq_params *data,
|
||||
return -1;
|
||||
data->center_freq2 = 5000 + center_segment1 * 5;
|
||||
/* fall through */
|
||||
case VHT_CHANWIDTH_80MHZ:
|
||||
case CHANWIDTH_80MHZ:
|
||||
data->bandwidth = 80;
|
||||
if ((vht_oper_chwidth == VHT_CHANWIDTH_80MHZ &&
|
||||
if ((vht_oper_chwidth == CHANWIDTH_80MHZ &&
|
||||
center_segment1) ||
|
||||
(vht_oper_chwidth == VHT_CHANWIDTH_80P80MHZ &&
|
||||
(vht_oper_chwidth == CHANWIDTH_80P80MHZ &&
|
||||
!center_segment1) ||
|
||||
!sec_channel_offset)
|
||||
return -1;
|
||||
@ -432,7 +432,7 @@ int hostapd_set_freq_params(struct hostapd_freq_params *data,
|
||||
return -1;
|
||||
}
|
||||
break;
|
||||
case VHT_CHANWIDTH_160MHZ:
|
||||
case CHANWIDTH_160MHZ:
|
||||
data->bandwidth = 160;
|
||||
if (!(vht_caps & (VHT_CAP_SUPP_CHAN_WIDTH_160MHZ |
|
||||
VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ))) {
|
||||
|
@ -706,7 +706,7 @@ enum hostapd_hw_mode ieee80211_freq_to_chan(int freq, u8 *channel)
|
||||
{
|
||||
u8 op_class;
|
||||
|
||||
return ieee80211_freq_to_channel_ext(freq, 0, VHT_CHANWIDTH_USE_HT,
|
||||
return ieee80211_freq_to_channel_ext(freq, 0, CHANWIDTH_USE_HT,
|
||||
&op_class, channel);
|
||||
}
|
||||
|
||||
@ -716,7 +716,7 @@ enum hostapd_hw_mode ieee80211_freq_to_chan(int freq, u8 *channel)
|
||||
* for HT40 and VHT. DFS channels are not covered.
|
||||
* @freq: Frequency (MHz) to convert
|
||||
* @sec_channel: 0 = non-HT40, 1 = sec. channel above, -1 = sec. channel below
|
||||
* @vht: VHT channel width (VHT_CHANWIDTH_*)
|
||||
* @vht: VHT channel width (CHANWIDTH_*)
|
||||
* @op_class: Buffer for returning operating class
|
||||
* @channel: Buffer for returning channel number
|
||||
* Returns: hw_mode on success, NUM_HOSTAPD_MODES on failure
|
||||
@ -771,13 +771,13 @@ enum hostapd_hw_mode ieee80211_freq_to_channel_ext(unsigned int freq,
|
||||
}
|
||||
|
||||
switch (vht) {
|
||||
case VHT_CHANWIDTH_80MHZ:
|
||||
case CHANWIDTH_80MHZ:
|
||||
vht_opclass = 128;
|
||||
break;
|
||||
case VHT_CHANWIDTH_160MHZ:
|
||||
case CHANWIDTH_160MHZ:
|
||||
vht_opclass = 129;
|
||||
break;
|
||||
case VHT_CHANWIDTH_80P80MHZ:
|
||||
case CHANWIDTH_80P80MHZ:
|
||||
vht_opclass = 130;
|
||||
break;
|
||||
default:
|
||||
@ -896,16 +896,16 @@ int ieee80211_chaninfo_to_channel(unsigned int freq, enum chan_width chanwidth,
|
||||
case CHAN_WIDTH_20_NOHT:
|
||||
case CHAN_WIDTH_20:
|
||||
case CHAN_WIDTH_40:
|
||||
vht = VHT_CHANWIDTH_USE_HT;
|
||||
vht = CHANWIDTH_USE_HT;
|
||||
break;
|
||||
case CHAN_WIDTH_80:
|
||||
vht = VHT_CHANWIDTH_80MHZ;
|
||||
vht = CHANWIDTH_80MHZ;
|
||||
break;
|
||||
case CHAN_WIDTH_80P80:
|
||||
vht = VHT_CHANWIDTH_80P80MHZ;
|
||||
vht = CHANWIDTH_80P80MHZ;
|
||||
break;
|
||||
case CHAN_WIDTH_160:
|
||||
vht = VHT_CHANWIDTH_160MHZ;
|
||||
vht = CHANWIDTH_160MHZ;
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -1275,10 +1275,10 @@ struct ieee80211_ampe_ie {
|
||||
#define VHT_RX_NSS_MAX_STREAMS 8
|
||||
|
||||
/* VHT channel widths */
|
||||
#define VHT_CHANWIDTH_USE_HT 0
|
||||
#define VHT_CHANWIDTH_80MHZ 1
|
||||
#define VHT_CHANWIDTH_160MHZ 2
|
||||
#define VHT_CHANWIDTH_80P80MHZ 3
|
||||
#define CHANWIDTH_USE_HT 0
|
||||
#define CHANWIDTH_80MHZ 1
|
||||
#define CHANWIDTH_160MHZ 2
|
||||
#define CHANWIDTH_80P80MHZ 3
|
||||
|
||||
#define OUI_MICROSOFT 0x0050f2 /* Microsoft (also used in Wi-Fi specs)
|
||||
* 00:50:F2 */
|
||||
@ -2092,7 +2092,7 @@ enum phy_type {
|
||||
/*
|
||||
* IEEE P802.11-REVmc/D5.0 Table 9-152 - HT/VHT Operation Information
|
||||
* subfields.
|
||||
* Note: These definitions are not the same as other VHT_CHANWIDTH_*.
|
||||
* Note: These definitions are not the same as other CHANWIDTH_*.
|
||||
*/
|
||||
enum nr_chan_width {
|
||||
NR_CHAN_WIDTH_20 = 0,
|
||||
|
@ -67,7 +67,7 @@ static void wpas_conf_ap_vht(struct wpa_supplicant *wpa_s,
|
||||
|
||||
if (!ssid->p2p_group) {
|
||||
if (!ssid->vht_center_freq1 ||
|
||||
conf->vht_oper_chwidth == VHT_CHANWIDTH_USE_HT)
|
||||
conf->vht_oper_chwidth == CHANWIDTH_USE_HT)
|
||||
goto no_vht;
|
||||
ieee80211_freq_to_chan(ssid->vht_center_freq1,
|
||||
&conf->vht_oper_centr_freq_seg0_idx);
|
||||
@ -78,14 +78,14 @@ static void wpas_conf_ap_vht(struct wpa_supplicant *wpa_s,
|
||||
|
||||
#ifdef CONFIG_P2P
|
||||
switch (conf->vht_oper_chwidth) {
|
||||
case VHT_CHANWIDTH_80MHZ:
|
||||
case VHT_CHANWIDTH_80P80MHZ:
|
||||
case CHANWIDTH_80MHZ:
|
||||
case CHANWIDTH_80P80MHZ:
|
||||
center_chan = wpas_p2p_get_vht80_center(wpa_s, mode, channel);
|
||||
wpa_printf(MSG_DEBUG,
|
||||
"VHT center channel %u for 80 or 80+80 MHz bandwidth",
|
||||
center_chan);
|
||||
break;
|
||||
case VHT_CHANWIDTH_160MHZ:
|
||||
case CHANWIDTH_160MHZ:
|
||||
center_chan = wpas_p2p_get_vht160_center(wpa_s, mode, channel);
|
||||
wpa_printf(MSG_DEBUG,
|
||||
"VHT center channel %u for 160 MHz bandwidth",
|
||||
@ -97,14 +97,14 @@ static void wpas_conf_ap_vht(struct wpa_supplicant *wpa_s,
|
||||
* try oper_cwidth 160 MHz first then VHT 80 MHz, if 160 MHz is
|
||||
* not supported.
|
||||
*/
|
||||
conf->vht_oper_chwidth = VHT_CHANWIDTH_160MHZ;
|
||||
conf->vht_oper_chwidth = CHANWIDTH_160MHZ;
|
||||
center_chan = wpas_p2p_get_vht160_center(wpa_s, mode, channel);
|
||||
if (center_chan) {
|
||||
wpa_printf(MSG_DEBUG,
|
||||
"VHT center channel %u for auto-selected 160 MHz bandwidth",
|
||||
center_chan);
|
||||
} else {
|
||||
conf->vht_oper_chwidth = VHT_CHANWIDTH_80MHZ;
|
||||
conf->vht_oper_chwidth = CHANWIDTH_80MHZ;
|
||||
center_chan = wpas_p2p_get_vht80_center(wpa_s, mode,
|
||||
channel);
|
||||
wpa_printf(MSG_DEBUG,
|
||||
@ -128,7 +128,7 @@ no_vht:
|
||||
conf->channel);
|
||||
conf->vht_oper_centr_freq_seg0_idx =
|
||||
conf->channel + conf->secondary_channel * 2;
|
||||
conf->vht_oper_chwidth = VHT_CHANWIDTH_USE_HT;
|
||||
conf->vht_oper_chwidth = CHANWIDTH_USE_HT;
|
||||
}
|
||||
#endif /* CONFIG_IEEE80211N */
|
||||
|
||||
|
@ -2240,8 +2240,8 @@ static const struct parse_data ssid_fields[] = {
|
||||
{ INT_RANGE(ht, 0, 1) },
|
||||
{ INT_RANGE(vht, 0, 1) },
|
||||
{ INT_RANGE(ht40, -1, 1) },
|
||||
{ INT_RANGE(max_oper_chwidth, VHT_CHANWIDTH_USE_HT,
|
||||
VHT_CHANWIDTH_80P80MHZ) },
|
||||
{ INT_RANGE(max_oper_chwidth, CHANWIDTH_USE_HT,
|
||||
CHANWIDTH_80P80MHZ) },
|
||||
{ INT(vht_center_freq1) },
|
||||
{ INT(vht_center_freq2) },
|
||||
#ifdef IEEE8021X_EAPOL
|
||||
|
@ -5548,17 +5548,17 @@ static int parse_freq(int chwidth, int freq2)
|
||||
if (freq2 < 0)
|
||||
return -1;
|
||||
if (freq2)
|
||||
return VHT_CHANWIDTH_80P80MHZ;
|
||||
return CHANWIDTH_80P80MHZ;
|
||||
|
||||
switch (chwidth) {
|
||||
case 0:
|
||||
case 20:
|
||||
case 40:
|
||||
return VHT_CHANWIDTH_USE_HT;
|
||||
return CHANWIDTH_USE_HT;
|
||||
case 80:
|
||||
return VHT_CHANWIDTH_80MHZ;
|
||||
return CHANWIDTH_80MHZ;
|
||||
case 160:
|
||||
return VHT_CHANWIDTH_160MHZ;
|
||||
return CHANWIDTH_160MHZ;
|
||||
default:
|
||||
wpa_printf(MSG_DEBUG, "Unknown max oper bandwidth: %d",
|
||||
chwidth);
|
||||
|
@ -334,14 +334,14 @@ static int wpa_supplicant_mesh_init(struct wpa_supplicant *wpa_s,
|
||||
if (ssid->max_oper_chwidth != DEFAULT_MAX_OPER_CHWIDTH)
|
||||
conf->vht_oper_chwidth = ssid->max_oper_chwidth;
|
||||
switch (conf->vht_oper_chwidth) {
|
||||
case VHT_CHANWIDTH_80MHZ:
|
||||
case VHT_CHANWIDTH_80P80MHZ:
|
||||
case CHANWIDTH_80MHZ:
|
||||
case CHANWIDTH_80P80MHZ:
|
||||
ieee80211_freq_to_chan(
|
||||
frequency,
|
||||
&conf->vht_oper_centr_freq_seg0_idx);
|
||||
conf->vht_oper_centr_freq_seg0_idx += ssid->ht40 * 2;
|
||||
break;
|
||||
case VHT_CHANWIDTH_160MHZ:
|
||||
case CHANWIDTH_160MHZ:
|
||||
ieee80211_freq_to_chan(
|
||||
frequency,
|
||||
&conf->vht_oper_centr_freq_seg0_idx);
|
||||
@ -465,18 +465,18 @@ int wpa_supplicant_join_mesh(struct wpa_supplicant *wpa_s,
|
||||
switch (params->freq.bandwidth) {
|
||||
case 80:
|
||||
if (params->freq.center_freq2) {
|
||||
ssid->max_oper_chwidth = VHT_CHANWIDTH_80P80MHZ;
|
||||
ssid->max_oper_chwidth = CHANWIDTH_80P80MHZ;
|
||||
ssid->vht_center_freq2 =
|
||||
params->freq.center_freq2;
|
||||
} else {
|
||||
ssid->max_oper_chwidth = VHT_CHANWIDTH_80MHZ;
|
||||
ssid->max_oper_chwidth = CHANWIDTH_80MHZ;
|
||||
}
|
||||
break;
|
||||
case 160:
|
||||
ssid->max_oper_chwidth = VHT_CHANWIDTH_160MHZ;
|
||||
ssid->max_oper_chwidth = CHANWIDTH_160MHZ;
|
||||
break;
|
||||
default:
|
||||
ssid->max_oper_chwidth = VHT_CHANWIDTH_USE_HT;
|
||||
ssid->max_oper_chwidth = CHANWIDTH_USE_HT;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -348,7 +348,7 @@ size_t wpas_supp_op_class_ie(struct wpa_supplicant *wpa_s,
|
||||
* TODO: Use the secondary channel and VHT channel width that will be
|
||||
* used after association.
|
||||
*/
|
||||
if (ieee80211_freq_to_channel_ext(freq, 0, VHT_CHANWIDTH_USE_HT,
|
||||
if (ieee80211_freq_to_channel_ext(freq, 0, CHANWIDTH_USE_HT,
|
||||
¤t, &chan) == NUM_HOSTAPD_MODES)
|
||||
return 0;
|
||||
|
||||
|
@ -5476,7 +5476,7 @@ exit_free:
|
||||
* @ht40: Start GO with 40 MHz channel width
|
||||
* @vht: Start GO with VHT support
|
||||
* @vht_chwidth: Channel width supported by GO operating with VHT support
|
||||
* (VHT_CHANWIDTH_*).
|
||||
* (CHANWIDTH_*).
|
||||
* @group_ssid: Specific Group SSID for join or %NULL if not set
|
||||
* @group_ssid_len: Length of @group_ssid in octets
|
||||
* Returns: 0 or new PIN (if pin was %NULL) on success, -1 on unspecified
|
||||
@ -9193,11 +9193,11 @@ static int wpas_p2p_move_go_csa(struct wpa_supplicant *wpa_s)
|
||||
csa_settings.freq_params.center_freq2 = freq2;
|
||||
|
||||
switch (conf->vht_oper_chwidth) {
|
||||
case VHT_CHANWIDTH_80MHZ:
|
||||
case VHT_CHANWIDTH_80P80MHZ:
|
||||
case CHANWIDTH_80MHZ:
|
||||
case CHANWIDTH_80P80MHZ:
|
||||
csa_settings.freq_params.bandwidth = 80;
|
||||
break;
|
||||
case VHT_CHANWIDTH_160MHZ:
|
||||
case CHANWIDTH_160MHZ:
|
||||
csa_settings.freq_params.bandwidth = 160;
|
||||
break;
|
||||
}
|
||||
|
@ -717,20 +717,20 @@ static int wpas_get_op_chan_phy(int freq, const u8 *ies, size_t ies_len,
|
||||
seg0 = vht_oper->vht_op_info_chan_center_freq_seg0_idx;
|
||||
seg1 = vht_oper->vht_op_info_chan_center_freq_seg1_idx;
|
||||
if (seg1 && abs(seg1 - seg0) == 8)
|
||||
vht = VHT_CHANWIDTH_160MHZ;
|
||||
vht = CHANWIDTH_160MHZ;
|
||||
else if (seg1)
|
||||
vht = VHT_CHANWIDTH_80P80MHZ;
|
||||
vht = CHANWIDTH_80P80MHZ;
|
||||
else
|
||||
vht = VHT_CHANWIDTH_80MHZ;
|
||||
vht = CHANWIDTH_80MHZ;
|
||||
break;
|
||||
case 2:
|
||||
vht = VHT_CHANWIDTH_160MHZ;
|
||||
vht = CHANWIDTH_160MHZ;
|
||||
break;
|
||||
case 3:
|
||||
vht = VHT_CHANWIDTH_80P80MHZ;
|
||||
vht = CHANWIDTH_80P80MHZ;
|
||||
break;
|
||||
default:
|
||||
vht = VHT_CHANWIDTH_USE_HT;
|
||||
vht = CHANWIDTH_USE_HT;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -925,9 +925,9 @@ static int wnm_nei_rep_add_bss(struct wpa_supplicant *wpa_s,
|
||||
if (ie && ie[1] >= 1) {
|
||||
vht_oper = (struct ieee80211_vht_operation *) (ie + 2);
|
||||
|
||||
if (vht_oper->vht_op_info_chwidth == VHT_CHANWIDTH_80MHZ ||
|
||||
vht_oper->vht_op_info_chwidth == VHT_CHANWIDTH_160MHZ ||
|
||||
vht_oper->vht_op_info_chwidth == VHT_CHANWIDTH_80P80MHZ)
|
||||
if (vht_oper->vht_op_info_chwidth == CHANWIDTH_80MHZ ||
|
||||
vht_oper->vht_op_info_chwidth == CHANWIDTH_160MHZ ||
|
||||
vht_oper->vht_op_info_chwidth == CHANWIDTH_80P80MHZ)
|
||||
vht = vht_oper->vht_op_info_chwidth;
|
||||
}
|
||||
|
||||
|
@ -2355,11 +2355,11 @@ skip_ht40:
|
||||
return;
|
||||
}
|
||||
|
||||
chwidth = VHT_CHANWIDTH_80MHZ;
|
||||
chwidth = CHANWIDTH_80MHZ;
|
||||
seg0 = vht80[j] + 6;
|
||||
seg1 = 0;
|
||||
|
||||
if (ssid->max_oper_chwidth == VHT_CHANWIDTH_80P80MHZ) {
|
||||
if (ssid->max_oper_chwidth == CHANWIDTH_80P80MHZ) {
|
||||
/* setup center_freq2, bandwidth */
|
||||
for (k = 0; k < ARRAY_SIZE(vht80); k++) {
|
||||
/* Only accept 80 MHz segments separated by a gap */
|
||||
@ -2378,27 +2378,27 @@ skip_ht40:
|
||||
continue;
|
||||
|
||||
/* Found a suitable second segment for 80+80 */
|
||||
chwidth = VHT_CHANWIDTH_80P80MHZ;
|
||||
chwidth = CHANWIDTH_80P80MHZ;
|
||||
vht_caps |=
|
||||
VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ;
|
||||
seg1 = vht80[k] + 6;
|
||||
}
|
||||
|
||||
if (chwidth == VHT_CHANWIDTH_80P80MHZ)
|
||||
if (chwidth == CHANWIDTH_80P80MHZ)
|
||||
break;
|
||||
}
|
||||
} else if (ssid->max_oper_chwidth == VHT_CHANWIDTH_160MHZ) {
|
||||
} else if (ssid->max_oper_chwidth == CHANWIDTH_160MHZ) {
|
||||
if (freq->freq == 5180) {
|
||||
chwidth = VHT_CHANWIDTH_160MHZ;
|
||||
chwidth = CHANWIDTH_160MHZ;
|
||||
vht_caps |= VHT_CAP_SUPP_CHAN_WIDTH_160MHZ;
|
||||
seg0 = 50;
|
||||
} else if (freq->freq == 5520) {
|
||||
chwidth = VHT_CHANWIDTH_160MHZ;
|
||||
chwidth = CHANWIDTH_160MHZ;
|
||||
vht_caps |= VHT_CAP_SUPP_CHAN_WIDTH_160MHZ;
|
||||
seg0 = 114;
|
||||
}
|
||||
} else if (ssid->max_oper_chwidth == VHT_CHANWIDTH_USE_HT) {
|
||||
chwidth = VHT_CHANWIDTH_USE_HT;
|
||||
} else if (ssid->max_oper_chwidth == CHANWIDTH_USE_HT) {
|
||||
chwidth = CHANWIDTH_USE_HT;
|
||||
seg0 = vht80[j] + 2;
|
||||
#ifdef CONFIG_HT_OVERRIDES
|
||||
if (ssid->disable_ht40)
|
||||
|
Loading…
Reference in New Issue
Block a user