2 * linux/include/linux/hdsmart.h
4 * Copyright (C) 1999-2000 Michael Cornwell <cornwell@acm.org>
5 * Copyright (C) 2000 Andre Hedrick <andre@linux-ide.org>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2, or (at your option)
12 * You should have received a copy of the GNU General Public License
13 * (for example /usr/src/linux/COPYING); if not, write to the Free
14 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17 #ifndef _LINUX_HDSMART_H
18 #define _LINUX_HDSMART_H
20 <<<<<<< HEAD
:include
/linux
/hdsmart
.h
24 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:include
/linux
/hdsmart
.h
25 #define OFFLINE_FULL_SCAN 0
26 #define SHORT_SELF_TEST 1
27 #define EXTEND_SELF_TEST 2
28 #define SHORT_CAPTIVE_SELF_TEST 129
29 #define EXTEND_CAPTIVE_SELF_TEST 130
31 /* smart_attribute is the vendor specific in SFF-8035 spec */
32 typedef struct ata_smart_attribute_s
{
34 unsigned short status_flag
;
35 unsigned char normalized
;
36 unsigned char worse_normal
;
39 } __attribute__ ((packed
)) ata_smart_attribute_t
;
41 /* smart_values is format of the read drive Atrribute command */
42 typedef struct ata_smart_values_s
{
43 unsigned short revnumber
;
44 ata_smart_attribute_t vendor_attributes
[30];
45 unsigned char offline_data_collection_status
;
46 unsigned char self_test_exec_status
;
47 unsigned short total_time_to_complete_off_line
;
48 unsigned char vendor_specific_366
;
49 unsigned char offline_data_collection_capability
;
50 unsigned short smart_capability
;
51 unsigned char errorlog_capability
;
52 unsigned char vendor_specific_371
;
53 unsigned char short_test_completion_time
;
54 unsigned char extend_test_completion_time
;
55 unsigned char reserved_374_385
[12];
56 unsigned char vendor_specific_386_509
[125];
58 } __attribute__ ((packed
)) ata_smart_values_t
;
60 /* Smart Threshold data structures */
61 /* Vendor attribute of SMART Threshold */
62 typedef struct ata_smart_threshold_entry_s
{
64 unsigned char normalized_threshold
;
65 unsigned char reserved
[10];
66 } __attribute__ ((packed
)) ata_smart_threshold_entry_t
;
68 /* Format of Read SMART THreshold Command */
69 typedef struct ata_smart_thresholds_s
{
70 unsigned short revnumber
;
71 ata_smart_threshold_entry_t thres_entries
[30];
72 unsigned char reserved
[149];
74 } __attribute__ ((packed
)) ata_smart_thresholds_t
;
76 typedef struct ata_smart_errorlog_command_struct_s
{
77 unsigned char devicecontrolreg
;
78 unsigned char featuresreg
;
79 unsigned char sector_count
;
80 unsigned char sector_number
;
81 unsigned char cylinder_low
;
82 unsigned char cylinder_high
;
83 unsigned char drive_head
;
84 unsigned char commandreg
;
85 unsigned int timestamp
;
86 } __attribute__ ((packed
)) ata_smart_errorlog_command_struct_t
;
88 typedef struct ata_smart_errorlog_error_struct_s
{
89 unsigned char error_condition
;
90 unsigned char extended_error
[14];
92 unsigned short timestamp
;
93 } __attribute__ ((packed
)) ata_smart_errorlog_error_struct_t
;
95 typedef struct ata_smart_errorlog_struct_s
{
96 ata_smart_errorlog_command_struct_t commands
[6];
97 ata_smart_errorlog_error_struct_t error_struct
;
98 } __attribute__ ((packed
)) ata_smart_errorlog_struct_t
;
100 typedef struct ata_smart_errorlog_s
{
101 unsigned char revnumber
;
102 unsigned char error_log_pointer
;
103 ata_smart_errorlog_struct_t errorlog_struct
[5];
104 unsigned short ata_error_count
;
105 unsigned short non_fatal_count
;
106 unsigned short drive_timeout_count
;
107 unsigned char reserved
[53];
108 unsigned char chksum
;
109 } __attribute__ ((packed
)) ata_smart_errorlog_t
;
111 typedef struct ata_smart_selftestlog_struct_s
{
112 unsigned char selftestnumber
;
113 unsigned char selfteststatus
;
114 unsigned short timestamp
;
115 unsigned char selftestfailurecheckpoint
;
116 unsigned int lbafirstfailure
;
117 unsigned char vendorspecific
[15];
118 } __attribute__ ((packed
)) ata_smart_selftestlog_struct_t
;
120 typedef struct ata_smart_selftestlog_s
{
121 unsigned short revnumber
;
122 ata_smart_selftestlog_struct_t selftest_struct
[21];
123 unsigned char vendorspecific
[2];
124 unsigned char mostrecenttest
;
125 unsigned char resevered
[2];
126 unsigned char chksum
;
127 } __attribute__ ((packed
)) ata_smart_selftestlog_t
;
128 <<<<<<< HEAD
:include
/linux
/hdsmart
.h
129 #endif /* __KERNEL__ *
131 #endif /* __KERNEL__ */
132 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:include
/linux
/hdsmart
.h
134 #endif /* _LINUX_HDSMART_H */