linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Felix Fietkau <nbd@openwrt.org>
To: linux-wireless@vger.kernel.org
Cc: linville@tuxdriver.com, lrodriguez@atheros.com
Subject: [PATCH 04/13] ath9k: remove bfs_paprd_timestamp from struct ath_buf_state
Date: Sun, 14 Nov 2010 15:20:04 +0100	[thread overview]
Message-ID: <1289744413-20789-4-git-send-email-nbd@openwrt.org> (raw)
In-Reply-To: <1289744413-20789-3-git-send-email-nbd@openwrt.org>

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
---
 drivers/net/wireless/ath/ath9k/ath9k.h |    2 +-
 drivers/net/wireless/ath/ath9k/main.c  |    2 ++
 drivers/net/wireless/ath/ath9k/xmit.c  |    7 +------
 3 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h
index 7316459..9106d41 100644
--- a/drivers/net/wireless/ath/ath9k/ath9k.h
+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
@@ -221,7 +221,6 @@ struct ath_buf_state {
 	int bfs_retries;
 	u8 bf_type;
 	u8 bfs_paprd;
-	unsigned long bfs_paprd_timestamp;
 	u32 bfs_keyix;
 	enum ath9k_internal_frame_type bfs_ftype;
 };
@@ -598,6 +597,7 @@ struct ath_softc {
 	struct work_struct paprd_work;
 	struct work_struct hw_check_work;
 	struct completion paprd_complete;
+	bool paprd_pending;
 
 	u32 intrstatus;
 	u32 sc_flags; /* SC_OP_* */
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index f8c811a..611797a 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -380,6 +380,7 @@ void ath_paprd_calibrate(struct work_struct *work)
 		}
 
 		init_completion(&sc->paprd_complete);
+		sc->paprd_pending = true;
 		ar9003_paprd_setup_gain_table(ah, chain);
 		txctl.paprd = BIT(chain);
 		if (ath_tx_start(hw, skb, &txctl) != 0)
@@ -387,6 +388,7 @@ void ath_paprd_calibrate(struct work_struct *work)
 
 		time_left = wait_for_completion_timeout(&sc->paprd_complete,
 				msecs_to_jiffies(ATH_PAPRD_TIMEOUT));
+		sc->paprd_pending = false;
 		if (!time_left) {
 			ath_print(ath9k_hw_common(ah), ATH_DBG_CALIBRATE,
 				  "Timeout waiting for paprd training on "
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c
index 6e0467c..9f3d23a 100644
--- a/drivers/net/wireless/ath/ath9k/xmit.c
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
@@ -1698,9 +1698,6 @@ static void ath_tx_start_dma(struct ath_softc *sc, struct ath_buf *bf,
 		if (bf->bf_state.bfs_paprd)
 			ar9003_hw_set_paprd_txdesc(ah, ds, bf->bf_state.bfs_paprd);
 
-		if (txctl->paprd)
-			bf->bf_state.bfs_paprd_timestamp = jiffies;
-
 		ath_tx_send_normal(sc, txctl->txq, NULL, &bf_head);
 	}
 
@@ -1874,9 +1871,7 @@ static void ath_tx_complete_buf(struct ath_softc *sc, struct ath_buf *bf,
 	bf->bf_buf_addr = 0;
 
 	if (bf->bf_state.bfs_paprd) {
-		if (time_after(jiffies,
-			       bf->bf_state.bfs_paprd_timestamp +
-			       msecs_to_jiffies(ATH_PAPRD_TIMEOUT)))
+		if (!sc->paprd_pending)
 			dev_kfree_skb_any(skb);
 		else
 			complete(&sc->paprd_complete);
-- 
1.7.3.2


  reply	other threads:[~2010-11-14 14:20 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-14 14:20 [PATCH 01/13] ath9k: remove bfs_seqno from struct ath_buf_state Felix Fietkau
2010-11-14 14:20 ` [PATCH 02/13] ath9k: remove bfs_tidno " Felix Fietkau
2010-11-14 14:20   ` [PATCH 03/13] ath9k: remove bfs_keytype " Felix Fietkau
2010-11-14 14:20     ` Felix Fietkau [this message]
2010-11-14 14:20       ` [PATCH 05/13] ath9k: remove bfs_keyix " Felix Fietkau
2010-11-14 14:20         ` [PATCH 06/13] ath9k: remove bfs_al " Felix Fietkau
2010-11-14 14:20           ` [PATCH 07/13] ath9k: remove bfs_nframes " Felix Fietkau
2010-11-14 14:20             ` [PATCH 08/13] ath9k: remove bfs_frmlen " Felix Fietkau
2010-11-14 14:20               ` [PATCH 09/13] ath9k: remove bf_tx_aborted from struct ath_buf Felix Fietkau
2010-11-14 14:20                 ` [PATCH 10/13] ath9k: clean up code duplication around ath_tx_start Felix Fietkau
2010-11-14 14:20                   ` [PATCH 11/13] ath9k: block new AMPDU sessions if SC_OP_TXAGGR is not set Felix Fietkau
2010-11-14 14:20                     ` [PATCH 12/13] ath9k: more tx setup cleanups Felix Fietkau
2010-11-14 14:20                       ` [PATCH 13/13] ath9k: store frame information used by aggregation inside the skb tx info Felix Fietkau
2010-11-15 11:27                     ` [PATCH 11/13] ath9k: block new AMPDU sessions if SC_OP_TXAGGR is not set Vasanthakumar Thiagarajan
2010-11-15 11:32                       ` Felix Fietkau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1289744413-20789-4-git-send-email-nbd@openwrt.org \
    --to=nbd@openwrt.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=lrodriguez@atheros.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).