From: Christian Lamparter Date: Mon, 21 Nov 2011 18:42:17 +0000 (+0100) Subject: carl9170 firmware: refactoring wlan_tx_ampdu X-Git-Tag: 1.9.5~35 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=5afdefe0d025f110bb270d8a2ad4e1773fbd70b9;p=carl9170fw.git carl9170 firmware: refactoring wlan_tx_ampdu Signed-off-by: Christian Lamparter --- diff --git a/carlfw/src/wlan.c b/carlfw/src/wlan.c index cc2b917..69d90e6 100644 --- a/carlfw/src/wlan.c +++ b/carlfw/src/wlan.c @@ -235,13 +235,19 @@ static inline bool same_aggr(struct ieee80211_hdr *a, struct ieee80211_hdr *b) return (get_tid(a) == get_tid(b)) || same_hdr(a, b); } +static void wlan_tx_ampdu_reset(unsigned int qidx) +{ + fw.wlan.ampdu_prev[qidx] = NULL; +} + static void wlan_tx_ampdu_end(unsigned int qidx) { struct carl9170_tx_superframe *ht_prev = fw.wlan.ampdu_prev[qidx]; - fw.wlan.ampdu_prev[qidx] = NULL; if (ht_prev) ht_prev->f.hdr.mac.ba_end = 1; + + wlan_tx_ampdu_reset(qidx); } static void wlan_tx_ampdu(struct carl9170_tx_superframe *super) @@ -249,16 +255,16 @@ static void wlan_tx_ampdu(struct carl9170_tx_superframe *super) unsigned int qidx = super->s.queue; struct carl9170_tx_superframe *ht_prev = fw.wlan.ampdu_prev[qidx]; - if (!super->f.hdr.mac.ampdu) { - wlan_tx_ampdu_end(qidx); - } else { - fw.wlan.ampdu_prev[qidx] = super; - + if (super->f.hdr.mac.ampdu) { if (ht_prev && !same_aggr(&super->f.data.i3e, &ht_prev->f.data.i3e)) ht_prev->f.hdr.mac.ba_end = 1; else super->f.hdr.mac.ba_end = 0; + + fw.wlan.ampdu_prev[qidx] = super; + } else { + wlan_tx_ampdu_end(qidx); } } @@ -463,6 +469,9 @@ static void handle_tx_completion(void) } } + + wlan_tx_ampdu_reset(i); + for_each_desc(desc, &fw.wlan.tx_retry) __wlan_tx(desc);