smartmontools SVN Rev 5474
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-21 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 5462 2023-03-13 10:45:06Z 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 drive_info = false;
34 bool smart_check_status = false;
36 bool smart_vendor_attrib = false;
37 bool smart_error_log = false;
38 bool smart_selftest_log = false;
40
41 bool gp_logdir = false, smart_logdir = false;
42 unsigned smart_ext_error_log = 0;
44 bool retry_error_log = false, retry_selftest_log = false;
45
46 std::vector<ata_log_request> log_requests;
47
48 bool devstat_all_pages = false, devstat_ssd_page = false;
49 std::vector<int> devstat_pages;
50
51 unsigned pending_defects_log = 0;
52
53 bool sct_temp_sts = false, sct_temp_hist = false;
54 int sct_erc_get = 0; // get(1), get_power_on(2)
55 int sct_erc_set = 0; // set(1), set_power_on(2), mfg_default(3)
57 bool sataphy = false, sataphy_reset = false;
58
59 bool smart_disable = false, smart_enable = false;
62
63 int smart_selftest_type = -1; // OFFLINE_FULL_SCAN, ..., see atacmds.h. -1 for no test
64 bool smart_selftest_force = false; // Ignore already running test
65 ata_selective_selftest_args smart_selective_args; // Extra args for selective self-test
66
67 unsigned sct_temp_int = 0;
68 bool sct_temp_int_pers = false;
69
70 enum { FMT_BRIEF = 0x01, FMT_HEX_ID = 0x02, FMT_HEX_VAL = 0x04 };
71 unsigned char output_format = 0; // FMT_* flags
72
74 bool fix_swapped_id = false; // Fix swapped ID strings returned by some buggy drivers
75
77
78 bool ignore_presets = false; // Ignore presets from drive database
79 bool show_presets = false; // Show presets and exit
80 unsigned char powermode = 0; // Skip check, if disk in idle or standby mode
81 unsigned char powerexit = 0; // exit() code for low power mode
82 int powerexit_unsup = -1; // exit() code for unsupported power mode or -1 to ignore
83
84 bool get_set_used = false; // true if any get/set command is used
85 bool get_aam = false; // print Automatic Acoustic Management status
86 int set_aam = 0; // disable(-1), enable(1..255->0..254) Automatic Acoustic Management
87 bool get_apm = false; // print Advanced Power Management status
88 int set_apm = 0; // disable(-1), enable(2..255->1..254) Advanced Power Management
89 bool get_lookahead = false; // print read look-ahead status
90 int set_lookahead = 0; // disable(-1), enable(1) read look-ahead
91 int set_standby = 0; // set(1..255->0..254) standby timer
92 bool set_standby_now = false; // set drive to standby
93 bool get_security = false; // print ATA security status
94 bool set_security_freeze = false; // Freeze ATA security
95 bool get_wcache = false; // print write cache status
96 int set_wcache = 0; // disable(-1), enable(1) write cache
97 bool sct_wcache_reorder_get = false; // print write cache reordering status
98 int sct_wcache_reorder_set = 0; // disable(-1), enable(1) write cache reordering
100 bool sct_wcache_sct_get = false; // print SCT Feature Control of write cache status
101 int sct_wcache_sct_set = 0; // determined by ata set features command(1), force enable(2), force disable(3)
102 bool sct_wcache_sct_set_pers = false; // persistent or volatile
103 bool get_dsn = false; // print DSN status
104 int set_dsn = 0; // disable(02h), enable(01h) DSN
105
106 bool farm_log = false; // Seagate Field Access Reliability Metrics log (FARM) for ATA
107 bool farm_log_suggest = false; // If -x/-xall or -a/-all is run, suggests FARM log if supported
108};
109
110int ataPrintMain(ata_device * device, const ata_print_options & options);
111
112#endif
int ataPrintMain(ata_device *device, const ata_print_options &options)
Definition: ataprint.cpp:3341
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:100
bool sct_temp_hist
Definition: ataprint.h:53
bool smart_auto_offl_disable
Definition: ataprint.h:60
bool sct_wcache_reorder_get
Definition: ataprint.h:97
bool smart_auto_save_enable
Definition: ataprint.h:61
bool smart_general_values
Definition: ataprint.h:35
unsigned sct_erc_writetime
Definition: ataprint.h:56
bool devstat_all_pages
Definition: ataprint.h:48
bool set_security_freeze
Definition: ataprint.h:94
unsigned pending_defects_log
Definition: ataprint.h:51
bool set_standby_now
Definition: ataprint.h:92
int identify_word_level
Definition: ataprint.h:33
int smart_selftest_type
Definition: ataprint.h:63
bool smart_selftest_log
Definition: ataprint.h:38
int identify_bit_level
Definition: ataprint.h:33
bool smart_disable
Definition: ataprint.h:59
ata_selective_selftest_args smart_selective_args
Definition: ataprint.h:65
unsigned char powerexit
Definition: ataprint.h:81
std::vector< int > devstat_pages
Definition: ataprint.h:49
bool smart_check_status
Definition: ataprint.h:34
bool farm_log_suggest
Definition: ataprint.h:107
unsigned smart_ext_error_log
Definition: ataprint.h:42
bool fix_swapped_id
Definition: ataprint.h:74
unsigned smart_ext_selftest_log
Definition: ataprint.h:43
firmwarebug_defs firmwarebugs
Definition: ataprint.h:73
bool ignore_presets
Definition: ataprint.h:78
unsigned char powermode
Definition: ataprint.h:80
bool get_lookahead
Definition: ataprint.h:89
bool sataphy_reset
Definition: ataprint.h:57
unsigned char output_format
Definition: ataprint.h:71
int sct_wcache_reorder_set
Definition: ataprint.h:98
bool sct_temp_int_pers
Definition: ataprint.h:68
bool smart_selftest_force
Definition: ataprint.h:64
bool smart_selective_selftest_log
Definition: ataprint.h:39
bool devstat_ssd_page
Definition: ataprint.h:48
ata_vendor_attr_defs attribute_defs
Definition: ataprint.h:76
unsigned sct_temp_int
Definition: ataprint.h:67
unsigned sct_erc_readtime
Definition: ataprint.h:56
bool smart_vendor_attrib
Definition: ataprint.h:36
std::vector< ata_log_request > log_requests
Definition: ataprint.h:46
bool sct_wcache_sct_set_pers
Definition: ataprint.h:102
bool retry_error_log
Definition: ataprint.h:44
bool sct_wcache_reorder_set_pers
Definition: ataprint.h:99
bool smart_auto_offl_enable
Definition: ataprint.h:60
bool retry_selftest_log
Definition: ataprint.h:44
bool smart_error_log
Definition: ataprint.h:37
bool smart_auto_save_disable
Definition: ataprint.h:61
int sct_wcache_sct_set
Definition: ataprint.h:101