smartmontools SVN Rev 5640
Utility to control and monitor storage systems with "S.M.A.R.T."
Classes | Namespaces | Macros | Functions | Variables
atacmds.cpp File Reference
#include "config.h"
#include <inttypes.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <stdlib.h>
#include <ctype.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

namespace  anonymous_namespace{atacmds.cpp}
 

Macros

#define __STDC_FORMAT_MACROS   1
 
#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)
 
bool isSmartErrorLogCapable (const ata_smart_values *data, const ata_identify_device *identity)
 
bool isSmartTestLogCapable (const ata_smart_values *data, const ata_identify_device *identity)
 
bool isGeneralPurposeLoggingCapable (const ata_identify_device *identity)
 
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, bool power_on, bool mfg_default)
 
int ataGetSCTErrorRecoveryControltime (ata_device *device, unsigned type, unsigned short &time_limit, bool power_on)
 
int ataSetSCTErrorRecoveryControltime (ata_device *device, unsigned type, unsigned short time_limit, bool power_on, bool mfg_default)
 
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 regular_expression::match_range &srcmatch)
 
static int anonymous_namespace{atacmds.cpp}::matchtoi (const char *src, const regular_expression::match_range &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

◆ __STDC_FORMAT_MACROS

#define __STDC_FORMAT_MACROS   1

Definition at line 15 of file atacmds.cpp.

◆ P

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

◆ SMART_CYL_HI

#define SMART_CYL_HI   0xC2

Definition at line 41 of file atacmds.cpp.

◆ SMART_CYL_LOW

#define SMART_CYL_LOW   0x4F

Definition at line 40 of file atacmds.cpp.

◆ SRET_STATUS_HI_EXCEEDED

#define SRET_STATUS_HI_EXCEEDED   0x2C

Definition at line 47 of file atacmds.cpp.

◆ SRET_STATUS_MID_EXCEEDED

#define SRET_STATUS_MID_EXCEEDED   0xF4

Definition at line 48 of file atacmds.cpp.

◆ SWAPV

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

Definition at line 340 of file atacmds.cpp.

Function Documentation

◆ ata_find_attr_index()

int ata_find_attr_index ( unsigned char  id,
const ata_smart_values smartval 
)

Definition at line 2146 of file atacmds.cpp.

◆ ata_format_attr_raw_value()

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

Definition at line 1920 of file atacmds.cpp.

◆ ata_format_id_string()

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

Definition at line 762 of file atacmds.cpp.

◆ ata_get_attr_raw_value()

uint64_t ata_get_attr_raw_value ( const ata_smart_attribute attr,
const ata_vendor_attr_defs defs 
)

Definition at line 1846 of file atacmds.cpp.

◆ ata_get_attr_state()

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

◆ ata_get_rotation_rate()

int ata_get_rotation_rate ( const ata_identify_device id)

Definition at line 920 of file atacmds.cpp.

◆ ata_get_size_info()

void ata_get_size_info ( const ata_identify_device id,
ata_size_info sizes 
)

Definition at line 658 of file atacmds.cpp.

◆ ata_get_smart_attr_name()

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

Definition at line 2127 of file atacmds.cpp.

◆ ata_get_wwn()

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

Definition at line 900 of file atacmds.cpp.

◆ ata_nodata_command()

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

Definition at line 787 of file atacmds.cpp.

◆ ata_read_identity()

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

Definition at line 817 of file atacmds.cpp.

◆ ata_return_temperature_value()

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

Definition at line 2159 of file atacmds.cpp.

◆ ata_set_features()

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

Definition at line 799 of file atacmds.cpp.

◆ ataCheckPowerMode()

int ataCheckPowerMode ( ata_device device)

Definition at line 777 of file atacmds.cpp.

◆ ataDisableAutoOffline()

int ataDisableAutoOffline ( ata_device device)

Definition at line 1581 of file atacmds.cpp.

◆ ataDisableAutoSave()

int ataDisableAutoSave ( ata_device device)

Definition at line 1558 of file atacmds.cpp.

◆ ataDisableSmart()

int ataDisableSmart ( ata_device device)

Definition at line 1543 of file atacmds.cpp.

◆ ataDoesSmartWork()

int ataDoesSmartWork ( ata_device device)

Definition at line 1593 of file atacmds.cpp.

◆ ataEnableAutoOffline()

int ataEnableAutoOffline ( ata_device device)

Definition at line 1570 of file atacmds.cpp.

◆ ataEnableAutoSave()

int ataEnableAutoSave ( ata_device device)

Definition at line 1551 of file atacmds.cpp.

◆ ataEnableSmart()

int ataEnableSmart ( ata_device device)

Definition at line 1536 of file atacmds.cpp.

◆ ataGetSCTErrorRecoveryControltime()

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

Definition at line 2510 of file atacmds.cpp.

◆ ataGetSetSCTErrorRecoveryControltime()

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

Definition at line 2414 of file atacmds.cpp.

◆ ataGetSetSCTFeatureControl()

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

Definition at line 2282 of file atacmds.cpp.

◆ ataGetSetSCTWriteCache()

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

Definition at line 2356 of file atacmds.cpp.

◆ ataGetSetSCTWriteCacheReordering()

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

Definition at line 2349 of file atacmds.cpp.

◆ ataIsSmartEnabled()

int ataIsSmartEnabled ( const ata_identify_device drive)

Definition at line 951 of file atacmds.cpp.

◆ ataReadErrorLog()

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

Definition at line 1424 of file atacmds.cpp.

◆ ataReadExtErrorLog()

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

Definition at line 1491 of file atacmds.cpp.

◆ ataReadExtSelfTestLog()

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

Definition at line 1061 of file atacmds.cpp.

◆ ataReadLogDirectory()

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

Definition at line 1164 of file atacmds.cpp.

◆ ataReadLogExt()

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

Definition at line 1111 of file atacmds.cpp.

◆ ataReadSCTStatus()

int ataReadSCTStatus ( ata_device device,
ata_sct_status_response sts 
)

Definition at line 2188 of file atacmds.cpp.

◆ ataReadSCTTempHist()

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

Definition at line 2220 of file atacmds.cpp.

◆ ataReadSelectiveSelfTestLog()

int ataReadSelectiveSelfTestLog ( ata_device device,
struct ata_selective_self_test_log data 
)

Definition at line 1184 of file atacmds.cpp.

◆ ataReadSelfTestLog()

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

Definition at line 1013 of file atacmds.cpp.

◆ ataReadSmartLog()

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

Definition at line 1143 of file atacmds.cpp.

◆ ataReadSmartThresholds()

int ataReadSmartThresholds ( ata_device device,
struct ata_smart_thresholds_pvt data 
)

Definition at line 1518 of file atacmds.cpp.

◆ ataReadSmartValues()

int ataReadSmartValues ( ata_device device,
struct ata_smart_values data 
)

Definition at line 967 of file atacmds.cpp.

◆ ataSetSCTErrorRecoveryControltime()

int ataSetSCTErrorRecoveryControltime ( ata_device device,
unsigned  type,
unsigned short  time_limit,
bool  power_on,
bool  mfg_default 
)

Definition at line 2516 of file atacmds.cpp.

◆ ataSetSCTTempInterval()

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

Definition at line 2363 of file atacmds.cpp.

◆ ataSmartStatus2()

int ataSmartStatus2 ( ata_device device)

Definition at line 1604 of file atacmds.cpp.

◆ ataSmartSupport()

int ataSmartSupport ( const ata_identify_device drive)

Definition at line 936 of file atacmds.cpp.

◆ ataSmartTest()

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

◆ ataWriteLogExt()

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

Definition at line 1080 of file atacmds.cpp.

◆ ataWriteSelectiveSelfTestLog()

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

◆ check_multi_sector_sum()

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

Definition at line 1045 of file atacmds.cpp.

◆ check_temp_range()

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

Definition at line 1903 of file atacmds.cpp.

◆ check_temp_word()

static int check_temp_word ( unsigned  word)
inlinestatic

Definition at line 1892 of file atacmds.cpp.

◆ checksum()

unsigned char checksum ( const void *  data)

Definition at line 716 of file atacmds.cpp.

◆ create_vendor_attribute_arg_list()

std::string create_vendor_attribute_arg_list ( )

Definition at line 262 of file atacmds.cpp.

◆ fix_exterrlog_lba()

static void fix_exterrlog_lba ( ata_smart_exterrlog log,
unsigned  nsectors 
)
static

Definition at line 1478 of file atacmds.cpp.

◆ fix_exterrlog_lba_cmd()

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

Definition at line 1469 of file atacmds.cpp.

◆ fixsamsungerrorlog()

static void fixsamsungerrorlog ( ata_smart_errorlog data)
static

Definition at line 1392 of file atacmds.cpp.

◆ fixsamsungerrorlog2()

static void fixsamsungerrorlog2 ( ata_smart_errorlog data)
static

Definition at line 1414 of file atacmds.cpp.

◆ fixsamsungselftestlog()

static void fixsamsungselftestlog ( ata_smart_selftestlog data)
static

Definition at line 996 of file atacmds.cpp.

◆ get_parsed_ata_device()

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

Definition at line 2838 of file atacmds.cpp.

◆ get_swapx_val()

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

Definition at line 337 of file atacmds.cpp.

◆ get_unc_attr_id()

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

Definition at line 53 of file atacmds.cpp.

◆ get_valid_firmwarebug_args()

const char * get_valid_firmwarebug_args ( )

Definition at line 297 of file atacmds.cpp.

◆ invalidate_serno()

static void invalidate_serno ( ata_identify_device id)
static

Definition at line 343 of file atacmds.cpp.

◆ isGeneralPurposeLoggingCapable()

bool isGeneralPurposeLoggingCapable ( const ata_identify_device identity)

Definition at line 1769 of file atacmds.cpp.

◆ isSmartErrorLogCapable()

bool isSmartErrorLogCapable ( const ata_smart_values data,
const ata_identify_device identity 
)

Definition at line 1731 of file atacmds.cpp.

◆ isSmartTestLogCapable()

bool isSmartTestLogCapable ( const ata_smart_values data,
const ata_identify_device identity 
)

Definition at line 1750 of file atacmds.cpp.

◆ parse_attribute_def()

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

Definition at line 149 of file atacmds.cpp.

◆ parse_firmwarebug_def()

bool parse_firmwarebug_def ( const char *  opt,
firmwarebug_defs firmwarebugs 
)

Definition at line 277 of file atacmds.cpp.

◆ preg()

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

Definition at line 382 of file atacmds.cpp.

◆ prettyprint()

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

Definition at line 409 of file atacmds.cpp.

◆ print_regs() [1/2]

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

Definition at line 391 of file atacmds.cpp.

◆ print_regs() [2/2]

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

Definition at line 400 of file atacmds.cpp.

◆ smartcommandhandler()

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

Definition at line 431 of file atacmds.cpp.

◆ swap2()

void swap2 ( char *  location)

Definition at line 304 of file atacmds.cpp.

◆ swap4()

void swap4 ( char *  location)

Definition at line 312 of file atacmds.cpp.

◆ swap8()

void swap8 ( char *  location)

Definition at line 321 of file atacmds.cpp.

◆ swapbytes()

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

Definition at line 726 of file atacmds.cpp.

◆ TestTime()

int TestTime ( const ata_smart_values data,
int  testtype 
)

Definition at line 1700 of file atacmds.cpp.

◆ trim()

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

Definition at line 735 of file atacmds.cpp.

Variable Documentation

◆ ata_debugmode

unsigned char ata_debugmode = 0

Definition at line 33 of file atacmds.cpp.

◆ atacmds_cpp_cvsid

const char* atacmds_cpp_cvsid
Initial value:
= "$Id: atacmds.cpp 5456 2023-02-14 18:26:21Z chrfranke $"
#define ATACMDS_H_CVSID
Definition: atacmds.h:16

Definition at line 29 of file atacmds.cpp.

◆ commandstrings

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

◆ dont_print_serial_number

bool dont_print_serial_number = false

Definition at line 37 of file atacmds.cpp.

◆ format_names

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},
}
@ RAWFMT_TEMP10X
Definition: atacmds.h:669
@ RAWFMT_HEX64
Definition: atacmds.h:658
@ RAWFMT_RAW16_OPT_AVG16
Definition: atacmds.h:660
@ RAWFMT_HEX56
Definition: atacmds.h:656
@ RAWFMT_MIN2HOUR
Definition: atacmds.h:665
@ RAWFMT_RAW24_DIV_RAW32
Definition: atacmds.h:663
@ RAWFMT_RAW16_OPT_RAW16
Definition: atacmds.h:659
@ RAWFMT_TEMPMINMAX
Definition: atacmds.h:668
@ RAWFMT_HEX48
Definition: atacmds.h:654
@ RAWFMT_RAW24_OPT_RAW8
Definition: atacmds.h:661
@ RAWFMT_MSEC24_HOUR32
Definition: atacmds.h:667
@ RAWFMT_RAW64
Definition: atacmds.h:657
@ RAWFMT_RAW56
Definition: atacmds.h:655
@ RAWFMT_RAW48
Definition: atacmds.h:653
@ RAWFMT_HALFMIN2HOUR
Definition: atacmds.h:666
@ RAWFMT_RAW16
Definition: atacmds.h:652
@ RAWFMT_SEC2HOUR
Definition: atacmds.h:664
@ RAWFMT_RAW8
Definition: atacmds.h:651
@ RAWFMT_RAW24_DIV_RAW24
Definition: atacmds.h:662

Definition at line 103 of file atacmds.cpp.

◆ map_old_vendor_opts

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

◆ num_format_names

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

Definition at line 125 of file atacmds.cpp.

◆ num_old_vendor_opts

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

Definition at line 145 of file atacmds.cpp.