int iwl4965_check_empty_hw_queue(struct iwl_priv *priv, int sta_id,
                                         u8 tid, int txq_id)
 {
-       struct iwl4965_queue *q = &priv->txq[txq_id].q;
+       struct iwl_queue *q = &priv->txq[txq_id].q;
        u8 *addr = priv->stations[sta_id].sta.sta.addr;
        struct iwl_tid_data *tid_data = &priv->stations[sta_id].tid[tid];
 
        return 0;
 }
 
-/**
- * iwl4965_queue_dec_wrap - Decrement queue index, wrap back to end if needed
- * @index -- current index
- * @n_bd -- total number of entries in queue (s/b power of 2)
- */
-static inline int iwl4965_queue_dec_wrap(int index, int n_bd)
-{
-       return (index == 0) ? n_bd - 1 : index - 1;
-}
-
 /**
  * iwl4965_rx_reply_compressed_ba - Handler for REPLY_COMPRESSED_BA
  *
        agg = &priv->stations[ba_resp->sta_id].tid[ba_resp->tid].agg;
 
        /* Find index just before block-ack window */
-       index = iwl4965_queue_dec_wrap(ba_resp_scd_ssn & 0xff, txq->q.n_bd);
+       index = iwl_queue_dec_wrap(ba_resp_scd_ssn & 0xff, txq->q.n_bd);
 
        /* TODO: Need to get this copy more safely - now good for debug */
 
                int freed = iwl4965_tx_queue_reclaim(priv, scd_flow, index);
                priv->stations[ba_resp->sta_id].
                        tid[ba_resp->tid].tfds_in_queue -= freed;
-               if (iwl4965_queue_space(&txq->q) > txq->q.low_mark &&
+               if (iwl_queue_space(&txq->q) > txq->q.low_mark &&
                        priv->mac80211_registered &&
                        agg->state != IWL_EMPTYING_HW_QUEUE_DELBA)
                        ieee80211_wake_queue(priv->hw, ampdu_q);
 
  * See more detailed info in iwl-4965-hw.h.
  ***************************************************/
 
-int iwl4965_queue_space(const struct iwl4965_queue *q)
+int iwl_queue_space(const struct iwl_queue *q)
 {
        int s = q->read_ptr - q->write_ptr;
 
 }
 
 
-static inline int x2_queue_used(const struct iwl4965_queue *q, int i)
+static inline int iwl_queue_used(const struct iwl_queue *q, int i)
 {
        return q->write_ptr > q->read_ptr ?
                (i >= q->read_ptr && i < q->write_ptr) :
                !(i < q->read_ptr && i >= q->write_ptr);
 }
 
-static inline u8 get_cmd_index(struct iwl4965_queue *q, u32 index, int is_huge)
+static inline u8 get_cmd_index(struct iwl_queue *q, u32 index, int is_huge)
 {
        /* This is for scan command, the big buffer at end of command array */
        if (is_huge)
 int iwl4965_enqueue_hcmd(struct iwl_priv *priv, struct iwl_host_cmd *cmd)
 {
        struct iwl_tx_queue *txq = &priv->txq[IWL_CMD_QUEUE_NUM];
-       struct iwl4965_queue *q = &txq->q;
+       struct iwl_queue *q = &txq->q;
        struct iwl_tfd_frame *tfd;
        u32 *control_flags;
        struct iwl_cmd *out_cmd;
                return -EIO;
        }
 
-       if (iwl4965_queue_space(q) < ((cmd->meta.flags & CMD_ASYNC) ? 2 : 1)) {
+       if (iwl_queue_space(q) < ((cmd->meta.flags & CMD_ASYNC) ? 2 : 1)) {
                IWL_ERROR("No space for Tx\n");
                return -ENOSPC;
        }
        u32 *control_flags;
        int txq_id = ctl->queue;
        struct iwl_tx_queue *txq = NULL;
-       struct iwl4965_queue *q = NULL;
+       struct iwl_queue *q = NULL;
        dma_addr_t phys_addr;
        dma_addr_t txcmd_phys;
        dma_addr_t scratch_phys;
        if (rc)
                return rc;
 
-       if ((iwl4965_queue_space(q) < q->high_mark)
+       if ((iwl_queue_space(q) < q->high_mark)
            && priv->mac80211_registered) {
                if (wait_write_ptr) {
                        spin_lock_irqsave(&priv->lock, flags);
 int iwl4965_tx_queue_reclaim(struct iwl_priv *priv, int txq_id, int index)
 {
        struct iwl_tx_queue *txq = &priv->txq[txq_id];
-       struct iwl4965_queue *q = &txq->q;
+       struct iwl_queue *q = &txq->q;
        int nfreed = 0;
 
-       if ((index >= q->n_bd) || (x2_queue_used(q, index) == 0)) {
+       if ((index >= q->n_bd) || (iwl_queue_used(q, index) == 0)) {
                IWL_ERROR("Read index for DMA queue txq id (%d), index %d, "
                          "is out of range [0-%d] %d %d.\n", txq_id,
                          index, q->n_bd, q->write_ptr, q->read_ptr);
        __le16 *qc;
 #endif
 
-       if ((index >= txq->q.n_bd) || (x2_queue_used(&txq->q, index) == 0)) {
+       if ((index >= txq->q.n_bd) || (iwl_queue_used(&txq->q, index) == 0)) {
                IWL_ERROR("Read index for DMA queue txq_id (%d) index %d "
                          "is out of range [0-%d] %d %d\n", txq_id,
                          index, txq->q.n_bd, txq->q.write_ptr,
                        freed = iwl4965_tx_queue_reclaim(priv, txq_id, index);
                        priv->stations[sta_id].tid[tid].tfds_in_queue -= freed;
 
-                       if (iwl4965_queue_space(&txq->q) > txq->q.low_mark &&
+                       if (iwl_queue_space(&txq->q) > txq->q.low_mark &&
                            txq_id >= 0 && priv->mac80211_registered &&
                            agg->state != IWL_EMPTYING_HW_QUEUE_DELBA) {
                                /* calculate mac80211 ampdu sw queue to wake */
                int freed = iwl4965_tx_queue_reclaim(priv, txq_id, index);
                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 &&
+               if (iwl_queue_space(&txq->q) > txq->q.low_mark &&
                        (txq_id >= 0) && priv->mac80211_registered)
                        ieee80211_wake_queue(priv->hw, txq_id);
                if (tid != MAX_TID_COUNT)
        struct iwl_priv *priv = hw->priv;
        int i, avail;
        struct iwl_tx_queue *txq;
-       struct iwl4965_queue *q;
+       struct iwl_queue *q;
        unsigned long flags;
 
        IWL_DEBUG_MAC80211("enter\n");
        for (i = 0; i < AC_NUM; i++) {
                txq = &priv->txq[i];
                q = &txq->q;
-               avail = iwl4965_queue_space(q);
+               avail = iwl_queue_space(q);
 
                stats[i].len = q->n_window - avail;
                stats[i].limit = q->n_window - q->high_mark;