git: f5a58c2da239 - main - linux80211: fix default deflink.rx_nss

From: Mikhail Pchelin <misha_at_FreeBSD.org>
Date: Fri, 06 Sep 2024 18:05:19 UTC
The branch main has been updated by misha:

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

commit f5a58c2da23930ee4870f2eb54788f4669b9aa33
Author:     Mikhail Pchelin <misha@FreeBSD.org>
AuthorDate: 2024-09-06 18:04:52 +0000
Commit:     Mikhail Pchelin <misha@FreeBSD.org>
CommitDate: 2024-09-06 18:04:52 +0000

    linux80211: fix default deflink.rx_nss
    
    Native Linux implementation sets this as a maximum between 1 and
    ht/vht/eht rx SS'es, FreeBSD does the same, but uses 0 as a minimum,
    which leads setting it to 0 if we're not in ht/vht case.
    
    This 0 was breaking rtw89 driver, when it was trying to determine
    SS number by subtracting 1 from rx_nss and passing the value to the
    hardware.
    
    After this patch rtw89 association and simple ping work reliably,
    but more work is needed to make the driver robust with heavy traffic
    (iperf3) and being long idle.
    
    Reviewed by:    bz
    Approved by:    bz
    Sponsored by:   Future Crew LLC
    Differential Revision:  https://reviews.freebsd.org/D46528
---
 sys/compat/linuxkpi/common/src/linux_80211.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c
index a2791d20a727..ae765cda5781 100644
--- a/sys/compat/linuxkpi/common/src/linux_80211.c
+++ b/sys/compat/linuxkpi/common/src/linux_80211.c
@@ -347,7 +347,7 @@ lkpi_lsta_alloc(struct ieee80211vap *vap, const uint8_t mac[IEEE80211_ADDR_LEN],
 
 	sta->deflink.smps_mode = IEEE80211_SMPS_OFF;
 	sta->deflink.bandwidth = IEEE80211_STA_RX_BW_20;
-	sta->deflink.rx_nss = 0;
+	sta->deflink.rx_nss = 1;
 
 	ht_rx_nss = 0;
 #if defined(LKPI_80211_HT)