diff options
| author | Ahmad Kholaif <akholaif@qca.qualcomm.com> | 2015-11-25 03:51:43 +0000 |
|---|---|---|
| committer | Anjaneedevi Kapparapu <akappa@codeaurora.org> | 2016-04-01 16:54:31 +0530 |
| commit | 4da65ec36d864b1dcc6d204e810f8b34a5e5e40c (patch) | |
| tree | 2224fb2814e30d1ad0d0e3a5dd16bed765fb005b | |
| parent | f337d73c6856741471cbd7d53741280711a46a1c (diff) | |
| download | android_external_wpa_supplicant_8-4da65ec36d864b1dcc6d204e810f8b34a5e5e40c.tar.gz android_external_wpa_supplicant_8-4da65ec36d864b1dcc6d204e810f8b34a5e5e40c.tar.bz2 android_external_wpa_supplicant_8-4da65ec36d864b1dcc6d204e810f8b34a5e5e40c.zip | |
IBSS/mesh: Add support for VHT80P80 configuration
A new network profile configuration parameter max_oper_chwidth=3 can be
used to specify preference to enable 80+80 MHz VHT channel for IBSS. If
that is set, the first 80 MHz segment is specified based on the
frequency parameter in the network profile and the second segment is
selected automatically (which will practically be limited to a single
possibility due to DFS requirements in most countries).
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Git-commit: 0f29bc68d18e489e9294bb0ef7a86a9a5235f8d1
Git-repo : git://w1.fi/srv/git/hostap.git
Change-Id: Idbdf5b9a17f338cb19ea9e047cd3473be536732f
CRs-Fixed: 944221
| -rw-r--r-- | wpa_supplicant/config.c | 2 | ||||
| -rw-r--r-- | wpa_supplicant/config_file.c | 1 | ||||
| -rw-r--r-- | wpa_supplicant/wpa_cli.c | 2 | ||||
| -rw-r--r-- | wpa_supplicant/wpa_supplicant.c | 41 |
4 files changed, 42 insertions, 4 deletions
diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c index 44f6946d..7f13aab5 100644 --- a/wpa_supplicant/config.c +++ b/wpa_supplicant/config.c @@ -1837,6 +1837,8 @@ static const struct parse_data ssid_fields[] = { { FUNC(auth_alg) }, { FUNC(scan_freq) }, { FUNC(freq_list) }, + { INT_RANGE(max_oper_chwidth, VHT_CHANWIDTH_USE_HT, + VHT_CHANWIDTH_80P80MHZ) }, #ifdef IEEE8021X_EAPOL { FUNC(eap) }, { STR_LENe(identity) }, diff --git a/wpa_supplicant/config_file.c b/wpa_supplicant/config_file.c index aeea70c1..80831647 100644 --- a/wpa_supplicant/config_file.c +++ b/wpa_supplicant/config_file.c @@ -751,6 +751,7 @@ static void wpa_config_write_network(FILE *f, struct wpa_ssid *ssid) INT(disabled); INT(peerkey); INT(mixed_cell); + INT(max_oper_chwidth); #ifdef CONFIG_IEEE80211W write_int(f, "ieee80211w", ssid->ieee80211w, MGMT_FRAME_PROTECTION_DEFAULT); diff --git a/wpa_supplicant/wpa_cli.c b/wpa_supplicant/wpa_cli.c index db58d112..c507ddc8 100644 --- a/wpa_supplicant/wpa_cli.c +++ b/wpa_supplicant/wpa_cli.c @@ -1543,7 +1543,7 @@ static const char *network_fields[] = { "ssid", "scan_ssid", "bssid", "bssid_blacklist", "bssid_whitelist", "psk", "proto", "key_mgmt", "bg_scan_period", "pairwise", "group", "auth_alg", "scan_freq", - "freq_list", + "freq_list", "max_oper_chwidth", #ifdef IEEE8021X_EAPOL "eap", "identity", "anonymous_identity", "password", "ca_cert", "ca_path", "client_cert", "private_key", "private_key_passwd", diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c index 63c359f5..452f8dda 100644 --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c @@ -1729,8 +1729,10 @@ void ibss_mesh_setup_freq(struct wpa_supplicant *wpa_s, struct hostapd_channel_data *pri_chan = NULL, *sec_chan = NULL; u8 channel; int i, chan_idx, ht40 = -1, res, obss_scan = 1; - unsigned int j; + unsigned int j, k; struct hostapd_freq_params vht_freq; + int chwidth, seg0, seg1; + u32 vht_caps = 0; freq->freq = ssid->frequency; @@ -1916,12 +1918,45 @@ void ibss_mesh_setup_freq(struct wpa_supplicant *wpa_s, return; } + chwidth = VHT_CHANWIDTH_80MHZ; + seg0 = vht80[j] + 6; + seg1 = 0; + + if (ssid->max_oper_chwidth == VHT_CHANWIDTH_80P80MHZ) { + /* setup center_freq2, bandwidth */ + for (k = 0; k < ARRAY_SIZE(vht80); k++) { + /* Only accept 80 MHz segments separated by a gap */ + if (j == k || abs(vht80[j] - vht80[k]) == 16) + continue; + for (i = vht80[k]; i < vht80[k] + 16; i += 4) { + struct hostapd_channel_data *chan; + + chan = hw_get_channel_chan(mode, i, NULL); + if (!chan) + continue; + + if (chan->flag & (HOSTAPD_CHAN_DISABLED | + HOSTAPD_CHAN_NO_IR | + HOSTAPD_CHAN_RADAR)) + continue; + + /* Found a suitable second segment for 80+80 */ + chwidth = VHT_CHANWIDTH_80P80MHZ; + vht_caps |= + VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ; + seg1 = vht80[k] + 6; + } + + if (chwidth == VHT_CHANWIDTH_80P80MHZ) + break; + } + } + if (hostapd_set_freq_params(&vht_freq, mode->mode, freq->freq, freq->channel, freq->ht_enabled, vht_freq.vht_enabled, freq->sec_channel_offset, - VHT_CHANWIDTH_80MHZ, - vht80[j] + 6, 0, 0) != 0) + chwidth, seg0, seg1, vht_caps) != 0) return; *freq = vht_freq; |
