Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 58457
b: refs/heads/master
c: b4be016
h: refs/heads/master
i:
  58455: d2ad225
v: v3
  • Loading branch information
Stefan Richter committed Jul 9, 2007
1 parent 2cc68ed commit 9d17123
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 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: 332ef3310bc37ff29fd4382d6dfb38a787078091
refs/heads/master: b4be016ad81af5a83f0be820edf106de883e6ade
19 changes: 8 additions & 11 deletions trunk/drivers/firewire/fw-sbp2.c
Original file line number Diff line number Diff line change
Expand Up @@ -887,7 +887,7 @@ complete_command_orb(struct sbp2_orb *base_orb, struct sbp2_status *status)

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

orb->cmd->result = result;
orb->done(orb->cmd);
Expand All @@ -902,7 +902,6 @@ static int sbp2_command_orb_map_scatterlist(struct sbp2_command_orb *orb)
struct fw_device *device = fw_device(unit->device.parent);
struct scatterlist *sg;
int sg_len, l, i, j, count;
size_t size;
dma_addr_t sg_addr;

sg = (struct scatterlist *)orb->cmd->request_buffer;
Expand Down Expand Up @@ -951,7 +950,13 @@ static int sbp2_command_orb_map_scatterlist(struct sbp2_command_orb *orb)
}
}

size = sizeof(orb->page_table[0]) * j;
fw_memcpy_to_be32(orb->page_table, orb->page_table,
sizeof(orb->page_table[0]) * j);
orb->page_table_bus =
dma_map_single(device->card->device, orb->page_table,
sizeof(orb->page_table), DMA_TO_DEVICE);
if (dma_mapping_error(orb->page_table_bus))
goto fail_page_table;

/*
* The data_descriptor pointer is the one case where we need
Expand All @@ -960,20 +965,12 @@ static int sbp2_command_orb_map_scatterlist(struct sbp2_command_orb *orb)
* initiator (i.e. us), but data_descriptor can refer to data
* on other nodes so we need to put our ID in descriptor.high.
*/

orb->page_table_bus =
dma_map_single(device->card->device, orb->page_table,
size, DMA_TO_DEVICE);
if (dma_mapping_error(orb->page_table_bus))
goto fail_page_table;
orb->request.data_descriptor.high = sd->address_high;
orb->request.data_descriptor.low = orb->page_table_bus;
orb->request.misc |=
COMMAND_ORB_PAGE_TABLE_PRESENT |
COMMAND_ORB_DATA_SIZE(j);

fw_memcpy_to_be32(orb->page_table, orb->page_table, size);

return 0;

fail_page_table:
Expand Down

0 comments on commit 9d17123

Please sign in to comment.