Classes |
| struct | ata_identify_device |
| struct | ata_smart_attribute |
| struct | ata_smart_values |
| struct | ata_smart_threshold_entry |
| struct | ata_smart_thresholds_pvt |
| struct | ata_smart_errorlog_error_struct |
| struct | ata_smart_errorlog_command_struct |
| struct | ata_smart_errorlog_struct |
| struct | ata_smart_errorlog |
| struct | ata_smart_exterrlog_command |
| struct | ata_smart_exterrlog_error |
| struct | ata_smart_exterrlog_error_log |
| struct | ata_smart_exterrlog |
| struct | ata_smart_selftestlog_struct |
| struct | ata_smart_selftestlog |
| struct | ata_smart_extselftestlog_desc |
| struct | ata_smart_extselftestlog |
| struct | ata_smart_log_entry |
| struct | ata_smart_log_directory |
| struct | test_span |
| struct | ata_selective_self_test_log |
| struct | ata_sct_status_response |
| struct | ata_sct_error_recovery_control_command |
| struct | ata_sct_feature_control_command |
| struct | ata_sct_data_table_command |
| struct | ata_sct_temperature_history_table |
| struct | ata_selective_selftest_args |
| struct | ata_selective_selftest_args::span_args |
| class | ata_vendor_attr_defs |
| struct | ata_vendor_attr_defs::entry |
| class | firmwarebug_defs |
| struct | ata_size_info |
Defines |
| #define | ATACMDS_H_CVSID "$Id: atacmds.h 3632 2012-10-09 10:10:53Z chrfranke $" |
| #define | ASSERT_SIZEOF_STRUCT(s, n) typedef char assert_sizeof_struct_##s[(sizeof(struct s) == (n)) ? 1 : -1] |
| #define | ATTR_PACKED |
| #define | ATA_CHECK_POWER_MODE 0xe5 |
| #define | ATA_IDENTIFY_DEVICE 0xec |
| #define | ATA_IDENTIFY_PACKET_DEVICE 0xa1 |
| #define | ATA_IDLE 0xe3 |
| #define | ATA_SMART_CMD 0xb0 |
| #define | ATA_SECURITY_FREEZE_LOCK 0xf5 |
| #define | ATA_SET_FEATURES 0xef |
| #define | ATA_STANDBY_IMMEDIATE 0xe0 |
| #define | ATA_DISABLE_AAM 0xc2 |
| #define | ATA_DISABLE_APM 0x85 |
| #define | ATA_DISABLE_WRITE_CACHE 0x82 |
| #define | ATA_DISABLE_READ_LOOK_AHEAD 0x55 |
| #define | ATA_ENABLE_AAM 0x42 |
| #define | ATA_ENABLE_APM 0x05 |
| #define | ATA_ENABLE_WRITE_CACHE 0x02 |
| #define | ATA_ENABLE_READ_LOOK_AHEAD 0xaa |
| #define | ATA_READ_LOG_EXT 0x2F |
| #define | ATA_SMART_READ_VALUES 0xd0 |
| #define | ATA_SMART_READ_THRESHOLDS 0xd1 |
| #define | ATA_SMART_AUTOSAVE 0xd2 |
| #define | ATA_SMART_SAVE 0xd3 |
| #define | ATA_SMART_IMMEDIATE_OFFLINE 0xd4 |
| #define | ATA_SMART_READ_LOG_SECTOR 0xd5 |
| #define | ATA_SMART_WRITE_LOG_SECTOR 0xd6 |
| #define | ATA_SMART_WRITE_THRESHOLDS 0xd7 |
| #define | ATA_SMART_ENABLE 0xd8 |
| #define | ATA_SMART_DISABLE 0xd9 |
| #define | ATA_SMART_STATUS 0xda |
| #define | ATA_SMART_AUTO_OFFLINE 0xdb |
| #define | OFFLINE_FULL_SCAN 0 |
| #define | SHORT_SELF_TEST 1 |
| #define | EXTEND_SELF_TEST 2 |
| #define | CONVEYANCE_SELF_TEST 3 |
| #define | SELECTIVE_SELF_TEST 4 |
| #define | ABORT_SELF_TEST 127 |
| #define | SHORT_CAPTIVE_SELF_TEST 129 |
| #define | EXTEND_CAPTIVE_SELF_TEST 130 |
| #define | CONVEYANCE_CAPTIVE_SELF_TEST 131 |
| #define | SELECTIVE_CAPTIVE_SELF_TEST 132 |
| #define | CAPTIVE_MASK (0x01<<7) |
| #define | NUMBER_ATA_SMART_ATTRIBUTES 30 |
| #define | ATTRIBUTE_FLAGS_PREFAILURE(x) (x & 0x01) |
| #define | ATTRIBUTE_FLAGS_ONLINE(x) (x & 0x02) |
| #define | ATTRIBUTE_FLAGS_PERFORMANCE(x) (x & 0x04) |
| #define | ATTRIBUTE_FLAGS_ERRORRATE(x) (x & 0x08) |
| #define | ATTRIBUTE_FLAGS_EVENTCOUNT(x) (x & 0x10) |
| #define | ATTRIBUTE_FLAGS_SELFPRESERVING(x) (x & 0x20) |
| #define | ATTRIBUTE_FLAGS_OTHER(x) ((x) & 0xffc0) |
| #define | SELECTIVE_FLAG_DOSCAN (0x0002) |
| #define | SELECTIVE_FLAG_PENDING (0x0008) |
| #define | SELECTIVE_FLAG_ACTIVE (0x0010) |
| #define | MAX_ATTRIBUTE_NUM 256 |
Enumerations |
| enum | smart_command_set {
ENABLE,
DISABLE,
AUTOSAVE,
IMMEDIATE_OFFLINE,
AUTO_OFFLINE,
STATUS,
STATUS_CHECK,
READ_VALUES,
READ_THRESHOLDS,
READ_LOG,
IDENTIFY,
PIDENTIFY,
CHECK_POWER_MODE,
WRITE_LOG
} |
| enum | { SEL_RANGE,
SEL_REDO,
SEL_NEXT,
SEL_CONT
} |
| enum | ata_vendor_def_prior { PRIOR_DEFAULT,
PRIOR_DATABASE,
PRIOR_USER
} |
| enum | ata_attr_raw_format {
RAWFMT_DEFAULT,
RAWFMT_RAW8,
RAWFMT_RAW16,
RAWFMT_RAW48,
RAWFMT_HEX48,
RAWFMT_RAW56,
RAWFMT_HEX56,
RAWFMT_RAW64,
RAWFMT_HEX64,
RAWFMT_RAW16_OPT_RAW16,
RAWFMT_RAW16_OPT_AVG16,
RAWFMT_RAW24_OPT_RAW8,
RAWFMT_RAW24_DIV_RAW24,
RAWFMT_RAW24_DIV_RAW32,
RAWFMT_SEC2HOUR,
RAWFMT_MIN2HOUR,
RAWFMT_HALFMIN2HOUR,
RAWFMT_MSEC24_HOUR32,
RAWFMT_TEMPMINMAX,
RAWFMT_TEMP10X
} |
| enum | { ATTRFLAG_INCREASING = 0x01,
ATTRFLAG_NO_NORMVAL = 0x02,
ATTRFLAG_NO_WORSTVAL = 0x04
} |
| enum | firmwarebug_t {
BUG_NONE = 0,
BUG_NOLOGDIR,
BUG_SAMSUNG,
BUG_SAMSUNG2,
BUG_SAMSUNG3,
BUG_XERRORLBA
} |
| enum | ata_attr_state {
ATTRSTATE_NON_EXISTING,
ATTRSTATE_NO_NORMVAL,
ATTRSTATE_NO_THRESHOLD,
ATTRSTATE_OK,
ATTRSTATE_FAILED_PAST,
ATTRSTATE_FAILED_NOW
} |
Functions |
| | ASSERT_SIZEOF_STRUCT (ata_identify_device, 512) |
| | ASSERT_SIZEOF_STRUCT (ata_smart_attribute, 12) |
| | ASSERT_SIZEOF_STRUCT (ata_smart_values, 512) |
| | ASSERT_SIZEOF_STRUCT (ata_smart_threshold_entry, 12) |
| | ASSERT_SIZEOF_STRUCT (ata_smart_thresholds_pvt, 512) |
| | ASSERT_SIZEOF_STRUCT (ata_smart_errorlog_error_struct, 30) |
| | ASSERT_SIZEOF_STRUCT (ata_smart_errorlog_command_struct, 12) |
| | ASSERT_SIZEOF_STRUCT (ata_smart_errorlog_struct, 90) |
| | ASSERT_SIZEOF_STRUCT (ata_smart_errorlog, 512) |
| | ASSERT_SIZEOF_STRUCT (ata_smart_exterrlog_command, 18) |
| | ASSERT_SIZEOF_STRUCT (ata_smart_exterrlog_error, 34) |
| | ASSERT_SIZEOF_STRUCT (ata_smart_exterrlog_error_log, 124) |
| | ASSERT_SIZEOF_STRUCT (ata_smart_exterrlog, 512) |
| | ASSERT_SIZEOF_STRUCT (ata_smart_selftestlog_struct, 24) |
| | ASSERT_SIZEOF_STRUCT (ata_smart_selftestlog, 512) |
| | ASSERT_SIZEOF_STRUCT (ata_smart_extselftestlog_desc, 26) |
| | ASSERT_SIZEOF_STRUCT (ata_smart_extselftestlog, 512) |
| | ASSERT_SIZEOF_STRUCT (ata_smart_log_entry, 2) |
| | ASSERT_SIZEOF_STRUCT (ata_smart_log_directory, 512) |
| | ASSERT_SIZEOF_STRUCT (test_span, 16) |
| | ASSERT_SIZEOF_STRUCT (ata_selective_self_test_log, 512) |
| | ASSERT_SIZEOF_STRUCT (ata_sct_status_response, 512) |
| | ASSERT_SIZEOF_STRUCT (ata_sct_error_recovery_control_command, 512) |
| | ASSERT_SIZEOF_STRUCT (ata_sct_feature_control_command, 512) |
| | ASSERT_SIZEOF_STRUCT (ata_sct_data_table_command, 512) |
| | ASSERT_SIZEOF_STRUCT (ata_sct_temperature_history_table, 512) |
| int | ata_read_identity (ata_device *device, ata_identify_device *buf, bool fix_swapped_id, unsigned char *raw_buf=0) |
| int | ataCheckPowerMode (ata_device *device) |
| bool | ata_nodata_command (ata_device *device, unsigned char command, int sector_count=-1) |
| bool | ata_set_features (ata_device *device, unsigned char features, int sector_count=-1) |
| int | ataReadSmartValues (ata_device *device, struct ata_smart_values *) |
| int | ataReadSmartThresholds (ata_device *device, struct ata_smart_thresholds_pvt *) |
| int | ataReadErrorLog (ata_device *device, ata_smart_errorlog *data, firmwarebug_defs firmwarebugs) |
| int | ataReadSelfTestLog (ata_device *device, ata_smart_selftestlog *data, firmwarebug_defs firmwarebugs) |
| int | ataReadSelectiveSelfTestLog (ata_device *device, struct ata_selective_self_test_log *data) |
| int | ataReadLogDirectory (ata_device *device, ata_smart_log_directory *, bool gpl) |
| bool | ataReadLogExt (ata_device *device, unsigned char logaddr, unsigned char features, unsigned page, void *data, unsigned nsectors) |
| bool | ataReadSmartLog (ata_device *device, unsigned char logaddr, void *data, unsigned nsectors) |
| bool | ataReadExtErrorLog (ata_device *device, ata_smart_exterrlog *log, unsigned nsectors, firmwarebug_defs firwarebugs) |
| bool | ataReadExtSelfTestLog (ata_device *device, ata_smart_extselftestlog *log, unsigned nsectors) |
| int | ataReadSCTStatus (ata_device *device, ata_sct_status_response *sts) |
| int | ataReadSCTTempHist (ata_device *device, ata_sct_temperature_history_table *tmh, ata_sct_status_response *sts) |
| int | ataSetSCTTempInterval (ata_device *device, unsigned interval, bool persistent) |
| int | ataGetSCTErrorRecoveryControltime (ata_device *device, unsigned type, unsigned short &time_limit) |
| int | ataSetSCTErrorRecoveryControltime (ata_device *device, unsigned type, unsigned short time_limit) |
| int | ataEnableSmart (ata_device *device) |
| int | ataDisableSmart (ata_device *device) |
| int | ataEnableAutoSave (ata_device *device) |
| int | ataDisableAutoSave (ata_device *device) |
| int | ataEnableAutoOffline (ata_device *device) |
| int | ataDisableAutoOffline (ata_device *device) |
| int | ataSmartTest (ata_device *device, int testtype, bool force, const ata_selective_selftest_args &args, const ata_smart_values *sv, uint64_t num_sectors) |
| int | ataWriteSelectiveSelfTestLog (ata_device *device, ata_selective_selftest_args &args, const ata_smart_values *sv, uint64_t num_sectors, const ata_selective_selftest_args *prev_spans=0) |
| int | ata_get_wwn (const ata_identify_device *id, unsigned &oui, uint64_t &unique_id) |
| int | ata_get_rotation_rate (const ata_identify_device *id) |
| int | ataDoesSmartWork (ata_device *device) |
| int | ataSmartSupport (const ata_identify_device *drive) |
| int | ataIsSmartEnabled (const ata_identify_device *drive) |
| int | ataSmartStatus2 (ata_device *device) |
| int | isSmartErrorLogCapable (const ata_smart_values *data, const ata_identify_device *identity) |
| int | isSmartTestLogCapable (const ata_smart_values *data, const ata_identify_device *identity) |
| int | isGeneralPurposeLoggingCapable (const ata_identify_device *identity) |
| int | isSupportExecuteOfflineImmediate (const ata_smart_values *data) |
| int | isSupportAutomaticTimer (const ata_smart_values *data) |
| int | isSupportOfflineAbort (const ata_smart_values *data) |
| int | isSupportOfflineSurfaceScan (const ata_smart_values *data) |
| int | isSupportSelfTest (const ata_smart_values *data) |
| int | isSupportConveyanceSelfTest (const ata_smart_values *data) |
| int | isSupportSelectiveSelfTest (const ata_smart_values *data) |
| bool | isSCTCapable (const ata_identify_device *drive) |
| bool | isSCTErrorRecoveryControlCapable (const ata_identify_device *drive) |
| bool | isSCTFeatureControlCapable (const ata_identify_device *drive) |
| bool | isSCTDataTableCapable (const ata_identify_device *drive) |
| int | TestTime (const ata_smart_values *data, int testtype) |
| ata_attr_state | ata_get_attr_state (const ata_smart_attribute &attr, int attridx, const ata_smart_threshold_entry *thresholds, const ata_vendor_attr_defs &defs, unsigned char *threshval=0) |
| uint64_t | ata_get_attr_raw_value (const ata_smart_attribute &attr, const ata_vendor_attr_defs &defs) |
| std::string | ata_format_attr_raw_value (const ata_smart_attribute &attr, const ata_vendor_attr_defs &defs) |
| std::string | ata_get_smart_attr_name (unsigned char id, const ata_vendor_attr_defs &defs, int rpm=0) |
| void | checksumwarning (const char *string) |
| int | ata_find_attr_index (unsigned char id, const ata_smart_values &smartval) |
| unsigned char | ata_return_temperature_value (const ata_smart_values *data, const ata_vendor_attr_defs &defs) |
| bool | parse_attribute_def (const char *opt, ata_vendor_attr_defs &defs, ata_vendor_def_prior priority) |
| unsigned char | get_unc_attr_id (bool offline, const ata_vendor_attr_defs &defs, bool &increase) |
| std::string | create_vendor_attribute_arg_list () |
| bool | parse_firmwarebug_def (const char *opt, firmwarebug_defs &firmwarebugs) |
| const char * | get_valid_firmwarebug_args () |
| int | smartcommandhandler (ata_device *device, smart_command_set command, int select, char *data) |
| int | ataPrintSmartSelfTestEntry (unsigned testnum, unsigned char test_type, unsigned char test_status, unsigned short timestamp, uint64_t failing_lba, bool print_error_only, bool &print_header) |
| int | ataPrintSmartSelfTestlog (const ata_smart_selftestlog *data, bool allentries, firmwarebug_defs firmwarebugs) |
| void | ata_get_size_info (const ata_identify_device *id, ata_size_info &sizes) |
| void | ata_format_id_string (char *out, const unsigned char *in, int n) |
| unsigned char | checksum (const void *data) |
| void | swap2 (char *location) |
| void | swap4 (char *location) |
| void | swap8 (char *location) |
| void | swapx (unsigned short *p) |
| void | swapx (unsigned int *p) |
| void | swapx (uint64_t *p) |
| ata_device * | get_parsed_ata_device (smart_interface *intf, const char *dev_name) |
Variables |
| struct ata_identify_device | ATTR_PACKED |
| unsigned char | ata_debugmode |
| bool | dont_print_serial_number |