aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ieee1394/sbp2.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ieee1394/sbp2.c')
-rw-r--r--drivers/ieee1394/sbp2.c30
1 files changed, 7 insertions, 23 deletions
diff --git a/drivers/ieee1394/sbp2.c b/drivers/ieee1394/sbp2.c
index 187e26f0485d..5d3b96e0a951 100644
--- a/drivers/ieee1394/sbp2.c
+++ b/drivers/ieee1394/sbp2.c
@@ -591,18 +591,14 @@ static struct sbp2_command_info *sbp2util_allocate_command_orb(
591 return cmd; 591 return cmd;
592} 592}
593 593
594static void sbp2util_free_command_dma(struct sbp2_command_info *cmd) 594/*
595 * Unmaps the DMAs of a command and moves the command to the completed ORB list.
596 * Must be called with lu->cmd_orb_lock held.
597 */
598static void sbp2util_mark_command_completed(struct sbp2_lu *lu,
599 struct sbp2_command_info *cmd)
595{ 600{
596 struct sbp2_lu *lu = (struct sbp2_lu *) 601 struct hpsb_host *host = lu->ud->ne->host;
597 cmd->Current_SCpnt->device->host->hostdata[0];
598 struct hpsb_host *host;
599
600 if (!lu) {
601 SBP2_ERR("%s: lu == NULL", __FUNCTION__);
602 return;
603 }
604
605 host = lu->ud->ne->host;
606 602
607 if (cmd->cmd_dma) { 603 if (cmd->cmd_dma) {
608 if (cmd->dma_type == CMD_DMA_SINGLE) 604 if (cmd->dma_type == CMD_DMA_SINGLE)
@@ -615,23 +611,11 @@ static void sbp2util_free_command_dma(struct sbp2_command_info *cmd)
615 cmd->dma_type = CMD_DMA_NONE; 611 cmd->dma_type = CMD_DMA_NONE;
616 cmd->cmd_dma = 0; 612 cmd->cmd_dma = 0;
617 } 613 }
618
619 if (cmd->sge_buffer) { 614 if (cmd->sge_buffer) {
620 pci_unmap_sg(host->pdev, cmd->sge_buffer, 615 pci_unmap_sg(host->pdev, cmd->sge_buffer,
621 cmd->dma_size, cmd->dma_dir); 616 cmd->dma_size, cmd->dma_dir);
622 cmd->sge_buffer = NULL; 617 cmd->sge_buffer = NULL;
623 } 618 }
624}
625
626/*
627 * This function moves a command to the completed orb list.
628 * Must be called with lu->cmd_orb_lock held.
629 */
630static void sbp2util_mark_command_completed(
631 struct sbp2_lu *lu,
632 struct sbp2_command_info *cmd)
633{
634 sbp2util_free_command_dma(cmd);
635 list_move_tail(&cmd->list, &lu->cmd_orb_completed); 619 list_move_tail(&cmd->list, &lu->cmd_orb_completed);
636} 620}
637 621