Source-Changes-HG archive

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

[src/trunk]: src/sbin/atactl add some intel specific smart values, and be mor...



details:   https://anonhg.NetBSD.org/src/rev/eef7019d0a2d
branches:  trunk
changeset: 449252:eef7019d0a2d
user:      mrg <mrg%NetBSD.org@localhost>
date:      Fri Mar 01 02:33:43 2019 +0000

description:
add some intel specific smart values, and be more specific for
a bunch of micron/crucial values.

diffstat:

 sbin/atactl/atactl.c |  55 +++++++++++++++++++++++++++++++++------------------
 1 files changed, 35 insertions(+), 20 deletions(-)

diffs (104 lines):

diff -r 03fc5a71db9e -r eef7019d0a2d sbin/atactl/atactl.c
--- a/sbin/atactl/atactl.c      Fri Mar 01 02:30:42 2019 +0000
+++ b/sbin/atactl/atactl.c      Fri Mar 01 02:33:43 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: atactl.c,v 1.79 2018/12/05 06:49:54 mrg Exp $  */
+/*     $NetBSD: atactl.c,v 1.80 2019/03/01 02:33:43 mrg Exp $  */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
 #include <sys/cdefs.h>
 
 #ifndef lint
-__RCSID("$NetBSD: atactl.c,v 1.79 2018/12/05 06:49:54 mrg Exp $");
+__RCSID("$NetBSD: atactl.c,v 1.80 2019/03/01 02:33:43 mrg Exp $");
 #endif
 
 
@@ -299,7 +299,7 @@
        { 180,          "Unused Reserved Block Count", NULL },
        { 181,          "Program Fail Count", NULL },
        { 182,          "Erase Fail Count", NULL },
-       { 183,          "SATA Downshift Error Count", NULL },
+       { 183,          "Runtime Bad Block", NULL },
        { 184,          "End-to-end error", NULL },
        { 185,          "Head Stability", NULL },
        { 186,          "Induced Op-Vibration Detection", NULL },
@@ -360,6 +360,7 @@
        {   5,          "Reallocated NAND block count", NULL },
        { 173,          "Average block erase count", NULL },
        { 181,          "Non 4K aligned access count", NULL },
+       { 183,          "SATA Downshift Error Count", NULL },
        { 184,          "Error correction count", NULL },
        { 189,          "Factory bad block count", NULL },
        { 197,          "Current pending ECC count", NULL },
@@ -372,15 +373,43 @@
 };
 
 /*
+ * Intel specific SMART attributes.  Fill me in with more.
+ */
+static const struct attr_table intel_smart_names[] = {
+       { 183,          "SATA Downshift Error Count", NULL },
+};
+
+/*
  * Vendor-specific SMART attribute table.  Can be used to override
  * a particular attribute name and special printer function, with the
  * default is the main table.
  */
-const struct vendor_name_table {
+static const struct vendor_name_table {
        const char *name;
        const struct attr_table *table;
 } vendor_smart_names[] = {
-       { .name = "Micron", .table = micron_smart_names },
+       { "Micron",             micron_smart_names },
+       { "Intel",              intel_smart_names },
+};
+
+/*
+ * Global model -> vendor table.  Extend this to regexp.
+ */
+static const struct model_to_vendor_table {
+       const char *model;
+       const char *vendor;
+} model_to_vendor[] = {
+       { "Crucial",            "Micron" },
+       { "Micron",             "Micron" },
+       { "C300-CT",            "Micron" },
+       { "C400-MT",            "Micron" },
+       { "M4-CT",              "Micron" },
+       { "M500",               "Micron" },
+       { "M510",               "Micron" },
+       { "M550",               "Micron" },
+       { "MTFDDA",             "Micron" },
+       { "EEFDDA",             "Micron" },
+       { "INTEL",              "Intel" },
 };
 
 static const struct bitinfo ata_sec_st[] = {
@@ -1009,21 +1038,7 @@
 static const char *
 guess_vendor(void)
 {
-       struct {
-               const char *model;
-               const char *vendor;
-       } model_to_vendor[] = {
-               { "Crucial", "Micron" },
-               { "Micron", "Micron" },
-               { "C300-CT", "Micron" },
-               { "C400-MT", "Micron" },
-               { "M4-CT", "Micron" },
-               { "M500", "Micron" },
-               { "M510", "Micron" },
-               { "M550", "Micron" },
-               { "MTFDDA", "Micron" },
-               { "EEFDDA", "Micron" },
-       };
+
        unsigned i;
 
        for (i = 0; i < __arraycount(model_to_vendor); i++)



Home | Main Index | Thread Index | Old Index