The branch main has been updated by bz:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=75aadc902298005c47d2b931c483452027ceae69

commit 75aadc902298005c47d2b931c483452027ceae69
Author:     Bjoern A. Zeeb <[email protected]>
AuthorDate: 2026-06-22 01:16:45 +0000
Commit:     Bjoern A. Zeeb <[email protected]>
CommitDate: 2026-06-22 01:21:39 +0000

    LinuxKPI: 802.11: adjust timing of sync_from_ni in lkpi_sta_assoc_to_run()
    
    We used to call the (*sta_state) downcall into the driver to set the
    sta state to ASSOC.  After that we did a lot of sync operations incl.
    the lkpi_sta_sync_from_ni() which does a lot of rate and bandwith
    adjustments.   This sync call needs to happen before we set the sta
    to assoc as drivers rely on some of this information, e.g., ht_cap and
    vht_cap (and equivalents for later standards) at that point.  Moving
    this will make, e.g., mt7921 transmit at higher rates than just
    basic_rates.
    
    Sponsored by:   The FreeBSD Foundation
    MFC after:      3 days
---
 sys/compat/linuxkpi/common/src/linux_80211.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c 
b/sys/compat/linuxkpi/common/src/linux_80211.c
index 33587016fe8d..2e7ce4d4148f 100644
--- a/sys/compat/linuxkpi/common/src/linux_80211.c
+++ b/sys/compat/linuxkpi/common/src/linux_80211.c
@@ -3190,6 +3190,16 @@ lkpi_sta_assoc_to_run(struct ieee80211vap *vap, enum 
ieee80211_state nstate, int
        if (vap->iv_flags & IEEE80211_F_WME)
                sta->wme = true;
 #endif
+       bss_changed = 0;
+       /*
+        * This sync needs to happen before the sta_state change to ASSOC.
+        * At least mt7921 (likely all drivers) rely on, e.g., ht_cap, vht_cap,
+        * .. to be set at the point we go to assoc.
+        */
+       bss_changed |= lkpi_sta_sync_from_ni(hw, vif, sta, ni, true);
+       if (ieee80211_hw_check(hw, HAS_RATE_CONTROL))
+               lkpi_80211_mo_set_bitrate_mask(hw, vif, &lvif->br_mask);
+
        error = lkpi_80211_mo_sta_state(hw, vif, lsta, IEEE80211_STA_ASSOC);
        if (error != 0) {
                ic_printf(vap->iv_ic, "%s:%d: mo_sta_state(ASSOC) "
@@ -3200,7 +3210,6 @@ lkpi_sta_assoc_to_run(struct ieee80211vap *vap, enum 
ieee80211_state nstate, int
        IMPROVE("wme / conf_tx [all]");
 
        /* Update bss info (bss_info_changed) (assoc, aid, ..). */
-       bss_changed = 0;
 #ifdef LKPI_80211_WME
        bss_changed |= lkpi_wme_update(lhw, vap, true);
 #endif
@@ -3261,7 +3270,6 @@ lkpi_sta_assoc_to_run(struct ieee80211vap *vap, enum 
ieee80211_state nstate, int
 
        bss_changed = 0;
        IMPROVE("Is this the right spot, has net80211 done all updates 
already?");
-       bss_changed |= lkpi_sta_sync_from_ni(hw, vif, sta, ni, true);
 
        /* Update thresholds. */
        hw->wiphy->frag_threshold = vap->iv_fragthreshold;

Reply via email to