3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-22 14:49:24 +01:00

scan: Parse network cost IE info into scan_bss

This commit is contained in:
Denis Kenzior 2021-09-03 16:32:51 -05:00
parent c93966d5a1
commit 9d045fae0e
2 changed files with 26 additions and 11 deletions

View File

@ -911,25 +911,39 @@ static bool start_next_scan_request(struct wiphy_radio_work_item *item)
return true;
}
static bool scan_parse_vendor_specific(struct scan_bss *bss, const void *data,
static void scan_parse_vendor_specific(struct scan_bss *bss, const void *data,
uint16_t len)
{
if (!bss->wpa && is_ie_wpa_ie(data, len))
uint16_t cost_level;
uint16_t cost_flags;
if (!bss->wpa && is_ie_wpa_ie(data, len)) {
bss->wpa = l_memdup(data - 2, len + 2);
else if (!bss->osen && is_ie_wfa_ie(data, len, IE_WFA_OI_OSEN))
return;
}
if (!bss->osen && is_ie_wfa_ie(data, len, IE_WFA_OI_OSEN)) {
bss->osen = l_memdup(data - 2, len + 2);
else if (is_ie_wfa_ie(data, len, IE_WFA_OI_HS20_INDICATION)) {
return;
}
if (is_ie_wfa_ie(data, len, IE_WFA_OI_HS20_INDICATION)) {
if (ie_parse_hs20_indication_from_data(data - 2, len + 2,
&bss->hs20_version, NULL, NULL) < 0)
return false;
return;
bss->hs20_capable = true;
} else if (is_ie_default_sae_group_oui(data, len))
bss->force_default_sae_group = true;
else
return false;
return;
}
return true;
if (!ie_parse_network_cost(data, len, &cost_level, &cost_flags)) {
bss->cost_level = cost_level;
bss->cost_flags = cost_flags;
return;
}
if (is_ie_default_sae_group_oui(data, len))
bss->force_default_sae_group = true;
}
/*
@ -1021,7 +1035,6 @@ static bool scan_parse_bss_information_elements(struct scan_bss *bss,
break;
case IE_TYPE_VENDOR_SPECIFIC:
/* Interested only in WPA/WFA IE from Vendor data */
scan_parse_vendor_specific(bss, iter.data, iter.len);
break;
case IE_TYPE_MOBILITY_DOMAIN:

View File

@ -84,6 +84,8 @@ struct scan_bss {
bool anqp_capable : 1;
bool hs20_capable : 1;
bool force_default_sae_group : 1;
uint8_t cost_level : 3;
uint8_t cost_flags : 4;
};
struct scan_parameters {