Annotation of embedaddon/smartmontools/ataprint.h, revision 1.1.1.1

1.1       misho       1: /*
                      2:  * ataprint.h
                      3:  *
                      4:  * Home page of code is: http://smartmontools.sourceforge.net
                      5:  *
                      6:  * Copyright (C) 2002-9 Bruce Allen <smartmontools-support@lists.sourceforge.net>
                      7:  * Copyright (C) 2008-9 Christian Franke <smartmontools-support@lists.sourceforge.net>
                      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: 
                     29: #define ATAPRINT_H_CVSID "$Id: ataprint.h 3435 2011-10-11 19:01:42Z chrfranke $\n"
                     30: 
                     31: #include <vector>
                     32: 
                     33: // Request to dump a GP or SMART log
                     34: struct 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
                     40: 
                     41:   ata_log_request()
                     42:     : gpl(false), logaddr(0), page(0), nsectors(0)
                     43:     { }
                     44: };
                     45: 
                     46: // Options for ataPrintMain
                     47: struct 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;
                     56: 
                     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;
                     61: 
                     62:   std::vector<ata_log_request> log_requests;
                     63: 
                     64:   bool devstat_all_pages, devstat_ssd_page;
                     65:   std::vector<int> devstat_pages;
                     66: 
                     67:   bool sct_temp_sts, sct_temp_hist;
                     68:   bool sct_erc_get;
                     69:   bool sct_erc_set;
                     70:   unsigned sct_erc_readtime, sct_erc_writetime;
                     71:   bool sataphy, sataphy_reset;
                     72: 
                     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;
                     76: 
                     77:   int smart_selftest_type; // OFFLINE_FULL_SCAN, ..., see atacmds.h. -1 for no test
                     78:   ata_selective_selftest_args smart_selective_args; // Extra args for selective self-test
                     79: 
                     80:   unsigned sct_temp_int;
                     81:   bool sct_temp_int_pers;
                     82: 
                     83:   unsigned char output_format; // 0=old, 1=brief
                     84:   unsigned char fix_firmwarebug; // FIX_*, see atacmds.h
                     85:   bool fix_swapped_id; // Fix swapped ID strings returned by some buggy drivers
                     86: 
                     87:   ata_vendor_attr_defs attribute_defs; // -v options
                     88: 
                     89:   bool ignore_presets; // Ignore presets from drive database
                     90:   bool show_presets; // Show presets and exit
                     91:   unsigned char powermode; // Skip check, if disk in idle or standby mode
                     92: 
                     93:   ata_print_options()
                     94:     : drive_info(false),
                     95:       smart_check_status(false),
                     96:       smart_general_values(false),
                     97:       smart_vendor_attrib(false),
                     98:       smart_error_log(false),
                     99:       smart_selftest_log(false),
                    100:       smart_selective_selftest_log(false),
                    101:       gp_logdir(false), smart_logdir(false),
                    102:       smart_ext_error_log(0),
                    103:       smart_ext_selftest_log(0),
                    104:       retry_error_log(false), retry_selftest_log(false),
                    105:       devstat_all_pages(false), devstat_ssd_page(false),
                    106:       sct_temp_sts(false), sct_temp_hist(false),
                    107:       sct_erc_get(false),
                    108:       sct_erc_set(false),
                    109:       sct_erc_readtime(0), sct_erc_writetime(0),
                    110:       sataphy(false), sataphy_reset(false),
                    111:       smart_disable(false), smart_enable(false),
                    112:       smart_auto_offl_disable(false), smart_auto_offl_enable(false),
                    113:       smart_auto_save_disable(false), smart_auto_save_enable(false),
                    114:       smart_selftest_type(-1),
                    115:       sct_temp_int(0), sct_temp_int_pers(false),
                    116:       output_format(0),
                    117:       fix_firmwarebug(FIX_NOTSPECIFIED),
                    118:       fix_swapped_id(false),
                    119:       ignore_presets(false),
                    120:       show_presets(false),
                    121:       powermode(0)
                    122:     { }
                    123: };
                    124: 
                    125: int ataPrintMain(ata_device * device, const ata_print_options & options);
                    126: 
                    127: #endif

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>