[net80211] implement "first RX defines the BAW" hack.

Unfortunately (sigh) some firmware doesn't provide the RX BA starting point,
so we need to cope and set a "close enough" sequence number so we (hopefully!)
don't discard frames as duplicates.

Tested:

* QCA9880v2, athp driver (under development), STA mode
This commit is contained in:
Adrian Chadd 2016-11-10 18:36:40 +00:00
parent 111bf579e3
commit 339be86fdb
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=308485
2 changed files with 21 additions and 2 deletions

View File

@ -582,7 +582,13 @@ ieee80211_ampdu_rx_start_ext(struct ieee80211_node *ni, int tid, int seq, int ba
memset(rap, 0, sizeof(*rap));
rap->rxa_wnd = (baw== 0) ?
IEEE80211_AGGR_BAWMAX : min(baw, IEEE80211_AGGR_BAWMAX);
rap->rxa_start = seq;
if (seq == -1) {
/* Wait for the first RX frame, use that as BAW */
rap->rxa_start = 0;
rap->rxa_flags |= IEEE80211_AGGR_WAITRX;
} else {
rap->rxa_start = seq;
}
rap->rxa_flags |= IEEE80211_AGGR_RUNNING | IEEE80211_AGGR_XCHGPEND;
IEEE80211_NOTE(ni->ni_vap, IEEE80211_MSG_11N, ni,
@ -617,7 +623,9 @@ ampdu_rx_stop(struct ieee80211_node *ni, struct ieee80211_rx_ampdu *rap)
{
ampdu_rx_purge(rap);
rap->rxa_flags &= ~(IEEE80211_AGGR_RUNNING | IEEE80211_AGGR_XCHGPEND);
rap->rxa_flags &= ~(IEEE80211_AGGR_RUNNING
| IEEE80211_AGGR_XCHGPEND
| IEEE80211_AGGR_WAITRX);
}
/*
@ -842,6 +850,16 @@ ieee80211_ampdu_reorder(struct ieee80211_node *ni, struct mbuf *m)
}
rxseq >>= IEEE80211_SEQ_SEQ_SHIFT;
rap->rxa_nframes++;
/*
* Handle waiting for the first frame to define the BAW.
* Some firmware doesn't provide the RX of the starting point
* of the BAW and we have to cope.
*/
if (rap->rxa_flags & IEEE80211_AGGR_WAITRX) {
rap->rxa_flags &= ~IEEE80211_AGGR_WAITRX;
rap->rxa_start = rxseq;
}
again:
if (rxseq == rap->rxa_start) {
/*

View File

@ -44,6 +44,7 @@ struct ieee80211_tx_ampdu {
#define IEEE80211_AGGR_SETUP 0x0008 /* deferred state setup */
#define IEEE80211_AGGR_NAK 0x0010 /* peer NAK'd ADDBA request */
#define IEEE80211_AGGR_BARPEND 0x0020 /* BAR response pending */
#define IEEE80211_AGGR_WAITRX 0x0040 /* Wait for first RX frame to define BAW */
uint8_t txa_tid;
uint8_t txa_token; /* dialog token */
int txa_lastsample; /* ticks @ last traffic sample */