mac80211: update to latest version, fix tx gain patch
[openwrt.git] / package / mac80211 / patches / 570-ath9k_config_qlen.patch
1 --- a/drivers/net/wireless/ath/ath9k/ath9k.h
2 +++ b/drivers/net/wireless/ath/ath9k/ath9k.h
3 @@ -297,6 +297,7 @@ struct ath_tx {
4         struct ath_txq txq[ATH9K_NUM_TX_QUEUES];
5         struct ath_descdma txdma;
6         struct ath_txq *txq_map[WME_NUM_AC];
7 +       u32 txq_max_pending[WME_NUM_AC];
8  };
9  
10  struct ath_rx_edma {
11 --- a/drivers/net/wireless/ath/ath9k/init.c
12 +++ b/drivers/net/wireless/ath/ath9k/init.c
13 @@ -436,6 +436,7 @@ static int ath9k_init_queues(struct ath_
14         for (i = 0; i < WME_NUM_AC; i++) {
15                 sc->tx.txq_map[i] = ath_txq_setup(sc, ATH9K_TX_QUEUE_DATA, i);
16                 sc->tx.txq_map[i]->mac80211_qnum = i;
17 +               sc->tx.txq_max_pending[i] = ATH_MAX_QDEPTH;
18         }
19         return 0;
20  }
21 --- a/drivers/net/wireless/ath/ath9k/xmit.c
22 +++ b/drivers/net/wireless/ath/ath9k/xmit.c
23 @@ -1987,7 +1987,8 @@ int ath_tx_start(struct ieee80211_hw *hw
24  
25         ath_txq_lock(sc, txq);
26         if (txq == sc->tx.txq_map[q] &&
27 -           ++txq->pending_frames > ATH_MAX_QDEPTH && !txq->stopped) {
28 +           ++txq->pending_frames > sc->tx.txq_max_pending[q] &&
29 +           !txq->stopped) {
30                 ieee80211_stop_queue(sc->hw, q);
31                 txq->stopped = true;
32         }
33 @@ -2046,7 +2047,8 @@ static void ath_tx_complete(struct ath_s
34                 if (WARN_ON(--txq->pending_frames < 0))
35                         txq->pending_frames = 0;
36  
37 -               if (txq->stopped && txq->pending_frames < ATH_MAX_QDEPTH) {
38 +               if (txq->stopped &&
39 +                   txq->pending_frames < sc->tx.txq_max_pending[q]) {
40                         ieee80211_wake_queue(sc->hw, q);
41                         txq->stopped = false;
42                 }
43 --- a/drivers/net/wireless/ath/ath9k/debug.c
44 +++ b/drivers/net/wireless/ath/ath9k/debug.c
45 @@ -1701,6 +1701,14 @@ int ath9k_init_debug(struct ath_hw *ah)
46                             &fops_interrupt);
47         debugfs_create_file("xmit", S_IRUSR, sc->debug.debugfs_phy, sc,
48                             &fops_xmit);
49 +       debugfs_create_u32("qlen_bk", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy,
50 +                          &sc->tx.txq_max_pending[WME_AC_BK]);
51 +       debugfs_create_u32("qlen_be", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy,
52 +                          &sc->tx.txq_max_pending[WME_AC_BE]);
53 +       debugfs_create_u32("qlen_vi", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy,
54 +                          &sc->tx.txq_max_pending[WME_AC_VI]);
55 +       debugfs_create_u32("qlen_vo", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy,
56 +                          &sc->tx.txq_max_pending[WME_AC_VO]);
57         debugfs_create_file("stations", S_IRUSR, sc->debug.debugfs_phy, sc,
58                             &fops_stations);
59         debugfs_create_file("misc", S_IRUSR, sc->debug.debugfs_phy, sc,