The branch stable/14 has been updated by bz:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=88d897ec1a957bb8be41e52495f9c32c56b38e96

commit 88d897ec1a957bb8be41e52495f9c32c56b38e96
Author:     Bjoern A. Zeeb <b...@freebsd.org>
AuthorDate: 2025-06-05 21:53:35 +0000
Commit:     Bjoern A. Zeeb <b...@freebsd.org>
CommitDate: 2025-06-10 23:40:47 +0000

    LinuxKPI: 802.11: fix lkpi_scan_ies_add() channel lookup
    
    When looking up the channel we may not get a result if no flags are
    passed in as net80211 channel list setup and lookup coding requires a
    matching flag (band).  So pass in IEEE80211_CHAN_[AG] depending on band
    to increase the chances of finding a base channel and from that derive
    rates, etc.
    
    Sponsored by:   The FreeBSD Foundation
    
    (cherry picked from commit f1a110f1f0f2ef83758f7d0a984b14f512ea00fd)
---
 sys/compat/linuxkpi/common/src/linux_80211.c | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c 
b/sys/compat/linuxkpi/common/src/linux_80211.c
index 1b1e5721d7b2..1487e20bebc7 100644
--- a/sys/compat/linuxkpi/common/src/linux_80211.c
+++ b/sys/compat/linuxkpi/common/src/linux_80211.c
@@ -4118,12 +4118,26 @@ lkpi_scan_ies_add(uint8_t *p, struct ieee80211_scan_ies 
*scan_ies,
                channels = supband->channels;
                chan = NULL;
                for (i = 0; i < supband->n_channels; i++) {
+                       uint32_t flags;
 
                        if (channels[i].flags & IEEE80211_CHAN_DISABLED)
                                continue;
 
+                       flags = 0;
+                       switch (band) {
+                       case NL80211_BAND_2GHZ:
+                               flags |= IEEE80211_CHAN_G;
+                               break;
+                       case NL80211_BAND_5GHZ:
+                               flags |= IEEE80211_CHAN_A;
+                               break;
+                       default:
+                               panic("%s:%d: unupported band %d\n",
+                                   __func__, __LINE__, band);
+                       }
+
                        chan = ieee80211_find_channel(ic,
-                           channels[i].center_freq, 0);
+                           channels[i].center_freq, flags);
                        if (chan != NULL)
                                break;
                }

Reply via email to