Some drivers (ath10k) report MCS 9 @ 20MHz, which
technically isn't allowed. To get more meaningful value
than 0 out of this however, just cap the bitrate for 20MHz
to MCS 8.

Signed-off-by: Thomas Pedersen <t...@qca.qualcomm.com>
---
 net/wireless/util.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/net/wireless/util.c b/net/wireless/util.c
index 0675f51..5fb0249 100644
--- a/net/wireless/util.c
+++ b/net/wireless/util.c
@@ -1157,7 +1157,9 @@ static u32 cfg80211_calculate_bitrate_vht(struct 
rate_info *rate)
                   58500000,
                   65000000,
                   78000000,
-                  0,
+                  /* some drivers report MCS 9 for 20MHz anyway. Clip to MCS 8
+                   * bitrate as it's closer than 0 */
+                  78000000,
                },
                {  13500000,
                   27000000,
-- 
2.1.4

Reply via email to