]> git.proxmox.com Git - mirror_smartmontools-debian.git/blobdiff - ataidentify.cpp
New upstream version 6.6
[mirror_smartmontools-debian.git] / ataidentify.cpp
index 900cd20e35f281bcc3517478dcb2a12b71e1f5b5..c56ba888a31190c7bb2762f1f515dac14a068de4 100644 (file)
@@ -1,9 +1,9 @@
 /*
  * ataidentify.cpp
  *
- * Home page of code is: http://smartmontools.sourceforge.net
+ * Home page of code is: http://www.smartmontools.org
  *
- * Copyright (C) 2012-13 Christian Franke <smartmontools-support@lists.sourceforge.net>
+ * Copyright (C) 2012-17 Christian Franke
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -18,7 +18,7 @@
 #include "config.h"
 #include "ataidentify.h"
 
-const char * ataidentify_cpp_cvsid = "$Id: ataidentify.cpp 3785 2013-03-07 21:58:05Z chrfranke $"
+const char * ataidentify_cpp_cvsid = "$Id: ataidentify.cpp 4573 2017-10-29 15:13:58Z chrfranke $"
   ATAIDENTIFY_H_CVSID;
 
 #include "int64.h"
@@ -33,7 +33,8 @@ const char * ataidentify_cpp_cvsid = "$Id: ataidentify.cpp 3785 2013-03-07 21:58
 // Tables 16 and 18 of T13/1532D (ATA/ATAPI-7) Volume 1 Revision 4b, April 21, 2004
 // Tables 29 and 39 of T13/1699-D (ATA8-ACS) Revision 6a, September 6, 2008
 // Tables 50 and 61 of T13/2015-D (ACS-2) Revision 7, June 22, 2011
-// Tables 51 and 56 of T13/2161-D (ACS-3) Revision 4g, February 27, 2013
+// Tables 45 and 50 of T13/2161-D (ACS-3) Revision 5, October 28, 2013
+// Table 55 of T13/BSR INCITS 529 (ACS-4) Revision 20, October 26, 2017 (ATAPI removed)
 
 const char * const identify_descriptions[] = {
   "  0 General configuration",
@@ -42,7 +43,7 @@ const char * const identify_descriptions[] = {
     ". 14 ATAPI: Must be set to 0",
     ". 13 ATAPI: Reserved",
     ". 12:8 ATAPI: Command set: 0x05 = CD/DVD",
-    ". 7 Removable media device",
+    ". 7 Removable media device [OBS-8]",
     ". 6 ATA: Not removable controller and/or device [OBS-6]",
     ". 5:3 ATA: Vendor specific [RET-3]",
     ". 6:5 ATAPI: DRQ after PACKET cmd: 0x0 = 3ms, 0x2 = 50us",
@@ -88,7 +89,8 @@ const char * const identify_descriptions[] = {
     ". 10 IORDY may be disabled",
     ". 9 LBA supported",
     ". 8 DMA supported",
-    ". 7:0 Vendor specific [RET-4]",
+    ". 7:2 Reserved", // ATA-3: Vendor specific, ATA-8: Retired
+    ". 1:0 Long Phy Sector Alignment Error reporting", // ACS-2
 
   " 50 Capabilities",
     ". 15:14 Must be set to 0x1",
@@ -116,9 +118,11 @@ const char * const identify_descriptions[] = {
     ". 14 OVERWRITE EXT supported",
     ". 13 CRYPTO SCRAMBLE EXT supported",
     ". 12 Sanitize Device feature set supported",
-    ". 11:9 Reserved",
-    ". 8 Bits 7:0 are valid",
-    ". 7:0 Current sectors per DRQ on READ/WRITE MULTIPLE",
+    ". 11 Cmds during sanitize as specified by this standard", // ACS-3
+    ". 10 SANITIZE ANTIFREEZE LOCK EXT supported", // ACS-3
+    ". 9 Reserved",
+    ". 8 Bits 7:0 are valid [OBS-ACS-4]",
+    ". 7:0 Current number of sectors per DRQ [OBS-ACS-4]",
 
   " 60-61 User addressable sectors for 28-bit commands (DWord)",
   " 62 Single Word DMA modes [OBS-3]",
@@ -157,8 +161,8 @@ const char * const identify_descriptions[] = {
     ". 5 Trimmed LBA range(s) returning zeroed data supported",
     ". 4 Device encrypts all user data",
     ". 3 Extended number of user addressable sectors supported",
-    ". 2 All write cache is non-volatile",
-    ". 1:0 Reserved",
+    ". 2 All write cache is non-volatile", // ACS-3
+    ". 1:0 Zoned Capabilities", // ACS-4
 
   " 70 Reserved",
   " 71-74 ATA: Reserved for IDENTIFY PACKET DEVICE",
@@ -186,7 +190,9 @@ const char * const identify_descriptions[] = {
     ". 0 Must be set to 0",
 
   " 77 Serial ATA additional capabilities", // ACS-3
-    ". 15:7 Reserved for Serial ATA",
+    ". 15:9 Reserved for Serial ATA",
+    ". 8 Power Disable feature always enabled", // ACS-4
+    ". 7 DevSleep to ReducedPwrState supported", // ACS-4
     ". 6 RECEIVE/SEND FPDMA QUEUED supported",
     ". 5 NCQ Queue Management supported",
     ". 4 NCQ Streaming supported",
@@ -194,7 +200,12 @@ const char * const identify_descriptions[] = {
     ". 0 Must be set to 0",
 
   " 78 Serial ATA features supported",
-    ". 15:8 Reserved for Serial ATA",
+    ". 15:13 Reserved for Serial ATA",
+    ". 12 Power Disable feature supported", // ACS-4
+    ". 11 Rebuild Assist feature set supported", // ACS-4
+    ". 10 Reserved for Serial ATA",
+    ". 9 Hybrid Information supported", // ACS-4
+    ". 8 Device Sleep feature supported", // ACS-4
     ". 7 NCQ Autosense supported", // ACS-3
     ". 6 Software Settings Preservation supported",
     ". 5 Hardware Feature Control supported", // ACS-3
@@ -205,7 +216,11 @@ const char * const identify_descriptions[] = {
     ". 0 Must be set to 0",
 
   " 79 Serial ATA features enabled",
-    ". 15:8 Reserved for Serial ATA",
+    ". 15:12 Reserved for Serial ATA",
+    ". 11 Rebuild Assist feature set enabled", // ACS-4
+    ". 10 Power Disable feature enabled", // ACS-4
+    ". 9 Hybrid Information enabled", // ACS-4
+    ". 8 Device Sleep feature enabled", // ACS-4
     ". 7 Automatic Partial to Slumber transitions enabled", // ACS-3
     ". 6 Software Settings Preservation enabled",
     ". 5 Hardware Feature Control enabled", // ACS-3
@@ -216,13 +231,14 @@ const char * const identify_descriptions[] = {
     ". 0 Must be set to 0",
 
   " 80 Major version number",
-    ". 15:11 Reserved",
+    ". 15:12 Reserved",
+    ". 11 ACS-4 supported",
     ". 10 ACS-3 supported",
     ". 9 ACS-2 supported",
     ". 8 ATA8-ACS supported",
-    ". 7 ATA/ATAPI-7 supported",
-    ". 6 ATA/ATAPI-6 supported",
-    ". 5 ATA/ATAPI-5 supported",
+    ". 7 ATA/ATAPI-7 supported [OBS-ACS-4]",
+    ". 6 ATA/ATAPI-6 supported [OBS-ACS-4]",
+    ". 5 ATA/ATAPI-5 supported [OBS-ACS-4]",
     ". 4 ATA/ATAPI-4 supported [OBS-8]",
     ". 3 ATA-3 supported [OBS-7]",
     ". 2 ATA-2 supported [OBS-6]",
@@ -257,7 +273,7 @@ const char * const identify_descriptions[] = {
     ". 10 48-bit Address feature set supported",
     ". 9 AAM feature set supported [OBS-ACS-2]",
     ". 8 SET MAX security extension supported [OBS-ACS-3]",
-    ". 7 Reserved for Address Offset Reserved Area Boot Method",
+    ". 7 Reserved for Addr Offset Resvd Area Boot [OBS-ACS-3]",
     ". 6 SET FEATURES subcommand required to spin-up",
     ". 5 PUIS feature set supported",
     ". 4 Removable Media Status Notification supported [OBS-8]",
@@ -273,12 +289,12 @@ const char * const identify_descriptions[] = {
     ". 10 URG bit for WRITE STREAM (DMA) EXT supported [OBS-8]",
     ". 9 URG bit for READ STREAM (DMA) EXT supported [OBS-8]",
     ". 8 64-bit World Wide Name supported",
-    ". 7 WRITE DMA QUEUED FUA EXT supported",
+    ". 7 WRITE DMA QUEUED FUA EXT supported [OBS-ACS-2]",
     ". 6 WRITE DMA/MULTIPLE FUA EXT supported",
     ". 5 GPL feature set supported",
-    ". 4 Streaming feature set supported [OBS-ACS-3]",
+    ". 4 Streaming feature set supported",
     ". 3 Media Card Pass Through Command supported [OBS-ACS-2]",
-    ". 2 Media serial number supported", // ACS-3 r3 or later: Reserved
+    ". 2 Media serial number supported [RES-ACS-3]",
     ". 1 SMART self-test supported",
     ". 0 SMART error logging supported",
 
@@ -309,7 +325,7 @@ const char * const identify_descriptions[] = {
     ". 10 48-bit Address features set supported",
     ". 9 AAM feature set enabled [OBS-ACS-2]",
     ". 8 SET MAX security extension enabled [OBS-ACS-3]",
-    ". 7 Reserved for Address Offset Reserved Area Boot Method",
+    ". 7 Reserved for Addr Offset Resvd Area Boot [OBS-ACS-3]",
     ". 6 SET FEATURES subcommand required to spin-up",
     ". 5 PUIS feature set enabled",
     ". 4 Removable Media Status Notification enabled [OBS-8]",
@@ -353,9 +369,18 @@ const char * const identify_descriptions[] = {
     ". 0 Ultra DMA mode 0 supported",
 
   " 89 SECURITY ERASE UNIT time",
+    ". 15 Bits 14:8 of value are valid", // ACS-3
+    ". 14:0 SECURITY ERASE UNIT time value", // value*2 minutes
+
   " 90 ENHANCED SECURITY ERASE UNIT time",
+    ". 15 Bits 14:8 of value are valid", // ACS-3
+    ". 14:0 ENHANCED SECURITY ERASE UNIT time value", // value*2 minutes
+
   " 91 Current APM level",
-  " 92 Master password revision code",
+    ". 15:8 Reserved", // ACS-3
+    ". 7:0 Current APM level value",
+
+  " 92 Master Password Identifier", // ATA-7: Master Password Revision Code
 
   " 93 Hardware reset result (PATA)",
     ". 15:14 Must be set to 0x1",
@@ -392,8 +417,8 @@ const char * const identify_descriptions[] = {
     ". 3:0 2^X logical sectors per physical sector",
 
   "107 Inter-seek delay for ISO 7779 acoustic testing",
-  "108-111 64-bit World Wide Name",
-  "112-115 Reserved for a 128-bit World Wide Name",
+  "108-111 World Wide Name",
+  "112-115 Reserved", // ATA-7: Reserved for world wide name extension to 128 bits
   "116 Reserved for TLC [OBS-ACS-3]",
   "117-118 Logical sector size (DWord)",
 
@@ -457,9 +482,9 @@ const char * const identify_descriptions[] = {
 
   "168 Form factor",
     ". 15:4 Reserved",
-    ". 3:0 Nominal form factor: -, 5.25, 3.5, 2.5, 1.8, <1.8",
+    ". 3:0 Nominal form factor: -, 5.25, 3.5, 2.5, 1.8, ...", // <1.8, ACS-4: mSATA, M.2, ...
 
-  "169 Data Set Management support",
+  "169 DATA SET MANAGEMENT command support",
     ". 15:1 Reserved",
     ". 0 Trim bit in DATA SET MANAGEMENT command supported",
 
@@ -468,7 +493,7 @@ const char * const identify_descriptions[] = {
   "176-205 Current media serial number (String)",
 
   "206 SCT Command Transport",
-    ". 15:12 Vendor Specific",
+    ". 15:12 Vendor specific",
     ". 11:8 Reserved",
     ". 7 Reserved for Serial ATA",
     ". 6 Reserved",
@@ -479,7 +504,7 @@ const char * const identify_descriptions[] = {
     ". 1 SCT Read/Write Long supported [OBS-ACS-2]",
     ". 0 SCT Command Transport supported",
 
-  "207-208 Reserved for CE-ATA",
+  "207-208 Reserved", // ATA-8: Reserved for CE-ATA
 
   "209 Alignment of logical sectors",
     ". 15:14 Must be set to 0x1",
@@ -512,10 +537,12 @@ const char * const identify_descriptions[] = {
   "221 Reserved",
 
   "222 Transport major version number",
-    ". 15:12 Transport type: 0x0 = Parallel, 0x1 = Serial",
-    ". 11:7 Reserved    | Reserved",
-    ". 6 Reserved    | SATA 3.1",
-    ". 5 Reserved    | SATA 3.0",
+    ". 15:12 Transport: 0x0 = Parallel, 0x1 = Serial, 0xe = PCIe", // PCIe: ACS-4
+    ". 11:9 Reserved    | Reserved",
+    ". 8 Reserved    | SATA 3.3", // ACS-4
+    ". 7 Reserved    | SATA 3.2", // ACS-4
+    ". 6 Reserved    | SATA 3.1", // ACS-3
+    ". 5 Reserved    | SATA 3.0", // ACS-2
     ". 4 Reserved    | SATA 2.6",
     ". 3 Reserved    | SATA 2.5",
     ". 2 Reserved    | SATA II: Extensions",
@@ -611,7 +638,7 @@ void ata_print_identify_data(const void * id, bool all_words, int bit_level)
     if (bit >= 0) {
       int b;
       if (bit2 >= 0)
-        b = (w >> bit2) & ~(~0 << (bit-bit2+1));
+        b = (w >> bit2) & ~(~0U << (bit-bit2+1));
       else
         b = (w >> bit) & 1;
 
@@ -683,9 +710,9 @@ void ata_print_identify_data(const void * id, bool all_words, int bit_level)
             if (word + 1 == word2 && strstr(desc, "(DWord)"))
               pout("  (%u)\n", ((unsigned)get_word(id, word2) << 16) | w);
             else if (word + 3 == word2 && strstr(desc, "(QWord)"))
-              pout("  (%"PRIu64")\n", ((uint64_t)get_word(id, word + 3) << 48)
-                                    | ((uint64_t)get_word(id, word + 2) << 32)
-                                    | ((unsigned)get_word(id, word + 1) << 16) | (unsigned)w);
+              pout("  (%" PRIu64 ")\n", ((uint64_t)get_word(id, word + 3) << 48)
+                                      | ((uint64_t)get_word(id, word + 2) << 32)
+                                      | ((unsigned)get_word(id, word + 1) << 16) | (unsigned)w);
             else
               pout("\n");
           }