smartmontools  SVN Rev 4556
Utility to control and monitor storage systems with "S.M.A.R.T."
Classes | Namespaces | Macros | Functions | Variables
atacmds.cpp File Reference
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <stdlib.h>
#include <ctype.h>
#include "config.h"
#include "int64.h"
#include "atacmds.h"
#include "knowndrives.h"
#include "utility.h"
#include "dev_ata_cmd_set.h"
Include dependency graph for atacmds.cpp:

Go to the source code of this file.

Classes

struct  format_name_entry
 
class  anonymous_namespace{atacmds.cpp}::parsed_ata_device
 
struct  anonymous_namespace{atacmds.cpp}::parsed_ata_device::parsed_ata_command
 

Namespaces

 anonymous_namespace{atacmds.cpp}
 

Macros

#define SMART_CYL_LOW   0x4F
 
#define SMART_CYL_HI   0xC2
 
#define SRET_STATUS_HI_EXCEEDED   0x2C
 
#define SRET_STATUS_MID_EXCEEDED   0xF4
 
#define SWAPV(x)   ((x) = get_swapx_val(x))
 
#define P(n)   (' ' <= p[n] && p[n] <= '~' ? (int)p[n] : '.')
 

Functions

unsigned char get_unc_attr_id (bool offline, const ata_vendor_attr_defs &defs, bool &increase)
 
bool parse_attribute_def (const char *opt, ata_vendor_attr_defs &defs, ata_vendor_def_prior priority)
 
std::string create_vendor_attribute_arg_list ()
 
bool parse_firmwarebug_def (const char *opt, firmwarebug_defs &firmwarebugs)
 
const char * get_valid_firmwarebug_args ()
 
void swap2 (char *location)
 
void swap4 (char *location)
 
void swap8 (char *location)
 
template<typename T >
static T get_swapx_val (T x)
 
static void invalidate_serno (ata_identify_device *id)
 
static const char * preg (const ata_register &r, char(&buf)[8])
 
static void print_regs (const char *prefix, const ata_in_regs &r, const char *suffix="\n")
 
static void print_regs (const char *prefix, const ata_out_regs &r, const char *suffix="\n")
 
static void prettyprint (const unsigned char *p, const char *name)
 
int smartcommandhandler (ata_device *device, smart_command_set command, int select, char *data)
 
void ata_get_size_info (const ata_identify_device *id, ata_size_info &sizes)
 
unsigned char checksum (const void *data)
 
static void swapbytes (char *out, const char *in, size_t n)
 
static void trim (char *out, const char *in)
 
void ata_format_id_string (char *out, const unsigned char *in, int n)
 
int ataCheckPowerMode (ata_device *device)
 
bool ata_nodata_command (ata_device *device, unsigned char command, int sector_count)
 
bool ata_set_features (ata_device *device, unsigned char features, int sector_count)
 
int ata_read_identity (ata_device *device, ata_identify_device *buf, bool fix_swapped_id, unsigned char *raw_buf)
 
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 ataSmartSupport (const ata_identify_device *drive)
 
int ataIsSmartEnabled (const ata_identify_device *drive)
 
int ataReadSmartValues (ata_device *device, struct ata_smart_values *data)
 
static void fixsamsungselftestlog (ata_smart_selftestlog *data)
 
int ataReadSelfTestLog (ata_device *device, ata_smart_selftestlog *data, firmwarebug_defs firmwarebugs)
 
static void check_multi_sector_sum (const void *data, unsigned nsectors, const char *msg)
 
bool ataReadExtSelfTestLog (ata_device *device, ata_smart_extselftestlog *log, unsigned nsectors)
 
bool ataWriteLogExt (ata_device *device, unsigned char logaddr, unsigned page, void *data, unsigned nsectors)
 
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)
 
int ataReadLogDirectory (ata_device *device, ata_smart_log_directory *data, bool gpl)
 
int ataReadSelectiveSelfTestLog (ata_device *device, struct ata_selective_self_test_log *data)
 
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_args)
 
static void fixsamsungerrorlog (ata_smart_errorlog *data)
 
static void fixsamsungerrorlog2 (ata_smart_errorlog *data)
 
int ataReadErrorLog (ata_device *device, ata_smart_errorlog *data, firmwarebug_defs firmwarebugs)
 
template<class T >
static void fix_exterrlog_lba_cmd (T &cmd)
 
static void fix_exterrlog_lba (ata_smart_exterrlog *log, unsigned nsectors)
 
bool ataReadExtErrorLog (ata_device *device, ata_smart_exterrlog *log, unsigned page, unsigned nsectors, firmwarebug_defs firmwarebugs)
 
int ataReadSmartThresholds (ata_device *device, struct ata_smart_thresholds_pvt *data)
 
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 ataDoesSmartWork (ata_device *device)
 
int ataSmartStatus2 (ata_device *device)
 
int ataSmartTest (ata_device *device, int testtype, bool force, const ata_selective_selftest_args &selargs, const ata_smart_values *sv, uint64_t num_sectors)
 
int TestTime (const ata_smart_values *data, int testtype)
 
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)
 
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)
 
uint64_t ata_get_attr_raw_value (const ata_smart_attribute &attr, const ata_vendor_attr_defs &defs)
 
static int check_temp_word (unsigned word)
 
static bool check_temp_range (int t, unsigned char ut1, unsigned char ut2, int &lo, int &hi)
 
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)
 
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)
 
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)
 
static int ataGetSetSCTFeatureControl (ata_device *device, unsigned short feature_code, unsigned short state, bool persistent, bool set)
 
int ataGetSetSCTWriteCacheReordering (ata_device *device, bool enable, bool persistent, bool set)
 
int ataGetSetSCTWriteCache (ata_device *device, unsigned short state, bool persistent, bool set)
 
int ataSetSCTTempInterval (ata_device *device, unsigned interval, bool persistent)
 
static int ataGetSetSCTErrorRecoveryControltime (ata_device *device, unsigned type, bool set, unsigned short &time_limit)
 
int ataGetSCTErrorRecoveryControltime (ata_device *device, unsigned type, unsigned short &time_limit)
 
int ataSetSCTErrorRecoveryControltime (ata_device *device, unsigned type, unsigned short time_limit)
 
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)
 
static const char * anonymous_namespace{atacmds.cpp}::nextline (const char *s, int &lineno)
 
static int anonymous_namespace{atacmds.cpp}::name2command (const char *s)
 
static bool anonymous_namespace{atacmds.cpp}::matchcpy (char *dest, size_t size, const char *src, const regmatch_t &srcmatch)
 
static int anonymous_namespace{atacmds.cpp}::matchtoi (const char *src, const regmatch_t &srcmatch, int defval)
 
ata_deviceget_parsed_ata_device (smart_interface *intf, const char *dev_name)
 

Variables

const char * atacmds_cpp_cvsid
 
unsigned char ata_debugmode = 0
 
bool dont_print_serial_number = false
 
const format_name_entry format_names []
 
const unsigned num_format_names = sizeof(format_names)/sizeof(format_names[0])
 
const char *const map_old_vendor_opts [][2]
 
const unsigned num_old_vendor_opts = sizeof(map_old_vendor_opts)/sizeof(map_old_vendor_opts[0])
 
static const char *const commandstrings []
 

Macro Definition Documentation

#define P (   n)    (' ' <= p[n] && p[n] <= '~' ? (int)p[n] : '.')
#define SMART_CYL_HI   0xC2

Definition at line 51 of file atacmds.cpp.

#define SMART_CYL_LOW   0x4F

Definition at line 50 of file atacmds.cpp.

#define SRET_STATUS_HI_EXCEEDED   0x2C

Definition at line 57 of file atacmds.cpp.

#define SRET_STATUS_MID_EXCEEDED   0xF4

Definition at line 58 of file atacmds.cpp.

#define SWAPV (   x)    ((x) = get_swapx_val(x))

Definition at line 350 of file atacmds.cpp.

Function Documentation

int ata_find_attr_index ( unsigned char  id,
const ata_smart_values smartval 
)

Definition at line 2217 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 1991 of file atacmds.cpp.

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

Definition at line 778 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 1917 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 
)

Definition at line 1867 of file atacmds.cpp.

int ata_get_rotation_rate ( const ata_identify_device id)

Definition at line 951 of file atacmds.cpp.

void ata_get_size_info ( const ata_identify_device id,
ata_size_info sizes 
)

Definition at line 674 of file atacmds.cpp.

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

Definition at line 2198 of file atacmds.cpp.

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

Definition at line 931 of file atacmds.cpp.

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

Definition at line 814 of file atacmds.cpp.

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

Definition at line 844 of file atacmds.cpp.

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

Definition at line 2230 of file atacmds.cpp.

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

Definition at line 826 of file atacmds.cpp.

int ataCheckPowerMode ( ata_device device)

Definition at line 804 of file atacmds.cpp.

int ataDisableAutoOffline ( ata_device device)

Definition at line 1612 of file atacmds.cpp.

int ataDisableAutoSave ( ata_device device)

Definition at line 1589 of file atacmds.cpp.

int ataDisableSmart ( ata_device device)

Definition at line 1574 of file atacmds.cpp.

int ataDoesSmartWork ( ata_device device)

Definition at line 1624 of file atacmds.cpp.

int ataEnableAutoOffline ( ata_device device)

Definition at line 1601 of file atacmds.cpp.

int ataEnableAutoSave ( ata_device device)

Definition at line 1582 of file atacmds.cpp.

int ataEnableSmart ( ata_device device)

Definition at line 1567 of file atacmds.cpp.

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

Definition at line 2570 of file atacmds.cpp.

static int ataGetSetSCTErrorRecoveryControltime ( ata_device device,
unsigned  type,
bool  set,
unsigned short &  time_limit 
)
static

Definition at line 2485 of file atacmds.cpp.

static int ataGetSetSCTFeatureControl ( ata_device device,
unsigned short  feature_code,
unsigned short  state,
bool  persistent,
bool  set 
)
static

Definition at line 2353 of file atacmds.cpp.

int ataGetSetSCTWriteCache ( ata_device device,
unsigned short  state,
bool  persistent,
bool  set 
)

Definition at line 2427 of file atacmds.cpp.

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

Definition at line 2420 of file atacmds.cpp.

int ataIsSmartEnabled ( const ata_identify_device drive)

Definition at line 982 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 2587 of file atacmds.cpp.

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

Definition at line 2667 of file atacmds.cpp.

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

Definition at line 1455 of file atacmds.cpp.

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

Definition at line 1522 of file atacmds.cpp.

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

Definition at line 1092 of file atacmds.cpp.

int ataReadLogDirectory ( ata_device device,
ata_smart_log_directory data,
bool  gpl 
)

Definition at line 1195 of file atacmds.cpp.

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

Definition at line 1142 of file atacmds.cpp.

int ataReadSCTStatus ( ata_device device,
ata_sct_status_response sts 
)

Definition at line 2259 of file atacmds.cpp.

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

Definition at line 2291 of file atacmds.cpp.

int ataReadSelectiveSelfTestLog ( ata_device device,
struct ata_selective_self_test_log data 
)

Definition at line 1215 of file atacmds.cpp.

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

Definition at line 1044 of file atacmds.cpp.

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

Definition at line 1174 of file atacmds.cpp.

int ataReadSmartThresholds ( ata_device device,
struct ata_smart_thresholds_pvt data 
)

Definition at line 1549 of file atacmds.cpp.

int ataReadSmartValues ( ata_device device,
struct ata_smart_values data 
)

Definition at line 998 of file atacmds.cpp.

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

Definition at line 2576 of file atacmds.cpp.

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

Definition at line 2434 of file atacmds.cpp.

int ataSmartStatus2 ( ata_device device)

Definition at line 1635 of file atacmds.cpp.

int ataSmartSupport ( const ata_identify_device drive)

Definition at line 967 of file atacmds.cpp.

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

Definition at line 1642 of file atacmds.cpp.

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

Definition at line 1111 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_args 
)

Definition at line 1244 of file atacmds.cpp.

static void check_multi_sector_sum ( const void *  data,
unsigned  nsectors,
const char *  msg 
)
static

Definition at line 1076 of file atacmds.cpp.

static bool check_temp_range ( int  t,
unsigned char  ut1,
unsigned char  ut2,
int &  lo,
int &  hi 
)
static

Definition at line 1974 of file atacmds.cpp.

static int check_temp_word ( unsigned  word)
inlinestatic

Definition at line 1963 of file atacmds.cpp.

unsigned char checksum ( const void *  data)

Definition at line 732 of file atacmds.cpp.

std::string create_vendor_attribute_arg_list ( )

Definition at line 272 of file atacmds.cpp.

static void fix_exterrlog_lba ( ata_smart_exterrlog log,
unsigned  nsectors 
)
static

Definition at line 1509 of file atacmds.cpp.

template<class T >
static void fix_exterrlog_lba_cmd ( T &  cmd)
inlinestatic

Definition at line 1500 of file atacmds.cpp.

static void fixsamsungerrorlog ( ata_smart_errorlog data)
static

Definition at line 1423 of file atacmds.cpp.

static void fixsamsungerrorlog2 ( ata_smart_errorlog data)
static

Definition at line 1445 of file atacmds.cpp.

static void fixsamsungselftestlog ( ata_smart_selftestlog data)
static

Definition at line 1027 of file atacmds.cpp.

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

Definition at line 3059 of file atacmds.cpp.

template<typename T >
static T get_swapx_val ( x)
static

Definition at line 347 of file atacmds.cpp.

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

Definition at line 63 of file atacmds.cpp.

const char* get_valid_firmwarebug_args ( )

Definition at line 307 of file atacmds.cpp.

static void invalidate_serno ( ata_identify_device id)
static

Definition at line 353 of file atacmds.cpp.

int isGeneralPurposeLoggingCapable ( const ata_identify_device identity)

Definition at line 1800 of file atacmds.cpp.

int isSmartErrorLogCapable ( const ata_smart_values data,
const ata_identify_device identity 
)

Definition at line 1762 of file atacmds.cpp.

int isSmartTestLogCapable ( const ata_smart_values data,
const ata_identify_device identity 
)

Definition at line 1781 of file atacmds.cpp.

int isSupportAutomaticTimer ( const ata_smart_values data)

Definition at line 1841 of file atacmds.cpp.

int isSupportConveyanceSelfTest ( const ata_smart_values data)

Definition at line 1857 of file atacmds.cpp.

int isSupportExecuteOfflineImmediate ( const ata_smart_values data)

Definition at line 1831 of file atacmds.cpp.

int isSupportOfflineAbort ( const ata_smart_values data)

Definition at line 1845 of file atacmds.cpp.

int isSupportOfflineSurfaceScan ( const ata_smart_values data)

Definition at line 1849 of file atacmds.cpp.

int isSupportSelectiveSelfTest ( const ata_smart_values data)

Definition at line 1861 of file atacmds.cpp.

int isSupportSelfTest ( const ata_smart_values data)

Definition at line 1853 of file atacmds.cpp.

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

Definition at line 159 of file atacmds.cpp.

bool parse_firmwarebug_def ( const char *  opt,
firmwarebug_defs firmwarebugs 
)

Definition at line 287 of file atacmds.cpp.

static const char* preg ( const ata_register r,
char(&)  buf[8] 
)
static

Definition at line 397 of file atacmds.cpp.

static void prettyprint ( const unsigned char *  p,
const char *  name 
)
static

Definition at line 424 of file atacmds.cpp.

static void print_regs ( const char *  prefix,
const ata_in_regs r,
const char *  suffix = "\n" 
)
static

Definition at line 406 of file atacmds.cpp.

static void print_regs ( const char *  prefix,
const ata_out_regs r,
const char *  suffix = "\n" 
)
static

Definition at line 415 of file atacmds.cpp.

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

Definition at line 446 of file atacmds.cpp.

void swap2 ( char *  location)

Definition at line 314 of file atacmds.cpp.

void swap4 ( char *  location)

Definition at line 322 of file atacmds.cpp.

void swap8 ( char *  location)

Definition at line 331 of file atacmds.cpp.

static void swapbytes ( char *  out,
const char *  in,
size_t  n 
)
static

Definition at line 742 of file atacmds.cpp.

int TestTime ( const ata_smart_values data,
int  testtype 
)

Definition at line 1731 of file atacmds.cpp.

static void trim ( char *  out,
const char *  in 
)
static

Definition at line 751 of file atacmds.cpp.

Variable Documentation

unsigned char ata_debugmode = 0

Definition at line 43 of file atacmds.cpp.

const char* atacmds_cpp_cvsid
Initial value:
= "$Id: atacmds.cpp 4555 2017-10-15 15:06:00Z chrfranke $"
#define ATACMDS_H_CVSID
Definition: atacmds.h:28

Definition at line 39 of file atacmds.cpp.

const char* const commandstrings[]
static
Initial value:
={
"SMART ENABLE",
"SMART DISABLE",
"SMART AUTOMATIC ATTRIBUTE SAVE",
"SMART IMMEDIATE OFFLINE",
"SMART AUTO OFFLINE",
"SMART STATUS",
"SMART STATUS CHECK",
"SMART READ ATTRIBUTE VALUES",
"SMART READ ATTRIBUTE THRESHOLDS",
"SMART READ LOG",
"IDENTIFY DEVICE",
"IDENTIFY PACKET DEVICE",
"CHECK POWER MODE",
"SMART WRITE LOG",
"WARNING (UNDEFINED COMMAND -- CONTACT DEVELOPERS AT " PACKAGE_BUGREPORT ")\n"
}

Definition at line 378 of file atacmds.cpp.

bool dont_print_serial_number = false

Definition at line 47 of file atacmds.cpp.

const format_name_entry format_names[]
Initial value:
= {
{"raw8" , RAWFMT_RAW8},
{"raw16" , RAWFMT_RAW16},
{"raw48" , RAWFMT_RAW48},
{"hex48" , RAWFMT_HEX48},
{"raw56" , RAWFMT_RAW56},
{"hex56" , RAWFMT_HEX56},
{"raw64" , RAWFMT_RAW64},
{"hex64" , RAWFMT_HEX64},
{"raw16(raw16)" , RAWFMT_RAW16_OPT_RAW16},
{"raw16(avg16)" , RAWFMT_RAW16_OPT_AVG16},
{"raw24(raw8)" , RAWFMT_RAW24_OPT_RAW8},
{"raw24/raw24" , RAWFMT_RAW24_DIV_RAW24},
{"raw24/raw32" , RAWFMT_RAW24_DIV_RAW32},
{"sec2hour" , RAWFMT_SEC2HOUR},
{"min2hour" , RAWFMT_MIN2HOUR},
{"halfmin2hour" , RAWFMT_HALFMIN2HOUR},
{"msec24hour32" , RAWFMT_MSEC24_HOUR32},
{"tempminmax" , RAWFMT_TEMPMINMAX},
{"temp10x" , RAWFMT_TEMP10X},
}

Definition at line 113 of file atacmds.cpp.

const char* const map_old_vendor_opts[][2]
Initial value:
= {
{ "9,halfminutes" , "9,halfmin2hour,Power_On_Half_Minutes"},
{ "9,minutes" , "9,min2hour,Power_On_Minutes"},
{ "9,seconds" , "9,sec2hour,Power_On_Seconds"},
{ "9,temp" , "9,tempminmax,Temperature_Celsius"},
{"192,emergencyretractcyclect" , "192,raw48,Emerg_Retract_Cycle_Ct"},
{"193,loadunload" , "193,raw24/raw24"},
{"194,10xCelsius" , "194,temp10x,Temperature_Celsius_x10"},
{"194,unknown" , "194,raw48,Unknown_Attribute"},
{"197,increasing" , "197,raw48+,Total_Pending_Sectors"},
{"198,offlinescanuncsectorct" , "198,raw48,Offline_Scan_UNC_SectCt"},
{"198,increasing" , "198,raw48+,Total_Offl_Uncorrectabl"},
{"200,writeerrorcount" , "200,raw48,Write_Error_Count"},
{"201,detectedtacount" , "201,raw48,Detected_TA_Count"},
{"220,temp" , "220,tempminmax,Temperature_Celsius"},
}

Definition at line 138 of file atacmds.cpp.

const unsigned num_format_names = sizeof(format_names)/sizeof(format_names[0])

Definition at line 135 of file atacmds.cpp.

const unsigned num_old_vendor_opts = sizeof(map_old_vendor_opts)/sizeof(map_old_vendor_opts[0])

Definition at line 155 of file atacmds.cpp.