smartmontools SVN Rev 3317
Utility to control and monitor storage systems with "S.M.A.R.T."
Classes | Namespaces | Defines | 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 "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

namespace  anonymous_namespace{atacmds.cpp}

Defines

#define SMART_CYL_LOW   0x4F
#define SMART_CYL_HI   0xC2
#define SRET_STATUS_HI_EXCEEDED   0x2C
#define SRET_STATUS_MID_EXCEEDED   0xF4
#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)
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 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 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)
static ata_attr_raw_format get_default_raw_format (unsigned char id)
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)
static const char * get_default_attr_name (unsigned char id, int rpm)
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)
int ataGetSetSCTWriteCacheReordering (ata_device *device, bool enable, 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 * 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 []

Define Documentation

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

Definition at line 50 of file atacmds.cpp.

#define SMART_CYL_LOW   0x4F

Definition at line 49 of file atacmds.cpp.

#define SRET_STATUS_HI_EXCEEDED   0x2C

Definition at line 56 of file atacmds.cpp.

#define SRET_STATUS_MID_EXCEEDED   0xF4

Definition at line 57 of file atacmds.cpp.


Function Documentation

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 
)

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 
)

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 
)

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 
)

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 
)

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.

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

Definition at line 2566 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  firmwarebugs 
)

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 data,
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 data 
)

Definition at line 1495 of file atacmds.cpp.

int ataReadSmartValues ( ata_device device,
struct ata_smart_values data 
)

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 selargs,
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_args 
)

Definition at line 1190 of file atacmds.cpp.

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

Definition at line 1052 of file atacmds.cpp.

unsigned char checksum ( const void *  data)

Definition at line 703 of file atacmds.cpp.

std::string create_vendor_attribute_arg_list ( )

Definition at line 252 of file atacmds.cpp.

static void fix_exterrlog_lba ( ata_smart_exterrlog log,
unsigned  nsectors 
) [static]

Definition at line 1455 of file atacmds.cpp.

template<class T >
static void fix_exterrlog_lba_cmd ( T &  cmd) [inline, static]

Definition at line 1446 of file atacmds.cpp.

static void fixsamsungerrorlog ( ata_smart_errorlog data) [static]

Definition at line 1369 of file atacmds.cpp.

static void fixsamsungerrorlog2 ( ata_smart_errorlog data) [static]

Definition at line 1391 of file atacmds.cpp.

static void fixsamsungselftestlog ( ata_smart_selftestlog data) [static]

Definition at line 1003 of file atacmds.cpp.

static const char* get_default_attr_name ( unsigned char  id,
int  rpm 
) [static]

Definition at line 2106 of file atacmds.cpp.

static ata_attr_raw_format get_default_raw_format ( unsigned char  id) [static]

Definition at line 1863 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.

static void invalidate_serno ( ata_identify_device id) [static]

Definition at line 323 of file atacmds.cpp.

int isGeneralPurposeLoggingCapable ( const ata_identify_device identity)

Definition at line 1746 of file atacmds.cpp.

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.

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

Definition at line 367 of file atacmds.cpp.

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

Definition at line 394 of file atacmds.cpp.

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

Definition at line 376 of file atacmds.cpp.

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

Definition at line 385 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.

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

Definition at line 713 of file atacmds.cpp.

int TestTime ( const ata_smart_values data,
int  testtype 
)

Definition at line 1677 of file atacmds.cpp.

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

Definition at line 722 of file atacmds.cpp.


Variable Documentation

unsigned char ata_debugmode = 0

Definition at line 42 of file atacmds.cpp.

const char* atacmds_cpp_cvsid
Initial value:
"$Id: atacmds.cpp 3881 2014-03-05 17:49:47Z chrfranke $"
                                 ATACMDS_H_CVSID

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

Definition at line 46 of file atacmds.cpp.

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 112 of file atacmds.cpp.

const char* 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 137 of file atacmds.cpp.

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

Definition at line 134 of file atacmds.cpp.

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

Definition at line 154 of file atacmds.cpp.