diff options
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-tx.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-tx.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-tx.c b/drivers/net/wireless/iwlwifi/iwl-tx.c index 80c3565a66ae..52b1b66f32d0 100644 --- a/drivers/net/wireless/iwlwifi/iwl-tx.c +++ b/drivers/net/wireless/iwlwifi/iwl-tx.c | |||
@@ -621,9 +621,6 @@ void iwl_tx_cmd_complete(struct iwl_priv *priv, struct iwl_rx_mem_buffer *rxb) | |||
621 | struct iwl_cmd_meta *meta; | 621 | struct iwl_cmd_meta *meta; |
622 | struct iwl_tx_queue *txq = &priv->txq[priv->cmd_queue]; | 622 | struct iwl_tx_queue *txq = &priv->txq[priv->cmd_queue]; |
623 | unsigned long flags; | 623 | unsigned long flags; |
624 | void (*callback) (struct iwl_priv *priv, struct iwl_device_cmd *cmd, | ||
625 | struct iwl_rx_packet *pkt); | ||
626 | |||
627 | 624 | ||
628 | /* If a Tx command is being handled and it isn't in the actual | 625 | /* If a Tx command is being handled and it isn't in the actual |
629 | * command queue then there a command routing bug has been introduced | 626 | * command queue then there a command routing bug has been introduced |
@@ -637,8 +634,6 @@ void iwl_tx_cmd_complete(struct iwl_priv *priv, struct iwl_rx_mem_buffer *rxb) | |||
637 | return; | 634 | return; |
638 | } | 635 | } |
639 | 636 | ||
640 | spin_lock_irqsave(&priv->hcmd_lock, flags); | ||
641 | |||
642 | cmd_index = get_cmd_index(&txq->q, index, huge); | 637 | cmd_index = get_cmd_index(&txq->q, index, huge); |
643 | cmd = txq->cmd[cmd_index]; | 638 | cmd = txq->cmd[cmd_index]; |
644 | meta = &txq->meta[cmd_index]; | 639 | meta = &txq->meta[cmd_index]; |
@@ -648,13 +643,14 @@ void iwl_tx_cmd_complete(struct iwl_priv *priv, struct iwl_rx_mem_buffer *rxb) | |||
648 | dma_unmap_len(meta, len), | 643 | dma_unmap_len(meta, len), |
649 | PCI_DMA_BIDIRECTIONAL); | 644 | PCI_DMA_BIDIRECTIONAL); |
650 | 645 | ||
651 | callback = NULL; | ||
652 | /* Input error checking is done when commands are added to queue. */ | 646 | /* Input error checking is done when commands are added to queue. */ |
653 | if (meta->flags & CMD_WANT_SKB) { | 647 | if (meta->flags & CMD_WANT_SKB) { |
654 | meta->source->reply_page = (unsigned long)rxb_addr(rxb); | 648 | meta->source->reply_page = (unsigned long)rxb_addr(rxb); |
655 | rxb->page = NULL; | 649 | rxb->page = NULL; |
656 | } else | 650 | } else if (meta->callback) |
657 | callback = meta->callback; | 651 | meta->callback(priv, cmd, pkt); |
652 | |||
653 | spin_lock_irqsave(&priv->hcmd_lock, flags); | ||
658 | 654 | ||
659 | iwl_hcmd_queue_reclaim(priv, txq_id, index, cmd_index); | 655 | iwl_hcmd_queue_reclaim(priv, txq_id, index, cmd_index); |
660 | 656 | ||
@@ -669,7 +665,4 @@ void iwl_tx_cmd_complete(struct iwl_priv *priv, struct iwl_rx_mem_buffer *rxb) | |||
669 | meta->flags = 0; | 665 | meta->flags = 0; |
670 | 666 | ||
671 | spin_unlock_irqrestore(&priv->hcmd_lock, flags); | 667 | spin_unlock_irqrestore(&priv->hcmd_lock, flags); |
672 | |||
673 | if (callback) | ||
674 | callback(priv, cmd, pkt); | ||
675 | } | 668 | } |