aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/eata_pio.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/eata_pio.c')
-rw-r--r--drivers/scsi/eata_pio.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/scsi/eata_pio.c b/drivers/scsi/eata_pio.c
index 982c5092be11..b5a60926e556 100644
--- a/drivers/scsi/eata_pio.c
+++ b/drivers/scsi/eata_pio.c
@@ -369,7 +369,6 @@ static int eata_pio_queue(struct scsi_cmnd *cmd,
369 cp = &hd->ccb[y]; 369 cp = &hd->ccb[y];
370 370
371 memset(cp, 0, sizeof(struct eata_ccb)); 371 memset(cp, 0, sizeof(struct eata_ccb));
372 memset(cmd->sense_buffer, 0, sizeof(cmd->sense_buffer));
373 372
374 cp->status = USED; /* claim free slot */ 373 cp->status = USED; /* claim free slot */
375 374
@@ -385,7 +384,7 @@ static int eata_pio_queue(struct scsi_cmnd *cmd,
385 cp->DataIn = 0; /* Input mode */ 384 cp->DataIn = 0; /* Input mode */
386 385
387 cp->Interpret = (cmd->device->id == hd->hostid); 386 cp->Interpret = (cmd->device->id == hd->hostid);
388 cp->cp_datalen = cpu_to_be32(cmd->request_bufflen); 387 cp->cp_datalen = cpu_to_be32(scsi_bufflen(cmd));
389 cp->Auto_Req_Sen = 0; 388 cp->Auto_Req_Sen = 0;
390 cp->cp_reqDMA = 0; 389 cp->cp_reqDMA = 0;
391 cp->reqlen = 0; 390 cp->reqlen = 0;
@@ -402,14 +401,14 @@ static int eata_pio_queue(struct scsi_cmnd *cmd,
402 cp->cmd = cmd; 401 cp->cmd = cmd;
403 cmd->host_scribble = (char *) &hd->ccb[y]; 402 cmd->host_scribble = (char *) &hd->ccb[y];
404 403
405 if (cmd->use_sg == 0) { 404 if (!scsi_bufflen(cmd)) {
406 cmd->SCp.buffers_residual = 1; 405 cmd->SCp.buffers_residual = 1;
407 cmd->SCp.ptr = cmd->request_buffer; 406 cmd->SCp.ptr = NULL;
408 cmd->SCp.this_residual = cmd->request_bufflen; 407 cmd->SCp.this_residual = 0;
409 cmd->SCp.buffer = NULL; 408 cmd->SCp.buffer = NULL;
410 } else { 409 } else {
411 cmd->SCp.buffer = cmd->request_buffer; 410 cmd->SCp.buffer = scsi_sglist(cmd);
412 cmd->SCp.buffers_residual = cmd->use_sg; 411 cmd->SCp.buffers_residual = scsi_sg_count(cmd);
413 cmd->SCp.ptr = sg_virt(cmd->SCp.buffer); 412 cmd->SCp.ptr = sg_virt(cmd->SCp.buffer);
414 cmd->SCp.this_residual = cmd->SCp.buffer->length; 413 cmd->SCp.this_residual = cmd->SCp.buffer->length;
415 } 414 }