-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathata.inc
More file actions
183 lines (170 loc) · 4.97 KB
/
ata.inc
File metadata and controls
183 lines (170 loc) · 4.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
;
; Disable HDD APM tray version. Stops your drive from clicking (excessive drive head parking)
;
; Copyright (C) 2012 Gilyazov Rustam
;
; This program is free software: you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
; the Free Software Foundation, either version 3 of the License, or
; (at your option) any later version.
;
; This program is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
; GNU General Public License for more details.
; You should have received a copy of the GNU General Public License
; along with this program. If not, see <http://www.gnu.org/licenses/>.
BROADCAST_QUERY_DENY = $424D5144
PBT_APMQUERYSUSPEND = $00
WM_POWERBROADCAST = $218
PBT_APMBATTERYLOW = $09
PBT_APMPOWERSTATUSCHANGE = $0A
PBT_APMOEMEVENT = $0B
PBT_APMQUERYSUSPEND = $00
PBT_APMQUERYSUSPENDFAILED = $02
PBT_APMRESUMECRITICAL = $06
PBT_APMRESUMEAUTOMATIC = $12
PBT_APMQUERYSUSPENDFAILED = $02
SMART_GET_VERSION = $74080
SMART_SEND_DRIVE_COMMAND = $7C084
SMART_RCV_DRIVE_DATA = $7C088
struct IDENTIFY_DEVICE_DATA
GeneralConfiguration dw ?
NumCylinders dw ?
ReservedWord2 dw ?
NumHeads dw ?
Retired1 dw 2 dup (?)
NumSectorsPerTrack dw ?
VendorUnique1 dw 3 dup (?)
SerialNumber db 20 dup (?)
Retired2 dw 2 dup (?)
Obsolete1 dw ?
FirmwareRevision db 8 dup (?)
ModelNumber db 40 dup (?)
MaximumBlockTransfer db ?
VendorUnique2 db ?
ReservedWord48 dw ?
Capabilities dd ?
ObsoleteWords51 dw 2 dup (?)
TranslationFieldsValid dw ?
NumberOfCurrentCylinders dw ?
NumberOfCurrentHeads dw ?
CurrentSectorsPerTrack dw ?
CurrentSectorCapacity dd ?
CurrentMultiSectorSetting db ?
MultiSectorSettingValid db ?
UserAddressableSectors dd ?
ObsoleteWord62 dw ?
MultiWordDMASupport db ?
MultiWordDMAActive db ?
AdvancedPIOModes db ?
ReservedByte64 db ?
MinimumMWXferCycleTime dw ?
RecommendedMWXferCycleTime dw ?
MinimumPIOCycleTime dw ?
MinimumPIOCycleTimeIORDY dw ?
ReservedWords69 dw 6 dup (?)
QueueDepth dw ?
ReservedWords76 dw 4 dup (?)
MajorRevision dw ?
MinorRevision dw ?
CommandSetSupport dw 3 dup (?)
CommandSetActive dw 3 dup (?)
UltraDMASupport db ?
UltraDMAActive db ?
ReservedWord89 dw 4 dup (?)
HardwareResetResult dw ?
CurrentAcousticValue db ?
RecommendedAcousticValue db ?
ReservedWord95 dw 5 dup (?)
Max48BitLBA dd 2 dup (?)
StreamingTransferTime dw ?
ReservedWord105 dw ?
PhysicalLogicalSectorSize dw ?
InterSeekDelay dw ?
WorldWideName dw 4 dup (?)
ReservedForWorldWideName128 dw 4 dup (?)
ReservedForTlcTechnicalReport dw ?
WordsPerLogicalSector dw 2 dup (?)
CommandSetSupportExt dw ?
CommandSetActiveExt dw ?
ReservedForExpandedSupportandActive dw 6 dup (?)
MsnSupport dw ?
SecurityStatus dw ?
ReservedWord129 dw 31 dup (?)
CfaPowerModel dw ?
ReservedForCfaWord161 dw 8 dup (?)
DataSetManagementFeature dw ?
ReservedForCfaWord170 dw 6 dup (?)
CurrentMediaSerialNumber dw 30 dup (?)
ReservedWord206 dw ?
ReservedWord207 dw 2 dup (?)
BlockAlignment dw ?
WriteReadVerifySectorCountMode3Only dw 2 dup (?)
WriteReadVerifySectorCountMode2Only dw 2 dup (?)
NVCacheCapabilities dw ?
NVCacheSizeLSW dw ?
NVCacheSizeMSW dw ?
NominalMediaRotationRate dw ?
ReservedWord218 dw ?
NVCacheEstimatedTimeToSpinUpInSeconds dw ?
Reserved dw ?
ReservedWord220 dw 35 dup (?)
Signature db ?
CheckSum db ?
ends
IOCTL_IDE_PASS_THROUGH = $04D028
IOCTL_ATA_PASS_THROUGH = $04D02C
HDIO_DRIVE_CMD = $03F1 ; Taken from /usr/include/linux/hdreg.h
HDIO_SET_ACOUSTIC = $032C
HDIO_GET_ACOUSTIC = $030F
WIN_SETFEATURES = $EF
SETFEATURES_EN_AAM = $42
SETFEATURES_DIS_AAM = $C2
SETFEATURES_EN_APM = $05
SETFEATURES_DIS_APM = $85
ATA_FLAGS_DRDY_REQUIRED = $01
ATA_FLAGS_DATA_IN = $02
ATA_FLAGS_DATA_OUT = $04
ATA_FLAGS_48BIT_COMMAND = $08
DRIVE_HEAD_REG = 0xA0
ERROR_ALREADY_EXISTS = 0xB7
struct ATA_PASS_THROUGH_EX
Length dw ?
AtaFlags dw ?
PathId db ?
TargetId db ?
Lun db ?
ReservedAsUchar db ?
DataTransferLength dd ?
TimeOutValue dd ?
ReservedAsUlong dd ?
DataBufferOffset dd ?
PreviousTaskFile IDEREGS
CurrentTaskFile IDEREGS
ends
struct ATA_PASS_THROUGH_EX_WITH_BUFFERS
Length dw ?
AtaFlags dw ?
PathId db ?
TargetId db ?
Lun db ?
ReservedAsUchar db ?
DataTransferLength dd ?
TimeOutValue dd ?
ReservedAsUlong dd ?
DataBufferOffset dd ?
PreviousTaskFile IDEREGS
CurrentTaskFile IDEREGS
Filler db ?
ucDataBuf db 512 dup (?)
ends
struct SMARTINFO
Unknown0 db ?
AttribIndex db ?
Unknown1 dw ?
Value db ?
Worst db ?
Data dd ?
Threshold dw ?
ends