All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/7] wiphy: add offload out parameter to wiphy_can_connect_sae
@ 2021-03-30 18:48 James Prestwood
  2021-03-30 18:48 ` [PATCH v2 2/7] wiphy: fix wiphy_can_connect AKM checks James Prestwood
                   ` (5 more replies)
  0 siblings, 6 replies; 11+ messages in thread
From: James Prestwood @ 2021-03-30 18:48 UTC (permalink / raw)
  To: iwd

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

This will be set if the SAE connection requires offloading to
work.
---
 src/wiphy.c | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/src/wiphy.c b/src/wiphy.c
index 676f236c..35872577 100644
--- a/src/wiphy.c
+++ b/src/wiphy.c
@@ -126,7 +126,7 @@ enum ie_rsn_cipher_suite wiphy_select_cipher(struct wiphy *wiphy, uint16_t mask)
 	return 0;
 }
 
-static bool wiphy_can_connect_sae(struct wiphy *wiphy)
+static bool wiphy_can_connect_sae(struct wiphy *wiphy, bool *offload)
 {
 	/*
 	 * SAE support in the kernel is a complete mess in that there are 3
@@ -153,8 +153,11 @@ static bool wiphy_can_connect_sae(struct wiphy *wiphy)
 
 	if (wiphy_has_feature(wiphy, NL80211_FEATURE_SAE)) {
 		/* Case (1) */
-		if (wiphy->support_cmds_auth_assoc)
+		if (wiphy->support_cmds_auth_assoc) {
+			if (offload)
+				*offload = false;
 			return true;
+		}
 
 		/*
 		 * Case (3)
@@ -165,8 +168,12 @@ static bool wiphy_can_connect_sae(struct wiphy *wiphy)
 	} else {
 		/* Case (2) */
 		if (wiphy_has_ext_feature(wiphy,
-					NL80211_EXT_FEATURE_SAE_OFFLOAD))
+					NL80211_EXT_FEATURE_SAE_OFFLOAD)) {
+			if (offload)
+				*offload = true;
+
 			return true;
+		}
 
 		return false;
 	}
@@ -234,7 +241,7 @@ enum ie_rsn_akm_suite wiphy_select_akm(struct wiphy *wiphy,
 				goto wpa2_personal;
 			}
 
-			if (!wiphy_can_connect_sae(wiphy))
+			if (!wiphy_can_connect_sae(wiphy, NULL))
 				goto wpa2_personal;
 
 			if (info.akm_suites &
@@ -411,7 +418,7 @@ bool wiphy_can_connect(struct wiphy *wiphy, struct scan_bss *bss)
 		switch (rsn_info.akm_suites) {
 		case IE_RSN_AKM_SUITE_SAE_SHA256:
 		case IE_RSN_AKM_SUITE_FT_OVER_SAE_SHA256:
-			if (!wiphy_can_connect_sae(wiphy))
+			if (!wiphy_can_connect_sae(wiphy, NULL))
 				return false;
 
 			break;
-- 
2.26.2

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2021-03-30 20:49 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-30 18:48 [PATCH v2 1/7] wiphy: add offload out parameter to wiphy_can_connect_sae James Prestwood
2021-03-30 18:48 ` [PATCH v2 2/7] wiphy: fix wiphy_can_connect AKM checks James Prestwood
2021-03-30 19:58   ` Denis Kenzior
2021-03-30 18:48 ` [PATCH v2 3/7] wiphy: allow FT AKM to be used if Auth/Assoc is not supported James Prestwood
2021-03-30 18:48 ` [PATCH v2 4/7] netdev: allow PSK offload for FT AKMs James Prestwood
2021-03-30 20:25   ` Denis Kenzior
2021-03-30 20:40     ` James Prestwood
2021-03-30 18:48 ` [PATCH v2 5/7] station: set handshake->offload if required James Prestwood
2021-03-30 18:48 ` [PATCH v2 6/7] doc: document new [General].4WayOffload James Prestwood
2021-03-30 20:49   ` Denis Kenzior
2021-03-30 18:48 ` [PATCH v2 7/7] wiphy: remove wiphy_supports_cmds_auth_assoc 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.