From e9e9be9def29ecf57c5d6c1187c7e7e00f165e47 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 24 Apr 2009 00:52:02 +0200 Subject: Get rid of qurik 9_UNKNOWN again Apparently Seagate seems to use the MSB's of the raw data of the power-on-time field for something else on some disks, so let's just look at the lower 32bits of that field and we get a value that works on all disks including those from Seagate. 32bit should be more than enough to encode the power-on-time for almost all disks so this should not be much of a limitation. --- atasmart.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/atasmart.c b/atasmart.c index 5cf6c30..8e21adb 100644 --- a/atasmart.c +++ b/atasmart.c @@ -1128,7 +1128,7 @@ static void make_pretty(SkSmartAttributeParsedData *a) { else if (!strcmp(a->name, "power-on-hours") || !strcmp(a->name, "loaded-hours") || !strcmp(a->name, "head-flying-hours")) - a->pretty_value = fourtyeight * 60 * 60 * 1000; + a->pretty_value = (fourtyeight & 0xFFFFFFFFU) * 60 * 60 * 1000; else if (!strcmp(a->name, "reallocated-sector-count")) a->pretty_value = fourtyeight & 0xFFFFFFFFU; else @@ -1204,8 +1204,7 @@ typedef enum SkSmartQuirk { SK_SMART_QUIRK_194_10XCELSIUS = 32, SK_SMART_QUIRK_194_UNKNOWN = 64, SK_SMART_QUIRK_200_WRITEERRORCOUNT = 128, - SK_SMART_QUIRK_201_DETECTEDTACOUNT = 256, - SK_SMART_QUIRK_9_UNKNOWN = 512 + SK_SMART_QUIRK_201_DETECTEDTACOUNT = 256 } SkSmartQuirk; /* %STRINGPOOLSTART% */ @@ -1219,7 +1218,6 @@ static const char *quirk_name[] = { "194_UNKNOWN", "200_WRITEERRORCOUNT", "201_DETECTEDTACOUNT", - "9_UNKNOWN", NULL }; /* %STRINGPOOLSTOP% */ @@ -1232,12 +1230,6 @@ typedef struct SkSmartQuirkDatabase { static const SkSmartQuirkDatabase quirk_database[] = { { - /*** Seagate */ - "^ST9160821AS$", - NULL, - SK_SMART_QUIRK_9_UNKNOWN - }, { - /*** Fujitsu */ "^FUJITSU MHR2040AT$", NULL, @@ -1459,8 +1451,7 @@ static const SkSmartAttributeInfo *lookup_attribute(SkDisk *d, uint8_t id) { "power-on-half-minutes", SK_SMART_ATTRIBUTE_UNIT_MSECONDS }; return &a; - } else if (quirk & SK_SMART_QUIRK_9_UNKNOWN) - return NULL; + } /* %STRINGPOOLSTOP% */ break; -- cgit