Skip to content

Commit

Permalink
[SCSI] i2o: convert to use the data buffer accessors
Browse files Browse the repository at this point in the history
- remove the unnecessary map_single path.

- convert to use the new accessors for the sg lists and the
parameters.

Note: needs to change i2o_dma_map_sg when the chaining sg is ready.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Acked-by: "Salyzyn, Mark" <mark_salyzyn@adaptec.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
  • Loading branch information
FUJITA Tomonori authored and James Bottomley committed Jun 17, 2007
1 parent 29c9768 commit 0ea7154
Showing 1 changed file with 7 additions and 17 deletions.
24 changes: 7 additions & 17 deletions drivers/message/i2o/i2o_scsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -377,12 +377,8 @@ static int i2o_scsi_reply(struct i2o_controller *c, u32 m,
osm_err("SCSI error %08x\n", error);

dev = &c->pdev->dev;
if (cmd->use_sg)
dma_unmap_sg(dev, cmd->request_buffer, cmd->use_sg,
cmd->sc_data_direction);
else if (cmd->SCp.dma_handle)
dma_unmap_single(dev, cmd->SCp.dma_handle, cmd->request_bufflen,
cmd->sc_data_direction);

scsi_dma_unmap(cmd);

cmd->scsi_done(cmd);

Expand Down Expand Up @@ -664,21 +660,15 @@ static int i2o_scsi_queuecommand(struct scsi_cmnd *SCpnt,

if (sgl_offset != SGL_OFFSET_0) {
/* write size of data addressed by SGL */
*mptr++ = cpu_to_le32(SCpnt->request_bufflen);
*mptr++ = cpu_to_le32(scsi_bufflen(SCpnt));

/* Now fill in the SGList and command */
if (SCpnt->use_sg) {
if (!i2o_dma_map_sg(c, SCpnt->request_buffer,
SCpnt->use_sg,

if (scsi_sg_count(SCpnt)) {
if (!i2o_dma_map_sg(c, scsi_sglist(SCpnt),
scsi_sg_count(SCpnt),
SCpnt->sc_data_direction, &mptr))
goto nomem;
} else {
SCpnt->SCp.dma_handle =
i2o_dma_map_single(c, SCpnt->request_buffer,
SCpnt->request_bufflen,
SCpnt->sc_data_direction, &mptr);
if (dma_mapping_error(SCpnt->SCp.dma_handle))
goto nomem;
}
}

Expand Down

0 comments on commit 0ea7154

Please sign in to comment.