aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2012-08-27 11:00:07 -0400
committerJohn W. Linville <linville@tuxdriver.com>2012-09-05 14:53:32 -0400
commit51dea9be7e01d7e825ed1882246693f09c21374c (patch)
tree1b39489085cc55c0276a29c8eb58ecd39e974b93 /drivers/net
parent1630d25fd00f195f0923d4b895e0529fdbba83c3 (diff)
ath9k: fix PA linearization calibration related crash
Before PAPRD training can run, the card needs to have sent a packet for thermal calibration. Sending a dummy packet with the PAPRD training flag set causes a crash under some circumstance. Fix the code by replacing the dummy tx with a delay that waits for a real packet tx to have occurred. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/ath/ath9k/hw.c2
-rw-r--r--drivers/net/wireless/ath/ath9k/hw.h1
-rw-r--r--drivers/net/wireless/ath/ath9k/link.c9
-rw-r--r--drivers/net/wireless/ath/ath9k/xmit.c3
4 files changed, 7 insertions, 8 deletions
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index 64a00d2f18f2..e4b9f35343e5 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -1775,6 +1775,8 @@ int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan,
1775 /* Operating channel changed, reset channel calibration data */ 1775 /* Operating channel changed, reset channel calibration data */
1776 memset(caldata, 0, sizeof(*caldata)); 1776 memset(caldata, 0, sizeof(*caldata));
1777 ath9k_init_nfcal_hist_buffer(ah, chan); 1777 ath9k_init_nfcal_hist_buffer(ah, chan);
1778 } else if (caldata) {
1779 caldata->paprd_packet_sent = false;
1778 } 1780 }
1779 ah->noise = ath9k_hw_getchan_noise(ah, chan); 1781 ah->noise = ath9k_hw_getchan_noise(ah, chan);
1780 1782
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h
index ce7332c64efb..6599a75f01fe 100644
--- a/drivers/net/wireless/ath/ath9k/hw.h
+++ b/drivers/net/wireless/ath/ath9k/hw.h
@@ -405,6 +405,7 @@ struct ath9k_hw_cal_data {
405 int8_t iCoff; 405 int8_t iCoff;
406 int8_t qCoff; 406 int8_t qCoff;
407 bool rtt_done; 407 bool rtt_done;
408 bool paprd_packet_sent;
408 bool paprd_done; 409 bool paprd_done;
409 bool nfcal_pending; 410 bool nfcal_pending;
410 bool nfcal_interference; 411 bool nfcal_interference;
diff --git a/drivers/net/wireless/ath/ath9k/link.c b/drivers/net/wireless/ath/ath9k/link.c
index 1c241921f95e..825a29cc9313 100644
--- a/drivers/net/wireless/ath/ath9k/link.c
+++ b/drivers/net/wireless/ath/ath9k/link.c
@@ -256,7 +256,7 @@ void ath_paprd_calibrate(struct work_struct *work)
256 int len = 1800; 256 int len = 1800;
257 int ret; 257 int ret;
258 258
259 if (!caldata) 259 if (!caldata || !caldata->paprd_packet_sent || caldata->paprd_done)
260 return; 260 return;
261 261
262 ath9k_ps_wakeup(sc); 262 ath9k_ps_wakeup(sc);
@@ -283,13 +283,6 @@ void ath_paprd_calibrate(struct work_struct *work)
283 continue; 283 continue;
284 284
285 chain_ok = 0; 285 chain_ok = 0;
286
287 ath_dbg(common, CALIBRATE,
288 "Sending PAPRD frame for thermal measurement on chain %d\n",
289 chain);
290 if (!ath_paprd_send_frame(sc, skb, chain))
291 goto fail_paprd;
292
293 ar9003_paprd_setup_gain_table(ah, chain); 286 ar9003_paprd_setup_gain_table(ah, chain);
294 287
295 ath_dbg(common, CALIBRATE, 288 ath_dbg(common, CALIBRATE,
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c
index 2c9da6b2ecb1..0d4155aec48d 100644
--- a/drivers/net/wireless/ath/ath9k/xmit.c
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
@@ -2018,6 +2018,9 @@ static void ath_tx_complete(struct ath_softc *sc, struct sk_buff *skb,
2018 2018
2019 ath_dbg(common, XMIT, "TX complete: skb: %p\n", skb); 2019 ath_dbg(common, XMIT, "TX complete: skb: %p\n", skb);
2020 2020
2021 if (sc->sc_ah->caldata)
2022 sc->sc_ah->caldata->paprd_packet_sent = true;
2023
2021 if (!(tx_flags & ATH_TX_ERROR)) 2024 if (!(tx_flags & ATH_TX_ERROR))
2022 /* Frame was ACKed */ 2025 /* Frame was ACKed */
2023 tx_info->flags |= IEEE80211_TX_STAT_ACK; 2026 tx_info->flags |= IEEE80211_TX_STAT_ACK;