mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-11-29 05:39:24 +01:00
ie: parse DGAF Disable bit from HS20 indication element
This commit is contained in:
parent
fd85192a54
commit
6852cf0a3e
11
src/ie.c
11
src/ie.c
@ -2035,7 +2035,8 @@ int ie_build_roaming_consortium(const uint8_t *rc, size_t rc_len, uint8_t *to)
|
||||
}
|
||||
|
||||
int ie_parse_hs20_indication(struct ie_tlv_iter *iter, uint8_t *version_out,
|
||||
uint16_t *pps_mo_id_out, uint8_t *domain_id_out)
|
||||
uint16_t *pps_mo_id_out, uint8_t *domain_id_out,
|
||||
bool *dgaf_disable_out)
|
||||
{
|
||||
unsigned int len = ie_tlv_iter_get_length(iter);
|
||||
const uint8_t *data = ie_tlv_iter_get_data(iter);
|
||||
@ -2060,6 +2061,9 @@ int ie_parse_hs20_indication(struct ie_tlv_iter *iter, uint8_t *version_out,
|
||||
if (pps_mo_present && domain_id_present)
|
||||
return -EPROTOTYPE;
|
||||
|
||||
if (dgaf_disable_out)
|
||||
*dgaf_disable_out = test_bit(&hs20_config, 0);
|
||||
|
||||
if (version_out)
|
||||
*version_out = bit_field(hs20_config, 4, 4);
|
||||
|
||||
@ -2087,7 +2091,7 @@ int ie_parse_hs20_indication(struct ie_tlv_iter *iter, uint8_t *version_out,
|
||||
|
||||
int ie_parse_hs20_indication_from_data(const uint8_t *data, size_t len,
|
||||
uint8_t *version, uint16_t *pps_mo_id,
|
||||
uint8_t *domain_id)
|
||||
uint8_t *domain_id, bool *dgaf_disable)
|
||||
{
|
||||
struct ie_tlv_iter iter;
|
||||
|
||||
@ -2099,7 +2103,8 @@ int ie_parse_hs20_indication_from_data(const uint8_t *data, size_t len,
|
||||
if (ie_tlv_iter_get_tag(&iter) != IE_TYPE_VENDOR_SPECIFIC)
|
||||
return -EPROTOTYPE;
|
||||
|
||||
return ie_parse_hs20_indication(&iter, version, pps_mo_id, domain_id);
|
||||
return ie_parse_hs20_indication(&iter, version, pps_mo_id, domain_id,
|
||||
dgaf_disable);
|
||||
}
|
||||
|
||||
/*
|
||||
|
5
src/ie.h
5
src/ie.h
@ -616,10 +616,11 @@ int ie_parse_roaming_consortium_from_data(const uint8_t *data, size_t len,
|
||||
int ie_build_roaming_consortium(const uint8_t *rc, size_t rc_len, uint8_t *to);
|
||||
|
||||
int ie_parse_hs20_indication(struct ie_tlv_iter *iter, uint8_t *version,
|
||||
uint16_t *pps_mo_id, uint8_t *domain_id);
|
||||
uint16_t *pps_mo_id, uint8_t *domain_id,
|
||||
bool *dgaf_disable);
|
||||
int ie_parse_hs20_indication_from_data(const uint8_t *data, size_t len,
|
||||
uint8_t *version, uint16_t *pps_mo_id,
|
||||
uint8_t *domain_id);
|
||||
uint8_t *domain_id, bool *dgaf_disable);
|
||||
int ie_build_hs20_indication(uint8_t version, uint8_t *to);
|
||||
|
||||
enum ie_rsnx_capability {
|
||||
|
@ -1071,7 +1071,8 @@ static void scan_parse_vendor_specific(struct scan_bss *bss, const void *data,
|
||||
|
||||
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)
|
||||
&bss->hs20_version, NULL, NULL,
|
||||
NULL) < 0)
|
||||
return;
|
||||
|
||||
bss->hs20_capable = true;
|
||||
|
Loading…
Reference in New Issue
Block a user