update .gitignore
[librecmc/librecmc.git] / package / kernel / mac80211 / patches / 307-ath9k-fix-moredata-bit-in-PS-buffered-frame-release.patch
1 From: Felix Fietkau <nbd@nbd.name>
2 Date: Sun, 28 Aug 2016 13:13:01 +0200
3 Subject: [PATCH] ath9k: fix moredata bit in PS buffered frame release
4
5 Signed-off-by: Felix Fietkau <nbd@nbd.name>
6 ---
7
8 --- a/drivers/net/wireless/ath/ath9k/xmit.c
9 +++ b/drivers/net/wireless/ath/ath9k/xmit.c
10 @@ -1635,6 +1635,22 @@ void ath_tx_aggr_wakeup(struct ath_softc
11         }
12  }
13  
14 +
15 +static void
16 +ath9k_set_moredata(struct ath_softc *sc, struct ath_buf *bf, bool val)
17 +{
18 +       struct ieee80211_hdr *hdr;
19 +       u16 mask = cpu_to_le16(IEEE80211_FCTL_MOREDATA);
20 +       u16 mask_val = mask * val;
21 +
22 +       hdr = (struct ieee80211_hdr *) bf->bf_mpdu->data;
23 +       if ((hdr->frame_control & mask) != mask_val) {
24 +               hdr->frame_control = (hdr->frame_control & ~mask) | mask_val;
25 +               dma_sync_single_for_device(sc->dev, bf->bf_buf_addr,
26 +                       sizeof(*hdr), DMA_TO_DEVICE);
27 +       }
28 +}
29 +
30  void ath9k_release_buffered_frames(struct ieee80211_hw *hw,
31                                    struct ieee80211_sta *sta,
32                                    u16 tids, int nframes,
33 @@ -1665,6 +1681,7 @@ void ath9k_release_buffered_frames(struc
34                         if (!bf)
35                                 break;
36  
37 +                       ath9k_set_moredata(sc, bf, true);
38                         list_add_tail(&bf->list, &bf_q);
39                         ath_set_rates(tid->an->vif, tid->an->sta, bf, true);
40                         if (bf_isampdu(bf)) {
41 @@ -1688,6 +1705,9 @@ void ath9k_release_buffered_frames(struc
42         if (list_empty(&bf_q))
43                 return;
44  
45 +       if (!more_data)
46 +               ath9k_set_moredata(sc, bf_tail, false);
47 +
48         info = IEEE80211_SKB_CB(bf_tail->bf_mpdu);
49         info->flags |= IEEE80211_TX_STATUS_EOSP;
50