if (iwl_queue_space(q) > q->low_mark && (txq_id >= 0) &&
                        (txq_id != IWL39_CMD_QUEUE_NUM) &&
                        priv->mac80211_registered)
-               iwl_wake_queue(priv, txq_id);
+               iwl_wake_queue(priv, txq);
 }
 
 /**
 
                        if (priv->mac80211_registered &&
                            (iwl_queue_space(&txq->q) > txq->q.low_mark) &&
                            (agg->state != IWL_EMPTYING_HW_QUEUE_DELBA))
-                               iwl_wake_queue(priv, txq->swq_id);
+                               iwl_wake_queue(priv, txq);
                }
        } else {
                info->status.rates[0].count = tx_resp->failure_frame + 1;
 
                if (priv->mac80211_registered &&
                    (iwl_queue_space(&txq->q) > txq->q.low_mark))
-                       iwl_wake_queue(priv, txq_id);
+                       iwl_wake_queue(priv, txq);
        }
        if (qc && likely(sta_id != IWL_INVALID_STATION))
                iwlagn_txq_check_empty(priv, sta_id, tid, txq_id);
 
                        if (priv->mac80211_registered &&
                            (iwl_queue_space(&txq->q) > txq->q.low_mark) &&
                            (agg->state != IWL_EMPTYING_HW_QUEUE_DELBA))
-                               iwl_wake_queue(priv, txq->swq_id);
+                               iwl_wake_queue(priv, txq);
                }
        } else {
                BUG_ON(txq_id != txq->swq_id);
 
                if (priv->mac80211_registered &&
                    (iwl_queue_space(&txq->q) > txq->q.low_mark))
-                       iwl_wake_queue(priv, txq_id);
+                       iwl_wake_queue(priv, txq);
        }
 
        iwlagn_txq_check_empty(priv, sta_id, tid, txq_id);
 
                        iwl_txq_update_write_ptr(priv, txq);
                        spin_unlock_irqrestore(&priv->lock, flags);
                } else {
-                       iwl_stop_queue(priv, txq->swq_id);
+                       iwl_stop_queue(priv, txq);
                }
        }
 
                if ((iwl_queue_space(&txq->q) > txq->q.low_mark) &&
                    priv->mac80211_registered &&
                    (agg->state != IWL_EMPTYING_HW_QUEUE_DELBA))
-                       iwl_wake_queue(priv, txq->swq_id);
+                       iwl_wake_queue(priv, txq);
 
                iwlagn_txq_check_empty(priv, sta_id, tid, scd_flow);
        }
 
        return 0x80 | (hwq << 2) | ac;
 }
 
-static inline void iwl_wake_queue(struct iwl_priv *priv, u8 queue)
+static inline void iwl_wake_queue(struct iwl_priv *priv,
+                                 struct iwl_tx_queue *txq)
 {
+       u8 queue = txq->swq_id;
        u8 ac = queue;
        u8 hwq = queue;
 
                        ieee80211_wake_queue(priv->hw, ac);
 }
 
-static inline void iwl_stop_queue(struct iwl_priv *priv, u8 queue)
+static inline void iwl_stop_queue(struct iwl_priv *priv,
+                                 struct iwl_tx_queue *txq)
 {
+       u8 queue = txq->swq_id;
        u8 ac = queue;
        u8 hwq = queue;
 
 
                        spin_unlock_irqrestore(&priv->lock, flags);
                }
 
-               iwl_stop_queue(priv, skb_get_queue_mapping(skb));
+               iwl_stop_queue(priv, txq);
        }
 
        return 0;