When using Extended Key ID mac80211 drops @IEEE80211_TX_CTL_AMPDU for
the last packet which can be added to a A-MPDU in preparation.

Finalize A-MPDU immediately and start a new aggregation.

Signed-off-by: Alexander Wetzel <[email protected]>
---

This is the (b)leading edge of my current attempt to figure out a
solution to the "must not aggregate keyid 0 and 1 frames together"
problem.

I've not even tested that patch properly, yet..
So it only shows how I think ath9k driver can use the A-MPDU border
signal to send out the A-MPDU frame currently under construction.

May be useful to figure out if we want to implement A-MPDU border signal
in mac80211, through.

 drivers/net/wireless/ath/ath9k/xmit.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/xmit.c 
b/drivers/net/wireless/ath/ath9k/xmit.c
index a24265018cb2..84bbce6f212f 100644
--- a/drivers/net/wireless/ath/ath9k/xmit.c
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
@@ -990,10 +990,8 @@ ath_tx_get_tid_subframe(struct ath_softc *sc, struct 
ath_txq *txq,
                 * from a previous session or a failed attempt in the queue.
                 * Send them out as normal data frames
                 */
-               if (!tid->active)
+               if (!tid->active) {
                        tx_info->flags &= ~IEEE80211_TX_CTL_AMPDU;
-
-               if (!(tx_info->flags & IEEE80211_TX_CTL_AMPDU)) {
                        bf->bf_state.bf_type = 0;
                        return bf;
                }
@@ -1017,12 +1015,18 @@ ath_tx_get_tid_subframe(struct ath_softc *sc, struct 
ath_txq *txq,
                        break;
                }
 
-               if (tid->bar_index > ATH_BA_INDEX(tid->seq_start, seqno)) {
+               if (tid->bar_index > ATH_BA_INDEX(tid->seq_start, seqno) ||
+                   !(tx_info->flags & IEEE80211_TX_CTL_AMPDU)) {
                        struct ath_tx_status ts = {};
                        struct list_head bf_head;
 
                        INIT_LIST_HEAD(&bf_head);
-                       list_add(&bf->list, &bf_head);
+                       if (tx_info->flags & IEEE80211_TX_CTL_AMPDU &&
+                           tid->bar_index <= ATH_BA_INDEX(tid->seq_start, 
seqno))
+                               list_add(&bf->list, &bf_head);
+                       else
+                               ath_tx_addto_baw(sc, tid, bf);
+
                        ath_tx_update_baw(sc, tid, bf);
                        ath_tx_complete_buf(sc, bf, txq, &bf_head, NULL, &ts, 
0);
                        continue;
-- 
2.20.1

Reply via email to