-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathata.h
966 lines (884 loc) · 22.2 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
/***************************************************************************
Aaru Data Preservation Suite
----------------------------------------------------------------------------
Filename : ata.h
Author(s) : Natalia Portillo
Component : Aaru.Device.Report
--[ Description ] ----------------------------------------------------------
Contains ATA definitions.
--[ License ] --------------------------------------------------------------
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/>.
----------------------------------------------------------------------------
Copyright © 2011-2020 Natalia Portillo
****************************************************************************/
#ifndef AARU_DEVICE_REPORT_ATA_H
#define AARU_DEVICE_REPORT_ATA_H
#pragma pack(1)
typedef struct
{
uint8_t feature;
uint8_t sectorCount;
uint8_t sector;
uint8_t cylinderLow;
uint8_t cylinderHigh;
uint8_t deviceHead;
uint8_t command;
} AtaRegistersCHS;
typedef struct
{
uint8_t feature;
uint8_t sectorCount;
uint8_t lbaLow;
uint8_t lbaMid;
uint8_t lbaHigh;
uint8_t deviceHead;
uint8_t command;
} AtaRegistersLBA28;
typedef struct
{
uint16_t feature;
uint16_t sectorCount;
uint16_t lbaLow;
uint16_t lbaMid;
uint16_t lbaHigh;
uint8_t deviceHead;
uint8_t command;
} AtaRegistersLBA48;
typedef struct
{
uint8_t status;
uint8_t error;
uint8_t sectorCount;
uint8_t sector;
uint8_t cylinderLow;
uint8_t cylinderHigh;
uint8_t deviceHead;
uint8_t command;
} AtaErrorRegistersCHS;
typedef struct
{
uint8_t status;
uint8_t error;
uint8_t sectorCount;
uint8_t lbaLow;
uint8_t lbaMid;
uint8_t lbaHigh;
uint8_t deviceHead;
uint8_t command;
} AtaErrorRegistersLBA28;
typedef struct
{
uint8_t status;
uint8_t error;
uint16_t sectorCount;
uint16_t lbaLow;
uint16_t lbaMid;
uint16_t lbaHigh;
uint8_t deviceHead;
uint8_t command;
} AtaErrorRegistersLBA48;
typedef enum
{
ATA_TRANSFER_NONE = 0, ATA_TRANSFER_FEATURE, ATA_TRANSFER_SECTORCOUNT, ATA_TRANSFTER_SPTSIU
} AtaTransferRegister;
typedef enum
{
ATA_PROTOCOL_HARD_RESET = 0,
ATA_PROTOCOL_SOFT_RESET = 1,
ATA_PROTOCOL_NO_DATA = 3,
ATA_PROTOCOL_PIO_IN = 4,
ATA_PROTOCOL_PIO_OUT = 5,
ATA_PROTOCOL_DMA = 6,
ATA_PROTOCOL_DMA_QUEUED = 7,
ATA_PROTOCOL_DEVICE_DIAGNOSTICS = 8,
ATA_PROTOCOL_DEVICE_RESET = 9,
ATA_PROTOCOL_UDMA_IN = 10,
ATA_PROTOCOL_UDMA_OUT = 11,
ATA_PROTOCOL_FPDMA = 12,
ATA_PROTOCOL_RETURN_RESPONSE = 15
} AtaProtocol;
typedef enum
{
ATA_READ_RETRY = 0x20,
ATA_READ_SECTORS = 0x21,
ATA_READ_LONG_RETRY = 0x22,
ATA_READ_LONG = 0x23,
ATA_READ_EXT = 0x24,
ATA_READ_DMA_EXT = 0x25,
ATA_SEEK = 0x70,
ATA_READ_DMA_RETRY = 0xC8,
ATA_READ_DMA = 0xC9,
ATA_IDENTIFY_PACKET_DEVICE = 0xA1,
ATA_IDENTIFY_DEVICE = 0xEC
} AtaCommands;
typedef struct
{
/*
Word 0
General device configuration
On ATAPI devices:
Bits 12 to 8 indicate device type as SCSI defined
Bits 6 to 5:
0 = Device shall set DRQ within 3 ms of receiving PACKET
1 = Device shall assert INTRQ when DRQ is set to one
2 = Device shall set DRQ within 50 µs of receiving PACKET
Bits 1 to 0:
0 = 12 byte command packet
1 = 16 byte command packet
CompactFlash is 0x848A (non magnetic, removable, not MFM, hardsector, and UltraFAST)
*/
uint16_t GeneralConfiguration;
/*
Word 1
Cylinders in default translation mode
Obsoleted in ATA/ATAPI-6
*/
uint16_t Cylinders;
/*
Word 2
Specific configuration
*/
uint16_t SpecificConfiguration;
/*
Word 3
Heads in default translation mode
Obsoleted in ATA/ATAPI-6
*/
uint16_t Heads;
/*
Word 4
Unformatted bytes per track in default translation mode
Obsoleted in ATA-2
*/
uint16_t UnformattedBPT;
/*
Word 5
Unformatted bytes per sector in default translation mode
Obsoleted in ATA-2
*/
uint16_t UnformattedBPS;
/*
Word 6
Sectors per track in default translation mode
Obsoleted in ATA/ATAPI-6
*/
uint16_t SectorsPerTrack;
/*
Words 7 to 8
CFA: Number of sectors per card
*/
uint32_t SectorsPerCard;
/*
Word 9
Vendor unique
Obsoleted in ATA/ATAPI-4
*/
uint16_t VendorWord9;
/*
Words 10 to 19
Device serial number, right justified, padded with spaces
*/
uint8_t SerialNumber[20];
/*
Word 20
Manufacturer defined
Obsoleted in ATA-2
0x0001 = single ported single sector buffer
0x0002 = dual ported multi sector buffer
0x0003 = dual ported multi sector buffer with reading
*/
uint16_t BufferType;
/*
Word 21
Size of buffer in 512 byte increments
Obsoleted in ATA-2
*/
uint16_t BufferSize;
/*
Word 22
Bytes of ECC available in READ/WRITE LONG commands
Obsoleted in ATA/ATAPI-4
*/
uint16_t EccBytes;
/*
Words 23 to 26
Firmware revision, left justified, padded with spaces
*/
uint8_t FirmwareRevision[8];
/*
Words 27 to 46
Model number, left justified, padded with spaces
*/
uint8_t Model[40];
/*
Word 47 bits 7 to 0
Maximum number of sectors that can be transferred per
interrupt on read and write multiple commands
*/
uint8_t MultipleMaxSectors;
/*
Word 47 bits 15 to 8
Vendor unique
ATA/ATAPI-4 says it must be 0x80
*/
uint8_t VendorWord47;
/*
Word 48
ATA-1: Set to 1 if it can perform doubleword I/O
ATA-2 to ATA/ATAPI-7: Reserved
ATA8-ACS: Trusted Computing feature set
*/
uint16_t TrustedComputing;
/*
Word 49
Capabilities
*/
uint16_t Capabilities;
/*
Word 50
Capabilities
*/
uint16_t Capabilities2;
/*
Word 51 bits 7 to 0
Vendor unique
Obsoleted in ATA/ATAPI-4
*/
uint8_t VendorWord51;
/*
Word 51 bits 15 to 8
Transfer timing mode in PIO
Obsoleted in ATA/ATAPI-4
*/
uint8_t PIOTransferTimingMode;
/*
Word 52 bits 7 to 0
Vendor unique
Obsoleted in ATA/ATAPI-4
*/
uint8_t VendorWord52;
/*
Word 52 bits 15 to 8
Transfer timing mode in DMA
Obsoleted in ATA/ATAPI-4
*/
uint8_t DMATransferTimingMode;
/*
Word 53 bits 7 to 0
Reports if words 54 to 58 are valid
*/
uint8_t ExtendedIdentify;
/*
Word 53 bits 15 to 8
Free-fall Control Sensitivity
*/
uint8_t FreeFallSensitivity;
/*
Word 54
Cylinders in current translation mode
Obsoleted in ATA/ATAPI-6
*/
uint16_t CurrentCylinders;
/*
Word 55
Heads in current translation mode
Obsoleted in ATA/ATAPI-6
*/
uint16_t CurrentHeads;
/*
Word 56
Sectors per track in current translation mode
Obsoleted in ATA/ATAPI-6
*/
uint16_t CurrentSectorsPerTrack;
/*
Words 57 to 58
Total sectors currently user-addressable
Obsoleted in ATA/ATAPI-6
*/
uint32_t CurrentSectors;
/*
Word 59 bits 7 to 0
Number of sectors currently set to transfer on a READ/WRITE MULTIPLE command
*/
uint8_t MultipleSectorNumber;
/*
Word 59 bits 15 to 8
Indicates if <see cref="MultipleSectorNumber"/> is valid
*/
uint8_t Capabilities3;
/*
Words 60 to 61
If drive supports LBA, how many sectors are addressable using LBA
*/
uint32_t LBASectors;
/*
Word 62 bits 7 to 0
Single word DMA modes available
Obsoleted in ATA/ATAPI-4
In ATAPI it's not obsolete, indicates UDMA mode (UDMA7 is instead MDMA0)
*/
uint8_t DMASupported;
/*
Word 62 bits 15 to 8
Single word DMA mode currently active
Obsoleted in ATA/ATAPI-4
In ATAPI it's not obsolete, bits 0 and 1 indicate MDMA mode+1,
bit 10 indicates DMA is supported and bit 15 indicates DMADIR bit
in PACKET is required for DMA transfers
*/
uint8_t DMAActive;
/*
Word 63 bits 7 to 0
Multiword DMA modes available
*/
uint8_t MDMASupported;
/*
Word 63 bits 15 to 8
Multiword DMA mode currently active
*/
uint8_t MDMAActive;
/*
Word 64 bits 7 to 0
Supported Advanced PIO transfer modes
*/
uint8_t APIOSupported;
/*
Word 64 bits 15 to 8
Reserved
*/
uint8_t ReservedWord64;
/*
Word 65
Minimum MDMA transfer cycle time per word in nanoseconds
*/
uint16_t MinMDMACycleTime;
/*
Word 66
Recommended MDMA transfer cycle time per word in nanoseconds
*/
uint16_t RecMDMACycleTime;
/*
Word 67
Minimum PIO transfer cycle time without flow control in nanoseconds
*/
uint16_t MinPIOCycleTimeNoFlow;
/*
Word 68
Minimum PIO transfer cycle time with IORDY flow control in nanoseconds
*/
uint16_t MinPIOCycleTimeFlow;
/*
Word 69
Additional supported
*/
uint16_t CommandSet5;
/*
Word 70
Reserved
*/
uint16_t ReservedWord70;
/*
Word 71
ATAPI: Typical time in ns from receipt of PACKET to release bus
*/
uint16_t PacketBusRelease;
/*
Word 72
ATAPI: Typical time in ns from receipt of SERVICE to clear BSY
*/
uint16_t ServiceBusyClear;
/*
Word 73
Reserved
*/
uint16_t ReservedWord73;
/*
Word 74
Reserved
*/
uint16_t ReservedWord74;
/*
Word 75
Maximum Queue depth
*/
uint16_t MaxQueueDepth;
/*
Word 76
Serial ATA Capabilities
*/
uint16_t SATACapabilities;
/*
Word 77
Serial ATA Additional Capabilities
*/
uint16_t SATACapabilities2;
/*
Word 78
Supported Serial ATA features
*/
uint16_t SATAFeatures;
/*
Word 79
Enabled Serial ATA features
*/
uint16_t EnabledSATAFeatures;
/*
Word 80
Major version of ATA/ATAPI standard supported
*/
uint16_t MajorVersion;
/*
Word 81
Minimum version of ATA/ATAPI standard supported
*/
uint16_t MinorVersion;
/*
Word 82
Supported command/feature sets
*/
uint16_t CommandSet;
/*
Word 83
Supported command/feature sets
*/
uint16_t CommandSet2;
/*
Word 84
Supported command/feature sets
*/
uint16_t CommandSet3;
/*
Word 85
Enabled command/feature sets
*/
uint16_t EnabledCommandSet;
/*
Word 86
Enabled command/feature sets
*/
uint16_t EnabledCommandSet2;
/*
Word 87
Enabled command/feature sets
*/
uint16_t EnabledCommandSet3;
/*
Word 88 bits 7 to 0
Supported Ultra DMA transfer modes
*/
uint8_t UDMASupported;
/*
Word 88 bits 15 to 8
Selected Ultra DMA transfer modes
*/
uint8_t UDMAActive;
/*
Word 89
Time required for security erase completion
*/
uint16_t SecurityEraseTime;
/*
Word 90
Time required for enhanced security erase completion
*/
uint16_t EnhancedSecurityEraseTime;
/*
Word 91
Current advanced power management value
*/
uint16_t CurrentAPM;
/*
Word 92
Master password revision code
*/
uint16_t MasterPasswordRevisionCode;
/*
Word 93
Hardware reset result
*/
uint16_t HardwareResetResult;
/*
Word 94 bits 7 to 0
Current AAM value
*/
uint8_t CurrentAAM;
/*
Word 94 bits 15 to 8
Vendor's recommended AAM value
*/
uint8_t RecommendedAAM;
/*
Word 95
Stream minimum request size
*/
uint16_t StreamMinReqSize;
/*
Word 96
Streaming transfer time in DMA
*/
uint16_t StreamTransferTimeDMA;
/*
Word 97
Streaming access latency in DMA and PIO
*/
uint16_t StreamAccessLatency;
/*
Words 98 to 99
Streaming performance granularity
*/
uint32_t StreamPerformanceGranularity;
/*
Words 100 to 103
48-bit LBA addressable sectors
*/
uint64_t LBA48Sectors;
/*
Word 104
Streaming transfer time in PIO
*/
uint16_t StreamTransferTimePIO;
/*
Word 105
Maximum number of 512-byte block per DATA SET MANAGEMENT command
*/
uint16_t DataSetMgmtSize;
/*
Word 106
Bit 15 should be zero
Bit 14 should be one
Bit 13 set indicates device has multiple logical sectors per physical sector
Bit 12 set indicates logical sector has more than 256 words (512 bytes)
Bits 11 to 4 are reserved
Bits 3 to 0 indicate power of two of logical sectors per physical sector
*/
uint16_t PhysLogSectorSize;
/*
Word 107
Interseek delay for ISO-7779 acoustic testing, in microseconds
*/
uint16_t InterseekDelay;
/*
Words 108 to 111
World Wide Name
*/
uint64_t WWN;
/*
Words 112 to 115
Reserved for WWN extension to 128 bit
*/
uint64_t WWNExtension;
/*
Word 116
Reserved for technical report
*/
uint16_t ReservedWord116;
/*
Words 117 to 118
Words per logical sector
*/
uint32_t LogicalSectorWords;
/*
Word 119
Supported command/feature sets
*/
uint16_t CommandSet4;
/*
Word 120
Supported command/feature sets
*/
uint16_t EnabledCommandSet4;
/*
Words 121 to 125
Reserved
*/
uint16_t ReservedWords121[5];
/*
Word 126
ATAPI byte count limit
*/
uint16_t ATAPIByteCount;
/*
Word 127
Removable Media Status Notification feature set support
Bits 15 to 2 are reserved
Bits 1 to 0 must be 0 for not supported or 1 for supported. 2 and 3 are reserved.
Obsoleted in ATA8-ACS
*/
uint16_t RemovableStatusSet;
/*
Word 128
Security status
*/
uint16_t SecurityStatus;
/*
Words 129 to 159
*/
uint16_t ReservedWords129[31];
/*
Word 160
CFA power mode
Bit 15 must be set
Bit 13 indicates mode 1 is required for one or more commands
Bit 12 indicates mode 1 is disabled
Bits 11 to 0 indicates maximum current in mA
*/
uint16_t CFAPowerMode;
/*
Words 161 to 167
Reserved for CFA
*/
uint16_t ReservedCFA[7];
/*
Word 168
Bits 15 to 4, reserved
Bits 3 to 0, device nominal form factor
*/
uint16_t DeviceFormFactor;
/*
Word 169
DATA SET MANAGEMENT support
*/
uint16_t DataSetMgmt;
/*
Words 170 to 173
Additional product identifier
*/
uint8_t AdditionalPID[8];
/*
Word 174
Reserved
*/
uint16_t ReservedWord174;
/*
Word 175
Reserved
*/
uint16_t ReservedWord175;
/*
Words 176 to 195
Current media serial number
*/
uint8_t MediaSerial[40];
/*
Words 196 to 205
Current media manufacturer
*/
uint8_t MediaManufacturer[20];
/*
Word 206
SCT Command Transport features
*/
uint16_t SCTCommandTransport;
/*
Word 207
Reserved for CE-ATA
*/
uint16_t ReservedCEATAWord207;
/*
Word 208
Reserved for CE-ATA
*/
uint16_t ReservedCEATAWord208;
/*
Word 209
Alignment of logical block within a larger physical block
Bit 15 shall be cleared to zero
Bit 14 shall be set to one
Bits 13 to 0 indicate logical sector offset within the first physical sector
*/
uint16_t LogicalAlignment;
/*
Words 210 to 211
Write/Read/Verify sector count mode 3 only
*/
uint32_t WRVSectorCountMode3;
/*
Words 212 to 213
Write/Read/Verify sector count mode 2 only
*/
uint32_t WRVSectorCountMode2;
/*
Word 214
NV Cache capabilities
Bits 15 to 12 feature set version
Bits 11 to 18 power mode feature set version
Bits 7 to 5 reserved
Bit 4 feature set enabled
Bits 3 to 2 reserved
Bit 1 power mode feature set enabled
Bit 0 power mode feature set supported
*/
uint16_t NVCacheCaps;
/*
Words 215 to 216
NV Cache Size in Logical BLocks
*/
uint32_t NVCacheSize;
/*
Word 217
Nominal media rotation rate
In ACS-1 meant NV Cache read speed in MB/s
*/
uint16_t NominalRotationRate;
/*
Word 218
NV Cache write speed in MB/s
Reserved since ACS-2
*/
uint16_t NVCacheWriteSpeed;
/*
Word 219 bits 7 to 0
Estimated device spin up in seconds
*/
uint8_t NVEstimatedSpinUp;
/*
Word 219 bits 15 to 8
NV Cache reserved
*/
uint8_t NVReserved;
/*
Word 220 bits 7 to 0
Write/Read/Verify feature set current mode
*/
uint8_t WRVMode;
/*
Word 220 bits 15 to 8
Reserved
*/
uint8_t WRVReserved;
/*
Word 221
Reserved
*/
uint16_t ReservedWord221;
/*
Word 222
Transport major revision number
Bits 15 to 12 indicate transport type. 0 parallel, 1 serial, 0xE PCIe.
Bits 11 to 0 indicate revision
*/
uint16_t TransportMajorVersion;
/*
Word 223
Transport minor revision number
*/
uint16_t TransportMinorVersion;
/*
Words 224 to 229
Reserved for CE-ATA
*/
uint16_t ReservedCEATA224[6];
/*
Words 230 to 233
48-bit LBA if Word 69 bit 3 is set
*/
uint64_t ExtendedUserSectors;
/*
Word 234
Minimum number of 512 byte units per DOWNLOAD MICROCODE mode 3
*/
uint16_t MinDownloadMicroMode3;
/*
Word 235
Maximum number of 512 byte units per DOWNLOAD MICROCODE mode 3
*/
uint16_t MaxDownloadMicroMode3;
/*
Words 236 to 254
*/
uint16_t ReservedWords[19];
/*
Word 255 bits 7 to 0
Should be 0xA5
*/
uint8_t Signature;
/*
Word 255 bits 15 to 8
Checksum
*/
uint8_t Checksum;
} IdentifyDevice;
unsigned char *AtaToCString(unsigned char *string, int len);
int SendAtaCommandChs(int fd,
AtaRegistersCHS registers,
AtaErrorRegistersCHS **errorRegisters,
int protocol,
int transferRegister,
unsigned char *buffer,
unsigned int buffer_len,
int transferBlocks);
int SendAtaCommandLba28(int fd,
AtaRegistersLBA28 registers,
AtaErrorRegistersLBA28 **errorRegisters,
int protocol,
int transferRegister,
unsigned char *buffer,
unsigned int buffer_len,
int transferBlocks);
int SendAtaCommandLba48(int fd,
AtaRegistersLBA48 registers,
AtaErrorRegistersLBA48 **errorRegisters,
int protocol,
int transferRegister,
unsigned char *buffer,
unsigned int buffer_len,
int transferBlocks);
int Identify(int fd, unsigned char **buffer, AtaErrorRegistersCHS **errorRegisters);
int Read(int fd,
unsigned char **buffer,
AtaErrorRegistersCHS **statusRegisters,
int retry,
uint16_t cylinder,
uint8_t head,
uint8_t sector,
uint8_t count);
int ReadLong(int fd,
unsigned char **buffer,
AtaErrorRegistersCHS **statusRegisters,
int retry,
uint16_t cylinder,
uint8_t head,
uint8_t sector,
uint32_t blockSize);
int Seek(int fd, AtaErrorRegistersCHS **statusRegisters, uint16_t cylinder, uint8_t head, uint8_t sector);
int ReadDma(int fd,
unsigned char **buffer,
AtaErrorRegistersCHS **statusRegisters,
int retry,
uint16_t cylinder,
uint8_t head,
uint8_t sector,
uint8_t count);
int ReadDmaLba(int fd,
unsigned char **buffer,
AtaErrorRegistersLBA28 **statusRegisters,
int retry,
uint32_t lba,
uint8_t count);
int ReadLba(int fd,
unsigned char **buffer,
AtaErrorRegistersLBA28 **statusRegisters,
int retry,
uint32_t lba,
uint8_t count);
int ReadLongLba(int fd,
unsigned char **buffer,
AtaErrorRegistersLBA28 **statusRegisters,
int retry,
uint32_t lba,
uint32_t blockSize);
int SeekLba(int fd, AtaErrorRegistersLBA28 **statusRegisters, uint32_t lba);
int
ReadDmaLba48(int fd, unsigned char **buffer, AtaErrorRegistersLBA48 **statusRegisters, uint64_t lba, uint16_t count);
int ReadLba48(int fd, unsigned char **buffer, AtaErrorRegistersLBA48 **statusRegisters, uint64_t lba, uint16_t count);
#endif //AARU_DEVICE_REPORT_ATA_H