Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 58459
b: refs/heads/master
c: 7aa4848
h: refs/heads/master
i:
  58457: 9d17123
  58455: d2ad225
v: v3
  • Loading branch information
Stefan Richter committed Jul 9, 2007
1 parent 96a559c commit f35a19a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 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: 8526392ae816a2c69f57097ba032865523019caa
refs/heads/master: 7aa484815f8c4defd01366f239b71da5e6b8a791
21 changes: 9 additions & 12 deletions trunk/drivers/firewire/fw-sbp2.c
Original file line number Diff line number Diff line change
Expand Up @@ -416,21 +416,11 @@ sbp2_send_management_orb(struct fw_unit *unit, int node_id, int generation,
if (orb == NULL)
return -ENOMEM;

/*
* The sbp2 device is going to send a block read request to
* read out the request from host memory, so map it for dma.
*/
orb->base.request_bus =
dma_map_single(device->card->device, &orb->request,
sizeof(orb->request), DMA_TO_DEVICE);
if (dma_mapping_error(orb->base.request_bus))
goto out;

orb->response_bus =
dma_map_single(device->card->device, &orb->response,
sizeof(orb->response), DMA_FROM_DEVICE);
if (dma_mapping_error(orb->response_bus))
goto out;
goto fail_mapping_response;

orb->request.response.high = 0;
orb->request.response.low = orb->response_bus;
Expand All @@ -456,6 +446,12 @@ sbp2_send_management_orb(struct fw_unit *unit, int node_id, int generation,
init_completion(&orb->done);
orb->base.callback = complete_management_orb;

orb->base.request_bus =
dma_map_single(device->card->device, &orb->request,
sizeof(orb->request), DMA_TO_DEVICE);
if (dma_mapping_error(orb->base.request_bus))
goto fail_mapping_request;

sbp2_send_orb(&orb->base, unit,
node_id, generation, sd->management_agent_address);

Expand Down Expand Up @@ -487,9 +483,10 @@ sbp2_send_management_orb(struct fw_unit *unit, int node_id, int generation,
out:
dma_unmap_single(device->card->device, orb->base.request_bus,
sizeof(orb->request), DMA_TO_DEVICE);
fail_mapping_request:
dma_unmap_single(device->card->device, orb->response_bus,
sizeof(orb->response), DMA_FROM_DEVICE);

fail_mapping_response:
if (response)
fw_memcpy_from_be32(response,
orb->response, sizeof(orb->response));
Expand Down

0 comments on commit f35a19a

Please sign in to comment.