iwlagn: iwl_rx_queue moves to the iwl_trans_pcie
[linux-2.6-block.git] / drivers / net / wireless / iwlwifi / iwl-trans-rx-pcie.c
index 474860290404d2805657562c5f56dcc9629aca16..fb06acf83fc6901685d3ff6dc36f524faf59ae7d 100644 (file)
@@ -127,9 +127,10 @@ static int iwl_rx_queue_space(const struct iwl_rx_queue *q)
 /**
  * iwl_rx_queue_update_write_ptr - Update the write pointer for the RX queue
  */
-void iwl_rx_queue_update_write_ptr(struct iwl_priv *priv,
+void iwl_rx_queue_update_write_ptr(struct iwl_trans *trans,
                        struct iwl_rx_queue *q)
 {
+       struct iwl_priv *priv = priv(trans);
        unsigned long flags;
        u32 reg;
 
@@ -145,11 +146,11 @@ void iwl_rx_queue_update_write_ptr(struct iwl_priv *priv,
                iwl_write32(priv, FH_RSCSR_CHNL0_WPTR, q->write_actual);
        } else {
                /* If power-saving is in use, make sure device is awake */
-               if (test_bit(STATUS_POWER_PMI, &priv->status)) {
+               if (test_bit(STATUS_POWER_PMI, &trans->shrd->status)) {
                        reg = iwl_read32(priv, CSR_UCODE_DRV_GP1);
 
                        if (reg & CSR_UCODE_DRV_GP1_BIT_MAC_SLEEP) {
-                               IWL_DEBUG_INFO(priv,
+                               IWL_DEBUG_INFO(trans,
                                        "Rx queue requesting wakeup,"
                                        " GP1 = 0x%x\n", reg);
                                iwl_set_bit(priv, CSR_GP_CNTRL,
@@ -178,8 +179,7 @@ void iwl_rx_queue_update_write_ptr(struct iwl_priv *priv,
 /**
  * iwlagn_dma_addr2rbd_ptr - convert a DMA address to a uCode read buffer ptr
  */
-static inline __le32 iwlagn_dma_addr2rbd_ptr(struct iwl_priv *priv,
-                                         dma_addr_t dma_addr)
+static inline __le32 iwlagn_dma_addr2rbd_ptr(dma_addr_t dma_addr)
 {
        return cpu_to_le32((u32)(dma_addr >> 8));
 }
@@ -195,9 +195,12 @@ static inline __le32 iwlagn_dma_addr2rbd_ptr(struct iwl_priv *priv,
  * also updates the memory address in the firmware to reference the new
  * target buffer.
  */
-static void iwlagn_rx_queue_restock(struct iwl_priv *priv)
+static void iwlagn_rx_queue_restock(struct iwl_trans *trans)
 {
-       struct iwl_rx_queue *rxq = &priv->rxq;
+       struct iwl_trans_pcie *trans_pcie =
+               IWL_TRANS_GET_PCIE_TRANS(trans);
+
+       struct iwl_rx_queue *rxq = &trans_pcie->rxq;
        struct list_head *element;
        struct iwl_rx_mem_buffer *rxb;
        unsigned long flags;
@@ -214,8 +217,7 @@ static void iwlagn_rx_queue_restock(struct iwl_priv *priv)
                list_del(element);
 
                /* Point to Rx buffer via next RBD in circular buffer */
-               rxq->bd[rxq->write] = iwlagn_dma_addr2rbd_ptr(priv,
-                                                             rxb->page_dma);
+               rxq->bd[rxq->write] = iwlagn_dma_addr2rbd_ptr(rxb->page_dma);
                rxq->queue[rxq->write] = rxb;
                rxq->write = (rxq->write + 1) & RX_QUEUE_MASK;
                rxq->free_count--;
@@ -224,7 +226,7 @@ static void iwlagn_rx_queue_restock(struct iwl_priv *priv)
        /* If the pre-allocated buffer pool is dropping low, schedule to
         * refill it */
        if (rxq->free_count <= RX_LOW_WATERMARK)
-               queue_work(priv->workqueue, &priv->rx_replenish);
+               queue_work(trans->shrd->workqueue, &trans_pcie->rx_replenish);
 
 
        /* If we've added more space for the firmware to place data, tell it.
@@ -233,7 +235,7 @@ static void iwlagn_rx_queue_restock(struct iwl_priv *priv)
                spin_lock_irqsave(&rxq->lock, flags);
                rxq->need_update = 1;
                spin_unlock_irqrestore(&rxq->lock, flags);
-               iwl_rx_queue_update_write_ptr(priv, rxq);
+               iwl_rx_queue_update_write_ptr(trans, rxq);
        }
 }
 
@@ -245,9 +247,12 @@ static void iwlagn_rx_queue_restock(struct iwl_priv *priv)
  * Also restock the Rx queue via iwl_rx_queue_restock.
  * This is called as a scheduled work item (except for during initialization)
  */
-static void iwlagn_rx_allocate(struct iwl_priv *priv, gfp_t priority)
+static void iwlagn_rx_allocate(struct iwl_trans *trans, gfp_t priority)
 {
-       struct iwl_rx_queue *rxq = &priv->rxq;
+       struct iwl_trans_pcie *trans_pcie =
+               IWL_TRANS_GET_PCIE_TRANS(trans);
+
+       struct iwl_rx_queue *rxq = &trans_pcie->rxq;
        struct list_head *element;
        struct iwl_rx_mem_buffer *rxb;
        struct page *page;
@@ -265,20 +270,21 @@ static void iwlagn_rx_allocate(struct iwl_priv *priv, gfp_t priority)
                if (rxq->free_count > RX_LOW_WATERMARK)
                        gfp_mask |= __GFP_NOWARN;
 
-               if (priv->hw_params.rx_page_order > 0)
+               if (hw_params(trans).rx_page_order > 0)
                        gfp_mask |= __GFP_COMP;
 
                /* Alloc a new receive buffer */
-               page = alloc_pages(gfp_mask, priv->hw_params.rx_page_order);
+               page = alloc_pages(gfp_mask,
+                                 hw_params(trans).rx_page_order);
                if (!page) {
                        if (net_ratelimit())
-                               IWL_DEBUG_INFO(priv, "alloc_pages failed, "
-                                              "order: %d\n",
-                                              priv->hw_params.rx_page_order);
+                               IWL_DEBUG_INFO(trans, "alloc_pages failed, "
+                                          "order: %d\n",
+                                          hw_params(trans).rx_page_order);
 
                        if ((rxq->free_count <= RX_LOW_WATERMARK) &&
                            net_ratelimit())
-                               IWL_CRIT(priv, "Failed to alloc_pages with %s."
+                               IWL_CRIT(trans, "Failed to alloc_pages with %s."
                                         "Only %u free buffers remaining.\n",
                                         priority == GFP_ATOMIC ?
                                         "GFP_ATOMIC" : "GFP_KERNEL",
@@ -293,7 +299,7 @@ static void iwlagn_rx_allocate(struct iwl_priv *priv, gfp_t priority)
 
                if (list_empty(&rxq->rx_used)) {
                        spin_unlock_irqrestore(&rxq->lock, flags);
-                       __free_pages(page, priv->hw_params.rx_page_order);
+                       __free_pages(page, hw_params(trans).rx_page_order);
                        return;
                }
                element = rxq->rx_used.next;
@@ -305,8 +311,8 @@ static void iwlagn_rx_allocate(struct iwl_priv *priv, gfp_t priority)
                BUG_ON(rxb->page);
                rxb->page = page;
                /* Get physical address of the RB */
-               rxb->page_dma = dma_map_page(priv->bus->dev, page, 0,
-                               PAGE_SIZE << priv->hw_params.rx_page_order,
+               rxb->page_dma = dma_map_page(bus(trans)->dev, page, 0,
+                               PAGE_SIZE << hw_params(trans).rx_page_order,
                                DMA_FROM_DEVICE);
                /* dma address must be no more than 36 bits */
                BUG_ON(rxb->page_dma & ~DMA_BIT_MASK(36));
@@ -322,35 +328,36 @@ static void iwlagn_rx_allocate(struct iwl_priv *priv, gfp_t priority)
        }
 }
 
-void iwlagn_rx_replenish(struct iwl_priv *priv)
+void iwlagn_rx_replenish(struct iwl_trans *trans)
 {
        unsigned long flags;
 
-       iwlagn_rx_allocate(priv, GFP_KERNEL);
+       iwlagn_rx_allocate(trans, GFP_KERNEL);
 
-       spin_lock_irqsave(&priv->lock, flags);
-       iwlagn_rx_queue_restock(priv);
-       spin_unlock_irqrestore(&priv->lock, flags);
+       spin_lock_irqsave(&trans->shrd->lock, flags);
+       iwlagn_rx_queue_restock(trans);
+       spin_unlock_irqrestore(&trans->shrd->lock, flags);
 }
 
-static void iwlagn_rx_replenish_now(struct iwl_priv *priv)
+static void iwlagn_rx_replenish_now(struct iwl_trans *trans)
 {
-       iwlagn_rx_allocate(priv, GFP_ATOMIC);
+       iwlagn_rx_allocate(trans, GFP_ATOMIC);
 
-       iwlagn_rx_queue_restock(priv);
+       iwlagn_rx_queue_restock(trans);
 }
 
 void iwl_bg_rx_replenish(struct work_struct *data)
 {
-       struct iwl_priv *priv =
-           container_of(data, struct iwl_priv, rx_replenish);
+       struct iwl_trans_pcie *trans_pcie =
+           container_of(data, struct iwl_trans_pcie, rx_replenish);
+       struct iwl_trans *trans = trans_pcie->trans;
 
-       if (test_bit(STATUS_EXIT_PENDING, &priv->status))
+       if (test_bit(STATUS_EXIT_PENDING, &trans->shrd->status))
                return;
 
-       mutex_lock(&priv->mutex);
-       iwlagn_rx_replenish(priv);
-       mutex_unlock(&priv->mutex);
+       mutex_lock(&trans->shrd->mutex);
+       iwlagn_rx_replenish(trans);
+       mutex_unlock(&trans->shrd->mutex);
 }
 
 /**
@@ -360,11 +367,13 @@ void iwl_bg_rx_replenish(struct work_struct *data)
  * the appropriate handlers, including command responses,
  * frame-received notifications, and other notifications.
  */
-static void iwl_rx_handle(struct iwl_priv *priv)
+static void iwl_rx_handle(struct iwl_trans *trans)
 {
        struct iwl_rx_mem_buffer *rxb;
        struct iwl_rx_packet *pkt;
-       struct iwl_rx_queue *rxq = &priv->rxq;
+       struct iwl_trans_pcie *trans_pcie =
+               IWL_TRANS_GET_PCIE_TRANS(trans);
+       struct iwl_rx_queue *rxq = &trans_pcie->rxq;
        u32 r, i;
        int reclaim;
        unsigned long flags;
@@ -379,7 +388,7 @@ static void iwl_rx_handle(struct iwl_priv *priv)
 
        /* Rx interrupt, but nothing sent from uCode */
        if (i == r)
-               IWL_DEBUG_RX(priv, "r = %d, i = %d\n", r, i);
+               IWL_DEBUG_RX(trans, "r = %d, i = %d\n", r, i);
 
        /* calculate total frames need to be restock after handling RX */
        total_empty = r - rxq->write_actual;
@@ -404,17 +413,17 @@ static void iwl_rx_handle(struct iwl_priv *priv)
 
                rxq->queue[i] = NULL;
 
-               dma_unmap_page(priv->bus->dev, rxb->page_dma,
-                              PAGE_SIZE << priv->hw_params.rx_page_order,
+               dma_unmap_page(bus(trans)->dev, rxb->page_dma,
+                              PAGE_SIZE << hw_params(trans).rx_page_order,
                               DMA_FROM_DEVICE);
                pkt = rxb_addr(rxb);
 
-               IWL_DEBUG_RX(priv, "r = %d, i = %d, %s, 0x%02x\n", r,
+               IWL_DEBUG_RX(trans, "r = %d, i = %d, %s, 0x%02x\n", r,
                        i, get_cmd_string(pkt->hdr.cmd), pkt->hdr.cmd);
 
                len = le32_to_cpu(pkt->len_n_flags) & FH_RSCSR_FRAME_SIZE_MSK;
                len += sizeof(u32); /* account for status word */
-               trace_iwlwifi_dev_rx(priv, pkt, len);
+               trace_iwlwifi_dev_rx(priv(trans), pkt, len);
 
                /* Reclaim a command buffer only if this packet is a response
                 *   to a (driver-originated) command.
@@ -430,7 +439,7 @@ static void iwl_rx_handle(struct iwl_priv *priv)
                        (pkt->hdr.cmd != STATISTICS_NOTIFICATION) &&
                        (pkt->hdr.cmd != REPLY_TX);
 
-               iwl_rx_dispatch(priv, rxb);
+               iwl_rx_dispatch(priv(trans), rxb);
 
                /*
                 * XXX: After here, we should always check rxb->page
@@ -442,12 +451,12 @@ static void iwl_rx_handle(struct iwl_priv *priv)
                if (reclaim) {
                        /* Invoke any callbacks, transfer the buffer to caller,
                         * and fire off the (possibly) blocking
-                        * trans_send_cmd()
+                        * iwl_trans_send_cmd()
                         * as we reclaim the driver command queue */
                        if (rxb->page)
-                               iwl_tx_cmd_complete(priv, rxb);
+                               iwl_tx_cmd_complete(priv(trans), rxb);
                        else
-                               IWL_WARN(priv, "Claim null rxb?\n");
+                               IWL_WARN(trans, "Claim null rxb?\n");
                }
 
                /* Reuse the page if possible. For notification packets and
@@ -455,8 +464,9 @@ static void iwl_rx_handle(struct iwl_priv *priv)
                 * rx_free list for reuse later. */
                spin_lock_irqsave(&rxq->lock, flags);
                if (rxb->page != NULL) {
-                       rxb->page_dma = dma_map_page(priv->bus->dev, rxb->page,
-                               0, PAGE_SIZE << priv->hw_params.rx_page_order,
+                       rxb->page_dma = dma_map_page(bus(trans)->dev, rxb->page,
+                               0, PAGE_SIZE <<
+                                   hw_params(trans).rx_page_order,
                                DMA_FROM_DEVICE);
                        list_add_tail(&rxb->list, &rxq->rx_free);
                        rxq->free_count++;
@@ -472,7 +482,7 @@ static void iwl_rx_handle(struct iwl_priv *priv)
                        count++;
                        if (count >= 8) {
                                rxq->read = i;
-                               iwlagn_rx_replenish_now(priv);
+                               iwlagn_rx_replenish_now(trans);
                                count = 0;
                        }
                }
@@ -481,9 +491,9 @@ static void iwl_rx_handle(struct iwl_priv *priv)
        /* Backtrack one entry */
        rxq->read = i;
        if (fill_rx)
-               iwlagn_rx_replenish_now(priv);
+               iwlagn_rx_replenish_now(trans);
        else
-               iwlagn_rx_queue_restock(priv);
+               iwlagn_rx_queue_restock(trans);
 }
 
 /* tasklet for iwlagn interrupt */
@@ -497,7 +507,7 @@ void iwl_irq_tasklet(struct iwl_priv *priv)
        u32 inta_mask;
 #endif
 
-       spin_lock_irqsave(&priv->lock, flags);
+       spin_lock_irqsave(&priv->shrd->lock, flags);
 
        /* Ack/clear/reset pending uCode interrupts.
         * Note:  Some bits in CSR_INT are "OR" of bits in CSR_FH_INT_STATUS,
@@ -515,7 +525,7 @@ void iwl_irq_tasklet(struct iwl_priv *priv)
        inta = priv->inta;
 
 #ifdef CONFIG_IWLWIFI_DEBUG
-       if (iwl_get_debug_level(priv) & IWL_DL_ISR) {
+       if (iwl_get_debug_level(priv->shrd) & IWL_DL_ISR) {
                /* just for debug */
                inta_mask = iwl_read32(priv, CSR_INT_MASK);
                IWL_DEBUG_ISR(priv, "inta 0x%08x, enabled 0x%08x\n ",
@@ -523,7 +533,7 @@ void iwl_irq_tasklet(struct iwl_priv *priv)
        }
 #endif
 
-       spin_unlock_irqrestore(&priv->lock, flags);
+       spin_unlock_irqrestore(&priv->shrd->lock, flags);
 
        /* saved interrupt in inta variable now we can reset priv->inta */
        priv->inta = 0;
@@ -544,7 +554,7 @@ void iwl_irq_tasklet(struct iwl_priv *priv)
        }
 
 #ifdef CONFIG_IWLWIFI_DEBUG
-       if (iwl_get_debug_level(priv) & (IWL_DL_ISR)) {
+       if (iwl_get_debug_level(priv->shrd) & (IWL_DL_ISR)) {
                /* NIC fires this, but we don't use it, redundant with WAKEUP */
                if (inta & CSR_INT_BIT_SCD) {
                        IWL_DEBUG_ISR(priv, "Scheduler finished to transmit "
@@ -579,11 +589,12 @@ void iwl_irq_tasklet(struct iwl_priv *priv)
                 * is killed. Hence update the killswitch state here. The
                 * rfkill handler will care about restarting if needed.
                 */
-               if (!test_bit(STATUS_ALIVE, &priv->status)) {
+               if (!test_bit(STATUS_ALIVE, &priv->shrd->status)) {
                        if (hw_rf_kill)
-                               set_bit(STATUS_RF_KILL_HW, &priv->status);
+                               set_bit(STATUS_RF_KILL_HW, &priv->shrd->status);
                        else
-                               clear_bit(STATUS_RF_KILL_HW, &priv->status);
+                               clear_bit(STATUS_RF_KILL_HW,
+                                         &priv->shrd->status);
                        wiphy_rfkill_set_hw_state(priv->hw->wiphy, hw_rf_kill);
                }
 
@@ -608,9 +619,11 @@ void iwl_irq_tasklet(struct iwl_priv *priv)
 
        /* uCode wakes up after power-down sleep */
        if (inta & CSR_INT_BIT_WAKEUP) {
+               struct iwl_trans_pcie *trans_pcie =
+                       IWL_TRANS_GET_PCIE_TRANS(trans(priv));
                IWL_DEBUG_ISR(priv, "Wakeup interrupt\n");
-               iwl_rx_queue_update_write_ptr(priv, &priv->rxq);
-               for (i = 0; i < priv->hw_params.max_txq_num; i++)
+               iwl_rx_queue_update_write_ptr(trans(priv), &trans_pcie->rxq);
+               for (i = 0; i < hw_params(priv).max_txq_num; i++)
                        iwl_txq_update_write_ptr(priv, &priv->txq[i]);
 
                priv->isr_stats.wakeup++;
@@ -647,7 +660,7 @@ void iwl_irq_tasklet(struct iwl_priv *priv)
                /* Disable periodic interrupt; we use it as just a one-shot. */
                iwl_write8(priv, CSR_INT_PERIODIC_REG,
                            CSR_INT_PERIODIC_DIS);
-               iwl_rx_handle(priv);
+               iwl_rx_handle(trans(priv));
 
                /*
                 * Enable periodic interrupt in 8 msec only if we received
@@ -686,7 +699,7 @@ void iwl_irq_tasklet(struct iwl_priv *priv)
 
        /* Re-enable all interrupts */
        /* only Re-enable if disabled by irq */
-       if (test_bit(STATUS_INT_ENABLED, &priv->status))
+       if (test_bit(STATUS_INT_ENABLED, &priv->shrd->status))
                iwl_enable_interrupts(priv);
        /* Re-enable RF_KILL if it occurred */
        else if (handled & CSR_INT_BIT_RF_KILL)
@@ -771,7 +784,7 @@ int iwl_reset_ict(struct iwl_priv *priv)
        if (!priv->ict_tbl_vir)
                return 0;
 
-       spin_lock_irqsave(&priv->lock, flags);
+       spin_lock_irqsave(&priv->shrd->lock, flags);
        iwl_disable_interrupts(priv);
 
        memset(&priv->ict_tbl[0], 0, sizeof(u32) * ICT_COUNT);
@@ -791,7 +804,7 @@ int iwl_reset_ict(struct iwl_priv *priv)
        priv->ict_index = 0;
        iwl_write32(priv, CSR_INT, priv->inta_mask);
        iwl_enable_interrupts(priv);
-       spin_unlock_irqrestore(&priv->lock, flags);
+       spin_unlock_irqrestore(&priv->shrd->lock, flags);
 
        return 0;
 }
@@ -801,9 +814,9 @@ void iwl_disable_ict(struct iwl_priv *priv)
 {
        unsigned long flags;
 
-       spin_lock_irqsave(&priv->lock, flags);
+       spin_lock_irqsave(&priv->shrd->lock, flags);
        priv->use_ict = false;
-       spin_unlock_irqrestore(&priv->lock, flags);
+       spin_unlock_irqrestore(&priv->shrd->lock, flags);
 }
 
 static irqreturn_t iwl_isr(int irq, void *data)
@@ -817,7 +830,7 @@ static irqreturn_t iwl_isr(int irq, void *data)
        if (!priv)
                return IRQ_NONE;
 
-       spin_lock_irqsave(&priv->lock, flags);
+       spin_lock_irqsave(&priv->shrd->lock, flags);
 
        /* Disable (but don't clear!) interrupts here to avoid
         *    back-to-back ISRs and sporadic interrupts from our NIC.
@@ -845,7 +858,7 @@ static irqreturn_t iwl_isr(int irq, void *data)
        }
 
 #ifdef CONFIG_IWLWIFI_DEBUG
-       if (iwl_get_debug_level(priv) & (IWL_DL_ISR)) {
+       if (iwl_get_debug_level(priv->shrd) & (IWL_DL_ISR)) {
                inta_fh = iwl_read32(priv, CSR_FH_INT_STATUS);
                IWL_DEBUG_ISR(priv, "ISR inta 0x%08x, enabled 0x%08x, "
                              "fh 0x%08x\n", inta, inta_mask, inta_fh);
@@ -856,21 +869,21 @@ static irqreturn_t iwl_isr(int irq, void *data)
        /* iwl_irq_tasklet() will service interrupts and re-enable them */
        if (likely(inta))
                tasklet_schedule(&priv->irq_tasklet);
-       else if (test_bit(STATUS_INT_ENABLED, &priv->status) &&
+       else if (test_bit(STATUS_INT_ENABLED, &priv->shrd->status) &&
                        !priv->inta)
                iwl_enable_interrupts(priv);
 
  unplugged:
-       spin_unlock_irqrestore(&priv->lock, flags);
+       spin_unlock_irqrestore(&priv->shrd->lock, flags);
        return IRQ_HANDLED;
 
  none:
        /* re-enable interrupts here since we don't have anything to service. */
        /* only Re-enable if disabled by irq  and no schedules tasklet. */
-       if (test_bit(STATUS_INT_ENABLED, &priv->status) && !priv->inta)
+       if (test_bit(STATUS_INT_ENABLED, &priv->shrd->status) && !priv->inta)
                iwl_enable_interrupts(priv);
 
-       spin_unlock_irqrestore(&priv->lock, flags);
+       spin_unlock_irqrestore(&priv->shrd->lock, flags);
        return IRQ_NONE;
 }
 
@@ -898,7 +911,7 @@ irqreturn_t iwl_isr_ict(int irq, void *data)
        if (!priv->use_ict)
                return iwl_isr(irq, data);
 
-       spin_lock_irqsave(&priv->lock, flags);
+       spin_lock_irqsave(&priv->shrd->lock, flags);
 
        /* Disable (but don't clear!) interrupts here to avoid
         * back-to-back ISRs and sporadic interrupts from our NIC.
@@ -955,7 +968,7 @@ irqreturn_t iwl_isr_ict(int irq, void *data)
        /* iwl_irq_tasklet() will service interrupts and re-enable them */
        if (likely(inta))
                tasklet_schedule(&priv->irq_tasklet);
-       else if (test_bit(STATUS_INT_ENABLED, &priv->status) &&
+       else if (test_bit(STATUS_INT_ENABLED, &priv->shrd->status) &&
                        !priv->inta) {
                /* Allow interrupt if was disabled by this handler and
                 * no tasklet was schedules, We should not enable interrupt,
@@ -964,16 +977,16 @@ irqreturn_t iwl_isr_ict(int irq, void *data)
                iwl_enable_interrupts(priv);
        }
 
-       spin_unlock_irqrestore(&priv->lock, flags);
+       spin_unlock_irqrestore(&priv->shrd->lock, flags);
        return IRQ_HANDLED;
 
  none:
        /* re-enable interrupts here since we don't have anything to service.
         * only Re-enable if disabled by irq.
         */
-       if (test_bit(STATUS_INT_ENABLED, &priv->status) && !priv->inta)
+       if (test_bit(STATUS_INT_ENABLED, &priv->shrd->status) && !priv->inta)
                iwl_enable_interrupts(priv);
 
-       spin_unlock_irqrestore(&priv->lock, flags);
+       spin_unlock_irqrestore(&priv->shrd->lock, flags);
        return IRQ_NONE;
 }