smartmontools SVN Rev 5640
Utility to control and monitor storage systems with "S.M.A.R.T."
ataprint.h
Go to the documentation of this file.
1/*
2 * ataprint.h
3 *
4 * Home page of code is: https://www.smartmontools.org
5 *
6 * Copyright (C) 2002-09 Bruce Allen
7 * Copyright (C) 2008-23 Christian Franke
8 * Copyright (C) 1999-2000 Michael Cornwell <cornwell@acm.org>
9 *
10 * SPDX-License-Identifier: GPL-2.0-or-later
11 */
12
13#ifndef ATAPRINT_H_
14#define ATAPRINT_H_
15
16#define ATAPRINT_H_CVSID "$Id: ataprint.h 5483 2023-06-25 17:09:03Z chrfranke $\n"
17
18#include <vector>
19
20// Request to dump a GP or SMART log
22{
23 bool gpl = false; // false: SMART, true: GP
24 unsigned char logaddr = 0; // Log address
25 unsigned page = 0; // First page (sector)
26 unsigned nsectors = 0; // # Sectors
27};
28
29// Options for ataPrintMain
31{
32 bool a_option = false; // true if '-a' is specified, used to suggest '-x'
33 bool drive_info = false;
35 bool smart_check_status = false;
37 bool smart_vendor_attrib = false;
38 bool smart_error_log = false;
39 bool smart_selftest_log = false;
41
42 bool gp_logdir = false, smart_logdir = false;
43 unsigned smart_ext_error_log = 0;
45 bool retry_error_log = false, retry_selftest_log = false;
46
47 std::vector<ata_log_request> log_requests;
48
49 bool devstat_all_pages = false, devstat_ssd_page = false;
50 std::vector<int> devstat_pages;
51
52 unsigned pending_defects_log = 0;
53
54 bool sct_temp_sts = false, sct_temp_hist = false;
55 int sct_erc_get = 0; // get(1), get_power_on(2)
56 int sct_erc_set = 0; // set(1), set_power_on(2), mfg_default(3)
58 bool sataphy = false, sataphy_reset = false;
59
60 bool smart_disable = false, smart_enable = false;
63
64 int smart_selftest_type = -1; // OFFLINE_FULL_SCAN, ..., see atacmds.h. -1 for no test
65 bool smart_selftest_force = false; // Ignore already running test
66 ata_selective_selftest_args smart_selective_args; // Extra args for selective self-test
67
68 unsigned sct_temp_int = 0;
69 bool sct_temp_int_pers = false;
70
71 enum { FMT_BRIEF = 0x01, FMT_HEX_ID = 0x02, FMT_HEX_VAL = 0x04 };
72 unsigned char output_format = 0; // FMT_* flags
73
75 bool fix_swapped_id = false; // Fix swapped ID strings returned by some buggy drivers
76
78
79 bool ignore_presets = false; // Ignore presets from drive database
80 bool show_presets = false; // Show presets and exit
81 unsigned char powermode = 0; // Skip check, if disk in idle or standby mode
82 unsigned char powerexit = 0; // exit() code for low power mode
83 int powerexit_unsup = -1; // exit() code for unsupported power mode or -1 to ignore
84
85 bool get_set_used = false; // true if any get/set command is used
86 bool get_aam = false; // print Automatic Acoustic Management status
87 int set_aam = 0; // disable(-1), enable(1..255->0..254) Automatic Acoustic Management
88 bool get_apm = false; // print Advanced Power Management status
89 int set_apm = 0; // disable(-1), enable(2..255->1..254) Advanced Power Management
90 bool get_lookahead = false; // print read look-ahead status
91 int set_lookahead = 0; // disable(-1), enable(1) read look-ahead
92 int set_standby = 0; // set(1..255->0..254) standby timer
93 bool set_standby_now = false; // set drive to standby
94 bool get_security = false; // print ATA security status
95 bool set_security_freeze = false; // Freeze ATA security
96 bool get_wcache = false; // print write cache status
97 int set_wcache = 0; // disable(-1), enable(1) write cache
98 bool sct_wcache_reorder_get = false; // print write cache reordering status
99 int sct_wcache_reorder_set = 0; // disable(-1), enable(1) write cache reordering
101 bool sct_wcache_sct_get = false; // print SCT Feature Control of write cache status
102 int sct_wcache_sct_set = 0; // determined by ata set features command(1), force enable(2), force disable(3)
103 bool sct_wcache_sct_set_pers = false; // persistent or volatile
104 bool get_dsn = false; // print DSN status
105 int set_dsn = 0; // disable(02h), enable(01h) DSN
106
107 bool farm_log = false; // Seagate Field Access Reliability Metrics log (FARM) for ATA
108 bool farm_log_suggest = false; // If -x/-xall or -a/-all is run, suggests FARM log if supported
109};
110
111int ataPrintMain(ata_device * device, const ata_print_options & options);
112
113#endif
int ataPrintMain(ata_device *device, const ata_print_options &options)
Definition: ataprint.cpp:3357
ATA device access.
unsigned page
Definition: ataprint.h:25
unsigned char logaddr
Definition: ataprint.h:24
unsigned nsectors
Definition: ataprint.h:26
bool sct_wcache_sct_get
Definition: ataprint.h:101
bool sct_temp_hist
Definition: ataprint.h:54
bool smart_auto_offl_disable
Definition: ataprint.h:61
bool sct_wcache_reorder_get
Definition: ataprint.h:98
bool smart_auto_save_enable
Definition: ataprint.h:62
bool smart_general_values
Definition: ataprint.h:36
unsigned sct_erc_writetime
Definition: ataprint.h:57
bool devstat_all_pages
Definition: ataprint.h:49
bool set_security_freeze
Definition: ataprint.h:95
unsigned pending_defects_log
Definition: ataprint.h:52
bool set_standby_now
Definition: ataprint.h:93
int identify_word_level
Definition: ataprint.h:34
int smart_selftest_type
Definition: ataprint.h:64
bool smart_selftest_log
Definition: ataprint.h:39
int identify_bit_level
Definition: ataprint.h:34
bool smart_disable
Definition: ataprint.h:60
ata_selective_selftest_args smart_selective_args
Definition: ataprint.h:66
unsigned char powerexit
Definition: ataprint.h:82
std::vector< int > devstat_pages
Definition: ataprint.h:50
bool smart_check_status
Definition: ataprint.h:35
bool farm_log_suggest
Definition: ataprint.h:108
unsigned smart_ext_error_log
Definition: ataprint.h:43
bool fix_swapped_id
Definition: ataprint.h:75
unsigned smart_ext_selftest_log
Definition: ataprint.h:44
firmwarebug_defs firmwarebugs
Definition: ataprint.h:74
bool ignore_presets
Definition: ataprint.h:79
unsigned char powermode
Definition: ataprint.h:81
bool get_lookahead
Definition: ataprint.h:90
bool sataphy_reset
Definition: ataprint.h:58
unsigned char output_format
Definition: ataprint.h:72
int sct_wcache_reorder_set
Definition: ataprint.h:99
bool sct_temp_int_pers
Definition: ataprint.h:69
bool smart_selftest_force
Definition: ataprint.h:65
bool smart_selective_selftest_log
Definition: ataprint.h:40
bool devstat_ssd_page
Definition: ataprint.h:49
ata_vendor_attr_defs attribute_defs
Definition: ataprint.h:77
unsigned sct_temp_int
Definition: ataprint.h:68
unsigned sct_erc_readtime
Definition: ataprint.h:57
bool smart_vendor_attrib
Definition: ataprint.h:37
std::vector< ata_log_request > log_requests
Definition: ataprint.h:47
bool sct_wcache_sct_set_pers
Definition: ataprint.h:103
bool retry_error_log
Definition: ataprint.h:45
bool sct_wcache_reorder_set_pers
Definition: ataprint.h:100
bool smart_auto_offl_enable
Definition: ataprint.h:61
bool retry_selftest_log
Definition: ataprint.h:45
bool smart_error_log
Definition: ataprint.h:38
bool smart_auto_save_disable
Definition: ataprint.h:62
int sct_wcache_sct_set
Definition: ataprint.h:102