Skip to content

Commit dff11c4

Browse files
Adrian ChaddAdrian Chadd
authored andcommitted
rtwn: enable seqno offload; migrate to use ieee80211_output_seqno_assign()
This should both enable the sequence number offloading and disable the net80211 TX lock from being acquired/released/checked. Locally tested: * RTL8812AU, STA mode Reviewed by: bz Differential Revision: https://reviews.freebsd.org/D52301 Differential Revision: https://reviews.freebsd.org/D50693
1 parent 5e82eec commit dff11c4

File tree

4 files changed

+20
-14
lines changed

4 files changed

+20
-14
lines changed

sys/dev/rtwn/if_rtwn.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,9 @@ rtwn_attach(struct rtwn_softc *sc)
268268
ic->ic_flags_ext |= IEEE80211_FEXT_WATCHDOG;
269269
#endif
270270

271+
/* Enable seqno offload */
272+
ic->ic_flags_ext |= IEEE80211_FEXT_SEQNO_OFFLOAD;
273+
271274
/* Adjust capabilities. */
272275
rtwn_adj_devcaps(sc);
273276

sys/dev/rtwn/if_rtwn_tx.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,10 @@ rtwn_tx_data(struct rtwn_softc *sc, struct ieee80211_node *ni,
183183
}
184184
}
185185

186+
/* seqno allocate, only if AMPDU isn't running */
187+
if ((m->m_flags & M_AMPDU_MPDU) == 0)
188+
ieee80211_output_seqno_assign(ni, -1, m);
189+
186190
cipher = IEEE80211_CIPHER_NONE;
187191
if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) {
188192
k = ieee80211_crypto_encap(ni, m);
@@ -229,6 +233,10 @@ rtwn_tx_raw(struct rtwn_softc *sc, struct ieee80211_node *ni,
229233
uint8_t type;
230234
u_int cipher;
231235

236+
/* seqno allocate, only if AMPDU isn't running */
237+
if ((m->m_flags & M_AMPDU_MPDU) == 0)
238+
ieee80211_output_seqno_assign(ni, -1, m);
239+
232240
/* Encrypt the frame if need be. */
233241
cipher = IEEE80211_CIPHER_NONE;
234242
if (params->ibp_flags & IEEE80211_BPF_CRYPTO) {

sys/dev/rtwn/rtl8192c/r92c_tx.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -452,11 +452,10 @@ r92c_fill_tx_desc(struct rtwn_softc *sc, struct ieee80211_node *ni,
452452
} else {
453453
uint16_t seqno;
454454

455-
if (m->m_flags & M_AMPDU_MPDU) {
456-
seqno = ni->ni_txseqs[tid] % IEEE80211_SEQ_RANGE;
457-
ni->ni_txseqs[tid]++;
458-
} else
459-
seqno = M_SEQNO_GET(m) % IEEE80211_SEQ_RANGE;
455+
if (m->m_flags & M_AMPDU_MPDU)
456+
ieee80211_output_seqno_assign(ni, -1, m);
457+
458+
seqno = M_SEQNO_GET(m);
460459

461460
/* Set sequence number. */
462461
txd->txdseq = htole16(seqno);
@@ -511,7 +510,7 @@ r92c_fill_tx_desc_raw(struct rtwn_softc *sc, struct ieee80211_node *ni,
511510
rtwn_r92c_tx_setup_hwseq(sc, txd);
512511
} else {
513512
/* Set sequence number. */
514-
txd->txdseq |= htole16(M_SEQNO_GET(m) % IEEE80211_SEQ_RANGE);
513+
txd->txdseq |= htole16(M_SEQNO_GET(m));
515514
}
516515
}
517516

sys/dev/rtwn/rtl8812a/r12a_tx.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -433,12 +433,9 @@ r12a_fill_tx_desc(struct rtwn_softc *sc, struct ieee80211_node *ni,
433433
} else {
434434
uint16_t seqno;
435435

436-
if (m->m_flags & M_AMPDU_MPDU) {
437-
seqno = ni->ni_txseqs[tid];
438-
ni->ni_txseqs[tid]++;
439-
} else
440-
seqno = M_SEQNO_GET(m) % IEEE80211_SEQ_RANGE;
441-
436+
if (m->m_flags & M_AMPDU_MPDU)
437+
ieee80211_output_seqno_assign(ni, -1, m);
438+
seqno = M_SEQNO_GET(m);
442439
/* Set sequence number. */
443440
txd->txdw9 |= htole32(SM(R12A_TXDW9_SEQ, seqno));
444441
}
@@ -493,8 +490,7 @@ r12a_fill_tx_desc_raw(struct rtwn_softc *sc, struct ieee80211_node *ni,
493490
txd->txdw3 |= htole32(SM(R12A_TXDW3_SEQ_SEL, uvp->id));
494491
} else {
495492
/* Set sequence number. */
496-
txd->txdw9 |= htole32(SM(R12A_TXDW9_SEQ,
497-
M_SEQNO_GET(m) % IEEE80211_SEQ_RANGE));
493+
txd->txdw9 |= htole32(SM(R12A_TXDW9_SEQ, M_SEQNO_GET(m)));
498494
}
499495
}
500496

0 commit comments

Comments
 (0)