ath9k: fix calibration on 5 ghz
[openwrt.git] / package / mac80211 / patches / 541-ath9k_aggr_queue_cleanup.patch
index e196cedfab03d5ddc76ad645ea045a0cdb58518c..27c144fba167e474490b2a91a9113dc9237ab2f4 100644 (file)
@@ -6,8 +6,8 @@
  struct ath_frame_info {
 +      struct ath_buf *bf;
        int framelen;
-       u32 keyix;
        enum ath9k_key_type keytype;
+       u8 keyix;
 @@ -235,7 +236,7 @@ struct ath_buf {
  
  struct ath_atx_tid {
@@ -92,7 +92,7 @@
                if (fi->retries)
                        ath_tx_update_baw(sc, tid, fi->seqno);
  
-@@ -352,7 +353,8 @@ static void ath_tx_complete_aggr(struct 
+@@ -349,7 +350,8 @@ static void ath_tx_complete_aggr(struct 
        struct ieee80211_tx_info *tx_info;
        struct ath_atx_tid *tid = NULL;
        struct ath_buf *bf_next, *bf_last = bf->bf_lastbf;
        u16 seq_st = 0, acked_cnt = 0, txfail_cnt = 0;
        u32 ba[WME_BA_BMP_SIZE >> 5];
        int isaggr, txfail, txpending, sendbar = 0, needreset = 0, nbad = 0;
-@@ -430,8 +432,7 @@ static void ath_tx_complete_aggr(struct 
+@@ -422,8 +424,7 @@ static void ath_tx_complete_aggr(struct 
                }
        }
  
  
        ath_tx_count_frames(sc, bf, ts, txok, &nframes, &nbad);
        while (bf) {
-@@ -476,10 +477,10 @@ static void ath_tx_complete_aggr(struct 
+@@ -467,10 +468,10 @@ static void ath_tx_complete_aggr(struct 
                 * Make sure the last desc is reclaimed if it
                 * not a holding desc.
                 */
  
                if (!txpending || (tid->state & AGGR_CLEANUP)) {
                        /*
-@@ -530,7 +531,7 @@ static void ath_tx_complete_aggr(struct 
+@@ -521,7 +522,7 @@ static void ath_tx_complete_aggr(struct 
  
                                        ath9k_hw_cleartxdesc(sc->sc_ah,
                                                             tbf->bf_desc);
                                } else {
                                        /*
                                         * Clear descriptor status words for
-@@ -545,21 +546,21 @@ static void ath_tx_complete_aggr(struct 
+@@ -536,21 +537,21 @@ static void ath_tx_complete_aggr(struct 
                         * Put this buffer to the temporary pending
                         * queue to retain ordering
                         */
                if (!an->sleeping)
                        ath_tx_queue_tid(txq, tid);
                spin_unlock_bh(&txq->axq_lock);
-@@ -730,19 +731,22 @@ static enum ATH_AGGR_STATUS ath_tx_form_
+@@ -743,19 +744,22 @@ static enum ATH_AGGR_STATUS ath_tx_form_
                                             int *aggr_len)
  {
  #define PADBYTES(_len) ((4 - ((_len) % 4)) % 4)
  
                /* do not step over block-ack window */
                if (!BAW_WITHIN(tid->seq_start, tid->baw_size, fi->seqno)) {
-@@ -794,7 +798,9 @@ static enum ATH_AGGR_STATUS ath_tx_form_
+@@ -808,7 +812,9 @@ static enum ATH_AGGR_STATUS ath_tx_form_
                if (!fi->retries)
                        ath_tx_addto_baw(sc, tid, fi->seqno);
                ath9k_hw_set11n_aggr_middle(sc->sc_ah, bf->bf_desc, ndelim);
                if (bf_prev) {
                        bf_prev->bf_next = bf;
                        ath9k_hw_set_desc_link(sc->sc_ah, bf_prev->bf_desc,
-@@ -802,7 +808,7 @@ static enum ATH_AGGR_STATUS ath_tx_form_
+@@ -816,7 +822,7 @@ static enum ATH_AGGR_STATUS ath_tx_form_
                }
                bf_prev = bf;
  
  
        *aggr_len = al;
  
-@@ -820,7 +826,7 @@ static void ath_tx_sched_aggr(struct ath
+@@ -834,7 +840,7 @@ static void ath_tx_sched_aggr(struct ath
        int aggr_len;
  
        do {
                        return;
  
                INIT_LIST_HEAD(&bf_q);
-@@ -941,7 +947,7 @@ bool ath_tx_aggr_sleep(struct ath_softc 
+@@ -955,7 +961,7 @@ bool ath_tx_aggr_sleep(struct ath_softc 
  
                spin_lock_bh(&txq->axq_lock);
  
                        buffered = true;
  
                tid->sched = false;
-@@ -974,7 +980,7 @@ void ath_tx_aggr_wakeup(struct ath_softc
+@@ -988,7 +994,7 @@ void ath_tx_aggr_wakeup(struct ath_softc
                spin_lock_bh(&txq->axq_lock);
                ac->clear_ps_filter = true;
  
                        ath_tx_queue_tid(txq, tid);
                        ath_txq_schedule(sc, txq);
                }
-@@ -1318,7 +1324,7 @@ void ath_txq_schedule(struct ath_softc *
+@@ -1332,7 +1338,7 @@ void ath_txq_schedule(struct ath_softc *
                         * add tid to round-robin queue if more frames
                         * are pending for the tid
                         */
                                ath_tx_queue_tid(txq, tid);
  
                        if (tid == last_tid ||
-@@ -1424,7 +1430,7 @@ static void ath_tx_send_ampdu(struct ath
+@@ -1438,7 +1444,7 @@ static void ath_tx_send_ampdu(struct ath
         * - seqno is not within block-ack window
         * - h/w queue depth exceeds low water mark
         */
            !BAW_WITHIN(tid->seq_start, tid->baw_size, fi->seqno) ||
            txctl->txq->axq_ampdu_depth >= ATH_AGGR_MIN_QDEPTH) {
                /*
-@@ -1432,7 +1438,7 @@ static void ath_tx_send_ampdu(struct ath
+@@ -1446,7 +1452,7 @@ static void ath_tx_send_ampdu(struct ath
                 * for aggregation.
                 */
                TX_STAT_INC(txctl->txq->axq_qnum, a_queued_sw);
                if (!txctl->an || !txctl->an->sleeping)
                        ath_tx_queue_tid(txctl->txq, tid);
                return;
-@@ -1763,6 +1769,7 @@ static struct ath_buf *ath_tx_setup_buff
+@@ -1777,6 +1783,7 @@ static struct ath_buf *ath_tx_setup_buff
                            bf->bf_buf_addr,
                            txq->axq_qnum);
  
  
        return bf;
  }
-@@ -2380,7 +2387,7 @@ void ath_tx_node_init(struct ath_softc *
+@@ -2394,7 +2401,7 @@ void ath_tx_node_init(struct ath_softc *
                tid->sched     = false;
                tid->paused    = false;
                tid->state &= ~AGGR_CLEANUP;