static void wpas_conf_ap_vht(struct wpa_supplicant *wpa_s, struct hostapd_config *conf, struct hostapd_hw_modes *mode) { #ifdef CONFIG_P2P u8 center_chan = 0; u8 channel = conf->channel; if (!conf->secondary_channel) goto no_vht; switch (conf->vht_oper_chwidth) { case VHT_CHANWIDTH_80MHZ: case VHT_CHANWIDTH_80P80MHZ: center_chan = wpas_p2p_get_vht80_center(wpa_s, mode, channel); break; case VHT_CHANWIDTH_160MHZ: center_chan = wpas_p2p_get_vht160_center(wpa_s, mode, channel); break; default: /* * conf->vht_oper_chwidth might not be set for non-P2P GO cases, * try oper_cwidth 160 MHz first then VHT 80 MHz, if 160 MHz is * not supported. */ conf->vht_oper_chwidth = VHT_CHANWIDTH_160MHZ; center_chan = wpas_p2p_get_vht160_center(wpa_s, mode, channel); if (!center_chan) { conf->vht_oper_chwidth = VHT_CHANWIDTH_80MHZ; center_chan = wpas_p2p_get_vht80_center(wpa_s, mode, channel); } break; } if (!center_chan) goto no_vht; conf->vht_oper_centr_freq_seg0_idx = center_chan; return; no_vht: conf->vht_oper_centr_freq_seg0_idx = channel + conf->secondary_channel * 2; #else /* CONFIG_P2P */ conf->vht_oper_centr_freq_seg0_idx = conf->channel + conf->secondary_channel * 2; #endif /* CONFIG_P2P */ conf->vht_oper_chwidth = VHT_CHANWIDTH_USE_HT; }
static void wpas_conf_ap_vht(struct wpa_supplicant *wpa_s, struct hostapd_config *conf, struct hostapd_hw_modes *mode) { #ifdef CONFIG_P2P u8 center_chan = 0; u8 channel = conf->channel; if (!conf->secondary_channel) goto no_vht; center_chan = wpas_p2p_get_vht80_center(wpa_s, mode, channel); if (!center_chan) goto no_vht; /* Use 80 MHz channel */ conf->vht_oper_chwidth = 1; conf->vht_oper_centr_freq_seg0_idx = center_chan; return; no_vht: conf->vht_oper_centr_freq_seg0_idx = channel + conf->secondary_channel * 2; #else /* CONFIG_P2P */ conf->vht_oper_centr_freq_seg0_idx = conf->channel + conf->secondary_channel * 2; #endif /* CONFIG_P2P */ }