iwlwifi: map A-MPDU HW queue to mac80211 A-MPDU SW queue
[deliverable/linux.git] / drivers / net / wireless / iwlwifi / iwl4965-base.c
index ea8b9756643bd6a85f4a154f870c18d643766c4c..54534270d46f8ee91cbcc99d87d7ad487a4b226b 100644 (file)
@@ -46,7 +46,7 @@
 #include <asm/div64.h>
 
 #include "iwl-eeprom.h"
-#include "iwl-4965.h"
+#include "iwl-dev.h"
 #include "iwl-core.h"
 #include "iwl-io.h"
 #include "iwl-helpers.h"
@@ -2522,8 +2522,6 @@ static void iwl4965_txstatus_to_ieee(struct iwl_priv *priv,
 
        tx_sta->status.ack_signal = 0;
        tx_sta->status.excessive_retries = 0;
-       tx_sta->status.queue_length = 0;
-       tx_sta->status.queue_number = 0;
 
        if (in_interrupt())
                ieee80211_tx_status_irqsafe(priv->hw,
@@ -2570,12 +2568,6 @@ int iwl4965_tx_queue_reclaim(struct iwl_priv *priv, int txq_id, int index)
                nfreed++;
        }
 
-/*     if (iwl4965_queue_space(q) > q->low_mark && (txq_id >= 0) &&
-                       (txq_id != IWL_CMD_QUEUE_NUM) &&
-                       priv->mac80211_registered)
-               ieee80211_wake_queue(priv->hw, txq_id); */
-
-
        return nfreed;
 }
 
@@ -2659,8 +2651,6 @@ static int iwl4965_tx_status_reply_tx(struct iwl_priv *priv,
 
                tx_status = &(priv->txq[txq_id].txb[idx].status);
                tx_status->retry_count = tx_resp->failure_frame;
-               tx_status->queue_number = status & 0xff;
-               tx_status->queue_length = tx_resp->failure_rts;
                tx_status->control.flags &= ~IEEE80211_TXCTL_AMPDU;
                tx_status->flags = iwl4965_is_tx_success(status)?
                        IEEE80211_TX_STATUS_ACK : 0;
@@ -2801,7 +2791,7 @@ static void iwl4965_rx_reply_tx(struct iwl_priv *priv,
                }
 
                if (txq->q.read_ptr != (scd_ssn & 0xff)) {
-                       int freed;
+                       int freed, ampdu_q;
                        index = iwl_queue_dec_wrap(scd_ssn & 0xff, txq->q.n_bd);
                        IWL_DEBUG_TX_REPLY("Retry scheduler reclaim scd_ssn "
                                           "%d index %d\n", scd_ssn , index);
@@ -2810,9 +2800,15 @@ static void iwl4965_rx_reply_tx(struct iwl_priv *priv,
 
                        if (iwl4965_queue_space(&txq->q) > txq->q.low_mark &&
                            txq_id >= 0 && priv->mac80211_registered &&
-                           agg->state != IWL_EMPTYING_HW_QUEUE_DELBA)
-                               ieee80211_wake_queue(priv->hw, txq_id);
-
+                           agg->state != IWL_EMPTYING_HW_QUEUE_DELBA) {
+                               /* calculate mac80211 ampdu sw queue to wake */
+                               ampdu_q = txq_id - IWL_BACK_QUEUE_FIRST_ID +
+                                         priv->hw->queues;
+                               if (agg->state == IWL_AGG_OFF)
+                                       ieee80211_wake_queue(priv->hw, txq_id);
+                               else
+                                       ieee80211_wake_queue(priv->hw, ampdu_q);
+                       }
                        iwl4965_check_empty_hw_queue(priv, sta_id, tid, txq_id);
                }
        } else {
@@ -2820,9 +2816,6 @@ static void iwl4965_rx_reply_tx(struct iwl_priv *priv,
        tx_status = &(txq->txb[txq->q.read_ptr].status);
 
        tx_status->retry_count = tx_resp->failure_frame;
-       tx_status->queue_number = status;
-       tx_status->queue_length = tx_resp->bt_kill_count;
-       tx_status->queue_length |= tx_resp->failure_rts;
        tx_status->flags =
            iwl4965_is_tx_success(status) ? IEEE80211_TX_STATUS_ACK : 0;
        iwl4965_hwrate_to_tx_control(priv, le32_to_cpu(tx_resp->rate_n_flags),
@@ -2840,8 +2833,7 @@ static void iwl4965_rx_reply_tx(struct iwl_priv *priv,
                if (tid != MAX_TID_COUNT)
                        priv->stations[sta_id].tid[tid].tfds_in_queue -= freed;
                if (iwl4965_queue_space(&txq->q) > txq->q.low_mark &&
-                       (txq_id >= 0) &&
-                       priv->mac80211_registered)
+                       (txq_id >= 0) && priv->mac80211_registered)
                        ieee80211_wake_queue(priv->hw, txq_id);
                if (tid != MAX_TID_COUNT)
                        iwl4965_check_empty_hw_queue(priv, sta_id, tid, txq_id);
@@ -6346,7 +6338,7 @@ static int iwl4965_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
        return ret;
 }
 
-static int iwl4965_mac_conf_tx(struct ieee80211_hw *hw, int queue,
+static int iwl4965_mac_conf_tx(struct ieee80211_hw *hw, u16 queue,
                           const struct ieee80211_tx_queue_params *params)
 {
        struct iwl_priv *priv = hw->priv;
@@ -6420,9 +6412,9 @@ static int iwl4965_mac_get_tx_stats(struct ieee80211_hw *hw,
                q = &txq->q;
                avail = iwl4965_queue_space(q);
 
-               stats->data[i].len = q->n_window - avail;
-               stats->data[i].limit = q->n_window - q->high_mark;
-               stats->data[i].count = q->n_window;
+               stats[i].len = q->n_window - avail;
+               stats[i].limit = q->n_window - q->high_mark;
+               stats[i].count = q->n_window;
 
        }
        spin_unlock_irqrestore(&priv->lock, flags);
This page took 0.050196 seconds and 5 git commands to generate.