linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/9] ath9k_hw: set spectral scan enable bit on trigger for AR9003+
@ 2018-07-23 16:02 Felix Fietkau
  2018-07-23 16:02 ` [PATCH 2/9] ath9k: don't run periodic and nf calibation at the same time Felix Fietkau
                   ` (8 more replies)
  0 siblings, 9 replies; 12+ messages in thread
From: Felix Fietkau @ 2018-07-23 16:02 UTC (permalink / raw)
  To: linux-wireless; +Cc: kvalo

AR9002 code and the QCA AR9003+ reference code do the same.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
 drivers/net/wireless/ath/ath9k/ar9003_phy.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/wireless/ath/ath9k/ar9003_phy.c b/drivers/net/wireless/ath/ath9k/ar9003_phy.c
index fe5102ca5010..98c5f524a360 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_phy.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.c
@@ -1800,6 +1800,8 @@ static void ar9003_hw_spectral_scan_config(struct ath_hw *ah,
 
 static void ar9003_hw_spectral_scan_trigger(struct ath_hw *ah)
 {
+	REG_SET_BIT(ah, AR_PHY_SPECTRAL_SCAN,
+		    AR_PHY_SPECTRAL_SCAN_ENABLE);
 	/* Activate spectral scan */
 	REG_SET_BIT(ah, AR_PHY_SPECTRAL_SCAN,
 		    AR_PHY_SPECTRAL_SCAN_ACTIVE);
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 2/9] ath9k: don't run periodic and nf calibation at the same time
  2018-07-23 16:02 [PATCH 1/9] ath9k_hw: set spectral scan enable bit on trigger for AR9003+ Felix Fietkau
@ 2018-07-23 16:02 ` Felix Fietkau
  2018-07-23 16:02 ` [PATCH 3/9] ath9k: force rx_clear when disabling rx Felix Fietkau
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 12+ messages in thread
From: Felix Fietkau @ 2018-07-23 16:02 UTC (permalink / raw)
  To: linux-wireless; +Cc: kvalo

The checks already prevents periodic cal from being started while noise
floor calibration runs. It is missing checks for the other way around.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
 drivers/net/wireless/ath/ath9k/ar9002_calib.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/ar9002_calib.c b/drivers/net/wireless/ath/ath9k/ar9002_calib.c
index 50fcd343c41a..fd9db8ca99d7 100644
--- a/drivers/net/wireless/ath/ath9k/ar9002_calib.c
+++ b/drivers/net/wireless/ath/ath9k/ar9002_calib.c
@@ -676,10 +676,10 @@ static int ar9002_hw_calibrate(struct ath_hw *ah, struct ath9k_channel *chan,
 			return 0;
 
 		ah->cal_list_curr = currCal = currCal->calNext;
-		if (currCal->calState == CAL_WAITING) {
+		if (currCal->calState == CAL_WAITING)
 			ath9k_hw_reset_calibration(ah, currCal);
-			return 0;
-		}
+
+		return 0;
 	}
 
 	/* Do NF cal only at longer intervals */
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 3/9] ath9k: force rx_clear when disabling rx
  2018-07-23 16:02 [PATCH 1/9] ath9k_hw: set spectral scan enable bit on trigger for AR9003+ Felix Fietkau
  2018-07-23 16:02 ` [PATCH 2/9] ath9k: don't run periodic and nf calibation at the same time Felix Fietkau
@ 2018-07-23 16:02 ` Felix Fietkau
  2018-07-30 18:07   ` Kalle Valo
  2018-07-23 16:02 ` [PATCH 4/9] ath9k: fix moredata bit in PS buffered frame release Felix Fietkau
                   ` (6 subsequent siblings)
  8 siblings, 1 reply; 12+ messages in thread
From: Felix Fietkau @ 2018-07-23 16:02 UTC (permalink / raw)
  To: linux-wireless; +Cc: kvalo, Felix Fietkau

From: Felix Fietkau <nbd@openwrt.org>

This makes stopping Rx more reliable and should reduce the frequency of
Rx related DMA stop warnings. Don't use rx_clear in TX99 mode.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
---
 drivers/net/wireless/ath/ath9k/mac.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/mac.c b/drivers/net/wireless/ath/ath9k/mac.c
index 58d02c19b6d0..c9d2bf3fa135 100644
--- a/drivers/net/wireless/ath/ath9k/mac.c
+++ b/drivers/net/wireless/ath/ath9k/mac.c
@@ -678,13 +678,18 @@ void ath9k_hw_startpcureceive(struct ath_hw *ah, bool is_scanning)
 
 	ath9k_ani_reset(ah, is_scanning);
 
-	REG_CLR_BIT(ah, AR_DIAG_SW, (AR_DIAG_RX_DIS | AR_DIAG_RX_ABORT));
+	REG_CLR_BIT(ah, AR_DIAG_SW,
+		    AR_DIAG_RX_DIS | AR_DIAG_RX_ABORT | AR_DIAG_FORCE_RX_CLEAR);
 }
 EXPORT_SYMBOL(ath9k_hw_startpcureceive);
 
 void ath9k_hw_abortpcurecv(struct ath_hw *ah)
 {
-	REG_SET_BIT(ah, AR_DIAG_SW, AR_DIAG_RX_ABORT | AR_DIAG_RX_DIS);
+	u32 reg = AR_DIAG_RX_DIS | AR_DIAG_RX_ABORT;
+
+	if (!IS_ENABLED(CPTCFG_ATH9K_TX99))
+		reg |= AR_DIAG_FORCE_RX_CLEAR;
+	REG_SET_BIT(ah, AR_DIAG_SW, reg);
 
 	ath9k_hw_disable_mib_counters(ah);
 }
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 4/9] ath9k: fix moredata bit in PS buffered frame release
  2018-07-23 16:02 [PATCH 1/9] ath9k_hw: set spectral scan enable bit on trigger for AR9003+ Felix Fietkau
  2018-07-23 16:02 ` [PATCH 2/9] ath9k: don't run periodic and nf calibation at the same time Felix Fietkau
  2018-07-23 16:02 ` [PATCH 3/9] ath9k: force rx_clear when disabling rx Felix Fietkau
@ 2018-07-23 16:02 ` Felix Fietkau
  2018-07-30 18:08   ` Kalle Valo
  2018-07-23 16:02 ` [PATCH 5/9] ath9k: clear potentially stale EOSP status bit in intermediate queues Felix Fietkau
                   ` (5 subsequent siblings)
  8 siblings, 1 reply; 12+ messages in thread
From: Felix Fietkau @ 2018-07-23 16:02 UTC (permalink / raw)
  To: linux-wireless; +Cc: kvalo

Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
 drivers/net/wireless/ath/ath9k/xmit.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c
index 7fdb152be0bb..cab24b43ac88 100644
--- a/drivers/net/wireless/ath/ath9k/xmit.c
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
@@ -1659,6 +1659,22 @@ void ath_tx_aggr_wakeup(struct ath_softc *sc, struct ath_node *an)
 	}
 }
 
+
+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,
@@ -1689,6 +1705,7 @@ void ath9k_release_buffered_frames(struct ieee80211_hw *hw,
 			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);
 			if (bf_isampdu(bf)) {
@@ -1712,6 +1729,9 @@ void ath9k_release_buffered_frames(struct ieee80211_hw *hw,
 	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;
 
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 5/9] ath9k: clear potentially stale EOSP status bit in intermediate queues
  2018-07-23 16:02 [PATCH 1/9] ath9k_hw: set spectral scan enable bit on trigger for AR9003+ Felix Fietkau
                   ` (2 preceding siblings ...)
  2018-07-23 16:02 ` [PATCH 4/9] ath9k: fix moredata bit in PS buffered frame release Felix Fietkau
@ 2018-07-23 16:02 ` Felix Fietkau
  2018-07-23 16:02 ` [PATCH 6/9] ath9k: report tx status on EOSP Felix Fietkau
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 12+ messages in thread
From: Felix Fietkau @ 2018-07-23 16:02 UTC (permalink / raw)
  To: linux-wireless; +Cc: kvalo

Prevents spurious ieee80211_sta_eosp calls.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
 drivers/net/wireless/ath/ath9k/xmit.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c
index cab24b43ac88..56a0d1b7527a 100644
--- a/drivers/net/wireless/ath/ath9k/xmit.c
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
@@ -969,7 +969,8 @@ ath_tx_get_tid_subframe(struct ath_softc *sc, struct ath_txq *txq,
 		bf->bf_lastbf = bf;
 
 		tx_info = IEEE80211_SKB_CB(skb);
-		tx_info->flags &= ~IEEE80211_TX_CTL_CLEAR_PS_FILT;
+		tx_info->flags &= ~(IEEE80211_TX_CTL_CLEAR_PS_FILT |
+				    IEEE80211_TX_STATUS_EOSP);
 
 		/*
 		 * No aggregation session is running, but there may be frames
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 6/9] ath9k: report tx status on EOSP
  2018-07-23 16:02 [PATCH 1/9] ath9k_hw: set spectral scan enable bit on trigger for AR9003+ Felix Fietkau
                   ` (3 preceding siblings ...)
  2018-07-23 16:02 ` [PATCH 5/9] ath9k: clear potentially stale EOSP status bit in intermediate queues Felix Fietkau
@ 2018-07-23 16:02 ` Felix Fietkau
  2018-07-23 16:02 ` [PATCH 7/9] ath9k: fix block-ack window tracking issues Felix Fietkau
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 12+ messages in thread
From: Felix Fietkau @ 2018-07-23 16:02 UTC (permalink / raw)
  To: linux-wireless; +Cc: kvalo

Fixes missed indications of end of U-APSD service period to mac80211

Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
 drivers/net/wireless/ath/ath9k/xmit.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c
index 56a0d1b7527a..d366170f01cf 100644
--- a/drivers/net/wireless/ath/ath9k/xmit.c
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
@@ -86,7 +86,8 @@ static void ath_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb)
 	struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
 	struct ieee80211_sta *sta = info->status.status_driver_data[0];
 
-	if (info->flags & IEEE80211_TX_CTL_REQ_TX_STATUS) {
+	if (info->flags & (IEEE80211_TX_CTL_REQ_TX_STATUS |
+			   IEEE80211_TX_STATUS_EOSP)) {
 		ieee80211_tx_status(hw, skb);
 		return;
 	}
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 7/9] ath9k: fix block-ack window tracking issues
  2018-07-23 16:02 [PATCH 1/9] ath9k_hw: set spectral scan enable bit on trigger for AR9003+ Felix Fietkau
                   ` (4 preceding siblings ...)
  2018-07-23 16:02 ` [PATCH 6/9] ath9k: report tx status on EOSP Felix Fietkau
@ 2018-07-23 16:02 ` Felix Fietkau
  2018-07-23 16:02 ` [PATCH 8/9] ath9k_hw: fix channel maximum power level test Felix Fietkau
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 12+ messages in thread
From: Felix Fietkau @ 2018-07-23 16:02 UTC (permalink / raw)
  To: linux-wireless; +Cc: kvalo

Ensure that a buffer gets tracked as part of the block-ack window as
soon as it's dequeued from the tid for the first time. Ensure that
double calls to ath_tx_addto_baw (e.g. on retransmission) don't cause
any issues.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
 drivers/net/wireless/ath/ath9k/xmit.c | 29 +++++++++++++++++----------
 1 file changed, 18 insertions(+), 11 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c
index d366170f01cf..bae0f6c045e1 100644
--- a/drivers/net/wireless/ath/ath9k/xmit.c
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
@@ -62,7 +62,7 @@ static void ath_tx_rc_status(struct ath_softc *sc, struct ath_buf *bf,
 			     struct ath_tx_status *ts, int nframes, int nbad,
 			     int txok);
 static void ath_tx_update_baw(struct ath_softc *sc, struct ath_atx_tid *tid,
-			      int seqno);
+			      struct ath_buf *bf);
 static struct ath_buf *ath_tx_setup_buffer(struct ath_softc *sc,
 					   struct ath_txq *txq,
 					   struct ath_atx_tid *tid,
@@ -296,7 +296,7 @@ static void ath_tx_flush_tid(struct ath_softc *sc, struct ath_atx_tid *tid)
 		}
 
 		if (fi->baw_tracked) {
-			ath_tx_update_baw(sc, tid, bf->bf_state.seqno);
+			ath_tx_update_baw(sc, tid, bf);
 			sendbar = true;
 		}
 
@@ -312,10 +312,15 @@ static void ath_tx_flush_tid(struct ath_softc *sc, struct ath_atx_tid *tid)
 }
 
 static void ath_tx_update_baw(struct ath_softc *sc, struct ath_atx_tid *tid,
-			      int seqno)
+			      struct ath_buf *bf)
 {
+	struct ath_frame_info *fi = get_frame_info(bf->bf_mpdu);
+	u16 seqno = bf->bf_state.seqno;
 	int index, cindex;
 
+	if (!fi->baw_tracked)
+		return;
+
 	index  = ATH_BA_INDEX(tid->seq_start, seqno);
 	cindex = (tid->baw_head + index) & (ATH_TID_MAX_BUFS - 1);
 
@@ -336,6 +341,9 @@ static void ath_tx_addto_baw(struct ath_softc *sc, struct ath_atx_tid *tid,
 	u16 seqno = bf->bf_state.seqno;
 	int index, cindex;
 
+	if (fi->baw_tracked)
+		return;
+
 	index  = ATH_BA_INDEX(tid->seq_start, seqno);
 	cindex = (tid->baw_head + index) & (ATH_TID_MAX_BUFS - 1);
 	__set_bit(cindex, tid->tx_buf);
@@ -612,7 +620,7 @@ static void ath_tx_complete_aggr(struct ath_softc *sc, struct ath_txq *txq,
 			 * complete the acked-ones/xretried ones; update
 			 * block-ack window
 			 */
-			ath_tx_update_baw(sc, tid, seqno);
+			ath_tx_update_baw(sc, tid, bf);
 
 			if (rc_update && (acked_cnt == 1 || txfail_cnt == 1)) {
 				memcpy(tx_info->control.rates, rates, sizeof(rates));
@@ -642,7 +650,7 @@ static void ath_tx_complete_aggr(struct ath_softc *sc, struct ath_txq *txq,
 				 * run out of tx buf.
 				 */
 				if (!tbf) {
-					ath_tx_update_baw(sc, tid, seqno);
+					ath_tx_update_baw(sc, tid, bf);
 
 					ath_tx_complete_buf(sc, bf, txq,
 							    &bf_head, NULL, ts,
@@ -1011,11 +1019,14 @@ ath_tx_get_tid_subframe(struct ath_softc *sc, struct ath_txq *txq,
 
 			INIT_LIST_HEAD(&bf_head);
 			list_add(&bf->list, &bf_head);
-			ath_tx_update_baw(sc, tid, seqno);
+			ath_tx_update_baw(sc, tid, bf);
 			ath_tx_complete_buf(sc, bf, txq, &bf_head, NULL, &ts, 0);
 			continue;
 		}
 
+		if (bf_isampdu(bf))
+			ath_tx_addto_baw(sc, tid, bf);
+
 		return bf;
 	}
 
@@ -1073,8 +1084,6 @@ ath_tx_form_aggr(struct ath_softc *sc, struct ath_txq *txq,
 		bf->bf_next = NULL;
 
 		/* link buffers of this frame to the aggregate */
-		if (!fi->baw_tracked)
-			ath_tx_addto_baw(sc, tid, bf);
 		bf->bf_state.ndelim = ndelim;
 
 		list_add_tail(&bf->list, bf_q);
@@ -1710,10 +1719,8 @@ void ath9k_release_buffered_frames(struct ieee80211_hw *hw,
 			ath9k_set_moredata(sc, bf, true);
 			list_add_tail(&bf->list, &bf_q);
 			ath_set_rates(tid->an->vif, tid->an->sta, bf);
-			if (bf_isampdu(bf)) {
-				ath_tx_addto_baw(sc, tid, bf);
+			if (bf_isampdu(bf))
 				bf->bf_state.bf_type &= ~BUF_AGGR;
-			}
 			if (bf_tail)
 				bf_tail->bf_next = bf;
 
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 8/9] ath9k_hw: fix channel maximum power level test
  2018-07-23 16:02 [PATCH 1/9] ath9k_hw: set spectral scan enable bit on trigger for AR9003+ Felix Fietkau
                   ` (5 preceding siblings ...)
  2018-07-23 16:02 ` [PATCH 7/9] ath9k: fix block-ack window tracking issues Felix Fietkau
@ 2018-07-23 16:02 ` Felix Fietkau
  2018-07-23 16:03 ` [PATCH 9/9] ath9k: fix more-data flag for buffered multicast packets Felix Fietkau
  2018-07-31  7:55 ` [PATCH 1/9] ath9k_hw: set spectral scan enable bit on trigger for AR9003+ Kalle Valo
  8 siblings, 0 replies; 12+ messages in thread
From: Felix Fietkau @ 2018-07-23 16:02 UTC (permalink / raw)
  To: linux-wireless; +Cc: kvalo

The tx power applied by set_txpower is limited by the CTL (conformance
test limit) entries in the EEPROM. These can change based on the user
configured regulatory domain.
Depending on the EEPROM data this can cause the tx power to become too
limited, if the original regdomain CTLs impose lower limits than the CTLs
of the user configured regdomain.

To fix this issue, set the initial channel limits without any CTL
restrictions and only apply the CTL at run time when setting the channel
and the real tx power.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
 drivers/net/wireless/ath/ath9k/hw.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index 1665066f4e24..9dc866404eca 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -2942,16 +2942,19 @@ void ath9k_hw_apply_txpower(struct ath_hw *ah, struct ath9k_channel *chan,
 	struct ath_regulatory *reg = ath9k_hw_regulatory(ah);
 	struct ieee80211_channel *channel;
 	int chan_pwr, new_pwr;
+	u16 ctl = NO_CTL;
 
 	if (!chan)
 		return;
 
+	if (!test)
+		ctl = ath9k_regd_get_ctl(reg, chan);
+
 	channel = chan->chan;
 	chan_pwr = min_t(int, channel->max_power * 2, MAX_RATE_POWER);
 	new_pwr = min_t(int, chan_pwr, reg->power_limit);
 
-	ah->eep_ops->set_txpower(ah, chan,
-				 ath9k_regd_get_ctl(reg, chan),
+	ah->eep_ops->set_txpower(ah, chan, ctl,
 				 get_antenna_gain(ah, chan), new_pwr, test);
 }
 
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 9/9] ath9k: fix more-data flag for buffered multicast packets
  2018-07-23 16:02 [PATCH 1/9] ath9k_hw: set spectral scan enable bit on trigger for AR9003+ Felix Fietkau
                   ` (6 preceding siblings ...)
  2018-07-23 16:02 ` [PATCH 8/9] ath9k_hw: fix channel maximum power level test Felix Fietkau
@ 2018-07-23 16:03 ` Felix Fietkau
  2018-07-31  7:55 ` [PATCH 1/9] ath9k_hw: set spectral scan enable bit on trigger for AR9003+ Kalle Valo
  8 siblings, 0 replies; 12+ messages in thread
From: Felix Fietkau @ 2018-07-23 16:03 UTC (permalink / raw)
  To: linux-wireless; +Cc: kvalo

The flag needs to be cleared for the last packet in the list, not the
first one. Fixes some issues with multicast packet loss for powersave
clients connected to an ath9k AP.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
 drivers/net/wireless/ath/ath9k/xmit.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c
index bae0f6c045e1..43b6c8508e49 100644
--- a/drivers/net/wireless/ath/ath9k/xmit.c
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
@@ -2436,7 +2436,6 @@ void ath_tx_cabq(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
 		.txq = sc->beacon.cabq
 	};
 	struct ath_tx_info info = {};
-	struct ieee80211_hdr *hdr;
 	struct ath_buf *bf_tail = NULL;
 	struct ath_buf *bf;
 	LIST_HEAD(bf_q);
@@ -2480,15 +2479,10 @@ void ath_tx_cabq(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
 	if (list_empty(&bf_q))
 		return;
 
-	bf = list_first_entry(&bf_q, struct ath_buf, list);
-	hdr = (struct ieee80211_hdr *) bf->bf_mpdu->data;
-
-	if (hdr->frame_control & cpu_to_le16(IEEE80211_FCTL_MOREDATA)) {
-		hdr->frame_control &= ~cpu_to_le16(IEEE80211_FCTL_MOREDATA);
-		dma_sync_single_for_device(sc->dev, bf->bf_buf_addr,
-			sizeof(*hdr), DMA_TO_DEVICE);
-	}
+	bf = list_last_entry(&bf_q, struct ath_buf, list);
+	ath9k_set_moredata(sc, bf, false);
 
+	bf = list_first_entry(&bf_q, struct ath_buf, list);
 	ath_txq_lock(sc, txctl.txq);
 	ath_tx_fill_desc(sc, bf, txctl.txq, 0);
 	ath_tx_txqaddbuf(sc, txctl.txq, &bf_q, false);
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH 3/9] ath9k: force rx_clear when disabling rx
  2018-07-23 16:02 ` [PATCH 3/9] ath9k: force rx_clear when disabling rx Felix Fietkau
@ 2018-07-30 18:07   ` Kalle Valo
  0 siblings, 0 replies; 12+ messages in thread
From: Kalle Valo @ 2018-07-30 18:07 UTC (permalink / raw)
  To: Felix Fietkau; +Cc: linux-wireless, Felix Fietkau

Felix Fietkau <nbd@nbd.name> writes:

> From: Felix Fietkau <nbd@openwrt.org>
>
> This makes stopping Rx more reliable and should reduce the frequency of
> Rx related DMA stop warnings. Don't use rx_clear in TX99 mode.
>
> Signed-off-by: Felix Fietkau <nbd@nbd.name>
> Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
> ---
>  drivers/net/wireless/ath/ath9k/mac.c | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath9k/mac.c b/drivers/net/wireless/ath/ath9k/mac.c
> index 58d02c19b6d0..c9d2bf3fa135 100644
> --- a/drivers/net/wireless/ath/ath9k/mac.c
> +++ b/drivers/net/wireless/ath/ath9k/mac.c
> @@ -678,13 +678,18 @@ void ath9k_hw_startpcureceive(struct ath_hw *ah, bool is_scanning)
>  
>  	ath9k_ani_reset(ah, is_scanning);
>  
> -	REG_CLR_BIT(ah, AR_DIAG_SW, (AR_DIAG_RX_DIS | AR_DIAG_RX_ABORT));
> +	REG_CLR_BIT(ah, AR_DIAG_SW,
> +		    AR_DIAG_RX_DIS | AR_DIAG_RX_ABORT | AR_DIAG_FORCE_RX_CLEAR);
>  }
>  EXPORT_SYMBOL(ath9k_hw_startpcureceive);
>  
>  void ath9k_hw_abortpcurecv(struct ath_hw *ah)
>  {
> -	REG_SET_BIT(ah, AR_DIAG_SW, AR_DIAG_RX_ABORT | AR_DIAG_RX_DIS);
> +	u32 reg = AR_DIAG_RX_DIS | AR_DIAG_RX_ABORT;
> +
> +	if (!IS_ENABLED(CPTCFG_ATH9K_TX99))
> +		reg |= AR_DIAG_FORCE_RX_CLEAR;
> +	REG_SET_BIT(ah, AR_DIAG_SW, reg);

CPTCFG_ prefix is obviously wrong, so I'll drop this patch.

But I also wonder if IS_ENABLED() is really correct? Why would enabling
a Kconfig option change "normal mode" (= not tx99 mode) functionality,
even when nobody accesses the tx99 debugfs file? I would have thought
there's some kind of runtime check to see if tx99 mode is enabled or
something like that.

-- 
Kalle Valo

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 4/9] ath9k: fix moredata bit in PS buffered frame release
  2018-07-23 16:02 ` [PATCH 4/9] ath9k: fix moredata bit in PS buffered frame release Felix Fietkau
@ 2018-07-30 18:08   ` Kalle Valo
  0 siblings, 0 replies; 12+ messages in thread
From: Kalle Valo @ 2018-07-30 18:08 UTC (permalink / raw)
  To: Felix Fietkau; +Cc: linux-wireless

Felix Fietkau <nbd@nbd.name> writes:

> Signed-off-by: Felix Fietkau <nbd@nbd.name>

No empty commit logs, please. What kind of bug does this fix? I can add
that to the commit log.

-- 
Kalle Valo

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/9] ath9k_hw: set spectral scan enable bit on trigger for AR9003+
  2018-07-23 16:02 [PATCH 1/9] ath9k_hw: set spectral scan enable bit on trigger for AR9003+ Felix Fietkau
                   ` (7 preceding siblings ...)
  2018-07-23 16:03 ` [PATCH 9/9] ath9k: fix more-data flag for buffered multicast packets Felix Fietkau
@ 2018-07-31  7:55 ` Kalle Valo
  8 siblings, 0 replies; 12+ messages in thread
From: Kalle Valo @ 2018-07-31  7:55 UTC (permalink / raw)
  To: Felix Fietkau; +Cc: linux-wireless

Felix Fietkau <nbd@nbd.name> wrote:

> AR9002 code and the QCA AR9003+ reference code do the same.
> 
> Signed-off-by: Felix Fietkau <nbd@nbd.name>
> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>

8 patches applied to ath-next branch of ath.git, thanks.

a2a49e86b325 ath9k_hw: set spectral scan enable bit on trigger for AR9003+
3a69dd366866 ath9k: don't run periodic and nf calibation at the same time
11f7f4f9c0d2 ath9k: fix moredata bit in PS buffered frame release
e20c7c91ef60 ath9k: clear potentially stale EOSP status bit in intermediate queues
36e14a787dd0 ath9k: report tx status on EOSP
1226f9e10296 ath9k: fix block-ack window tracking issues
461d8a6bb987 ath9k_hw: fix channel maximum power level test
52d7e0e5339b ath9k: fix more-data flag for buffered multicast packets

-- 
https://patchwork.kernel.org/patch/10540573/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2018-07-31  9:34 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-23 16:02 [PATCH 1/9] ath9k_hw: set spectral scan enable bit on trigger for AR9003+ Felix Fietkau
2018-07-23 16:02 ` [PATCH 2/9] ath9k: don't run periodic and nf calibation at the same time Felix Fietkau
2018-07-23 16:02 ` [PATCH 3/9] ath9k: force rx_clear when disabling rx Felix Fietkau
2018-07-30 18:07   ` Kalle Valo
2018-07-23 16:02 ` [PATCH 4/9] ath9k: fix moredata bit in PS buffered frame release Felix Fietkau
2018-07-30 18:08   ` Kalle Valo
2018-07-23 16:02 ` [PATCH 5/9] ath9k: clear potentially stale EOSP status bit in intermediate queues Felix Fietkau
2018-07-23 16:02 ` [PATCH 6/9] ath9k: report tx status on EOSP Felix Fietkau
2018-07-23 16:02 ` [PATCH 7/9] ath9k: fix block-ack window tracking issues Felix Fietkau
2018-07-23 16:02 ` [PATCH 8/9] ath9k_hw: fix channel maximum power level test Felix Fietkau
2018-07-23 16:03 ` [PATCH 9/9] ath9k: fix more-data flag for buffered multicast packets Felix Fietkau
2018-07-31  7:55 ` [PATCH 1/9] ath9k_hw: set spectral scan enable bit on trigger for AR9003+ Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).