IBSS: Add support for VHT80 configuration

Configure VHT80 based on driver capabilities.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
This commit is contained in:
Janusz Dziedzic 2015-02-19 07:15:48 +01:00 committed by Jouni Malinen
parent ada157f3b0
commit 563ee1832b
2 changed files with 53 additions and 0 deletions

View file

@ -1199,6 +1199,8 @@ struct wpa_driver_capa {
#define WPA_DRIVER_FLAGS_TDLS_CHANNEL_SWITCH 0x0000000800000000ULL
/** Driver supports IBSS with HT datarates */
#define WPA_DRIVER_FLAGS_HT_IBSS 0x0000001000000000ULL
/** Driver supports IBSS with VHT datarates */
#define WPA_DRIVER_FLAGS_VHT_IBSS 0x0000002000000000ULL
u64 flags;
#define WPA_DRIVER_SMPS_MODE_STATIC 0x00000001

View file

@ -1669,10 +1669,12 @@ void ibss_mesh_setup_freq(struct wpa_supplicant *wpa_s,
struct hostapd_hw_modes *mode = NULL;
int ht40plus[] = { 36, 44, 52, 60, 100, 108, 116, 124, 132, 149, 157,
184, 192 };
int vht80[] = { 36, 52, 100, 116, 132, 149 };
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;
struct hostapd_freq_params vht_freq;
freq->freq = ssid->frequency;
@ -1821,6 +1823,55 @@ void ibss_mesh_setup_freq(struct wpa_supplicant *wpa_s,
wpa_printf(MSG_DEBUG,
"IBSS/mesh: setup freq channel %d, sec_channel_offset %d",
freq->channel, freq->sec_channel_offset);
/* Not sure if mesh is ready for VHT */
if (ssid->mode != WPAS_MODE_IBSS)
return;
/* For IBSS check VHT_IBSS flag */
if (!(wpa_s->drv_flags & WPA_DRIVER_FLAGS_VHT_IBSS))
return;
vht_freq = *freq;
vht_freq.vht_enabled = vht_supported(mode);
if (!vht_freq.vht_enabled)
return;
/* setup center_freq1, bandwidth */
for (j = 0; j < ARRAY_SIZE(vht80); j++) {
if (freq->channel >= vht80[j] &&
freq->channel < vht80[j] + 16)
break;
}
if (j == ARRAY_SIZE(vht80))
return;
for (i = vht80[j]; i < vht80[j] + 16; i += 4) {
struct hostapd_channel_data *chan;
chan = hw_get_channel_chan(mode, i, NULL);
if (!chan)
return;
/* Back to HT configuration if channel not usable */
if (chan->flag & (HOSTAPD_CHAN_DISABLED | HOSTAPD_CHAN_NO_IR))
return;
}
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[i] + 6, 0, 0) != 0)
return;
*freq = vht_freq;
wpa_printf(MSG_DEBUG, "IBSS: VHT setup freq cf1 %d, cf2 %d, bw %d",
freq->center_freq1, freq->center_freq2, freq->bandwidth);
}