Parse 6 GHz capability from driver capabilities

Store 6 GHz capability on channel list update for wpa_supplicant use.
This will be used in the next commit to extend scanning behavior based
on changes to 6 GHz channel availability.

Signed-off-by: Matthew Wang <matthewmwang@chromium.org>
This commit is contained in:
Matthew Wang 2023-06-02 15:15:10 -07:00 committed by Jouni Malinen
parent 41baf0159a
commit 0b8a672253
3 changed files with 26 additions and 24 deletions

View file

@ -420,29 +420,6 @@ wpa_supplicant_build_filter_ssids(struct wpa_config *conf, size_t *num_ssids)
}
#ifdef CONFIG_P2P
static bool is_6ghz_supported(struct wpa_supplicant *wpa_s)
{
struct hostapd_channel_data *chnl;
int i, j;
for (i = 0; i < wpa_s->hw.num_modes; i++) {
if (wpa_s->hw.modes[i].mode == HOSTAPD_MODE_IEEE80211A) {
chnl = wpa_s->hw.modes[i].channels;
for (j = 0; j < wpa_s->hw.modes[i].num_channels; j++) {
if (chnl[j].flag & HOSTAPD_CHAN_DISABLED)
continue;
if (is_6ghz_freq(chnl[j].freq))
return true;
}
}
}
return false;
}
#endif /* CONFIG_P2P */
static void wpa_supplicant_optimize_freqs(
struct wpa_supplicant *wpa_s, struct wpa_driver_scan_params *params)
{
@ -1555,7 +1532,7 @@ scan:
}
}
if (!params.freqs && is_6ghz_supported(wpa_s) &&
if (!params.freqs && wpas_is_6ghz_supported(wpa_s, true) &&
(wpa_s->p2p_in_invitation || wpa_s->p2p_in_provisioning))
wpas_p2p_scan_freqs(wpa_s, &params, true);
#endif /* CONFIG_P2P */

View file

@ -7118,6 +7118,7 @@ static int wpa_supplicant_init_iface(struct wpa_supplicant *wpa_s,
wpa_s->hw_capab == CAPAB_NO_HT_VHT)
wpa_s->hw_capab = CAPAB_HT;
}
wpa_s->support_6ghz = wpas_is_6ghz_supported(wpa_s, false);
}
capa_res = wpa_drv_get_capa(wpa_s, &capa);
@ -9245,3 +9246,25 @@ int wpa_drv_send_action(struct wpa_supplicant *wpa_s, unsigned int freq,
return wpa_s->driver->send_action(wpa_s->drv_priv, freq, wait, dst, src,
bssid, data, data_len, no_cck);
}
bool wpas_is_6ghz_supported(struct wpa_supplicant *wpa_s, bool only_enabled)
{
struct hostapd_channel_data *chnl;
int i, j;
for (i = 0; i < wpa_s->hw.num_modes; i++) {
if (wpa_s->hw.modes[i].mode == HOSTAPD_MODE_IEEE80211A) {
chnl = wpa_s->hw.modes[i].channels;
for (j = 0; j < wpa_s->hw.modes[i].num_channels; j++) {
if (only_enabled &&
(chnl[j].flag & HOSTAPD_CHAN_DISABLED))
continue;
if (is_6ghz_freq(chnl[j].freq))
return true;
}
}
}
return false;
}

View file

@ -1566,6 +1566,7 @@ struct wpa_supplicant {
unsigned int enable_dscp_policy_capa:1;
unsigned int connection_dscp:1;
unsigned int wait_for_dscp_req:1;
bool support_6ghz;
struct wpa_signal_info last_signal_info;
@ -1959,6 +1960,7 @@ int wpas_pasn_deauthenticate(struct wpa_supplicant *wpa_s, const u8 *own_addr,
void wpas_pasn_auth_trigger(struct wpa_supplicant *wpa_s,
struct pasn_auth *pasn_auth);
void wpas_pasn_auth_work_done(struct wpa_supplicant *wpa_s, int status);
bool wpas_is_6ghz_supported(struct wpa_supplicant *wpa_s, bool only_enabled);
bool wpa_is_non_eht_scs_traffic_desc_supported(struct wpa_bss *bss);