aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/ata/libata-scsi.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index 598ef1018e19..7ad046b7c356 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -450,8 +450,8 @@ static struct ata_queued_cmd *ata_scsi_qc_new(struct ata_device *dev,
450 qc->scsicmd = cmd; 450 qc->scsicmd = cmd;
451 qc->scsidone = done; 451 qc->scsidone = done;
452 452
453 qc->__sg = (struct scatterlist *) cmd->request_buffer; 453 qc->__sg = scsi_sglist(cmd);
454 qc->n_elem = cmd->use_sg; 454 qc->n_elem = scsi_sg_count(cmd);
455 } else { 455 } else {
456 cmd->result = (DID_OK << 16) | (QUEUE_FULL << 1); 456 cmd->result = (DID_OK << 16) | (QUEUE_FULL << 1);
457 done(cmd); 457 done(cmd);
@@ -1493,13 +1493,13 @@ static int ata_scsi_translate(struct ata_device *dev, struct scsi_cmnd *cmd,
1493 /* data is present; dma-map it */ 1493 /* data is present; dma-map it */
1494 if (cmd->sc_data_direction == DMA_FROM_DEVICE || 1494 if (cmd->sc_data_direction == DMA_FROM_DEVICE ||
1495 cmd->sc_data_direction == DMA_TO_DEVICE) { 1495 cmd->sc_data_direction == DMA_TO_DEVICE) {
1496 if (unlikely(cmd->request_bufflen < 1)) { 1496 if (unlikely(scsi_bufflen(cmd) < 1)) {
1497 ata_dev_printk(dev, KERN_WARNING, 1497 ata_dev_printk(dev, KERN_WARNING,
1498 "WARNING: zero len r/w req\n"); 1498 "WARNING: zero len r/w req\n");
1499 goto err_did; 1499 goto err_did;
1500 } 1500 }
1501 1501
1502 ata_sg_init(qc, cmd->request_buffer, cmd->use_sg); 1502 ata_sg_init(qc, scsi_sglist(cmd), scsi_sg_count(cmd));
1503 1503
1504 qc->dma_dir = cmd->sc_data_direction; 1504 qc->dma_dir = cmd->sc_data_direction;
1505 } 1505 }
@@ -1553,7 +1553,7 @@ static unsigned int ata_scsi_rbuf_get(struct scsi_cmnd *cmd, u8 **buf_out)
1553 u8 *buf; 1553 u8 *buf;
1554 unsigned int buflen; 1554 unsigned int buflen;
1555 1555
1556 struct scatterlist *sg = (struct scatterlist *) cmd->request_buffer; 1556 struct scatterlist *sg = scsi_sglist(cmd);
1557 1557
1558 if (sg) { 1558 if (sg) {
1559 buf = kmap_atomic(sg->page, KM_IRQ0) + sg->offset; 1559 buf = kmap_atomic(sg->page, KM_IRQ0) + sg->offset;
@@ -1580,7 +1580,7 @@ static unsigned int ata_scsi_rbuf_get(struct scsi_cmnd *cmd, u8 **buf_out)
1580 1580
1581static inline void ata_scsi_rbuf_put(struct scsi_cmnd *cmd, u8 *buf) 1581static inline void ata_scsi_rbuf_put(struct scsi_cmnd *cmd, u8 *buf)
1582{ 1582{
1583 struct scatterlist *sg = (struct scatterlist *) cmd->request_buffer; 1583 struct scatterlist *sg = scsi_sglist(cmd);
1584 if (sg) 1584 if (sg)
1585 kunmap_atomic(buf - sg->offset, KM_IRQ0); 1585 kunmap_atomic(buf - sg->offset, KM_IRQ0);
1586} 1586}
@@ -2383,7 +2383,7 @@ static unsigned int atapi_xlat(struct ata_queued_cmd *qc)
2383 } 2383 }
2384 2384
2385 qc->tf.command = ATA_CMD_PACKET; 2385 qc->tf.command = ATA_CMD_PACKET;
2386 qc->nbytes = scmd->request_bufflen; 2386 qc->nbytes = scsi_bufflen(scmd);
2387 2387
2388 /* check whether ATAPI DMA is safe */ 2388 /* check whether ATAPI DMA is safe */
2389 if (!using_pio && ata_check_atapi_dma(qc)) 2389 if (!using_pio && ata_check_atapi_dma(qc))
@@ -2633,7 +2633,7 @@ static unsigned int ata_scsi_pass_thru(struct ata_queued_cmd *qc)
2633 case ATA_CMD_WRITE_LONG_ONCE: 2633 case ATA_CMD_WRITE_LONG_ONCE:
2634 if (tf->protocol != ATA_PROT_PIO || tf->nsect != 1) 2634 if (tf->protocol != ATA_PROT_PIO || tf->nsect != 1)
2635 goto invalid_fld; 2635 goto invalid_fld;
2636 qc->sect_size = scmd->request_bufflen; 2636 qc->sect_size = scsi_bufflen(scmd);
2637 } 2637 }
2638 2638
2639 /* 2639 /*
@@ -2663,7 +2663,7 @@ static unsigned int ata_scsi_pass_thru(struct ata_queued_cmd *qc)
2663 * TODO: find out if we need to do more here to 2663 * TODO: find out if we need to do more here to
2664 * cover scatter/gather case. 2664 * cover scatter/gather case.
2665 */ 2665 */
2666 qc->nbytes = scmd->request_bufflen; 2666 qc->nbytes = scsi_bufflen(scmd);
2667 2667
2668 /* request result TF */ 2668 /* request result TF */
2669 qc->flags |= ATA_QCFLAG_RESULT_TF; 2669 qc->flags |= ATA_QCFLAG_RESULT_TF;