Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 130412
b: refs/heads/master
c: 5e21256
h: refs/heads/master
v: v3
  • Loading branch information
Stefan Richter committed Jan 28, 2009
1 parent e0636df commit 568b04a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f746072abc12d0e10ecd7847f1846157fde15987
refs/heads/master: 5e2125677fd72d36396cc537466e07ffcbbd4b2b
27 changes: 17 additions & 10 deletions trunk/drivers/firewire/fw-sbp2.c
Original file line number Diff line number Diff line change
Expand Up @@ -1284,6 +1284,19 @@ static struct fw_driver sbp2_driver = {
.id_table = sbp2_id_table,
};

static void sbp2_unmap_scatterlist(struct device *card_device,
struct sbp2_command_orb *orb)
{
if (scsi_sg_count(orb->cmd))
dma_unmap_sg(card_device, scsi_sglist(orb->cmd),
scsi_sg_count(orb->cmd),
orb->cmd->sc_data_direction);

if (orb->request.misc & cpu_to_be32(COMMAND_ORB_PAGE_TABLE_PRESENT))
dma_unmap_single(card_device, orb->page_table_bus,
sizeof(orb->page_table), DMA_TO_DEVICE);
}

static unsigned int
sbp2_status_to_sense_data(u8 *sbp2_status, u8 *sense_data)
{
Expand Down Expand Up @@ -1363,15 +1376,7 @@ complete_command_orb(struct sbp2_orb *base_orb, struct sbp2_status *status)

dma_unmap_single(device->card->device, orb->base.request_bus,
sizeof(orb->request), DMA_TO_DEVICE);

if (scsi_sg_count(orb->cmd) > 0)
dma_unmap_sg(device->card->device, scsi_sglist(orb->cmd),
scsi_sg_count(orb->cmd),
orb->cmd->sc_data_direction);

if (orb->page_table_bus != 0)
dma_unmap_single(device->card->device, orb->page_table_bus,
sizeof(orb->page_table), DMA_TO_DEVICE);
sbp2_unmap_scatterlist(device->card->device, orb);

orb->cmd->result = result;
orb->done(orb->cmd);
Expand Down Expand Up @@ -1493,8 +1498,10 @@ static int sbp2_scsi_queuecommand(struct scsi_cmnd *cmd, scsi_done_fn_t done)
orb->base.request_bus =
dma_map_single(device->card->device, &orb->request,
sizeof(orb->request), DMA_TO_DEVICE);
if (dma_mapping_error(device->card->device, orb->base.request_bus))
if (dma_mapping_error(device->card->device, orb->base.request_bus)) {
sbp2_unmap_scatterlist(device->card->device, orb);
goto out;
}

sbp2_send_orb(&orb->base, lu, lu->tgt->node_id, generation,
lu->command_block_agent_address + SBP2_ORB_POINTER);
Expand Down

0 comments on commit 568b04a

Please sign in to comment.