* ataprint.h
*
* Home page of code is: https://www.smartmontools.org
*
* Copyright (C) 2002-09 Bruce Allen
* Copyright (C) 2008-23 Christian Franke
* Copyright (C) 1999-2000 Michael Cornwell <cornwell@acm.org>
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef ATAPRINT_H_
#define ATAPRINT_H_
#define ATAPRINT_H_CVSID "$Id: ataprint.h 5483 2023-06-25 17:09:03Z chrfranke $\n"
#include <vector>
struct ata_log_request
{
bool gpl = false;
unsigned char logaddr = 0;
unsigned page = 0;
unsigned nsectors = 0;
};
struct ata_print_options
{
bool a_option = false;
bool drive_info = false;
int identify_word_level = -1, identify_bit_level = -1;
bool smart_check_status = false;
bool smart_general_values = false;
bool smart_vendor_attrib = false;
bool smart_error_log = false;
bool smart_selftest_log = false;
bool smart_selective_selftest_log = false;
bool gp_logdir = false, smart_logdir = false;
unsigned smart_ext_error_log = 0;
unsigned smart_ext_selftest_log = 0;
bool retry_error_log = false, retry_selftest_log = false;
std::vector<ata_log_request> log_requests;
bool devstat_all_pages = false, devstat_ssd_page = false;
std::vector<int> devstat_pages;
unsigned pending_defects_log = 0;
bool sct_temp_sts = false, sct_temp_hist = false;
int sct_erc_get = 0;
int sct_erc_set = 0;
unsigned sct_erc_readtime = 0, sct_erc_writetime = 0;
bool sataphy = false, sataphy_reset = false;
bool smart_disable = false, smart_enable = false;
bool smart_auto_offl_disable = false, smart_auto_offl_enable = false;
bool smart_auto_save_disable = false, smart_auto_save_enable = false;
int smart_selftest_type = -1;
bool smart_selftest_force = false;
ata_selective_selftest_args smart_selective_args;
unsigned sct_temp_int = 0;
bool sct_temp_int_pers = false;
enum { FMT_BRIEF = 0x01, FMT_HEX_ID = 0x02, FMT_HEX_VAL = 0x04 };
unsigned char output_format = 0;
firmwarebug_defs firmwarebugs;
bool fix_swapped_id = false;
ata_vendor_attr_defs attribute_defs;
bool ignore_presets = false;
bool show_presets = false;
unsigned char powermode = 0;
unsigned char powerexit = 0;
int powerexit_unsup = -1;
bool get_set_used = false;
bool get_aam = false;
int set_aam = 0;
bool get_apm = false;
int set_apm = 0;
bool get_lookahead = false;
int set_lookahead = 0;
int set_standby = 0;
bool set_standby_now = false;
bool get_security = false;
bool set_security_freeze = false;
bool get_wcache = false;
int set_wcache = 0;
bool sct_wcache_reorder_get = false;
int sct_wcache_reorder_set = 0;
bool sct_wcache_reorder_set_pers = false;
bool sct_wcache_sct_get = false;
int sct_wcache_sct_set = 0;
bool sct_wcache_sct_set_pers = false;
bool get_dsn = false;
int set_dsn = 0;
bool farm_log = false;
bool farm_log_suggest = false;
};
int ataPrintMain(ata_device * device, const ata_print_options & options);
#endif