aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/wireless/ath/ath9k/ath9k.h2
-rw-r--r--drivers/net/wireless/ath/ath9k/main.c2
-rw-r--r--drivers/net/wireless/ath/ath9k/xmit.c7
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 bd988ea88bd1..826b665de9c2 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 {
221 int bfs_retries; 221 int bfs_retries;
222 u8 bf_type; 222 u8 bf_type;
223 u8 bfs_paprd; 223 u8 bfs_paprd;
224 unsigned long bfs_paprd_timestamp;
225 u32 bfs_keyix; 224 u32 bfs_keyix;
226 enum ath9k_internal_frame_type bfs_ftype; 225 enum ath9k_internal_frame_type bfs_ftype;
227}; 226};
@@ -598,6 +597,7 @@ struct ath_softc {
598 struct work_struct paprd_work; 597 struct work_struct paprd_work;
599 struct work_struct hw_check_work; 598 struct work_struct hw_check_work;
600 struct completion paprd_complete; 599 struct completion paprd_complete;
600 bool paprd_pending;
601 601
602 u32 intrstatus; 602 u32 intrstatus;
603 u32 sc_flags; /* SC_OP_* */ 603 u32 sc_flags; /* SC_OP_* */
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index df7c62d9bec4..cfec2ad664d8 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -375,6 +375,7 @@ void ath_paprd_calibrate(struct work_struct *work)
375 } 375 }
376 376
377 init_completion(&sc->paprd_complete); 377 init_completion(&sc->paprd_complete);
378 sc->paprd_pending = true;
378 ar9003_paprd_setup_gain_table(ah, chain); 379 ar9003_paprd_setup_gain_table(ah, chain);
379 txctl.paprd = BIT(chain); 380 txctl.paprd = BIT(chain);
380 if (ath_tx_start(hw, skb, &txctl) != 0) 381 if (ath_tx_start(hw, skb, &txctl) != 0)
@@ -382,6 +383,7 @@ void ath_paprd_calibrate(struct work_struct *work)
382 383
383 time_left = wait_for_completion_timeout(&sc->paprd_complete, 384 time_left = wait_for_completion_timeout(&sc->paprd_complete,
384 msecs_to_jiffies(ATH_PAPRD_TIMEOUT)); 385 msecs_to_jiffies(ATH_PAPRD_TIMEOUT));
386 sc->paprd_pending = false;
385 if (!time_left) { 387 if (!time_left) {
386 ath_print(ath9k_hw_common(ah), ATH_DBG_CALIBRATE, 388 ath_print(ath9k_hw_common(ah), ATH_DBG_CALIBRATE,
387 "Timeout waiting for paprd training on " 389 "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 6e0467cf0812..9f3d23a4e580 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,
1698 if (bf->bf_state.bfs_paprd) 1698 if (bf->bf_state.bfs_paprd)
1699 ar9003_hw_set_paprd_txdesc(ah, ds, bf->bf_state.bfs_paprd); 1699 ar9003_hw_set_paprd_txdesc(ah, ds, bf->bf_state.bfs_paprd);
1700 1700
1701 if (txctl->paprd)
1702 bf->bf_state.bfs_paprd_timestamp = jiffies;
1703
1704 ath_tx_send_normal(sc, txctl->txq, NULL, &bf_head); 1701 ath_tx_send_normal(sc, txctl->txq, NULL, &bf_head);
1705 } 1702 }
1706 1703
@@ -1874,9 +1871,7 @@ static void ath_tx_complete_buf(struct ath_softc *sc, struct ath_buf *bf,
1874 bf->bf_buf_addr = 0; 1871 bf->bf_buf_addr = 0;
1875 1872
1876 if (bf->bf_state.bfs_paprd) { 1873 if (bf->bf_state.bfs_paprd) {
1877 if (time_after(jiffies, 1874 if (!sc->paprd_pending)
1878 bf->bf_state.bfs_paprd_timestamp +
1879 msecs_to_jiffies(ATH_PAPRD_TIMEOUT)))
1880 dev_kfree_skb_any(skb); 1875 dev_kfree_skb_any(skb);
1881 else 1876 else
1882 complete(&sc->paprd_complete); 1877 complete(&sc->paprd_complete);