[libata scsi] add CHS support to ata_scsi_start_stop_xlat()
authorAlbert Lee <albertcc@tw.ibm.com>
Tue, 4 Oct 2005 12:48:17 +0000 (08:48 -0400)
committerJeff Garzik <jgarzik@pobox.com>
Tue, 4 Oct 2005 12:48:17 +0000 (08:48 -0400)
drivers/scsi/libata-scsi.c

index 22434e0d4e758aaa05c63a099a95d4560f5a14ca..4982e6eff7004f7a7a7a078aa6d8eb07bc4c08e1 100644 (file)
@@ -435,10 +435,21 @@ static unsigned int ata_scsi_start_stop_xlat(struct ata_queued_cmd *qc,
                return 1;       /* power conditions not supported */
        if (scsicmd[4] & 0x1) {
                tf->nsect = 1;  /* 1 sector, lba=0 */
-               tf->lbah = 0x0;
-               tf->lbam = 0x0;
-               tf->lbal = 0x0;
-               tf->device |= ATA_LBA;
+
+               if (qc->dev->flags & ATA_DFLAG_LBA) {
+                       qc->tf.flags |= ATA_TFLAG_LBA;
+
+                       tf->lbah = 0x0;
+                       tf->lbam = 0x0;
+                       tf->lbal = 0x0;
+                       tf->device |= ATA_LBA;
+               } else {
+                       /* CHS */
+                       tf->lbal = 0x1; /* sect */
+                       tf->lbam = 0x0; /* cyl low */
+                       tf->lbah = 0x0; /* cyl high */
+               }
+
                tf->command = ATA_CMD_VERIFY;   /* READ VERIFY */
        } else {
                tf->nsect = 0;  /* time period value (0 implies now) */