diff options
author | Felix Fietkau <nbd@nbd.name> | 2016-08-28 13:50:09 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2016-09-02 14:43:51 +0200 |
commit | 372d0fea29e60b02154fd7176ba32e7742f6640e (patch) | |
tree | 08aa89a69d6bce19f16985479387a7063fa04cc5 /package/kernel/mac80211/patches/339-ath9k-fix-moredata-bit-in-PS-buffered-frame-release.patch | |
parent | 1e72d1bf16e6f2e2a9579bc5c91bae61402da3aa (diff) | |
download | mtk-20170518-372d0fea29e60b02154fd7176ba32e7742f6640e.zip mtk-20170518-372d0fea29e60b02154fd7176ba32e7742f6640e.tar.gz mtk-20170518-372d0fea29e60b02154fd7176ba32e7742f6640e.tar.bz2 |
ath9k: add a bunch of powersave handling fixes
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'package/kernel/mac80211/patches/339-ath9k-fix-moredata-bit-in-PS-buffered-frame-release.patch')
-rw-r--r-- | package/kernel/mac80211/patches/339-ath9k-fix-moredata-bit-in-PS-buffered-frame-release.patch | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/package/kernel/mac80211/patches/339-ath9k-fix-moredata-bit-in-PS-buffered-frame-release.patch b/package/kernel/mac80211/patches/339-ath9k-fix-moredata-bit-in-PS-buffered-frame-release.patch new file mode 100644 index 0000000..49b37e4 --- /dev/null +++ b/package/kernel/mac80211/patches/339-ath9k-fix-moredata-bit-in-PS-buffered-frame-release.patch @@ -0,0 +1,49 @@ +From: Felix Fietkau <nbd@nbd.name> +Date: Sun, 28 Aug 2016 13:13:01 +0200 +Subject: [PATCH] ath9k: fix moredata bit in PS buffered frame release + +Signed-off-by: Felix Fietkau <nbd@nbd.name> +--- + +--- a/drivers/net/wireless/ath/ath9k/xmit.c ++++ b/drivers/net/wireless/ath/ath9k/xmit.c +@@ -1634,6 +1634,21 @@ void ath_tx_aggr_wakeup(struct ath_softc + } + } + ++static void ++ath9k_set_moredata(struct ath_softc *sc, struct ath_buf *bf, bool val) ++{ ++ struct ieee80211_hdr *hdr; ++ u16 mask = cpu_to_le16(IEEE80211_FCTL_MOREDATA); ++ u16 mask_val = mask * val; ++ ++ hdr = (struct ieee80211_hdr *) bf->bf_mpdu->data; ++ if ((hdr->frame_control & mask) != mask_val) { ++ hdr->frame_control = (hdr->frame_control & ~mask) | mask_val; ++ dma_sync_single_for_device(sc->dev, bf->bf_buf_addr, ++ sizeof(*hdr), DMA_TO_DEVICE); ++ } ++} ++ + void ath9k_release_buffered_frames(struct ieee80211_hw *hw, + struct ieee80211_sta *sta, + u16 tids, int nframes, +@@ -1664,6 +1679,7 @@ void ath9k_release_buffered_frames(struc + if (!bf) + break; + ++ ath9k_set_moredata(sc, bf, true); + list_add_tail(&bf->list, &bf_q); + ath_set_rates(tid->an->vif, tid->an->sta, bf, true); + if (bf_isampdu(bf)) { +@@ -1687,6 +1703,9 @@ void ath9k_release_buffered_frames(struc + if (list_empty(&bf_q)) + return; + ++ if (!more_data) ++ ath9k_set_moredata(sc, bf_tail, false); ++ + info = IEEE80211_SKB_CB(bf_tail->bf_mpdu); + info->flags |= IEEE80211_TX_STATUS_EOSP; + |