All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] band: return -ENOTSUP when RSSI is too low for rate estimation
@ 2024-04-15 15:11 James Prestwood
  2024-04-15 15:11 ` [PATCH 2/3] scan: replace -ENETUNREACH with -ENOTSUP for rate estimation return James Prestwood
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: James Prestwood @ 2024-04-15 15:11 UTC (permalink / raw)
  To: iwd; +Cc: James Prestwood

This was overlooked in a prior patch and causes the rate estimation
to return -ENETUNREACH if the RSSI is too low to support the
various capabilities. This return was unhandled and was treated as
if the IE was invalid which then printed a warning.

The low RSSI case should just be ignored, similar to if the IE was
not provided at all. In this case return -ENOTSUP so the caller
moves on to the next capability set.

Note: this does result in most of the estimation functions only
      returning 0 or -ENOTSUP as they do little to no validation
      on the frame, but rather just test bits. Additional
      validation could be added in the future which would be
      handled by this patch.
---
 src/band.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/band.c b/src/band.c
index 11cd965e..d71380ae 100644
--- a/src/band.c
+++ b/src/band.c
@@ -121,7 +121,7 @@ int band_estimate_nonht_rate(const struct band *band,
 	}
 
 	if (!max_rate)
-		return -ENETUNREACH;
+		return -ENOTSUP;
 
 	*out_data_rate = max_rate * 500000;
 	return 0;
@@ -319,7 +319,7 @@ int band_estimate_ht_rx_rate(const struct band *band,
 				rssi, sgi, out_data_rate))
 		return 0;
 
-	return -ENETUNREACH;
+	return -ENOTSUP;
 }
 
 static bool find_best_mcs_vht(uint8_t max_index, enum ofdm_channel_width width,
@@ -502,7 +502,7 @@ try_vht80:
 				rssi, nss, sgi, out_data_rate))
 		return 0;
 
-	return -ENETUNREACH;
+	return -ENOTSUP;
 }
 
 /*
@@ -678,7 +678,7 @@ int band_estimate_he_rx_rate(const struct band *band, const uint8_t *hec,
 	}
 
 	if (!rate)
-		return -EBADMSG;
+		return -ENOTSUP;
 
 	*out_data_rate = rate;
 
-- 
2.34.1


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

end of thread, other threads:[~2024-04-15 19:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-15 15:11 [PATCH 1/3] band: return -ENOTSUP when RSSI is too low for rate estimation James Prestwood
2024-04-15 15:11 ` [PATCH 2/3] scan: replace -ENETUNREACH with -ENOTSUP for rate estimation return James Prestwood
2024-04-15 15:11 ` [PATCH 3/3] wiphy: include MAC of BSS with invalid HE capabilities James Prestwood
2024-04-15 18:47 ` [PATCH 1/3] band: return -ENOTSUP when RSSI is too low for rate estimation Denis Kenzior
2024-04-15 19:01   ` James Prestwood
2024-04-15 19:07     ` Denis Kenzior

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.