1 From: Felix Fietkau <nbd@nbd.name>
2 Date: Sun, 23 Jul 2017 14:58:22 +0200
3 Subject: [PATCH] ath9k: fix more-data flag for buffered multicast
6 The flag needs to be cleared for the last packet in the list, not the
7 first one. Fixes some issues with multicast packet loss for powersave
8 clients connected to an ath9k AP.
10 Signed-off-by: Felix Fietkau <nbd@nbd.name>
13 --- a/drivers/net/wireless/ath/ath9k/xmit.c
14 +++ b/drivers/net/wireless/ath/ath9k/xmit.c
15 @@ -2436,7 +2436,6 @@ void ath_tx_cabq(struct ieee80211_hw *hw
16 .txq = sc->beacon.cabq
18 struct ath_tx_info info = {};
19 - struct ieee80211_hdr *hdr;
20 struct ath_buf *bf_tail = NULL;
23 @@ -2480,15 +2479,10 @@ void ath_tx_cabq(struct ieee80211_hw *hw
24 if (list_empty(&bf_q))
27 - bf = list_first_entry(&bf_q, struct ath_buf, list);
28 - hdr = (struct ieee80211_hdr *) bf->bf_mpdu->data;
30 - if (hdr->frame_control & cpu_to_le16(IEEE80211_FCTL_MOREDATA)) {
31 - hdr->frame_control &= ~cpu_to_le16(IEEE80211_FCTL_MOREDATA);
32 - dma_sync_single_for_device(sc->dev, bf->bf_buf_addr,
33 - sizeof(*hdr), DMA_TO_DEVICE);
35 + bf = list_last_entry(&bf_q, struct ath_buf, list);
36 + ath9k_set_moredata(sc, bf, false);
38 + bf = list_first_entry(&bf_q, struct ath_buf, list);
39 ath_txq_lock(sc, txctl.txq);
40 ath_tx_fill_desc(sc, bf, txctl.txq, 0);
41 ath_tx_txqaddbuf(sc, txctl.txq, &bf_q, false);