Signed-off-by: Bart Van Assche <bart.vanassche@xxxxxxxxxxx> Cc: Finn Thain <fthain@xxxxxxxxxxxxxxxxxxx> Cc: Michael Schmitz <schmitzmic@xxxxxxxxx> --- drivers/scsi/ncr53c8xx.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/ncr53c8xx.c b/drivers/scsi/ncr53c8xx.c index 5b93ed8..b9c489a 100644 --- a/drivers/scsi/ncr53c8xx.c +++ b/drivers/scsi/ncr53c8xx.c @@ -4286,13 +4286,12 @@ static int ncr_queue_command (struct ncb *np, struct scsi_cmnd *cmd) direction = DMA_NONE; /* - ** If data direction is BIDIRECTIONAL, speculate FROM_DEVICE + ** For bidi commands, speculate FROM_DEVICE ** but prepare alternate pointers for TO_DEVICE in case ** of our speculation will be just wrong. ** SCRIPTS will swap values if needed. */ switch(direction) { - case DMA_BIDIRECTIONAL: case DMA_TO_DEVICE: goalp = NCB_SCRIPT_PHYS (np, data_out2) + 8; if (segments <= MAX_SCATTERL) @@ -4301,7 +4300,7 @@ static int ncr_queue_command (struct ncb *np, struct scsi_cmnd *cmd) lastp = NCB_SCRIPTH_PHYS (np, hdata_out2); lastp -= (segments - MAX_SCATTERL) * 16; } - if (direction != DMA_BIDIRECTIONAL) + if (!scsi_bidi_cmd(cmd)) break; cp->phys.header.wgoalp = cpu_to_scr(goalp); cp->phys.header.wlastp = cpu_to_scr(lastp); @@ -4328,7 +4327,7 @@ static int ncr_queue_command (struct ncb *np, struct scsi_cmnd *cmd) cp->phys.header.lastp = cpu_to_scr(lastp); cp->phys.header.goalp = cpu_to_scr(goalp); - if (direction == DMA_BIDIRECTIONAL) + if (scsi_bidi_cmd(cmd)) cp->phys.header.savep = cpu_to_scr(NCB_SCRIPTH_PHYS (np, data_io)); else -- 2.1.2 -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html