]> git.proxmox.com Git - mirror_smartmontools-debian.git/blame - ataprint.h
Updated changelog
[mirror_smartmontools-debian.git] / ataprint.h
CommitLineData
832b75ed
GG
1/*
2 * ataprint.h
3 *
4 * Home page of code is: http://smartmontools.sourceforge.net
5 *
2127e193 6 * Copyright (C) 2002-9 Bruce Allen <smartmontools-support@lists.sourceforge.net>
d008864d 7 * Copyright (C) 2008-12 Christian Franke <smartmontools-support@lists.sourceforge.net>
832b75ed
GG
8 * Copyright (C) 1999-2000 Michael Cornwell <cornwell@acm.org>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2, or (at your option)
13 * any later version.
14 *
15 * You should have received a copy of the GNU General Public License
16 * (for example COPYING); if not, write to the Free
17 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 *
19 * This code was originally developed as a Senior Thesis by Michael Cornwell
20 * at the Concurrent Systems Laboratory (now part of the Storage Systems
21 * Research Center), Jack Baskin School of Engineering, University of
22 * California, Santa Cruz. http://ssrc.soe.ucsc.edu/
23 *
24 */
25
26#ifndef ATAPRINT_H_
27#define ATAPRINT_H_
28
e165493d 29#define ATAPRINT_H_CVSID "$Id: ataprint.h 3530 2012-03-27 19:54:06Z chrfranke $\n"
832b75ed 30
2127e193 31#include <vector>
832b75ed 32
2127e193
GI
33// Request to dump a GP or SMART log
34struct ata_log_request
35{
36 bool gpl; // false: SMART, true: GP
37 unsigned char logaddr; // Log address
38 unsigned page; // First page (sector)
39 unsigned nsectors; // # Sectors
832b75ed 40
2127e193
GI
41 ata_log_request()
42 : gpl(false), logaddr(0), page(0), nsectors(0)
43 { }
44};
832b75ed 45
2127e193 46// Options for ataPrintMain
2127e193
GI
47struct ata_print_options
48{
49 bool drive_info;
50 bool smart_check_status;
51 bool smart_general_values;
52 bool smart_vendor_attrib;
53 bool smart_error_log;
54 bool smart_selftest_log;
55 bool smart_selective_selftest_log;
832b75ed 56
2127e193
GI
57 bool gp_logdir, smart_logdir;
58 unsigned smart_ext_error_log;
59 unsigned smart_ext_selftest_log;
60 bool retry_error_log, retry_selftest_log;
832b75ed 61
2127e193 62 std::vector<ata_log_request> log_requests;
832b75ed 63
d008864d
GI
64 bool devstat_all_pages, devstat_ssd_page;
65 std::vector<int> devstat_pages;
66
2127e193 67 bool sct_temp_sts, sct_temp_hist;
7f0798ef
GI
68 bool sct_erc_get;
69 bool sct_erc_set;
70 unsigned sct_erc_readtime, sct_erc_writetime;
2127e193 71 bool sataphy, sataphy_reset;
832b75ed 72
2127e193
GI
73 bool smart_disable, smart_enable;
74 bool smart_auto_offl_disable, smart_auto_offl_enable;
75 bool smart_auto_save_disable, smart_auto_save_enable;
832b75ed 76
2127e193 77 int smart_selftest_type; // OFFLINE_FULL_SCAN, ..., see atacmds.h. -1 for no test
d008864d 78 bool smart_selftest_force; // Ignore already running test
2127e193 79 ata_selective_selftest_args smart_selective_args; // Extra args for selective self-test
832b75ed 80
2127e193
GI
81 unsigned sct_temp_int;
82 bool sct_temp_int_pers;
832b75ed 83
e165493d
GI
84 enum { FMT_BRIEF = 0x01, FMT_HEX_ID = 0x02, FMT_HEX_VAL = 0x04 };
85 unsigned char output_format; // FMT_* flags
86
2127e193
GI
87 unsigned char fix_firmwarebug; // FIX_*, see atacmds.h
88 bool fix_swapped_id; // Fix swapped ID strings returned by some buggy drivers
832b75ed 89
bed94269 90 ata_vendor_attr_defs attribute_defs; // -v options
2127e193
GI
91
92 bool ignore_presets; // Ignore presets from drive database
93 bool show_presets; // Show presets and exit
94 unsigned char powermode; // Skip check, if disk in idle or standby mode
95
d008864d
GI
96 bool get_set_used; // true if any get/set command is used
97 bool get_aam; // print Automatic Acoustic Management status
98 int set_aam; // disable(-1), enable(1..255->0..254) Automatic Acoustic Management
99 bool get_apm; // print Advanced Power Management status
100 int set_apm; // disable(-1), enable(2..255->1..254) Advanced Power Management
101 bool get_lookahead; // print read look-ahead status
102 int set_lookahead; // disable(-1), enable(1) read look-ahead
103 int set_standby; // set(1..255->0..254) standby timer
104 bool set_standby_now; // set drive to standby
105 bool get_security; // print ATA security status
106 bool set_security_freeze; // Freeze ATA security
107 bool get_wcache; // print write cache status
108 int set_wcache; // disable(-1), enable(1) write cache
109
2127e193
GI
110 ata_print_options()
111 : drive_info(false),
112 smart_check_status(false),
113 smart_general_values(false),
114 smart_vendor_attrib(false),
115 smart_error_log(false),
116 smart_selftest_log(false),
117 smart_selective_selftest_log(false),
118 gp_logdir(false), smart_logdir(false),
119 smart_ext_error_log(0),
120 smart_ext_selftest_log(0),
121 retry_error_log(false), retry_selftest_log(false),
d008864d 122 devstat_all_pages(false), devstat_ssd_page(false),
2127e193 123 sct_temp_sts(false), sct_temp_hist(false),
7f0798ef
GI
124 sct_erc_get(false),
125 sct_erc_set(false),
126 sct_erc_readtime(0), sct_erc_writetime(0),
2127e193
GI
127 sataphy(false), sataphy_reset(false),
128 smart_disable(false), smart_enable(false),
129 smart_auto_offl_disable(false), smart_auto_offl_enable(false),
130 smart_auto_save_disable(false), smart_auto_save_enable(false),
d008864d 131 smart_selftest_type(-1), smart_selftest_force(false),
2127e193 132 sct_temp_int(0), sct_temp_int_pers(false),
a7e8ffec 133 output_format(0),
2127e193
GI
134 fix_firmwarebug(FIX_NOTSPECIFIED),
135 fix_swapped_id(false),
136 ignore_presets(false),
137 show_presets(false),
d008864d
GI
138 powermode(0),
139 get_set_used(false),
140 get_aam(false), set_aam(0),
141 get_apm(false), set_apm(0),
142 get_lookahead(false), set_lookahead(0),
143 set_standby(0), set_standby_now(false),
144 get_security(false), set_security_freeze(false),
145 get_wcache(false), set_wcache(0)
bed94269 146 { }
2127e193
GI
147};
148
149int ataPrintMain(ata_device * device, const ata_print_options & options);
832b75ed
GG
150
151#endif