/
ata.h
executable file
·1956 lines (1574 loc) · 77.3 KB
/
ata.h
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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*++
Copyright (c) Microsoft Corporation. All rights reserved.
Module Name:
ata.h
Abstract:
Defines the structures used by ATA port and the miniport drivers.
Authors:
Revision History:
--*/
#ifndef _NTATA_
#define _NTATA_
#if _MSC_VER >= 1200
#pragma warning(push)
#endif
#pragma warning(disable:4200) // zero-sized array in struct/union
#pragma warning(disable:4214) // bit field types other than int
#pragma warning(disable:4201) // nameless struct/union
//
// 11/7/2011: update to ACS3 - D2161r1b; and SATA 3.1 Gold version.
//
//
// IDENTIFY device data (response to 0xEC)
//
#pragma pack(push, id_device_data, 1)
typedef struct _IDENTIFY_DEVICE_DATA {
struct {
USHORT Reserved1 : 1;
USHORT Retired3 : 1;
USHORT ResponseIncomplete : 1;
USHORT Retired2 : 3;
USHORT FixedDevice : 1; // obsolete
USHORT RemovableMedia : 1; // obsolete
USHORT Retired1 : 7;
USHORT DeviceType : 1;
} GeneralConfiguration; // word 0
USHORT NumCylinders; // word 1, obsolete
USHORT SpecificConfiguration; // word 2
USHORT NumHeads; // word 3, obsolete
USHORT Retired1[2];
USHORT NumSectorsPerTrack; // word 6, obsolete
USHORT VendorUnique1[3];
UCHAR SerialNumber[20]; // word 10-19
USHORT Retired2[2];
USHORT Obsolete1;
UCHAR FirmwareRevision[8]; // word 23-26
UCHAR ModelNumber[40]; // word 27-46
UCHAR MaximumBlockTransfer; // word 47. 01h-10h = Maximum number of sectors that shall be transferred per interrupt on READ/WRITE MULTIPLE commands
UCHAR VendorUnique2;
struct {
USHORT FeatureSupported : 1;
USHORT Reserved : 15;
}TrustedComputing; // word 48
struct {
UCHAR CurrentLongPhysicalSectorAlignment : 2;
UCHAR ReservedByte49 : 6;
UCHAR DmaSupported : 1;
UCHAR LbaSupported : 1; // Shall be set to one to indicate that LBA is supported.
UCHAR IordyDisable : 1;
UCHAR IordySupported : 1;
UCHAR Reserved1 : 1; // Reserved for the IDENTIFY PACKET DEVICE command
UCHAR StandybyTimerSupport : 1;
UCHAR Reserved2 : 2; // Reserved for the IDENTIFY PACKET DEVICE command
USHORT ReservedWord50;
}Capabilities; // word 49-50
USHORT ObsoleteWords51[2];
USHORT TranslationFieldsValid : 3; // word 53, bit 0 - Obsolete; bit 1 - words 70:64 valid; bit 2; word 88 valid
USHORT Reserved3 : 5;
USHORT FreeFallControlSensitivity : 8;
USHORT NumberOfCurrentCylinders; // word 54, obsolete
USHORT NumberOfCurrentHeads; // word 55, obsolete
USHORT CurrentSectorsPerTrack; // word 56, obsolete
ULONG CurrentSectorCapacity; // word 57, word 58, obsolete
UCHAR CurrentMultiSectorSetting; // word 59
UCHAR MultiSectorSettingValid : 1;
UCHAR ReservedByte59 : 3;
UCHAR SanitizeFeatureSupported : 1;
UCHAR CryptoScrambleExtCommandSupported : 1;
UCHAR OverwriteExtCommandSupported : 1;
UCHAR BlockEraseExtCommandSupported : 1;
ULONG UserAddressableSectors; // word 60-61, for 28-bit commands
USHORT ObsoleteWord62;
USHORT MultiWordDMASupport : 8; // word 63
USHORT MultiWordDMAActive : 8;
USHORT AdvancedPIOModes : 8; // word 64. bit 0:1 - PIO mode supported
USHORT ReservedByte64 : 8;
USHORT MinimumMWXferCycleTime; // word 65
USHORT RecommendedMWXferCycleTime; // word 66
USHORT MinimumPIOCycleTime; // word 67
USHORT MinimumPIOCycleTimeIORDY; // word 68
struct {
USHORT Reserved : 2;
USHORT NonVolatileWriteCache : 1; // All write cache is non-volatile
USHORT ExtendedUserAddressableSectorsSupported : 1;
USHORT DeviceEncryptsAllUserData : 1;
USHORT ReadZeroAfterTrimSupported : 1;
USHORT Optional28BitCommandsSupported : 1;
USHORT IEEE1667 : 1; // Reserved for IEEE 1667
USHORT DownloadMicrocodeDmaSupported : 1;
USHORT SetMaxSetPasswordUnlockDmaSupported : 1;
USHORT WriteBufferDmaSupported : 1;
USHORT ReadBufferDmaSupported : 1;
USHORT DeviceConfigIdentifySetDmaSupported : 1; // obsolete
USHORT LPSAERCSupported : 1; // Long Physical Sector Alignment Error Reporting Control is supported.
USHORT DeterministicReadAfterTrimSupported : 1;
USHORT CFastSpecSupported : 1;
}AdditionalSupported; // word 69
USHORT ReservedWords70[5]; // word 70 - reserved
// word 71:74 - Reserved for the IDENTIFY PACKET DEVICE command
//Word 75
USHORT QueueDepth : 5; // Maximum queue depth - 1
USHORT ReservedWord75 : 11;
struct {
// Word 76
USHORT Reserved0 : 1; // shall be set to 0
USHORT SataGen1 : 1; // Supports SATA Gen1 Signaling Speed (1.5Gb/s)
USHORT SataGen2 : 1; // Supports SATA Gen2 Signaling Speed (3.0Gb/s)
USHORT SataGen3 : 1; // Supports SATA Gen3 Signaling Speed (6.0Gb/s)
USHORT Reserved1 : 4;
USHORT NCQ : 1; // Supports the NCQ feature set
USHORT HIPM : 1; // Supports HIPM
USHORT PhyEvents : 1; // Supports the SATA Phy Event Counters log
USHORT NcqUnload : 1; // Supports Unload while NCQ commands are outstanding
USHORT NcqPriority : 1; // Supports NCQ priority information
USHORT HostAutoPS : 1; // Supports Host Automatic Partial to Slumber transitions
USHORT DeviceAutoPS : 1; // Supports Device Automatic Partial to Slumber transitions
USHORT ReadLogDMA : 1; // Supports READ LOG DMA EXT as equivalent to READ LOG EXT
// Word 77
USHORT Reserved2 : 1; // shall be set to 0
USHORT CurrentSpeed : 3; // Coded value indicating current negotiated Serial ATA signal speed
USHORT NcqStreaming : 1; // Supports NCQ Streaming
USHORT NcqQueueMgmt : 1; // Supports NCQ Queue Management Command
USHORT NcqReceiveSend : 1; // Supports RECEIVE FPDMA QUEUED and SEND FPDMA QUEUED commands
USHORT DEVSLPtoReducedPwrState : 1;
USHORT Reserved3 : 8;
}SerialAtaCapabilities;
// Word 78
struct {
USHORT Reserved0 : 1; //shall be set to 0
USHORT NonZeroOffsets:1; // Device supports non-zero buffer offsets in DMA Setup FIS
USHORT DmaSetupAutoActivate:1; // Device supports DMA Setup auto-activation
USHORT DIPM : 1; // Device supports DIPM
USHORT InOrderData : 1; // Device supports in-order data delivery
USHORT HardwareFeatureControl:1; // Hardware Feature Control is supported
USHORT SoftwareSettingsPreservation:1; // Device supports Software Settings Preservation
USHORT NCQAutosense:1; // Supports NCQ Autosense
USHORT DEVSLP :1; // Device supports link power state - device sleep
USHORT HybridInformation :1; // Device supports Hybrid Information Feature (If the device does not support NCQ (word 76 bit 8 is 0), then this bit shall be cleared to 0.)
USHORT Reserved1 : 6;
}SerialAtaFeaturesSupported;
// Word 79
struct {
USHORT Reserved0 : 1; // shall be set to 0
USHORT NonZeroOffsets:1; // Non-zero buffer offsets in DMA Setup FIS enabled
USHORT DmaSetupAutoActivate:1; // DMA Setup auto-activation optimization enabled
USHORT DIPM : 1; // DIPM enabled
USHORT InOrderData : 1; // In-order data delivery enabled
USHORT HardwareFeatureControl:1; // Hardware Feature Control is enabled
USHORT SoftwareSettingsPreservation:1; // Software Settings Preservation enabled
USHORT DeviceAutoPS : 1; // Device Automatic Partial to Slumber transitions enabled
USHORT DEVSLP :1; // link power state - device sleep is enabled
USHORT HybridInformation :1; // Hybrid Information Feature is enabled
USHORT Reserved1 : 6;
}SerialAtaFeaturesEnabled;
USHORT MajorRevision; // word 80. bit 5 - supports ATA5; bit 6 - supports ATA6; bit 7 - supports ATA7; bit 8 - supports ATA8-ACS; bit 9 - supports ACS-2;
USHORT MinorRevision; // word 81. T13 minior version number
struct {
//
// Word 82
//
USHORT SmartCommands : 1; // The SMART feature set is supported
USHORT SecurityMode : 1; // The Security feature set is supported
USHORT RemovableMediaFeature : 1; // obsolete
USHORT PowerManagement : 1; // shall be set to 1
USHORT Reserved1 : 1; // PACKET feature set, set to 0 indicates not supported for ATA devices (only support for ATAPI devices)
USHORT WriteCache : 1; // The volatile write cache is supported
USHORT LookAhead : 1; // Read look-ahead is supported
USHORT ReleaseInterrupt : 1; // obsolete
USHORT ServiceInterrupt : 1; // obsolete
USHORT DeviceReset : 1; // Shall be cleared to zero to indicate that the DEVICE RESET command is not supported
USHORT HostProtectedArea : 1; // obsolete
USHORT Obsolete1 : 1;
USHORT WriteBuffer : 1; // The WRITE BUFFER command is supported
USHORT ReadBuffer : 1; // The READ BUFFER command is supported
USHORT Nop : 1; // The NOP command is supported
USHORT Obsolete2 : 1;
//
// Word 83
//
USHORT DownloadMicrocode : 1; // The DOWNLOAD MICROCODE command is supported
USHORT DmaQueued : 1; // obsolete
USHORT Cfa : 1; // The CFA feature set is supported
USHORT AdvancedPm : 1; // The APM feature set is supported
USHORT Msn : 1; // obsolete
USHORT PowerUpInStandby : 1; // The PUIS feature set is supported
USHORT ManualPowerUp : 1; // SET FEATURES subcommand is required to spin-up after power-up
USHORT Reserved2 : 1;
USHORT SetMax : 1; // obsolete
USHORT Acoustics : 1; // obsolete
USHORT BigLba : 1; // The 48-bit Address feature set is supported
USHORT DeviceConfigOverlay : 1; // obsolete
USHORT FlushCache : 1; // Shall be set to one to indicate that the mandatory FLUSH CACHE command is supported
USHORT FlushCacheExt : 1; // The FLUSH CACHE EXT command is supported
USHORT WordValid83 : 2; // shall be 01b
//
// Word 84
//
USHORT SmartErrorLog : 1; // SMART error logging is supported
USHORT SmartSelfTest : 1; // The SMART self-test is supported
USHORT MediaSerialNumber : 1; // Media serial number is supported
USHORT MediaCardPassThrough : 1; // obsolete
USHORT StreamingFeature : 1; // The Streaming feature set is supported
USHORT GpLogging : 1; // The GPL feature set is supported
USHORT WriteFua : 1; // The WRITE DMA FUA EXT and WRITE MULTIPLE FUA EXT commands are supported
USHORT WriteQueuedFua : 1; // obsolete
USHORT WWN64Bit : 1; // The 64-bit World wide name is supported
USHORT URGReadStream : 1; // obsolete
USHORT URGWriteStream : 1; // obsolete
USHORT ReservedForTechReport : 2;
USHORT IdleWithUnloadFeature : 1; // The IDLE IMMEDIATE command with UNLOAD feature is supported
USHORT WordValid : 2; // shall be 01b
}CommandSetSupport;
struct {
//
// Word 85
//
USHORT SmartCommands : 1; // The SMART feature set is enabled
USHORT SecurityMode : 1; // The Security feature set is enabled
USHORT RemovableMediaFeature : 1; // obsolete
USHORT PowerManagement : 1; // Shall be set to one to indicate that the mandatory Power Management feature set is supported
USHORT Reserved1 : 1; // Shall be cleared to zero to indicate that the PACKET feature set is not supported
USHORT WriteCache : 1; // The volatile write cache is enabled
USHORT LookAhead : 1; // Read look-ahead is enabled
USHORT ReleaseInterrupt : 1; // The release interrupt is enabled
USHORT ServiceInterrupt : 1; // The SERVICE interrupt is enabled
USHORT DeviceReset : 1; // Shall be cleared to zero to indicate that the DEVICE RESET command is not supported
USHORT HostProtectedArea : 1; // obsolete
USHORT Obsolete1 : 1;
USHORT WriteBuffer : 1; // The WRITE BUFFER command is supported
USHORT ReadBuffer : 1; // The READ BUFFER command is supported
USHORT Nop : 1; // The NOP command is supported
USHORT Obsolete2 : 1;
//
// Word 86
//
USHORT DownloadMicrocode : 1; // The DOWNLOAD MICROCODE command is supported
USHORT DmaQueued : 1; // obsolete
USHORT Cfa : 1; // The CFA feature set is supported
USHORT AdvancedPm : 1; // The APM feature set is enabled
USHORT Msn : 1; // obsolete
USHORT PowerUpInStandby : 1; // The PUIS feature set is enabled
USHORT ManualPowerUp : 1; // SET FEATURES subcommand is required to spin-up after power-up
USHORT Reserved2 : 1;
USHORT SetMax : 1; // obsolete
USHORT Acoustics : 1; // obsolete
USHORT BigLba : 1; // The 48-bit Address features set is supported
USHORT DeviceConfigOverlay : 1; // obsolete
USHORT FlushCache : 1; // FLUSH CACHE command supported
USHORT FlushCacheExt : 1; // FLUSH CACHE EXT command supported
USHORT Resrved3 : 1;
USHORT Words119_120Valid : 1; // Words 119..120 are valid
//
// Word 87
//
USHORT SmartErrorLog : 1; // SMART error logging is supported
USHORT SmartSelfTest : 1; // SMART self-test supported
USHORT MediaSerialNumber : 1; // Media serial number is valid
USHORT MediaCardPassThrough : 1; // obsolete
USHORT StreamingFeature : 1; // obsolete
USHORT GpLogging : 1; // The GPL feature set is supported
USHORT WriteFua : 1; // The WRITE DMA FUA EXT and WRITE MULTIPLE FUA EXT commands are supported
USHORT WriteQueuedFua : 1; // obsolete
USHORT WWN64Bit : 1; // The 64-bit World wide name is supported
USHORT URGReadStream : 1; // obsolete
USHORT URGWriteStream : 1; // obsolete
USHORT ReservedForTechReport : 2;
USHORT IdleWithUnloadFeature : 1; // The IDLE IMMEDIATE command with UNLOAD FEATURE is supported
USHORT Reserved4 : 2; // bit 14 shall be set to 1; bit 15 shall be cleared to 0
}CommandSetActive;
USHORT UltraDMASupport : 8; // word 88. bit 0 - UDMA mode 0 is supported ... bit 6 - UDMA mode 6 and below are supported
USHORT UltraDMAActive : 8; // word 88. bit 8 - UDMA mode 0 is selected ... bit 14 - UDMA mode 6 is selected
struct { // word 89
USHORT TimeRequired : 15;
USHORT ExtendedTimeReported : 1;
} NormalSecurityEraseUnit;
struct { // word 90
USHORT TimeRequired : 15;
USHORT ExtendedTimeReported : 1;
} EnhancedSecurityEraseUnit;
USHORT CurrentAPMLevel : 8; // word 91
USHORT ReservedWord91 : 8;
USHORT MasterPasswordID; // word 92. Master Password Identifier
USHORT HardwareResetResult; // word 93
USHORT CurrentAcousticValue : 8; // word 94. obsolete
USHORT RecommendedAcousticValue : 8;
USHORT StreamMinRequestSize; // word 95
USHORT StreamingTransferTimeDMA; // word 96
USHORT StreamingAccessLatencyDMAPIO; // word 97
ULONG StreamingPerfGranularity; // word 98, 99
ULONG Max48BitLBA[2]; // word 100-103
USHORT StreamingTransferTime; // word 104. Streaming Transfer Time - PIO
USHORT DsmCap; // word 105
struct {
USHORT LogicalSectorsPerPhysicalSector : 4; // n power of 2: logical sectors per physical sector
USHORT Reserved0 : 8;
USHORT LogicalSectorLongerThan256Words : 1;
USHORT MultipleLogicalSectorsPerPhysicalSector : 1;
USHORT Reserved1 : 2; // bit 14 - shall be set to 1; bit 15 - shall be clear to 0
} PhysicalLogicalSectorSize; // word 106
USHORT InterSeekDelay; //word 107. Inter-seek delay for ISO 7779 standard acoustic testing
USHORT WorldWideName[4]; //words 108-111
USHORT ReservedForWorldWideName128[4]; //words 112-115
USHORT ReservedForTlcTechnicalReport; //word 116
USHORT WordsPerLogicalSector[2]; //words 117-118 Logical sector size (DWord)
struct {
USHORT ReservedForDrqTechnicalReport : 1;
USHORT WriteReadVerify : 1; // The Write-Read-Verify feature set is supported
USHORT WriteUncorrectableExt : 1; // The WRITE UNCORRECTABLE EXT command is supported
USHORT ReadWriteLogDmaExt : 1; // The READ LOG DMA EXT and WRITE LOG DMA EXT commands are supported
USHORT DownloadMicrocodeMode3 : 1; // Download Microcode mode 3 is supported
USHORT FreefallControl : 1; // The Free-fall Control feature set is supported
USHORT SenseDataReporting : 1; // Sense Data Reporting feature set is supported
USHORT ExtendedPowerConditions : 1; // Extended Power Conditions feature set is supported
USHORT Reserved0 : 6;
USHORT WordValid : 2; // shall be 01b
}CommandSetSupportExt; //word 119
struct {
USHORT ReservedForDrqTechnicalReport : 1;
USHORT WriteReadVerify : 1; // The Write-Read-Verify feature set is enabled
USHORT WriteUncorrectableExt : 1; // The WRITE UNCORRECTABLE EXT command is supported
USHORT ReadWriteLogDmaExt : 1; // The READ LOG DMA EXT and WRITE LOG DMA EXT commands are supported
USHORT DownloadMicrocodeMode3 : 1; // Download Microcode mode 3 is supported
USHORT FreefallControl : 1; // The Free-fall Control feature set is enabled
USHORT SenseDataReporting : 1; // Sense Data Reporting feature set is enabled
USHORT ExtendedPowerConditions : 1; // Extended Power Conditions feature set is enabled
USHORT Reserved0 : 6;
USHORT Reserved1 : 2; // bit 14 - shall be set to 1; bit 15 - shall be clear to 0
}CommandSetActiveExt; //word 120
USHORT ReservedForExpandedSupportandActive[6];
USHORT MsnSupport : 2; //word 127. obsolete
USHORT ReservedWord127 : 14;
struct { //word 128
USHORT SecuritySupported : 1;
USHORT SecurityEnabled : 1;
USHORT SecurityLocked : 1;
USHORT SecurityFrozen : 1;
USHORT SecurityCountExpired : 1;
USHORT EnhancedSecurityEraseSupported : 1;
USHORT Reserved0 : 2;
USHORT SecurityLevel : 1; // Master Password Capability: 0 = High, 1 = Maximum
USHORT Reserved1 : 7;
} SecurityStatus;
USHORT ReservedWord129[31]; //word 129...159. Vendor specific
struct { //word 160
USHORT MaximumCurrentInMA : 12;
USHORT CfaPowerMode1Disabled : 1;
USHORT CfaPowerMode1Required : 1;
USHORT Reserved0 : 1;
USHORT Word160Supported : 1;
} CfaPowerMode1;
USHORT ReservedForCfaWord161[7]; //Words 161-167
USHORT NominalFormFactor : 4; //Word 168
USHORT ReservedWord168 : 12;
struct { //Word 169
USHORT SupportsTrim : 1;
USHORT Reserved0 : 15;
} DataSetManagementFeature;
USHORT AdditionalProductID[4]; //Words 170-173
USHORT ReservedForCfaWord174[2]; //Words 174-175
USHORT CurrentMediaSerialNumber[30]; //Words 176-205
struct { //Word 206
USHORT Supported : 1; // The SCT Command Transport is supported
USHORT Reserved0 : 1; // obsolete
USHORT WriteSameSuported : 1; // The SCT Write Same command is supported
USHORT ErrorRecoveryControlSupported : 1; // The SCT Error Recovery Control command is supported
USHORT FeatureControlSuported : 1; // The SCT Feature Control command is supported
USHORT DataTablesSuported : 1; // The SCT Data Tables command is supported
USHORT Reserved1 : 6;
USHORT VendorSpecific : 4;
} SCTCommandTransport;
USHORT ReservedWord207[2]; //Words 207-208
struct { //Word 209
USHORT AlignmentOfLogicalWithinPhysical: 14;
USHORT Word209Supported: 1; // shall be set to 1
USHORT Reserved0: 1; // shall be cleared to 0
} BlockAlignment;
USHORT WriteReadVerifySectorCountMode3Only[2]; //Words 210-211
USHORT WriteReadVerifySectorCountMode2Only[2]; //Words 212-213
struct {
USHORT NVCachePowerModeEnabled: 1;
USHORT Reserved0: 3;
USHORT NVCacheFeatureSetEnabled: 1;
USHORT Reserved1: 3;
USHORT NVCachePowerModeVersion: 4;
USHORT NVCacheFeatureSetVersion: 4;
} NVCacheCapabilities; //Word 214. obsolete
USHORT NVCacheSizeLSW; //Word 215. obsolete
USHORT NVCacheSizeMSW; //Word 216. obsolete
USHORT NominalMediaRotationRate; //Word 217; value 0001h means non-rotating media.
USHORT ReservedWord218; //Word 218
struct {
UCHAR NVCacheEstimatedTimeToSpinUpInSeconds;
UCHAR Reserved;
} NVCacheOptions; //Word 219. obsolete
USHORT WriteReadVerifySectorCountMode : 8; //Word 220. Write-Read-Verify feature set current mode
USHORT ReservedWord220 : 8;
USHORT ReservedWord221; //Word 221
struct { //Word 222 Transport major version number
USHORT MajorVersion : 12; // 0000h or FFFFh = device does not report version
USHORT TransportType : 4;
} TransportMajorVersion;
USHORT TransportMinorVersion; // Word 223
USHORT ReservedWord224[6]; // Word 224...229
ULONG ExtendedNumberOfUserAddressableSectors[2]; // Words 230...233 Extended Number of User Addressable Sectors
USHORT MinBlocksPerDownloadMicrocodeMode03; // Word 234 Minimum number of 512-byte data blocks per Download Microcode mode 03h operation
USHORT MaxBlocksPerDownloadMicrocodeMode03; // Word 235 Maximum number of 512-byte data blocks per Download Microcode mode 03h operation
USHORT ReservedWord236[19]; // Word 236...254
USHORT Signature : 8; //Word 255
USHORT CheckSum : 8;
} IDENTIFY_DEVICE_DATA, *PIDENTIFY_DEVICE_DATA;
#pragma pack (pop, id_device_data)
//
// identify packet data (response to 0xA1)
//
#pragma pack (push, id_packet_data, 1)
typedef struct _IDENTIFY_PACKET_DATA {
struct {
USHORT PacketType : 2; // 00b = 12 byte command packet; 01b = 16 byte command packet
USHORT IncompleteResponse : 1; // Incomplete response
USHORT Reserved1 : 2;
USHORT DrqDelay : 2; // 00b = Device shall set DRQ to one within 3 ms of receiving PACKET command. 10b = Device shall set DRQ to one within 50 us of receiving PACKET command.
USHORT RemovableMedia : 1; // obsolete
USHORT CommandPacketType : 5; // This value follows the peripheral device type as defined in SPC-4 (e.g., 05h indicates a CD/DVD device).
USHORT Reserved2 : 1;
USHORT DeviceType : 2; // 10b = ATAPI device
}GeneralConfiguration;
USHORT ResevedWord1; // word 1
USHORT UniqueConfiguration; // word 2
USHORT ReservedWords3[7]; // word 3...9
UCHAR SerialNumber[20]; // word 10...19
USHORT ReservedWords20[3]; // word 20...22
UCHAR FirmwareRevision[8]; // word 23...26
UCHAR ModelNumber[40]; // word 27...46
USHORT ReservedWords47[2]; // word 47...48
struct { // word 49...50
USHORT VendorSpecific : 8;
USHORT DmaSupported : 1;
USHORT LbaSupported : 1; // shall be set to 1
USHORT IordyDisabled : 1;
USHORT IordySupported : 1;
USHORT Obsolete : 1;
USHORT OverlapSupported : 1; // obsolete
USHORT QueuedCommandsSupported : 1; // obsolete
USHORT InterleavedDmaSupported : 1; // obsolete
USHORT DeviceSpecificStandbyTimerValueMin : 1; // Shall be set to one to indicate a device specific Standby timer value minimum.
USHORT Obsolete1 : 1;
USHORT ReservedWord50 : 12;
USHORT WordValid : 2; // value shall be 01b
} Capabilities;
USHORT ObsoleteWords51[2];
USHORT TranslationFieldsValid:3; // word 53. bit 0 - obsolete; bit 1 - words 64..70 are valid; bit 2 - word 88 is valid
USHORT Reserved3:13;
USHORT ReservedWords54[8]; // word 54...61
struct { // word 62
USHORT UDMA0Supported : 1;
USHORT UDMA1Supported : 1;
USHORT UDMA2Supported : 1;
USHORT UDMA3Supported : 1;
USHORT UDMA4Supported : 1;
USHORT UDMA5Supported : 1;
USHORT UDMA6Supported : 1;
USHORT MDMA0Supported : 1;
USHORT MDMA1Supported : 1;
USHORT MDMA2Supported : 1;
USHORT DMASupported : 1;
USHORT ReservedWord62 : 4;
USHORT DMADIRBitRequired : 1; // DMADIR bit in the PACKET command is required for DMA transfers
} DMADIR;
USHORT MultiWordDMASupport : 8; // word 63
USHORT MultiWordDMAActive : 8;
USHORT AdvancedPIOModes : 8; // word 64
USHORT ReservedByte64 : 8;
USHORT MinimumMWXferCycleTime; // word 65. Minimum Multiword DMA transfer cycle time per word. Cycle time in nanoseconds
USHORT RecommendedMWXferCycleTime; // word 66. Manufacturer recommended Multiword DMA transfer cycle time. Cycle time in nanoseconds
USHORT MinimumPIOCycleTime; // word 67. Minimum PIO transfer cycle time without flow control. Cycle time in nanoseconds
USHORT MinimumPIOCycleTimeIORDY; // word 68. Minimum PIO transfer cycle time with IORDY. Cycle time in nanoseconds
USHORT ReservedWords69[2]; // word 69...70
USHORT BusReleaseDelay; // word 71. obsolete
USHORT ServiceCommandDelay; // word 72. obsolete
USHORT ReservedWords73[2]; // word 73...74
//Word 75. obsolete
USHORT QueueDepth : 5;
USHORT ReservedWord75 : 11;
struct {
// Word 76
USHORT Reserved0 : 1; //shall be set to 0
USHORT SataGen1 : 1; // The SATA Gen1 Signaling Speed (1.5Gb/s) is supported
USHORT SataGen2 : 1; // The SATA Gen2 Signaling Speed (3.0Gb/s) is supported
USHORT SataGen3 : 1; // The SATA Gen3 Signaling Speed (6.0Gb/s) is supported
USHORT Reserved1 : 5;
USHORT HIPM : 1; // Support HIPM
USHORT PhyEvents : 1; // The SATA Phy Event Counters log is supported
USHORT Reserved3 : 2;
USHORT HostAutoPS : 1; // Supports Host Automatic Partial to Slumber transitions
USHORT DeviceAutoPS : 1; // Supports Device Automatic Partial to Slumber transitions
USHORT Reserved4 : 1;
// Word 77
USHORT Reserved5 : 1; //shall be set to 0
USHORT CurrentSpeed : 3; // Coded value indicating current negotiated Serial ATA signal speed
USHORT SlimlineDeviceAttention:1; // Supports Device Attention on slimline connected device
USHORT HostEnvironmentDetect:1; // Supports host environment detect
USHORT Reserved : 10;
}SerialAtaCapabilities;
// Word 78
struct {
USHORT Reserved0 : 1; //shall be set to 0
USHORT Reserved1 : 2;
USHORT DIPM : 1; // Device initiated power management is supported
USHORT Reserved2 : 1;
USHORT AsynchronousNotification:1; // Asynchronous notification supported
USHORT SoftwareSettingsPreservation:1; // The SSP feature set is supported
USHORT Reserved3 : 9;
}SerialAtaFeaturesSupported;
// Word 79
struct {
USHORT Reserved0 : 1; // shall be set to 0
USHORT Reserved1 : 2;
USHORT DIPM : 1; // Device initiated power management is enabled
USHORT Reserved2 : 1;
USHORT AsynchronousNotification:1; // Asynchronous notification enabled
USHORT SoftwareSettingsPreservation:1; // The SSP feature set is enabled
USHORT DeviceAutoPS : 1; // Device Automatic Partial to Slumber transitions enabled
USHORT Reserved3 : 8;
}SerialAtaFeaturesEnabled;
USHORT MajorRevision; // word 80. 0000h or FFFFh = device does not report version; bit 0...4 obsolete; bit 5 - ATA5 is supported; bit 6 - ATA6 is supported; bit 7 - ATA7 is supported; bit 8 - ATA8-ACS is supported;
USHORT MinorRevision; // word 81
struct { // word 82...83
USHORT SmartCommands : 1; // Shall be cleared to zero to indicate that the SMART feature set is not supported
USHORT SecurityMode : 1; // The Security feature set is supported
USHORT RemovableMedia : 1; // obsolete
USHORT PowerManagement : 1; // The Power Management feature set supported
USHORT PacketCommands : 1; // Shall be set to one indicating the PACKET feature set is supported.
USHORT WriteCache : 1; // The volatile write cache is supported
USHORT LookAhead : 1; // Read look-ahead supported
USHORT ReleaseInterrupt : 1; // obsolete
USHORT ServiceInterrupt : 1; // obsolete
USHORT DeviceReset : 1; // Shall be set to one to indicate that the DEVICE RESET command is supported
USHORT HostProtectedArea : 1; // obsolete
USHORT Obsolete1 : 1;
USHORT WriteBuffer : 1; // Shall be cleared to zero to indicate that the WRITE BUFFER command is not supported
USHORT ReadBuffer : 1; // Shall be cleared to zero to indicate that the READ BUFFER command is not supported
USHORT Nop : 1; // Shall be set to one to indicate that the NOP command is supported
USHORT Obsolete2 : 1;
USHORT DownloadMicrocode : 1; // Shall be cleared to zero to indicate that the DOWNLOAD MICROCODE command is not supported
USHORT Reserved1 : 2;
USHORT AdvancedPm : 1; // The APM feature set is supported
USHORT Msn : 1; // obsolete
USHORT PowerUpInStandby : 1; // The PUIS feature set is supported
USHORT ManualPowerUp : 1; // The SET FEATURES subcommand is required to spin-up after power-up
USHORT Reserved2 : 1;
USHORT SetMax : 1; // obsolete
USHORT Reserved3 : 3;
USHORT FlushCache : 1; // The FLUSH CACHE command is supported
USHORT Reserved4 : 1;
USHORT WordValid : 2; // shall be 01b
} CommandSetSupport;
struct { // word 84
USHORT Reserved0 : 5;
USHORT GpLogging : 1; // The GPL feature set is supported
USHORT Reserved1 : 2;
USHORT WWN64Bit : 1; // shall be set to one to indicate that the mandator WWN is supported
USHORT Reserved2 : 5;
USHORT WordValid : 2; // shall be 01b
}CommandSetSupportExt;
struct { // word 85...86
USHORT SmartCommands : 1; // Shall be cleared to zero to indicate that the SMART feature set is not supported
USHORT SecurityMode : 1; // The Security feature set is enabled
USHORT RemovableMedia : 1; // obsolete
USHORT PowerManagement : 1; // Power Management feature set is enabled
USHORT PacketCommands : 1; // Shall be set to one indicating the PACKET feature set is supported.
USHORT WriteCache : 1; // The volatile write cache is enabled
USHORT LookAhead : 1; // Read look-ahead is enabled
USHORT ReleaseInterrupt : 1; // obsolete
USHORT ServiceInterrupt : 1; // obsolete
USHORT DeviceReset : 1; // Shall be set to one to indicate that the DEVICE RESET command is supported
USHORT HostProtectedArea : 1; // obsolete
USHORT Obsolete1 : 1;
USHORT WriteBuffer : 1; // Shall be cleared to zero to indicate that the WRITE BUFFER command is not supported
USHORT ReadBuffer : 1; // Shall be cleared to zero to indicate that the READ BUFFER command is not supported
USHORT Nop : 1; // Shall be set to one to indicate that the NOP command is supported
USHORT Obsolete2 : 1;
USHORT DownloadMicrocode : 1; // Shall be cleared to zero to indicate that the DOWNLOAD MICROCODE command is not supported
USHORT Reserved1 : 2;
USHORT AdvancedPm : 1; // The APM feature set is enabled
USHORT Msn : 1; // obsolete
USHORT PowerUpInStandby : 1; // The PUIS feature set is enabled
USHORT ManualPowerUp : 1; // SET FEATURES subcommand required to spin-up after power-up
USHORT Reserved2 : 1;
USHORT SetMax : 1; // obsolete
USHORT Reserved3 : 3;
USHORT FlushCache : 1; // The FLUSH CACHE command is supported
USHORT Reserved : 3;
} CommandSetActive;
struct { // word 87
USHORT Reserved0 : 5;
USHORT GpLogging : 1; // This bit is a copy of word 84 bit 5
USHORT Reserved1 : 2;
USHORT WWN64Bit : 1; // shall be set to one to indicate that the mandator WWN is supported
USHORT Reserved2 : 5;
USHORT WordValid : 2; // shall be 01b
}CommandSetActiveExt;
USHORT UltraDMASupport : 8; // word 88
USHORT UltraDMAActive : 8;
USHORT TimeRequiredForNormalEraseModeSecurityEraseUnit; // word 89
USHORT TimeRequiredForEnhancedEraseModeSecurityEraseUnit; // word 90
USHORT CurrentAPMLevel; // word 91
USHORT MasterPasswordID; // word 92
USHORT HardwareResetResult; // word 93
USHORT ReservedWords94[14]; // word 94...107
USHORT WorldWideName[4]; // word 108...111
USHORT ReservedWords112[13]; // word 112...124
USHORT AtapiZeroByteCount; // word 125
USHORT ReservedWord126; // word 126. obsolete
USHORT MsnSupport : 2; // word 127. obsolete
USHORT ReservedWord127 : 14;
USHORT SecurityStatus; // word 128
USHORT VendorSpecific[31]; // Word 129...159
USHORT ReservedWord160[16]; // Word 160...175. Reserved for assignment by the CompactFlash Association
USHORT ReservedWord176[46]; // Word 176...221
struct { //Word 222 Transport major version number. 0000h or FFFFh = device does not report version
USHORT MajorVersion : 12;
USHORT TransportType : 4;
} TransportMajorVersion;
USHORT TransportMinorVersion; // Word 223
USHORT ReservedWord224[31]; // Word 224...254
USHORT Signature : 8;
USHORT CheckSum : 8;
} IDENTIFY_PACKET_DATA, *PIDENTIFY_PACKET_DATA;
#pragma pack (pop, id_packet_data)
//
// Register FIS
//
#pragma pack (push, regfis, 1)
typedef struct _REGISTER_FIS {
//
// dword 0
//
UCHAR FisType;
UCHAR Reserved0 : 7;
UCHAR CmdReg : 1;
UCHAR Command;
UCHAR Features;
//
// dword 1
//
UCHAR SectorNumber;
UCHAR CylinderLow;
UCHAR CylinderHigh;
UCHAR DeviceHead;
//
// dword 2
//
UCHAR SectorNumberExp;
UCHAR CylinderLowExp;
UCHAR CylinderHighExp;
UCHAR FeaturesExp;
//
// dword 3
//
UCHAR SectorCount;
UCHAR SectorCountExp;
UCHAR Reserved2;
UCHAR Control;
//
// dword 4
//
ULONG Reserved3;
}REGISTER_FIS, *PREGISTER_FIS;
#pragma pack (pop, regfis)
//
// ATAPI specific scsiops
//
#define ATAPI_MODE_SENSE 0x5A
#define ATAPI_MODE_SELECT 0x55
#define ATAPI_LS120_FORMAT_UNIT 0x24
//
// IDE driveSelect register bit for LBA mode
//
#define IDE_LBA_MODE (1 << 6)
//
// IDE drive control definitions
//
#define IDE_DC_DISABLE_INTERRUPTS 0x02
#define IDE_DC_RESET_CONTROLLER 0x04
#define IDE_DC_REENABLE_CONTROLLER 0x00
//
// IDE status definitions
//
#define IDE_STATUS_ERROR 0x01
#define IDE_STATUS_INDEX 0x02
#define IDE_STATUS_CORRECTED_ERROR 0x04
#define IDE_STATUS_DRQ 0x08
#define IDE_STATUS_DSC 0x10
#define IDE_STATUS_DEVICE_FAULT 0x20
#define IDE_STATUS_DRDY 0x40
#define IDE_STATUS_IDLE 0x50
#define IDE_STATUS_BUSY 0x80
//
// IDE error definitions
//
#define IDE_ERROR_BAD_BLOCK 0x80
#define IDE_ERROR_CRC_ERROR IDE_ERROR_BAD_BLOCK
#define IDE_ERROR_DATA_ERROR 0x40
#define IDE_ERROR_MEDIA_CHANGE 0x20
#define IDE_ERROR_ID_NOT_FOUND 0x10
#define IDE_ERROR_MEDIA_CHANGE_REQ 0x08
#define IDE_ERROR_COMMAND_ABORTED 0x04
#define IDE_ERROR_END_OF_MEDIA 0x02
#define IDE_ERROR_ILLEGAL_LENGTH 0x01
#define IDE_ERROR_ADDRESS_NOT_FOUND IDE_ERROR_ILLEGAL_LENGTH
//
// IDE command definitions
//
#define IDE_COMMAND_NOP 0x00
#define IDE_COMMAND_DATA_SET_MANAGEMENT 0x06
#define IDE_COMMAND_ATAPI_RESET 0x08
#define IDE_COMMAND_READ 0x20
#define IDE_COMMAND_READ_EXT 0x24
#define IDE_COMMAND_READ_DMA_EXT 0x25
#define IDE_COMMAND_READ_DMA_QUEUED_EXT 0x26
#define IDE_COMMAND_READ_MULTIPLE_EXT 0x29
#define IDE_COMMAND_READ_LOG_EXT 0x2f
#define IDE_COMMAND_WRITE 0x30
#define IDE_COMMAND_WRITE_EXT 0x34
#define IDE_COMMAND_WRITE_DMA_EXT 0x35
#define IDE_COMMAND_WRITE_DMA_QUEUED_EXT 0x36
#define IDE_COMMAND_WRITE_MULTIPLE_EXT 0x39
#define IDE_COMMAND_WRITE_DMA_FUA_EXT 0x3D
#define IDE_COMMAND_WRITE_DMA_QUEUED_FUA_EXT 0x3E
#define IDE_COMMAND_WRITE_LOG_EXT 0x3f
#define IDE_COMMAND_VERIFY 0x40
#define IDE_COMMAND_VERIFY_EXT 0x42
#define IDE_COMMAND_WRITE_LOG_DMA_EXT 0x57
#define IDE_COMMAND_TRUSTED_NON_DATA 0x5B
#define IDE_COMMAND_TRUSTED_RECEIVE 0x5C
#define IDE_COMMAND_TRUSTED_RECEIVE_DMA 0x5D
#define IDE_COMMAND_TRUSTED_SEND 0x5E
#define IDE_COMMAND_TRUSTED_SEND_DMA 0x5F
#define IDE_COMMAND_READ_FPDMA_QUEUED 0x60 // NCQ Read command
#define IDE_COMMAND_WRITE_FPDMA_QUEUED 0x61 // NCQ Write command
#define IDE_COMMAND_NCQ_NON_DATA 0x63 // NCQ Non-Data command
#define IDE_COMMAND_SEND_FPDMA_QUEUED 0x64 // NCQ Send command
#define IDE_COMMAND_RECEIVE_FPDMA_QUEUED 0x65 // NCQ Receive command
#define IDE_COMMAND_SET_DATE_AND_TIME 0x77 // optional 48bit command
#define IDE_COMMAND_EXECUTE_DEVICE_DIAGNOSTIC 0x90
#define IDE_COMMAND_SET_DRIVE_PARAMETERS 0x91
#define IDE_COMMAND_DOWNLOAD_MICROCODE 0x92 // Optional 28bit command
#define IDE_COMMAND_DOWNLOAD_MICROCODE_DMA 0x93 // Optional 28bit command
#define IDE_COMMAND_ATAPI_PACKET 0xA0
#define IDE_COMMAND_ATAPI_IDENTIFY 0xA1
#define IDE_COMMAND_SMART 0xB0
#define IDE_COMMAND_READ_LOG_DMA_EXT 0xB1
#define IDE_COMMAND_SANITIZE_DEVICE 0xB4
#define IDE_COMMAND_READ_MULTIPLE 0xC4
#define IDE_COMMAND_WRITE_MULTIPLE 0xC5
#define IDE_COMMAND_SET_MULTIPLE 0xC6
#define IDE_COMMAND_READ_DMA 0xC8
#define IDE_COMMAND_WRITE_DMA 0xCA
#define IDE_COMMAND_WRITE_DMA_QUEUED 0xCC
#define IDE_COMMAND_WRITE_MULTIPLE_FUA_EXT 0xCE
#define IDE_COMMAND_GET_MEDIA_STATUS 0xDA
#define IDE_COMMAND_DOOR_LOCK 0xDE
#define IDE_COMMAND_DOOR_UNLOCK 0xDF
#define IDE_COMMAND_STANDBY_IMMEDIATE 0xE0
#define IDE_COMMAND_IDLE_IMMEDIATE 0xE1
#define IDE_COMMAND_CHECK_POWER 0xE5
#define IDE_COMMAND_SLEEP 0xE6
#define IDE_COMMAND_FLUSH_CACHE 0xE7
#define IDE_COMMAND_FLUSH_CACHE_EXT 0xEA
#define IDE_COMMAND_IDENTIFY 0xEC
#define IDE_COMMAND_MEDIA_EJECT 0xED
#define IDE_COMMAND_SET_FEATURE 0xEF
#define IDE_COMMAND_SECURITY_SET_PASSWORD 0xF1
#define IDE_COMMAND_SECURITY_UNLOCK 0xF2
#define IDE_COMMAND_SECURITY_ERASE_PREPARE 0xF3
#define IDE_COMMAND_SECURITY_ERASE_UNIT 0xF4
#define IDE_COMMAND_SECURITY_FREEZE_LOCK 0xF5
#define IDE_COMMAND_SECURITY_DISABLE_PASSWORD 0xF6
#define IDE_COMMAND_NOT_VALID 0xFF
//
// IDE Set Transfer Mode
//
#define IDE_SET_DEFAULT_PIO_MODE(mode) ((UCHAR) 1) // disable I/O Ready
#define IDE_SET_ADVANCE_PIO_MODE(mode) ((UCHAR) ((1 << 3) | (mode)))
#define IDE_SET_SWDMA_MODE(mode) ((UCHAR) ((1 << 4) | (mode)))
#define IDE_SET_MWDMA_MODE(mode) ((UCHAR) ((1 << 5) | (mode)))
#define IDE_SET_UDMA_MODE(mode) ((UCHAR) ((1 << 6) | (mode)))
//
// Set features parameter list
//
#define IDE_FEATURE_ENABLE_WRITE_CACHE 0x2
#define IDE_FEATURE_SET_TRANSFER_MODE 0x3
#define IDE_FEATURE_ENABLE_PUIS 0x6
#define IDE_FEATURE_PUIS_SPIN_UP 0x7
#define IDE_FEATURE_ENABLE_SATA_FEATURE 0x10
#define IDE_FEATURE_DISABLE_MSN 0x31
#define IDE_FEATURE_DISABLE_REVERT_TO_POWER_ON 0x66
#define IDE_FEATURE_DISABLE_WRITE_CACHE 0x82
#define IDE_FEATURE_DISABLE_PUIS 0x86
#define IDE_FEATURE_DISABLE_SATA_FEATURE 0x90
#define IDE_FEATURE_ENABLE_MSN 0x95
//
// SATA Features Sector Count parameter list
//
#define IDE_SATA_FEATURE_NON_ZERO_DMA_BUFFER_OFFSET 0x1
#define IDE_SATA_FEATURE_DMA_SETUP_FIS_AUTO_ACTIVATE 0x2
#define IDE_SATA_FEATURE_DEVICE_INITIATED_POWER_MANAGEMENT 0x3
#define IDE_SATA_FEATURE_GUARANTEED_IN_ORDER_DELIVERY 0x4
#define IDE_SATA_FEATURE_ASYNCHRONOUS_NOTIFICATION 0x5
#define IDE_SATA_FEATURE_SOFTWARE_SETTINGS_PRESERVATION 0x6
#define IDE_SATA_FEATURE_DEVICE_AUTO_PARTIAL_TO_SLUMBER 0x7
#define IDE_SATA_FEATURE_ENABLE_HARDWARE_FEATURE_CONTROL 0x8
#define IDE_SATA_FEATURE_DEVSLP 0x9
#define IDE_SATA_FEATURE_HYBRID_INFORMATION 0xa
//