aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/mesh.c
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2015-12-17 16:37:19 (GMT)
committerJouni Malinen <j@w1.fi>2015-12-17 19:20:02 (GMT)
commitd06a35052f182d3aebc7b7e1c780cca7b386997d (patch)
tree70842a178cf7d594a8ca15810b94aba180bceed6 /wpa_supplicant/mesh.c
parent7e40a8812bff13a2f4c4f3ba531278dca2a7fba3 (diff)
downloadhostap-d06a35052f182d3aebc7b7e1c780cca7b386997d.zip
hostap-d06a35052f182d3aebc7b7e1c780cca7b386997d.tar.gz
hostap-d06a35052f182d3aebc7b7e1c780cca7b386997d.tar.bz2
mesh: Fix VHT Operation information in peering messages
The full VHT channel information was not set in the hostapd data structures which resulted in incorrect information (all zeros) being used when building the VHT Operation element for peering messages while the actual driver mode was set with the full details. We did not seem to use the VHT information from peering messages, so this does not change behavior with another wpa_supplicant-based mesh implementation. Anyway, these elements should match the ones used in Beacon frames. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'wpa_supplicant/mesh.c')
-rw-r--r--wpa_supplicant/mesh.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/wpa_supplicant/mesh.c b/wpa_supplicant/mesh.c
index 8f74b5d..7925aa9 100644
--- a/wpa_supplicant/mesh.c
+++ b/wpa_supplicant/mesh.c
@@ -193,6 +193,29 @@ static int wpa_supplicant_mesh_init(struct wpa_supplicant *wpa_s,
ssid->frequency);
goto out_free;
}
+ if (ssid->ht40)
+ conf->secondary_channel = ssid->ht40;
+ if (conf->hw_mode == HOSTAPD_MODE_IEEE80211A && ssid->vht) {
+ conf->vht_oper_chwidth = ssid->max_oper_chwidth;
+ switch (conf->vht_oper_chwidth) {
+ case VHT_CHANWIDTH_80MHZ:
+ case VHT_CHANWIDTH_80P80MHZ:
+ ieee80211_freq_to_chan(
+ ssid->frequency,
+ &conf->vht_oper_centr_freq_seg0_idx);
+ conf->vht_oper_centr_freq_seg0_idx += ssid->ht40 * 2;
+ break;
+ case VHT_CHANWIDTH_160MHZ:
+ ieee80211_freq_to_chan(
+ ssid->frequency,
+ &conf->vht_oper_centr_freq_seg0_idx);
+ conf->vht_oper_centr_freq_seg0_idx += ssid->ht40 * 2;
+ conf->vht_oper_centr_freq_seg0_idx += 40 / 5;
+ break;
+ }
+ ieee80211_freq_to_chan(ssid->vht_center_freq2,
+ &conf->vht_oper_centr_freq_seg1_idx);
+ }
if (ssid->mesh_basic_rates == NULL) {
/*
@@ -334,6 +357,28 @@ int wpa_supplicant_join_mesh(struct wpa_supplicant *wpa_s,
ibss_mesh_setup_freq(wpa_s, ssid, &params.freq);
wpa_s->mesh_ht_enabled = !!params.freq.ht_enabled;
wpa_s->mesh_vht_enabled = !!params.freq.vht_enabled;
+ if (params.freq.ht_enabled && params.freq.sec_channel_offset)
+ ssid->ht40 = params.freq.sec_channel_offset;
+ if (wpa_s->mesh_vht_enabled) {
+ ssid->vht = 1;
+ switch (params.freq.bandwidth) {
+ case 80:
+ if (params.freq.center_freq2) {
+ ssid->max_oper_chwidth = VHT_CHANWIDTH_80P80MHZ;
+ ssid->vht_center_freq2 =
+ params.freq.center_freq2;
+ } else {
+ ssid->max_oper_chwidth = VHT_CHANWIDTH_80MHZ;
+ }
+ break;
+ case 160:
+ ssid->max_oper_chwidth = VHT_CHANWIDTH_160MHZ;
+ break;
+ default:
+ ssid->max_oper_chwidth = VHT_CHANWIDTH_USE_HT;
+ break;
+ }
+ }
if (ssid->beacon_int > 0)
params.beacon_int = ssid->beacon_int;
else if (wpa_s->conf->beacon_int > 0)