git: 038279d2a86f - stable/12 - rtwn: make sure to not write in upper bits of txdseq

Andriy Gapon avg at FreeBSD.org
Mon Jul 19 06:50:12 UTC 2021


The branch stable/12 has been updated by avg:

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

commit 038279d2a86f904b51f1b65d1ef283c09884b04f
Author:     Andriy Gapon <avg at FreeBSD.org>
AuthorDate: 2021-06-21 08:05:04 +0000
Commit:     Andriy Gapon <avg at FreeBSD.org>
CommitDate: 2021-07-19 06:49:53 +0000

    rtwn: make sure to not write in upper bits of txdseq
    
    ni_txseqs is kept as 16-bit counter, but we need to trim the upper four
    bits as they may have special meanings for the firmware / hardware.
    For instance, bit 15 enables hardware / firmware generation of sequence
    numbers that overrides sequence numbers programmed by the driver.
    
    Reviewed by:    adrian
    
    (cherry picked from commit 7544c1d20d8b7127ed3511edeb94e01d328daebb)
---
 sys/dev/rtwn/rtl8192c/r92c_tx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/dev/rtwn/rtl8192c/r92c_tx.c b/sys/dev/rtwn/rtl8192c/r92c_tx.c
index ab2d05635358..b01731ba29ed 100644
--- a/sys/dev/rtwn/rtl8192c/r92c_tx.c
+++ b/sys/dev/rtwn/rtl8192c/r92c_tx.c
@@ -335,7 +335,7 @@ r92c_fill_tx_desc(struct rtwn_softc *sc, struct ieee80211_node *ni,
 		uint16_t seqno;
 
 		if (m->m_flags & M_AMPDU_MPDU) {
-			seqno = ni->ni_txseqs[tid];
+			seqno = ni->ni_txseqs[tid] % IEEE80211_SEQ_RANGE;
 			ni->ni_txseqs[tid]++;
 		} else
 			seqno = M_SEQNO_GET(m) % IEEE80211_SEQ_RANGE;


More information about the dev-commits-src-all mailing list