mt76: update to the latest version
[oweals/openwrt.git] / package / kernel / mac80211 / patches / 366-ath9k-fix-more-data-flag-for-buffered-multicast-pack.patch
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
4  packets
5
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.
9
10 Signed-off-by: Felix Fietkau <nbd@nbd.name>
11 ---
12
13 --- a/drivers/net/wireless/ath/ath9k/xmit.c
14 +++ b/drivers/net/wireless/ath/ath9k/xmit.c
15 @@ -2451,7 +2451,6 @@ void ath_tx_cabq(struct ieee80211_hw *hw
16                 .txq = sc->beacon.cabq
17         };
18         struct ath_tx_info info = {};
19 -       struct ieee80211_hdr *hdr;
20         struct ath_buf *bf_tail = NULL;
21         struct ath_buf *bf;
22         LIST_HEAD(bf_q);
23 @@ -2495,15 +2494,10 @@ void ath_tx_cabq(struct ieee80211_hw *hw
24         if (list_empty(&bf_q))
25                 return;
26  
27 -       bf = list_first_entry(&bf_q, struct ath_buf, list);
28 -       hdr = (struct ieee80211_hdr *) bf->bf_mpdu->data;
29 -
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);
34 -       }
35 +       bf = list_last_entry(&bf_q, struct ath_buf, list);
36 +       ath9k_set_moredata(sc, bf, false);
37  
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);