The branch main has been updated by bz:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=73cd1c5d44ead3b84cebcc0c24278429afa9e6ec

commit 73cd1c5d44ead3b84cebcc0c24278429afa9e6ec
Author:     Bjoern A. Zeeb <b...@freebsd.org>
AuthorDate: 2024-12-30 06:35:03 +0000
Commit:     Bjoern A. Zeeb <b...@freebsd.org>
CommitDate: 2025-02-22 23:16:25 +0000

    LinuxKPI: 802.11: add further checks for deflink.supp_rates[]
    
    When setting the per-band supp_rates bitfield check for mandatory
    rates only.  We cannot easily say at that point for 2Ghz whether
    11g is supported so assume these days it is not pure-b.
    
    Sponsored by:   The FreeBSD Foundation
    MFC after:      3 days
---
 sys/compat/linuxkpi/common/src/linux_80211.c | 28 ++++++++++++++++++++++++----
 1 file changed, 24 insertions(+), 4 deletions(-)

diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c 
b/sys/compat/linuxkpi/common/src/linux_80211.c
index 041789857f0d..62d29feabb09 100644
--- a/sys/compat/linuxkpi/common/src/linux_80211.c
+++ b/sys/compat/linuxkpi/common/src/linux_80211.c
@@ -550,10 +550,30 @@ lkpi_lsta_alloc(struct ieee80211vap *vap, const uint8_t 
mac[IEEE80211_ADDR_LEN],
                        continue;
 
                for (i = 0; i < supband->n_bitrates; i++) {
-
-                       IMPROVE("Further supband->bitrates[i]* checks?");
-                       /* or should we get them from the ni? */
-                       sta->deflink.supp_rates[band] |= BIT(i);
+                       switch (band) {
+                       case NL80211_BAND_2GHZ:
+                               switch (supband->bitrates[i].bitrate) {
+                               case 240:       /* 11g only */
+                               case 120:       /* 11g only */
+                               case 110:
+                               case 60:        /* 11g only */
+                               case 55:
+                               case 20:
+                               case 10:
+                                       sta->deflink.supp_rates[band] |= BIT(i);
+                                       break;
+                               }
+                               break;
+                       case NL80211_BAND_5GHZ:
+                               switch (supband->bitrates[i].bitrate) {
+                               case 240:
+                               case 120:
+                               case 60:
+                                       sta->deflink.supp_rates[band] |= BIT(i);
+                                       break;
+                               }
+                               break;
+                       }
                }
        }
 

Reply via email to