aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2010-11-10 21:25:44 -0500
committerWey-Yi Guy <wey-yi.w.guy@intel.com>2010-11-16 10:45:49 -0500
commit549a04e092e5e043df82fd0541f3b67ab488359b (patch)
tree440be5b9af0f6193d69e4202bc488acacb2236f7
parent4bea9b990205e4a3d432d9d6c29687215618a306 (diff)
iwlwifi: pass txq to wake/stop queue
Instead of passing the txq->swq_id, pass the txq struct directly to make sure that in the future nobody will pass an invalid number. Only three places actually change from using the txq_id or the skb's queue_mapping to now using txq->swq_id as well. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-3945.c2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-4965.c4
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-lib.c4
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-tx.c4
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-helpers.h8
-rw-r--r--drivers/net/wireless/iwlwifi/iwl3945-base.c2
6 files changed, 14 insertions, 10 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.c b/drivers/net/wireless/iwlwifi/iwl-3945.c
index 4503245211ac..56f4ca7e49d9 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945.c
+++ b/drivers/net/wireless/iwlwifi/iwl-3945.c
@@ -297,7 +297,7 @@ static void iwl3945_tx_queue_reclaim(struct iwl_priv *priv,
297 if (iwl_queue_space(q) > q->low_mark && (txq_id >= 0) && 297 if (iwl_queue_space(q) > q->low_mark && (txq_id >= 0) &&
298 (txq_id != IWL39_CMD_QUEUE_NUM) && 298 (txq_id != IWL39_CMD_QUEUE_NUM) &&
299 priv->mac80211_registered) 299 priv->mac80211_registered)
300 iwl_wake_queue(priv, txq_id); 300 iwl_wake_queue(priv, txq);
301} 301}
302 302
303/** 303/**
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c
index 19400792a3fe..2ec868d328b9 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965.c
@@ -2239,7 +2239,7 @@ static void iwl4965_rx_reply_tx(struct iwl_priv *priv,
2239 if (priv->mac80211_registered && 2239 if (priv->mac80211_registered &&
2240 (iwl_queue_space(&txq->q) > txq->q.low_mark) && 2240 (iwl_queue_space(&txq->q) > txq->q.low_mark) &&
2241 (agg->state != IWL_EMPTYING_HW_QUEUE_DELBA)) 2241 (agg->state != IWL_EMPTYING_HW_QUEUE_DELBA))
2242 iwl_wake_queue(priv, txq->swq_id); 2242 iwl_wake_queue(priv, txq);
2243 } 2243 }
2244 } else { 2244 } else {
2245 info->status.rates[0].count = tx_resp->failure_frame + 1; 2245 info->status.rates[0].count = tx_resp->failure_frame + 1;
@@ -2263,7 +2263,7 @@ static void iwl4965_rx_reply_tx(struct iwl_priv *priv,
2263 2263
2264 if (priv->mac80211_registered && 2264 if (priv->mac80211_registered &&
2265 (iwl_queue_space(&txq->q) > txq->q.low_mark)) 2265 (iwl_queue_space(&txq->q) > txq->q.low_mark))
2266 iwl_wake_queue(priv, txq_id); 2266 iwl_wake_queue(priv, txq);
2267 } 2267 }
2268 if (qc && likely(sta_id != IWL_INVALID_STATION)) 2268 if (qc && likely(sta_id != IWL_INVALID_STATION))
2269 iwlagn_txq_check_empty(priv, sta_id, tid, txq_id); 2269 iwlagn_txq_check_empty(priv, sta_id, tid, txq_id);
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
index 2ba83b5bbb8e..eef90b5c9728 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
@@ -446,7 +446,7 @@ static void iwlagn_rx_reply_tx(struct iwl_priv *priv,
446 if (priv->mac80211_registered && 446 if (priv->mac80211_registered &&
447 (iwl_queue_space(&txq->q) > txq->q.low_mark) && 447 (iwl_queue_space(&txq->q) > txq->q.low_mark) &&
448 (agg->state != IWL_EMPTYING_HW_QUEUE_DELBA)) 448 (agg->state != IWL_EMPTYING_HW_QUEUE_DELBA))
449 iwl_wake_queue(priv, txq->swq_id); 449 iwl_wake_queue(priv, txq);
450 } 450 }
451 } else { 451 } else {
452 BUG_ON(txq_id != txq->swq_id); 452 BUG_ON(txq_id != txq->swq_id);
@@ -456,7 +456,7 @@ static void iwlagn_rx_reply_tx(struct iwl_priv *priv,
456 456
457 if (priv->mac80211_registered && 457 if (priv->mac80211_registered &&
458 (iwl_queue_space(&txq->q) > txq->q.low_mark)) 458 (iwl_queue_space(&txq->q) > txq->q.low_mark))
459 iwl_wake_queue(priv, txq_id); 459 iwl_wake_queue(priv, txq);
460 } 460 }
461 461
462 iwlagn_txq_check_empty(priv, sta_id, tid, txq_id); 462 iwlagn_txq_check_empty(priv, sta_id, tid, txq_id);
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-tx.c b/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
index 0fc86c9d8fd4..179a9c85045c 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
@@ -783,7 +783,7 @@ int iwlagn_tx_skb(struct iwl_priv *priv, struct sk_buff *skb)
783 iwl_txq_update_write_ptr(priv, txq); 783 iwl_txq_update_write_ptr(priv, txq);
784 spin_unlock_irqrestore(&priv->lock, flags); 784 spin_unlock_irqrestore(&priv->lock, flags);
785 } else { 785 } else {
786 iwl_stop_queue(priv, txq->swq_id); 786 iwl_stop_queue(priv, txq);
787 } 787 }
788 } 788 }
789 789
@@ -1408,7 +1408,7 @@ void iwlagn_rx_reply_compressed_ba(struct iwl_priv *priv,
1408 if ((iwl_queue_space(&txq->q) > txq->q.low_mark) && 1408 if ((iwl_queue_space(&txq->q) > txq->q.low_mark) &&
1409 priv->mac80211_registered && 1409 priv->mac80211_registered &&
1410 (agg->state != IWL_EMPTYING_HW_QUEUE_DELBA)) 1410 (agg->state != IWL_EMPTYING_HW_QUEUE_DELBA))
1411 iwl_wake_queue(priv, txq->swq_id); 1411 iwl_wake_queue(priv, txq);
1412 1412
1413 iwlagn_txq_check_empty(priv, sta_id, tid, scd_flow); 1413 iwlagn_txq_check_empty(priv, sta_id, tid, scd_flow);
1414 } 1414 }
diff --git a/drivers/net/wireless/iwlwifi/iwl-helpers.h b/drivers/net/wireless/iwlwifi/iwl-helpers.h
index 1aaef70deaec..23fa8e88356b 100644
--- a/drivers/net/wireless/iwlwifi/iwl-helpers.h
+++ b/drivers/net/wireless/iwlwifi/iwl-helpers.h
@@ -116,8 +116,10 @@ static inline u8 iwl_virtual_agg_queue_num(u8 ac, u8 hwq)
116 return 0x80 | (hwq << 2) | ac; 116 return 0x80 | (hwq << 2) | ac;
117} 117}
118 118
119static inline void iwl_wake_queue(struct iwl_priv *priv, u8 queue) 119static inline void iwl_wake_queue(struct iwl_priv *priv,
120 struct iwl_tx_queue *txq)
120{ 121{
122 u8 queue = txq->swq_id;
121 u8 ac = queue; 123 u8 ac = queue;
122 u8 hwq = queue; 124 u8 hwq = queue;
123 125
@@ -131,8 +133,10 @@ static inline void iwl_wake_queue(struct iwl_priv *priv, u8 queue)
131 ieee80211_wake_queue(priv->hw, ac); 133 ieee80211_wake_queue(priv->hw, ac);
132} 134}
133 135
134static inline void iwl_stop_queue(struct iwl_priv *priv, u8 queue) 136static inline void iwl_stop_queue(struct iwl_priv *priv,
137 struct iwl_tx_queue *txq)
135{ 138{
139 u8 queue = txq->swq_id;
136 u8 ac = queue; 140 u8 ac = queue;
137 u8 hwq = queue; 141 u8 hwq = queue;
138 142
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index a55b4623e1c8..b8c490624d26 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -662,7 +662,7 @@ static int iwl3945_tx_skb(struct iwl_priv *priv, struct sk_buff *skb)
662 spin_unlock_irqrestore(&priv->lock, flags); 662 spin_unlock_irqrestore(&priv->lock, flags);
663 } 663 }
664 664
665 iwl_stop_queue(priv, skb_get_queue_mapping(skb)); 665 iwl_stop_queue(priv, txq);
666 } 666 }
667 667
668 return 0; 668 return 0;