~ubuntu-branches/ubuntu/natty/libatasmart/natty

« back to all changes in this revision

Viewing changes to atasmart.c

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2010-02-19 23:37:28 UTC
  • mto: This revision was merged to the branch mainline in revision 12.
  • Revision ID: james.westby@ubuntu.com-20100219233728-za4vo84wuh058ar0
Tags: upstream-0.17+git20100219
ImportĀ upstreamĀ versionĀ 0.17+git20100219

Show diffs side-by-side

added added

removed removed

Lines of Context:
151
151
#define SK_MSECOND_VALID_SHORT_MAX (60ULL * 60ULL * 1000ULL)
152
152
#define SK_MSECOND_VALID_LONG_MAX (30ULL * 365ULL * 24ULL * 60ULL * 60ULL * 1000ULL)
153
153
 
154
 
int init_smart(SkDisk *d);
 
154
static int init_smart(SkDisk *d);
155
155
 
156
156
static const char *disk_type_to_human_string(SkDiskType type) {
157
157
 
1290
1290
        [11]  = { "calibration-retry-count",     SK_SMART_ATTRIBUTE_UNIT_NONE,     NULL },
1291
1291
        [12]  = { "power-cycle-count",           SK_SMART_ATTRIBUTE_UNIT_NONE,     NULL },
1292
1292
        [13]  = { "read-soft-error-rate",        SK_SMART_ATTRIBUTE_UNIT_NONE,     NULL },
 
1293
        [184] = { "end-to-end-error",            SK_SMART_ATTRIBUTE_UNIT_NONE,     NULL },
1293
1294
        [187] = { "reported-uncorrect",          SK_SMART_ATTRIBUTE_UNIT_SECTORS,  verify_sectors },
 
1295
        [188] = { "command-timeout",             SK_SMART_ATTRIBUTE_UNIT_NONE,     NULL },
1294
1296
        [189] = { "high-fly-writes",             SK_SMART_ATTRIBUTE_UNIT_NONE,     NULL },
1295
1297
        [190] = { "airflow-temperature-celsius", SK_SMART_ATTRIBUTE_UNIT_MKELVIN,  verify_temperature },
1296
1298
        [191] = { "g-sense-error-rate",          SK_SMART_ATTRIBUTE_UNIT_NONE,     NULL },
1513
1515
                SK_SMART_QUIRK_5_UNKNOWN
1514
1516
        }, {
1515
1517
 
1516
 
        /*** Apple SSD (?) http://bugs.freedesktop.org/show_bug.cgi?id=24700 */
 
1518
        /*** Apple SSD (?) http://bugs.freedesktop.org/show_bug.cgi?id=24700
 
1519
                           https://bugs.launchpad.net/ubuntu/+source/gnome-disk-utility/+bug/438136/comments/4 */
1517
1520
                "^MCCOE64GEMPP$",
1518
 
                "^2.9.09$",
 
1521
                "^2.9.0[3-9]$",
1519
1522
                SK_SMART_QUIRK_5_UNKNOWN|
1520
1523
                SK_SMART_QUIRK_190_UNKNOWN
1521
1524
        }, {
2502
2505
                        goto finish;
2503
2506
                }
2504
2507
 
2505
 
                if ((vid == 0x152d && pid == 0x2329) ||
2506
 
                    (vid == 0x152d && pid == 0x2338) ||
2507
 
                    (vid == 0x152d && pid == 0x2339))
 
2508
                if ((vid == 0x0928 && pid == 0x0000))
 
2509
                        /* This Oxford Semiconductor bridge seems to
 
2510
                         * choke on SAT commands. Let's explicitly
 
2511
                         * black list it here.
 
2512
                         *
 
2513
                         * http://bugs.freedesktop.org/show_bug.cgi?id=24951 */
 
2514
                        d->type = SK_DISK_TYPE_NONE;
 
2515
                else if ((vid == 0x152d && pid == 0x2329) ||
 
2516
                         (vid == 0x152d && pid == 0x2338) ||
 
2517
                         (vid == 0x152d && pid == 0x2339))
2508
2518
                        /* Some JMicron bridges seem to choke on SMART
2509
2519
                         * commands, so let's explicitly black list
2510
2520
                         * them here.
2515
2525
                         * these vids/pids choke on the jmicron access
2516
2526
                         * mode. To make sure we don't break things
2517
2527
                         * for people we now disable this by
2518
 
                         * default.*/
 
2528
                         * default. */
2519
2529
                        d->type = SK_DISK_TYPE_NONE;
2520
2530
                else if ((vid == 0x152d && pid == 0x2336))
2521
2531
                        /* This JMicron bridge seems to always work
2548
2558
        return r;
2549
2559
}
2550
2560
 
2551
 
int init_smart(SkDisk *d) {
 
2561
static int init_smart(SkDisk *d) {
2552
2562
        /* We don't do the SMART initialization right-away, since some
2553
2563
         * drivers spin up when we do that */
2554
2564
 
2578
2588
        }
2579
2589
 
2580
2590
        disk_smart_read_thresholds(d);
 
2591
        ret = 0;
2581
2592
 
2582
2593
fail:
2583
2594
        return ret;