[PATCH 02/12] libata: add ata_id_has_sata() and use it in ata_id_has_ncq()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If word 76 is 0 or 0xffff, all SATA IDENTIFY words are invalid.  Add
ata_id_has_sata() for this test and use it in ata_id_has_ncq().

Signed-off-by: Tejun Heo <htejun@xxxxxxxxx>

---

 include/linux/ata.h |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

bd18162e08a1508a802a188d6cec69ac3cd5bc8b
diff --git a/include/linux/ata.h b/include/linux/ata.h
index 3671af8..a7798c3 100644
--- a/include/linux/ata.h
+++ b/include/linux/ata.h
@@ -286,7 +286,8 @@ #define ata_id_has_wcache(id)	((id)[82] 
 #define ata_id_has_pm(id)	((id)[82] & (1 << 3))
 #define ata_id_has_lba(id)	((id)[49] & (1 << 9))
 #define ata_id_has_dma(id)	((id)[49] & (1 << 8))
-#define ata_id_has_ncq(id)	((id)[76] & (1 << 8))
+#define ata_id_has_sata(id)	((id)[76] && (id)[76] != 0xffff)
+#define ata_id_has_ncq(id)	(ata_id_has_sata(id) && ((id)[76] & (1 << 8)))
 #define ata_id_queue_depth(id)	(((id)[75] & 0x1f) + 1)
 #define ata_id_removeable(id)	((id)[0] & (1 << 7))
 #define ata_id_has_dword_io(id)	((id)[50] & (1 << 0))
-- 
1.3.2


-
: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Filesystems]     [Linux SCSI]     [Linux RAID]     [Git]     [Kernel Newbies]     [Linux Newbie]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Samba]     [Device Mapper]

  Powered by Linux