ssb: update ssb to version from linux-next-20110311
[openwrt.git] / package / mac80211 / patches / 571-ath9k_fix_dma_stop.patch
1 --- a/drivers/net/wireless/ath/ath9k/xmit.c
2 +++ b/drivers/net/wireless/ath/ath9k/xmit.c
3 @@ -1271,16 +1271,14 @@ bool ath_drain_all_txq(struct ath_softc
4 if (sc->sc_flags & SC_OP_INVALID)
5 return true;
6
7 - /* Stop beacon queue */
8 - ath9k_hw_stoptxdma(sc->sc_ah, sc->beacon.beaconq);
9 + ath9k_hw_abort_tx_dma(ah);
10
11 - /* Stop data queues */
12 + /* Check if any queue remains active */
13 for (i = 0; i < ATH9K_NUM_TX_QUEUES; i++) {
14 - if (ATH_TXQ_SETUP(sc, i)) {
15 - txq = &sc->tx.txq[i];
16 - ath9k_hw_stoptxdma(ah, txq->axq_qnum);
17 - npend += ath9k_hw_numtxpending(ah, txq->axq_qnum);
18 - }
19 + if (!ATH_TXQ_SETUP(sc, i))
20 + continue;
21 +
22 + npend += ath9k_hw_numtxpending(ah, sc->tx.txq[i].axq_qnum);
23 }
24
25 if (npend)
26 --- a/drivers/net/wireless/ath/ath9k/mac.c
27 +++ b/drivers/net/wireless/ath/ath9k/mac.c
28 @@ -143,6 +143,34 @@ bool ath9k_hw_updatetxtriglevel(struct a
29 }
30 EXPORT_SYMBOL(ath9k_hw_updatetxtriglevel);
31
32 +void ath9k_hw_abort_tx_dma(struct ath_hw *ah)
33 +{
34 + int i, q;
35 +
36 + REG_WRITE(ah, AR_Q_TXD, AR_Q_TXD_M);
37 +
38 + REG_SET_BIT(ah, AR_PCU_MISC, AR_PCU_FORCE_QUIET_COLL | AR_PCU_CLEAR_VMF);
39 + REG_SET_BIT(ah, AR_DIAG_SW, AR_DIAG_FORCE_CH_IDLE_HIGH);
40 + REG_SET_BIT(ah, AR_D_GBL_IFS_MISC, AR_D_GBL_IFS_MISC_IGNORE_BACKOFF);
41 +
42 + for (q = 0; q < AR_NUM_QCU; q++) {
43 + for (i = 0; i < 1000; i++) {
44 + if (i)
45 + udelay(5);
46 +
47 + if (!ath9k_hw_numtxpending(ah, q))
48 + break;
49 + }
50 + }
51 +
52 + REG_CLR_BIT(ah, AR_PCU_MISC, AR_PCU_FORCE_QUIET_COLL | AR_PCU_CLEAR_VMF);
53 + REG_CLR_BIT(ah, AR_DIAG_SW, AR_DIAG_FORCE_CH_IDLE_HIGH);
54 + REG_CLR_BIT(ah, AR_D_GBL_IFS_MISC, AR_D_GBL_IFS_MISC_IGNORE_BACKOFF);
55 +
56 + REG_WRITE(ah, AR_Q_TXD, 0);
57 +}
58 +EXPORT_SYMBOL(ath9k_hw_abort_tx_dma);
59 +
60 bool ath9k_hw_stoptxdma(struct ath_hw *ah, u32 q)
61 {
62 #define ATH9K_TX_STOP_DMA_TIMEOUT 4000 /* usec */
63 --- a/drivers/net/wireless/ath/ath9k/mac.h
64 +++ b/drivers/net/wireless/ath/ath9k/mac.h
65 @@ -676,6 +676,7 @@ void ath9k_hw_cleartxdesc(struct ath_hw
66 u32 ath9k_hw_numtxpending(struct ath_hw *ah, u32 q);
67 bool ath9k_hw_updatetxtriglevel(struct ath_hw *ah, bool bIncTrigLevel);
68 bool ath9k_hw_stoptxdma(struct ath_hw *ah, u32 q);
69 +void ath9k_hw_abort_tx_dma(struct ath_hw *ah);
70 void ath9k_hw_gettxintrtxqs(struct ath_hw *ah, u32 *txqs);
71 bool ath9k_hw_set_txq_props(struct ath_hw *ah, int q,
72 const struct ath9k_tx_queue_info *qinfo);
This page took 0.042565 seconds and 5 git commands to generate.