aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/scsi/eata_pio.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/scsi/eata_pio.c b/drivers/scsi/eata_pio.c
index 982c5092be11..9579507f555b 100644
--- a/drivers/scsi/eata_pio.c
+++ b/drivers/scsi/eata_pio.c
@@ -385,7 +385,7 @@ static int eata_pio_queue(struct scsi_cmnd *cmd,
385 cp->DataIn = 0; /* Input mode */ 385 cp->DataIn = 0; /* Input mode */
386 386
387 cp->Interpret = (cmd->device->id == hd->hostid); 387 cp->Interpret = (cmd->device->id == hd->hostid);
388 cp->cp_datalen = cpu_to_be32(cmd->request_bufflen); 388 cp->cp_datalen = cpu_to_be32(scsi_bufflen(cmd));
389 cp->Auto_Req_Sen = 0; 389 cp->Auto_Req_Sen = 0;
390 cp->cp_reqDMA = 0; 390 cp->cp_reqDMA = 0;
391 cp->reqlen = 0; 391 cp->reqlen = 0;
@@ -402,14 +402,14 @@ static int eata_pio_queue(struct scsi_cmnd *cmd,
402 cp->cmd = cmd; 402 cp->cmd = cmd;
403 cmd->host_scribble = (char *) &hd->ccb[y]; 403 cmd->host_scribble = (char *) &hd->ccb[y];
404 404
405 if (cmd->use_sg == 0) { 405 if (!scsi_bufflen(cmd)) {
406 cmd->SCp.buffers_residual = 1; 406 cmd->SCp.buffers_residual = 1;
407 cmd->SCp.ptr = cmd->request_buffer; 407 cmd->SCp.ptr = NULL;
408 cmd->SCp.this_residual = cmd->request_bufflen; 408 cmd->SCp.this_residual = 0;
409 cmd->SCp.buffer = NULL; 409 cmd->SCp.buffer = NULL;
410 } else { 410 } else {
411 cmd->SCp.buffer = cmd->request_buffer; 411 cmd->SCp.buffer = scsi_sglist(cmd);
412 cmd->SCp.buffers_residual = cmd->use_sg; 412 cmd->SCp.buffers_residual = scsi_sg_count(cmd);
413 cmd->SCp.ptr = sg_virt(cmd->SCp.buffer); 413 cmd->SCp.ptr = sg_virt(cmd->SCp.buffer);
414 cmd->SCp.this_residual = cmd->SCp.buffer->length; 414 cmd->SCp.this_residual = cmd->SCp.buffer->length;
415 } 415 }