diff mbox series

[v2,2/4] wiphy: handle -ENETUNREACH for rate estimation

Message ID 20240415192948.65857-2-prestwoj@gmail.com (mailing list archive)
State Accepted, archived
Headers show
Series [v2,1/4] wiphy: include MAC of BSS with invalid HE capabilities | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
prestwoj/iwd-ci-gitlint success GitLint

Commit Message

James Prestwood April 15, 2024, 7:29 p.m. UTC
If the RSSI is too low or the local capabilities were not
compatible to estimate the rate don't warn but instead treat
this the same as -ENOTSUP and drop down to the next capability
set.
---
 src/wiphy.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

v2:
 * Check for -ENETUNREACH
diff mbox series

Patch

diff --git a/src/wiphy.c b/src/wiphy.c
index 8f5e46bf..fb36ebb2 100644
--- a/src/wiphy.c
+++ b/src/wiphy.c
@@ -1056,7 +1056,7 @@  int wiphy_estimate_data_rate(struct wiphy *wiphy,
 					out_data_rate);
 	if (!ret)
 		return 0;
-	else if (ret != -ENOTSUP)
+	else if (ret != -ENOTSUP && ret != -ENETUNREACH)
 		l_warn("error parsing HE capabilities");
 
 	ret = band_estimate_vht_rx_rate(bandp, vht_capabilities, vht_operation,
@@ -1065,7 +1065,7 @@  int wiphy_estimate_data_rate(struct wiphy *wiphy,
 					out_data_rate);
 	if (!ret)
 		return 0;
-	else if (ret != -ENOTSUP)
+	else if (ret != -ENOTSUP && ret != -ENETUNREACH)
 		l_warn("error parsing VHT capabilities");
 
 	ret = band_estimate_ht_rx_rate(bandp, ht_capabilities, ht_operation,
@@ -1073,14 +1073,14 @@  int wiphy_estimate_data_rate(struct wiphy *wiphy,
 					out_data_rate);
 	if (!ret)
 		return 0;
-	else if (ret != -ENOTSUP)
+	else if (ret != -ENOTSUP && ret != -ENETUNREACH)
 		l_warn("error parsing HT capabilities");
 
 	ret = band_estimate_nonht_rate(bandp, supported_rates,
 						ext_supported_rates,
 						bss->signal_strength / 100,
 						out_data_rate);
-	if (ret != 0 && ret != -ENOTSUP)
+	if (ret != 0 && ret != -ENOTSUP && ret != -ENETUNREACH)
 		l_warn("error parsing non-HT rates");
 
 	return ret;