aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-tx.c
diff options
context:
space:
mode:
authorJohn W. Linville <linville@tuxdriver.com>2010-02-26 16:54:45 -0500
committerJohn W. Linville <linville@tuxdriver.com>2010-02-26 16:54:45 -0500
commit64463da913bc8f791980ba28d93ac5e716ab9cc5 (patch)
treecf958678f7cf0b615a52356beb2d18240424ab4a /drivers/net/wireless/iwlwifi/iwl-tx.c
parent4a6967b88af02eebeedfbb91bc09160750225bb5 (diff)
parenta120e912eb51e347f36c71b60a1d13af74d30e83 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6
Conflicts: drivers/net/wireless/iwlwifi/iwl-core.h net/mac80211/rate.c
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-tx.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-tx.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-tx.c b/drivers/net/wireless/iwlwifi/iwl-tx.c
index 38655ad8f43c..10701b8eef23 100644
--- a/drivers/net/wireless/iwlwifi/iwl-tx.c
+++ b/drivers/net/wireless/iwlwifi/iwl-tx.c
@@ -118,6 +118,20 @@ void iwl_txq_update_write_ptr(struct iwl_priv *priv, struct iwl_tx_queue *txq)
118EXPORT_SYMBOL(iwl_txq_update_write_ptr); 118EXPORT_SYMBOL(iwl_txq_update_write_ptr);
119 119
120 120
121void iwl_free_tfds_in_queue(struct iwl_priv *priv,
122 int sta_id, int tid, int freed)
123{
124 if (priv->stations[sta_id].tid[tid].tfds_in_queue >= freed)
125 priv->stations[sta_id].tid[tid].tfds_in_queue -= freed;
126 else {
127 IWL_ERR(priv, "free more than tfds_in_queue (%u:%d)\n",
128 priv->stations[sta_id].tid[tid].tfds_in_queue,
129 freed);
130 priv->stations[sta_id].tid[tid].tfds_in_queue = 0;
131 }
132}
133EXPORT_SYMBOL(iwl_free_tfds_in_queue);
134
121/** 135/**
122 * iwl_tx_queue_free - Deallocate DMA queue. 136 * iwl_tx_queue_free - Deallocate DMA queue.
123 * @txq: Transmit queue to deallocate. 137 * @txq: Transmit queue to deallocate.
@@ -1127,6 +1141,7 @@ int iwl_tx_queue_reclaim(struct iwl_priv *priv, int txq_id, int index)
1127 struct iwl_queue *q = &txq->q; 1141 struct iwl_queue *q = &txq->q;
1128 struct iwl_tx_info *tx_info; 1142 struct iwl_tx_info *tx_info;
1129 int nfreed = 0; 1143 int nfreed = 0;
1144 struct ieee80211_hdr *hdr;
1130 1145
1131 if ((index >= q->n_bd) || (iwl_queue_used(q, index) == 0)) { 1146 if ((index >= q->n_bd) || (iwl_queue_used(q, index) == 0)) {
1132 IWL_ERR(priv, "Read index for DMA queue txq id (%d), index %d, " 1147 IWL_ERR(priv, "Read index for DMA queue txq id (%d), index %d, "
@@ -1141,13 +1156,16 @@ int iwl_tx_queue_reclaim(struct iwl_priv *priv, int txq_id, int index)
1141 1156
1142 tx_info = &txq->txb[txq->q.read_ptr]; 1157 tx_info = &txq->txb[txq->q.read_ptr];
1143 iwl_tx_status(priv, tx_info->skb[0]); 1158 iwl_tx_status(priv, tx_info->skb[0]);
1159
1160 hdr = (struct ieee80211_hdr *)tx_info->skb[0]->data;
1161 if (hdr && ieee80211_is_data_qos(hdr->frame_control))
1162 nfreed++;
1144 tx_info->skb[0] = NULL; 1163 tx_info->skb[0] = NULL;
1145 1164
1146 if (priv->cfg->ops->lib->txq_inval_byte_cnt_tbl) 1165 if (priv->cfg->ops->lib->txq_inval_byte_cnt_tbl)
1147 priv->cfg->ops->lib->txq_inval_byte_cnt_tbl(priv, txq); 1166 priv->cfg->ops->lib->txq_inval_byte_cnt_tbl(priv, txq);
1148 1167
1149 priv->cfg->ops->lib->txq_free_tfd(priv, txq); 1168 priv->cfg->ops->lib->txq_free_tfd(priv, txq);
1150 nfreed++;
1151 } 1169 }
1152 return nfreed; 1170 return nfreed;
1153} 1171}
@@ -1561,7 +1579,7 @@ void iwl_rx_reply_compressed_ba(struct iwl_priv *priv,
1561 if (txq->q.read_ptr != (ba_resp_scd_ssn & 0xff)) { 1579 if (txq->q.read_ptr != (ba_resp_scd_ssn & 0xff)) {
1562 /* calculate mac80211 ampdu sw queue to wake */ 1580 /* calculate mac80211 ampdu sw queue to wake */
1563 int freed = iwl_tx_queue_reclaim(priv, scd_flow, index); 1581 int freed = iwl_tx_queue_reclaim(priv, scd_flow, index);
1564 priv->stations[sta_id].tid[tid].tfds_in_queue -= freed; 1582 iwl_free_tfds_in_queue(priv, sta_id, tid, freed);
1565 1583
1566 if ((iwl_queue_space(&txq->q) > txq->q.low_mark) && 1584 if ((iwl_queue_space(&txq->q) > txq->q.low_mark) &&
1567 priv->mac80211_registered && 1585 priv->mac80211_registered &&