]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ata: SATL compliance for Inquiry Product Revision
authorKeith Busch <keith.busch@intel.com>
Thu, 1 May 2014 17:12:03 +0000 (11:12 -0600)
committerNitin Garg <nitin.garg@freescale.com>
Fri, 16 Jan 2015 03:17:24 +0000 (21:17 -0600)
The SCSI-to-ATA Translation standard says to use data words 25 and 26
unless they are spaces. For devices that use these words in the firmware
field, they are generally more useful anyway.

Signed-off-by: Keith Busch <keith.busch@intel.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
(cherry picked from commit c49a6bf5eecd31f335df1a3700c92be1a824c6f0)

drivers/ata/libata-scsi.c

index ef8567de6a7515b45631f4a06f3447fe0604f0b3..72691fd939483af322e4460d8d168b2bf5899b46 100644 (file)
@@ -1993,7 +1993,11 @@ static unsigned int ata_scsiop_inq_std(struct ata_scsi_args *args, u8 *rbuf)
        memcpy(rbuf, hdr, sizeof(hdr));
        memcpy(&rbuf[8], "ATA     ", 8);
        ata_id_string(args->id, &rbuf[16], ATA_ID_PROD, 16);
-       ata_id_string(args->id, &rbuf[32], ATA_ID_FW_REV, 4);
+
+       /* From SAT, use last 2 words from fw rev unless they are spaces */
+       ata_id_string(args->id, &rbuf[32], ATA_ID_FW_REV + 2, 4);
+       if (strncmp(&rbuf[32], "    ", 4) == 0)
+               ata_id_string(args->id, &rbuf[32], ATA_ID_FW_REV, 4);
 
        if (rbuf[32] == 0 || rbuf[32] == ' ')
                memcpy(&rbuf[32], "n/a ", 4);