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 packets
5 The flag needs to be cleared for the last packet in the list, not the
6 first one. Fixes some issues with multicast packet loss for powersave
7 clients connected to an ath9k AP.
9 Signed-off-by: Felix Fietkau <nbd@nbd.name>
12 --- a/drivers/net/wireless/ath/ath9k/xmit.c
13 +++ b/drivers/net/wireless/ath/ath9k/xmit.c
14 @@ -2451,7 +2451,6 @@ void ath_tx_cabq(struct ieee80211_hw *hw
15 .txq = sc->beacon.cabq
17 struct ath_tx_info info = {};
18 - struct ieee80211_hdr *hdr;
19 struct ath_buf *bf_tail = NULL;
22 @@ -2495,15 +2494,10 @@ void ath_tx_cabq(struct ieee80211_hw *hw
23 if (list_empty(&bf_q))
26 - bf = list_first_entry(&bf_q, struct ath_buf, list);
27 - hdr = (struct ieee80211_hdr *) bf->bf_mpdu->data;
29 - if (hdr->frame_control & cpu_to_le16(IEEE80211_FCTL_MOREDATA)) {
30 - hdr->frame_control &= ~cpu_to_le16(IEEE80211_FCTL_MOREDATA);
31 - dma_sync_single_for_device(sc->dev, bf->bf_buf_addr,
32 - sizeof(*hdr), DMA_TO_DEVICE);
34 + bf = list_last_entry(&bf_q, struct ath_buf, list);
35 + ath9k_set_moredata(sc, bf, false);
37 + bf = list_first_entry(&bf_q, struct ath_buf, list);
38 ath_txq_lock(sc, txctl.txq);
39 ath_tx_fill_desc(sc, bf, txctl.txq, 0);
40 ath_tx_txqaddbuf(sc, txctl.txq, &bf_q, false);