Skip to contentSkip to conversation

manager: move debug print in dump callback

PATCH In review James Prestwood 2 participants 5 messages May 4, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/4 manager: move debug print in dump callback

This callback gets called way to many times to have a debug print in the location that it was. Instead only print if a NEW wiphy is found, and also print the name/id.

---
 src/manager.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
src/manager.c +2 -2
index f351c780..5462418b 100644
@@ -519,8 +519,6 @@ static void manager_wiphy_dump_callback(struct l_genl_msg *msg, void *user_data)
 	struct wiphy *wiphy;
 	struct wiphy_setup_state *state;
 
-	l_debug("");
-
 	if (nl80211_parse_attrs(msg, NL80211_ATTR_WIPHY, &id,
 					NL80211_ATTR_WIPHY_NAME, &name,
 					NL80211_ATTR_UNSPEC) < 0)
@@ -543,6 +541,8 @@ static void manager_wiphy_dump_callback(struct l_genl_msg *msg, void *user_data)
 	state->id = id;
 	state->wiphy = wiphy;
 
+	l_debug("New wiphy %s added (%d)", name, id);
+
 	l_queue_push_tail(pending_wiphys, state);
 
 done:
Signature · 1 line
2.21.1
#1 lore raw

PATCH 2/4 scan: remove useless debug print

Further on in the function we still print that the scan was triggered.

---
 src/scan.c | 2 --
 1 file changed, 2 deletions(-)
src/scan.c +0 -2
index c3ae3f8b..718f7497 100644
@@ -204,8 +204,6 @@ static void scan_request_triggered(struct l_genl_msg *msg, void *userdata)
 	struct scan_request *sr = l_queue_peek_head(sc->requests);
 	int err;
 
-	l_debug("");
-
 	sc->start_cmd_id = 0;
 
 	err = l_genl_msg_get_error(msg);
Signature · 1 line
2.21.1
#2 lore raw

PATCH 3/4 wiphy: remove useless debug prints

In reply to James Prestwood

Several parsing functions printed the function name, which isn't very useful to anyone.

---
 src/wiphy.c | 6 ------
 1 file changed, 6 deletions(-)
src/wiphy.c +0 -6
index 139474d2..9821da0e 100644
@@ -715,8 +715,6 @@ static void parse_supported_frequencies(struct wiphy *wiphy,
 	const void *data;
 	struct l_genl_attr attr;
 
-	l_debug("");
-
 	while (l_genl_attr_next(freqs, NULL, NULL, NULL)) {
 		if (!l_genl_attr_recurse(freqs, &attr))
 			continue;
@@ -786,8 +784,6 @@ static void parse_supported_bands(struct wiphy *wiphy,
 	uint16_t type;
 	struct l_genl_attr attr;
 
-	l_debug("");
-
 	while (l_genl_attr_next(bands, &type, NULL, NULL)) {
 		enum nl80211_band band = type;
 
@@ -1081,8 +1077,6 @@ void wiphy_update_from_genl(struct wiphy *wiphy, struct l_genl_msg *msg)
 	if (wiphy->blacklisted)
 		return;
 
-	l_debug("");
-
 	wiphy_parse_attributes(wiphy, msg);
 }
 
Signature · 1 line
2.21.1
#3 lore raw

PATCH 4/4 wiphy: restrict FT AKMs when not supported

In reply to James Prestwood

Some full mac cards don't like being given a FT AKM when connecting. From an API perspective this should be supported, but in practice these cards behave differently and some do no accept FT AKMs. Until this becomes more stable any cards not supporting Auth/Assoc commands (full mac) will not connect using FT AKMs.

---
 src/wiphy.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
src/wiphy.c +7 -4
index 9821da0e..aef39549 100644
@@ -157,7 +157,8 @@ enum ie_rsn_akm_suite wiphy_select_akm(struct wiphy *wiphy,
 		}
 
 		if ((info.akm_suites & IE_RSN_AKM_SUITE_FT_OVER_8021X) &&
-				bss->rsne && bss->mde_present)
+				bss->rsne && bss->mde_present &&
+				wiphy->support_cmds_auth_assoc)
 			return IE_RSN_AKM_SUITE_FT_OVER_8021X;
 
 		if (info.akm_suites & IE_RSN_AKM_SUITE_8021X_SHA256)
@@ -175,8 +176,9 @@ enum ie_rsn_akm_suite wiphy_select_akm(struct wiphy *wiphy,
 		if (wiphy->supported_ciphers & IE_RSN_CIPHER_SUITE_BIP &&
 				wiphy_has_feature(wiphy, NL80211_FEATURE_SAE) &&
 				info.mfpr) {
-			if (info.akm_suites &
-					IE_RSN_AKM_SUITE_FT_OVER_SAE_SHA256)
+			if ((info.akm_suites &
+					IE_RSN_AKM_SUITE_FT_OVER_SAE_SHA256) &&
+					wiphy->support_cmds_auth_assoc)
 				return IE_RSN_AKM_SUITE_FT_OVER_SAE_SHA256;
 
 			if (info.akm_suites & IE_RSN_AKM_SUITE_SAE_SHA256)
@@ -184,7 +186,8 @@ enum ie_rsn_akm_suite wiphy_select_akm(struct wiphy *wiphy,
 		}
 
 		if ((info.akm_suites & IE_RSN_AKM_SUITE_FT_USING_PSK) &&
-				bss->rsne && bss->mde_present)
+				bss->rsne && bss->mde_present &&
+				wiphy->support_cmds_auth_assoc)
 			return IE_RSN_AKM_SUITE_FT_USING_PSK;
 
 		if (info.akm_suites & IE_RSN_AKM_SUITE_PSK_SHA256)
Signature · 1 line
2.21.1
#4 lore raw
In reply to James Prestwood

Hi James,

Quoted 6 lines · James Prestwood

This callback gets called way to many times to have a debug print in the location that it was. Instead only print if a NEW wiphy is found, and also print the name/id.

---
  src/manager.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

All applied, thanks.

Regards,
-Denis