ata: SATL compliance for Inquiry Product Revision
PATCH v2 1/1 ata: SATL compliance for Inquiry Product Revision
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 <[email protected]>
---
v1 -> v2:
Use words 25 and 26 by default, strncmp for spaces and fall back to the original.
Added a comment to explain what the heck is happening.
drivers/ata/libata-scsi.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/ata/libata-scsi.c +5 -1
@@ -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 );
Signature · 1 line
1.7.10.4
Tejun Heo
AppliedQuoted 5 lines · Keith Busch
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 <[email protected]>
Applied to libata/for-3.16.
Thanks.
Signature · 1 line
tejun