smartmontools SVN Rev 3317
Utility to control and monitor storage systems with "S.M.A.R.T."
Classes | Defines | Enumerations | Functions | Variables
atacmds.h File Reference
#include "dev_interface.h"
Include dependency graph for atacmds.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

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 3825 2013-07-06 21:38:25Z samm2 $"
#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 ataGetSetSCTWriteCacheReordering (ata_device *device, bool enable, bool persistent, bool set)
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_deviceget_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

Define Documentation

#define ABORT_SELF_TEST   127

Definition at line 116 of file atacmds.h.

#define ASSERT_SIZEOF_STRUCT (   s,
 
)    typedef char assert_sizeof_struct_##s[(sizeof(struct s) == (n)) ? 1 : -1]

Definition at line 37 of file atacmds.h.

#define ATA_CHECK_POWER_MODE   0xe5

Definition at line 71 of file atacmds.h.

#define ATA_DISABLE_AAM   0xc2

Definition at line 81 of file atacmds.h.

#define ATA_DISABLE_APM   0x85

Definition at line 82 of file atacmds.h.

#define ATA_DISABLE_READ_LOOK_AHEAD   0x55

Definition at line 84 of file atacmds.h.

#define ATA_DISABLE_WRITE_CACHE   0x82

Definition at line 83 of file atacmds.h.

#define ATA_ENABLE_AAM   0x42

Definition at line 85 of file atacmds.h.

#define ATA_ENABLE_APM   0x05

Definition at line 86 of file atacmds.h.

#define ATA_ENABLE_READ_LOOK_AHEAD   0xaa

Definition at line 88 of file atacmds.h.

#define ATA_ENABLE_WRITE_CACHE   0x02

Definition at line 87 of file atacmds.h.

#define ATA_IDENTIFY_DEVICE   0xec

Definition at line 72 of file atacmds.h.

#define ATA_IDENTIFY_PACKET_DEVICE   0xa1

Definition at line 73 of file atacmds.h.

#define ATA_IDLE   0xe3

Definition at line 74 of file atacmds.h.

#define ATA_READ_LOG_EXT   0x2F

Definition at line 91 of file atacmds.h.

#define ATA_SECURITY_FREEZE_LOCK   0xf5

Definition at line 76 of file atacmds.h.

#define ATA_SET_FEATURES   0xef

Definition at line 77 of file atacmds.h.

#define ATA_SMART_AUTO_OFFLINE   0xdb

Definition at line 108 of file atacmds.h.

#define ATA_SMART_AUTOSAVE   0xd2

Definition at line 97 of file atacmds.h.

#define ATA_SMART_CMD   0xb0

Definition at line 75 of file atacmds.h.

#define ATA_SMART_DISABLE   0xd9

Definition at line 104 of file atacmds.h.

#define ATA_SMART_ENABLE   0xd8

Definition at line 103 of file atacmds.h.

#define ATA_SMART_IMMEDIATE_OFFLINE   0xd4

Definition at line 99 of file atacmds.h.

#define ATA_SMART_READ_LOG_SECTOR   0xd5

Definition at line 100 of file atacmds.h.

#define ATA_SMART_READ_THRESHOLDS   0xd1

Definition at line 96 of file atacmds.h.

#define ATA_SMART_READ_VALUES   0xd0

Definition at line 95 of file atacmds.h.

#define ATA_SMART_SAVE   0xd3

Definition at line 98 of file atacmds.h.

#define ATA_SMART_STATUS   0xda

Definition at line 105 of file atacmds.h.

#define ATA_SMART_WRITE_LOG_SECTOR   0xd6

Definition at line 101 of file atacmds.h.

#define ATA_SMART_WRITE_THRESHOLDS   0xd7

Definition at line 102 of file atacmds.h.

#define ATA_STANDBY_IMMEDIATE   0xe0

Definition at line 78 of file atacmds.h.

#define ATACMDS_H_CVSID   "$Id: atacmds.h 3825 2013-07-06 21:38:25Z samm2 $"

Definition at line 28 of file atacmds.h.

Definition at line 45 of file atacmds.h.

#define ATTRIBUTE_FLAGS_ERRORRATE (   x)    (x & 0x08)

Definition at line 197 of file atacmds.h.

#define ATTRIBUTE_FLAGS_EVENTCOUNT (   x)    (x & 0x10)

Definition at line 200 of file atacmds.h.

#define ATTRIBUTE_FLAGS_ONLINE (   x)    (x & 0x02)

Definition at line 188 of file atacmds.h.

#define ATTRIBUTE_FLAGS_OTHER (   x)    ((x) & 0xffc0)

Definition at line 206 of file atacmds.h.

#define ATTRIBUTE_FLAGS_PERFORMANCE (   x)    (x & 0x04)

Definition at line 194 of file atacmds.h.

#define ATTRIBUTE_FLAGS_PREFAILURE (   x)    (x & 0x01)

Definition at line 178 of file atacmds.h.

#define ATTRIBUTE_FLAGS_SELFPRESERVING (   x)    (x & 0x20)

Definition at line 203 of file atacmds.h.

#define CAPTIVE_MASK   (0x01<<7)

Definition at line 121 of file atacmds.h.

#define CONVEYANCE_CAPTIVE_SELF_TEST   131

Definition at line 119 of file atacmds.h.

#define CONVEYANCE_SELF_TEST   3

Definition at line 114 of file atacmds.h.

#define EXTEND_CAPTIVE_SELF_TEST   130

Definition at line 118 of file atacmds.h.

#define EXTEND_SELF_TEST   2

Definition at line 113 of file atacmds.h.

#define MAX_ATTRIBUTE_NUM   256

Definition at line 931 of file atacmds.h.

#define NUMBER_ATA_SMART_ATTRIBUTES   30

Definition at line 124 of file atacmds.h.

#define OFFLINE_FULL_SCAN   0

Definition at line 111 of file atacmds.h.

#define SELECTIVE_CAPTIVE_SELF_TEST   132

Definition at line 120 of file atacmds.h.

#define SELECTIVE_FLAG_ACTIVE   (0x0010)

Definition at line 515 of file atacmds.h.

#define SELECTIVE_FLAG_DOSCAN   (0x0002)

Definition at line 513 of file atacmds.h.

#define SELECTIVE_FLAG_PENDING   (0x0008)

Definition at line 514 of file atacmds.h.

#define SELECTIVE_SELF_TEST   4

Definition at line 115 of file atacmds.h.

#define SHORT_CAPTIVE_SELF_TEST   129

Definition at line 117 of file atacmds.h.

#define SHORT_SELF_TEST   1

Definition at line 112 of file atacmds.h.


Enumeration Type Documentation

anonymous enum
Enumerator:
SEL_RANGE 
SEL_REDO 
SEL_NEXT 
SEL_CONT 

Definition at line 617 of file atacmds.h.

anonymous enum
Enumerator:
ATTRFLAG_INCREASING 
ATTRFLAG_NO_NORMVAL 
ATTRFLAG_NO_WORSTVAL 

Definition at line 685 of file atacmds.h.

Enumerator:
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 

Definition at line 660 of file atacmds.h.

Enumerator:
ATTRSTATE_NON_EXISTING 
ATTRSTATE_NO_NORMVAL 
ATTRSTATE_NO_THRESHOLD 
ATTRSTATE_OK 
ATTRSTATE_FAILED_PAST 
ATTRSTATE_FAILED_NOW 

Definition at line 887 of file atacmds.h.

Enumerator:
PRIOR_DEFAULT 
PRIOR_DATABASE 
PRIOR_USER 

Definition at line 652 of file atacmds.h.

Enumerator:
BUG_NONE 
BUG_NOLOGDIR 
BUG_SAMSUNG 
BUG_SAMSUNG2 
BUG_SAMSUNG3 
BUG_XERRORLBA 

Definition at line 722 of file atacmds.h.

Enumerator:
ENABLE 
DISABLE 
AUTOSAVE 
IMMEDIATE_OFFLINE 
AUTO_OFFLINE 
STATUS 
STATUS_CHECK 
READ_VALUES 
READ_THRESHOLDS 
READ_LOG 
IDENTIFY 
PIDENTIFY 
CHECK_POWER_MODE 
WRITE_LOG 

Definition at line 48 of file atacmds.h.


Function Documentation

ASSERT_SIZEOF_STRUCT ( ata_identify_device  ,
512   
)
ASSERT_SIZEOF_STRUCT ( ata_smart_attribute  ,
12   
)
ASSERT_SIZEOF_STRUCT ( ata_smart_threshold_entry  ,
12   
)
ASSERT_SIZEOF_STRUCT ( ata_smart_errorlog_struct  ,
90   
)
ASSERT_SIZEOF_STRUCT ( ata_smart_extselftestlog_desc  ,
26   
)
ASSERT_SIZEOF_STRUCT ( ata_smart_extselftestlog  ,
512   
)
ASSERT_SIZEOF_STRUCT ( ata_smart_errorlog  ,
512   
)
ASSERT_SIZEOF_STRUCT ( ata_smart_log_entry  ,
 
)
ASSERT_SIZEOF_STRUCT ( ata_smart_log_directory  ,
512   
)
ASSERT_SIZEOF_STRUCT ( ata_smart_thresholds_pvt  ,
512   
)
ASSERT_SIZEOF_STRUCT ( ata_smart_exterrlog_command  ,
18   
)
ASSERT_SIZEOF_STRUCT ( test_span  ,
16   
)
ASSERT_SIZEOF_STRUCT ( ata_selective_self_test_log  ,
512   
)
ASSERT_SIZEOF_STRUCT ( ata_smart_exterrlog_error  ,
34   
)
ASSERT_SIZEOF_STRUCT ( ata_sct_status_response  ,
512   
)
ASSERT_SIZEOF_STRUCT ( ata_sct_error_recovery_control_command  ,
512   
)
ASSERT_SIZEOF_STRUCT ( ata_smart_values  ,
512   
)
ASSERT_SIZEOF_STRUCT ( ata_smart_errorlog_error_struct  ,
30   
)
ASSERT_SIZEOF_STRUCT ( ata_smart_exterrlog_error_log  ,
124   
)
ASSERT_SIZEOF_STRUCT ( ata_sct_feature_control_command  ,
512   
)
ASSERT_SIZEOF_STRUCT ( ata_sct_data_table_command  ,
512   
)
ASSERT_SIZEOF_STRUCT ( ata_smart_exterrlog  ,
512   
)
ASSERT_SIZEOF_STRUCT ( ata_sct_temperature_history_table  ,
512   
)
ASSERT_SIZEOF_STRUCT ( ata_smart_errorlog_command_struct  ,
12   
)
ASSERT_SIZEOF_STRUCT ( ata_smart_selftestlog_struct  ,
24   
)
ASSERT_SIZEOF_STRUCT ( ata_smart_selftestlog  ,
512   
)
int ata_find_attr_index ( unsigned char  id,
const ata_smart_values smartval 
)

Definition at line 2313 of file atacmds.cpp.

std::string ata_format_attr_raw_value ( const ata_smart_attribute attr,
const ata_vendor_attr_defs defs 
)

Definition at line 1932 of file atacmds.cpp.

void ata_format_id_string ( char *  out,
const unsigned char *  in,
int  n 
)

Definition at line 749 of file atacmds.cpp.

uint64_t ata_get_attr_raw_value ( const ata_smart_attribute attr,
const ata_vendor_attr_defs defs 
)

Definition at line 1886 of file atacmds.cpp.

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 
)

Definition at line 1813 of file atacmds.cpp.

int ata_get_rotation_rate ( const ata_identify_device id)

Definition at line 927 of file atacmds.cpp.

void ata_get_size_info ( const ata_identify_device id,
ata_size_info sizes 
)

Definition at line 645 of file atacmds.cpp.

std::string ata_get_smart_attr_name ( unsigned char  id,
const ata_vendor_attr_defs defs,
int  rpm = 0 
)

Definition at line 2303 of file atacmds.cpp.

int ata_get_wwn ( const ata_identify_device id,
unsigned &  oui,
uint64_t unique_id 
)

Definition at line 907 of file atacmds.cpp.

bool ata_nodata_command ( ata_device device,
unsigned char  command,
int  sector_count = -1 
)

Definition at line 788 of file atacmds.cpp.

int ata_read_identity ( ata_device device,
ata_identify_device buf,
bool  fix_swapped_id,
unsigned char *  raw_buf = 0 
)

Definition at line 818 of file atacmds.cpp.

unsigned char ata_return_temperature_value ( const ata_smart_values data,
const ata_vendor_attr_defs defs 
)

Definition at line 2326 of file atacmds.cpp.

bool ata_set_features ( ata_device device,
unsigned char  features,
int  sector_count = -1 
)

Definition at line 800 of file atacmds.cpp.

int ataCheckPowerMode ( ata_device device)

Definition at line 775 of file atacmds.cpp.

int ataDisableAutoOffline ( ata_device device)

Definition at line 1558 of file atacmds.cpp.

int ataDisableAutoSave ( ata_device device)

Definition at line 1535 of file atacmds.cpp.

int ataDisableSmart ( ata_device device)

Definition at line 1520 of file atacmds.cpp.

int ataDoesSmartWork ( ata_device device)

Definition at line 1570 of file atacmds.cpp.

int ataEnableAutoOffline ( ata_device device)

Definition at line 1547 of file atacmds.cpp.

int ataEnableAutoSave ( ata_device device)

Definition at line 1528 of file atacmds.cpp.

int ataEnableSmart ( ata_device device)

Definition at line 1513 of file atacmds.cpp.

int ataGetSCTErrorRecoveryControltime ( ata_device device,
unsigned  type,
unsigned short &  time_limit 
)

Definition at line 2651 of file atacmds.cpp.

int ataGetSetSCTWriteCacheReordering ( ata_device device,
bool  enable,
bool  persistent,
bool  set 
)

Definition at line 2448 of file atacmds.cpp.

int ataIsSmartEnabled ( const ata_identify_device drive)

Definition at line 958 of file atacmds.cpp.

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 
)

Definition at line 2668 of file atacmds.cpp.

int ataPrintSmartSelfTestlog ( const ata_smart_selftestlog data,
bool  allentries,
firmwarebug_defs  firmwarebugs 
)

Definition at line 2748 of file atacmds.cpp.

int ataReadErrorLog ( ata_device device,
ata_smart_errorlog data,
firmwarebug_defs  firmwarebugs 
)

Definition at line 1401 of file atacmds.cpp.

bool ataReadExtErrorLog ( ata_device device,
ata_smart_exterrlog log,
unsigned  nsectors,
firmwarebug_defs  firwarebugs 
)

Definition at line 1468 of file atacmds.cpp.

bool ataReadExtSelfTestLog ( ata_device device,
ata_smart_extselftestlog log,
unsigned  nsectors 
)

Definition at line 1068 of file atacmds.cpp.

int ataReadLogDirectory ( ata_device device,
ata_smart_log_directory ,
bool  gpl 
)

Definition at line 1141 of file atacmds.cpp.

bool ataReadLogExt ( ata_device device,
unsigned char  logaddr,
unsigned char  features,
unsigned  page,
void *  data,
unsigned  nsectors 
)

Definition at line 1088 of file atacmds.cpp.

int ataReadSCTStatus ( ata_device device,
ata_sct_status_response sts 
)

Definition at line 2355 of file atacmds.cpp.

int ataReadSCTTempHist ( ata_device device,
ata_sct_temperature_history_table tmh,
ata_sct_status_response sts 
)

Definition at line 2385 of file atacmds.cpp.

int ataReadSelectiveSelfTestLog ( ata_device device,
struct ata_selective_self_test_log data 
)

Definition at line 1161 of file atacmds.cpp.

int ataReadSelfTestLog ( ata_device device,
ata_smart_selftestlog data,
firmwarebug_defs  firmwarebugs 
)

Definition at line 1020 of file atacmds.cpp.

bool ataReadSmartLog ( ata_device device,
unsigned char  logaddr,
void *  data,
unsigned  nsectors 
)

Definition at line 1120 of file atacmds.cpp.

int ataReadSmartThresholds ( ata_device device,
struct ata_smart_thresholds_pvt  
)

Definition at line 1495 of file atacmds.cpp.

int ataReadSmartValues ( ata_device device,
struct ata_smart_values  
)

Definition at line 974 of file atacmds.cpp.

int ataSetSCTErrorRecoveryControltime ( ata_device device,
unsigned  type,
unsigned short  time_limit 
)

Definition at line 2657 of file atacmds.cpp.

int ataSetSCTTempInterval ( ata_device device,
unsigned  interval,
bool  persistent 
)

Definition at line 2515 of file atacmds.cpp.

int ataSmartStatus2 ( ata_device device)

Definition at line 1581 of file atacmds.cpp.

int ataSmartSupport ( const ata_identify_device drive)

Definition at line 943 of file atacmds.cpp.

int ataSmartTest ( ata_device device,
int  testtype,
bool  force,
const ata_selective_selftest_args args,
const ata_smart_values sv,
uint64_t  num_sectors 
)

Definition at line 1588 of file atacmds.cpp.

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 
)

Definition at line 1190 of file atacmds.cpp.

unsigned char checksum ( const void *  data)

Definition at line 703 of file atacmds.cpp.

void checksumwarning ( const char *  string)

Definition at line 1138 of file smartctl.cpp.

std::string create_vendor_attribute_arg_list ( )

Definition at line 252 of file atacmds.cpp.

ata_device* get_parsed_ata_device ( smart_interface intf,
const char *  dev_name 
)

Definition at line 3140 of file atacmds.cpp.

unsigned char get_unc_attr_id ( bool  offline,
const ata_vendor_attr_defs defs,
bool &  increase 
)

Definition at line 62 of file atacmds.cpp.

const char* get_valid_firmwarebug_args ( )

Definition at line 287 of file atacmds.cpp.

int isGeneralPurposeLoggingCapable ( const ata_identify_device identity)

Definition at line 1746 of file atacmds.cpp.

bool isSCTCapable ( const ata_identify_device drive) [inline]

Definition at line 872 of file atacmds.h.

bool isSCTDataTableCapable ( const ata_identify_device drive) [inline]

Definition at line 881 of file atacmds.h.

bool isSCTErrorRecoveryControlCapable ( const ata_identify_device drive) [inline]

Definition at line 875 of file atacmds.h.

bool isSCTFeatureControlCapable ( const ata_identify_device drive) [inline]

Definition at line 878 of file atacmds.h.

int isSmartErrorLogCapable ( const ata_smart_values data,
const ata_identify_device identity 
)

Definition at line 1708 of file atacmds.cpp.

int isSmartTestLogCapable ( const ata_smart_values data,
const ata_identify_device identity 
)

Definition at line 1727 of file atacmds.cpp.

int isSupportAutomaticTimer ( const ata_smart_values data)

Definition at line 1787 of file atacmds.cpp.

int isSupportConveyanceSelfTest ( const ata_smart_values data)

Definition at line 1803 of file atacmds.cpp.

int isSupportExecuteOfflineImmediate ( const ata_smart_values data)

Definition at line 1777 of file atacmds.cpp.

int isSupportOfflineAbort ( const ata_smart_values data)

Definition at line 1791 of file atacmds.cpp.

int isSupportOfflineSurfaceScan ( const ata_smart_values data)

Definition at line 1795 of file atacmds.cpp.

int isSupportSelectiveSelfTest ( const ata_smart_values data)

Definition at line 1807 of file atacmds.cpp.

int isSupportSelfTest ( const ata_smart_values data)

Definition at line 1799 of file atacmds.cpp.

bool parse_attribute_def ( const char *  opt,
ata_vendor_attr_defs defs,
ata_vendor_def_prior  priority 
)

Definition at line 158 of file atacmds.cpp.

bool parse_firmwarebug_def ( const char *  opt,
firmwarebug_defs firmwarebugs 
)

Definition at line 267 of file atacmds.cpp.

int smartcommandhandler ( ata_device device,
smart_command_set  command,
int  select,
char *  data 
)

Definition at line 416 of file atacmds.cpp.

void swap2 ( char *  location)

Definition at line 294 of file atacmds.cpp.

void swap4 ( char *  location)

Definition at line 302 of file atacmds.cpp.

void swap8 ( char *  location)

Definition at line 311 of file atacmds.cpp.

void swapx ( unsigned short *  p) [inline]

Definition at line 1005 of file atacmds.h.

void swapx ( uint64_t p) [inline]

Definition at line 1009 of file atacmds.h.

void swapx ( unsigned int *  p) [inline]

Definition at line 1007 of file atacmds.h.

int TestTime ( const ata_smart_values data,
int  testtype 
)

Definition at line 1677 of file atacmds.cpp.


Variable Documentation

unsigned char ata_debugmode

Definition at line 42 of file atacmds.cpp.

Definition at line 46 of file atacmds.cpp.