All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/5] ie: parse DGAF Disable bit from HS20 indication element
@ 2021-11-04 17:57 James Prestwood
  0 siblings, 0 replies; only message in thread
From: James Prestwood @ 2021-11-04 17:57 UTC (permalink / raw)
  To: iwd

[-- Attachment #1: Type: text/plain, Size: 2954 bytes --]

---
 src/ie.c   | 11 ++++++++---
 src/ie.h   |  5 +++--
 src/scan.c |  3 ++-
 3 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/src/ie.c b/src/ie.c
index a5f3cbc2..8108c02a 100644
--- a/src/ie.c
+++ b/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);
 }
 
 /*
diff --git a/src/ie.h b/src/ie.h
index b122524b..685350d6 100644
--- a/src/ie.h
+++ b/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 {
diff --git a/src/scan.c b/src/scan.c
index 2a96943b..815cb3f2 100644
--- a/src/scan.c
+++ b/src/scan.c
@@ -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;
-- 
2.31.1

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-11-04 17:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-04 17:57 [PATCH 2/5] ie: parse DGAF Disable bit from HS20 indication element James Prestwood

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.