SK_SMART_SELF_TEST_EXTENDED = 2,
SK_SMART_SELF_TEST_CONVEYANCE = 3,
SK_SMART_SELF_TEST_ABORT = 127
+
+ /* This enum may be extended at any time without this being
+ * considered an ABI change. So take care when you use this
+ * type! */
} SkSmartSelfTest;
const char* sk_smart_self_test_to_string(SkSmartSelfTest test);
SK_SMART_OFFLINE_DATA_COLLECTION_STATUS_FATAL,
SK_SMART_OFFLINE_DATA_COLLECTION_STATUS_UNKNOWN,
_SK_SMART_OFFLINE_DATA_COLLECTION_STATUS_MAX
+
+ /* This enum may be extended at any time without this being
+ * considered an ABI change. So take care when you use this
+ * type! */
} SkSmartOfflineDataCollectionStatus;
const char* sk_smart_offline_data_collection_status_to_string(SkSmartOfflineDataCollectionStatus status);
SK_SMART_SELF_TEST_EXECUTION_STATUS_ERROR_HANDLING = 8,
SK_SMART_SELF_TEST_EXECUTION_STATUS_INPROGRESS = 15,
_SK_SMART_SELF_TEST_EXECUTION_STATUS_MAX
+
+ /* This enum may be extended at any time without this being
+ * considered an ABI change. So take care when you use this
+ * type! */
} SkSmartSelfTestExecutionStatus;
const char *sk_smart_self_test_execution_status_to_string(SkSmartSelfTestExecutionStatus status);
typedef enum SkSmartAttributeUnit {
SK_SMART_ATTRIBUTE_UNIT_UNKNOWN,
SK_SMART_ATTRIBUTE_UNIT_NONE,
- SK_SMART_ATTRIBUTE_UNIT_MSECONDS, /* milliseconds */
+ SK_SMART_ATTRIBUTE_UNIT_MSECONDS, /* milliseconds */
SK_SMART_ATTRIBUTE_UNIT_SECTORS,
- SK_SMART_ATTRIBUTE_UNIT_MKELVIN, /* millikelvin */
+ SK_SMART_ATTRIBUTE_UNIT_MKELVIN, /* millikelvin */
+ SK_SMART_ATTRIBUTE_UNIT_SMALL_PERCENT, /* percentage with 3 decimal points */
+ SK_SMART_ATTRIBUTE_UNIT_PERCENT, /* integer percentage */
+ SK_SMART_ATTRIBUTE_UNIT_MB,
_SK_SMART_ATTRIBUTE_UNIT_MAX
+
+ /* This enum may be extended at any time without this being
+ * considered an ABI change. So take care when you use this
+ * type! */
} SkSmartAttributeUnit;
const char* sk_smart_attribute_unit_to_string(SkSmartAttributeUnit unit);
SkBool prefailure:1;
/* Volatile data */
- SkBool good:1, good_valid:1;
+ SkBool good_now:1, good_now_valid:1;
+ SkBool good_in_the_past:1, good_in_the_past_valid:1;
SkBool current_value_valid:1, worst_value_valid:1;
+ SkBool warn:1;
uint8_t current_value, worst_value;
uint64_t pretty_value;
uint8_t raw[6];
typedef enum SkSmartOverall {
SK_SMART_OVERALL_GOOD,
- SK_SMART_OVERALL_BAD_STATUS, /* Smart Self Assessment negative */
- SK_SMART_OVERALL_BAD_SECTOR, /* At least one bad sector */
- SK_SMART_OVERALL_BAD_ATTRIBUTE, /* At least one attribute exceeded its threshold */
+ SK_SMART_OVERALL_BAD_ATTRIBUTE_IN_THE_PAST, /* At least one pre-fail attribute exceeded its threshold in the past */
+ SK_SMART_OVERALL_BAD_SECTOR, /* At least one bad sector */
+ SK_SMART_OVERALL_BAD_ATTRIBUTE_NOW, /* At least one pre-fail attribute is exceeding its threshold now */
+ SK_SMART_OVERALL_BAD_SECTOR_MANY, /* Many bad sectors */
+ SK_SMART_OVERALL_BAD_STATUS, /* Smart Self Assessment negative */
_SK_SMART_OVERALL_MAX
+
+ /* This enum may be extended at any time without this being
+ * considered an ABI change. So take care when you use this
+ * type! */
} SkSmartOverall;
const char* sk_smart_overall_to_string(SkSmartOverall overall);
/* High level API to get the power on time */
int sk_disk_smart_get_power_on(SkDisk *d, uint64_t *mseconds);
+/* High level API to get the power cycle count */
+int sk_disk_smart_get_power_cycle(SkDisk *d, uint64_t *count);
+
/* High level API to get the number of bad sectors (i.e. pending and reallocated) */
int sk_disk_smart_get_bad(SkDisk *d, uint64_t *sectors);