forked from gregkh/ndas
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathndas_scsi_cmd_fmt.h
More file actions
4679 lines (4036 loc) · 125 KB
/
ndas_scsi_cmd_fmt.h
File metadata and controls
4679 lines (4036 loc) · 125 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
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
#ifndef __NDAS_SCSI_FMT_H__
#define __NDAS_SCSI_FMT_H__
//
// Generic 6-Byte CDB
//
typedef union _CDB {
struct _CDB6GENERIC {
xuint8 OperationCode;
#if defined(__LITTLE_ENDIAN_BITFIELD)
xuint8 Immediate : 1;
xuint8 CommandUniqueBits : 4;
xuint8 LogicalUnitNumber : 3;
#else
xuint8 LogicalUnitNumber : 3;
xuint8 CommandUniqueBits : 4;
xuint8 Immediate : 1;
#endif
xuint8 CommandUniqueBytes[3];
#if defined(__LITTLE_ENDIAN_BITFIELD)
xuint8 Link : 1;
xuint8 Flag : 1;
xuint8 Reserved : 4;
xuint8 VendorUnique : 2;
#else
xuint8 VendorUnique : 2;
xuint8 Reserved : 4;
xuint8 Flag : 1;
xuint8 Link : 1;
#endif
} CDB6GENERIC;
//
// Standard 6-byte CDB
//
struct _CDB6READWRITE {
xuint8 OperationCode; // 0x08, 0x0A - SCSIOP_READ, SCSIOP_WRITE
#if defined(__LITTLE_ENDIAN_BITFIELD)
xuint8 LogicalBlockMsb1 : 5;
xuint8 LogicalUnitNumber : 3;
#else
xuint8 LogicalUnitNumber : 3;
xuint8 LogicalBlockMsb1 : 5;
#endif
xuint8 LogicalBlockMsb0;
xuint8 LogicalBlockLsb;
xuint8 TransferBlocks;
xuint8 Control;
} CDB6READWRITE;
//
// SCSI-1 Inquiry CDB
//
struct _CDB6INQUIRY {
xuint8 OperationCode; // 0x12 - SCSIOP_INQUIRY
#if defined(__LITTLE_ENDIAN_BITFIELD)
xuint8 Reserved1 : 5;
xuint8 LogicalUnitNumber : 3;
#else
xuint8 LogicalUnitNumber : 3;
xuint8 Reserved1 : 5;
#endif
xuint8 PageCode;
xuint8 IReserved;
xuint8 AllocationLength;
xuint8 Control;
} CDB6INQUIRY;
//
// SCSI-3 Inquiry CDB
//
struct _CDB6INQUIRY3 {
xuint8 OperationCode; // 0x12 - SCSIOP_INQUIRY
#if defined(__LITTLE_ENDIAN_BITFIELD)
xuint8 EnableVitalProductData : 1;
xuint8 CommandSupportData : 1;
xuint8 Reserved1 : 6;
#else
xuint8 Reserved1 : 6;
xuint8 CommandSupportData : 1;
xuint8 EnableVitalProductData : 1;
#endif
xuint8 PageCode;
xuint8 Reserved2;
xuint8 AllocationLength;
xuint8 Control;
} CDB6INQUIRY3;
struct _CDB6VERIFY {
xuint8 OperationCode; // 0x13 - SCSIOP_VERIFY
#if defined(__LITTLE_ENDIAN_BITFIELD)
xuint8 Fixed : 1;
xuint8 ByteCompare : 1;
xuint8 Immediate : 1;
xuint8 Reserved : 2;
xuint8 LogicalUnitNumber : 3;
#else
xuint8 LogicalUnitNumber : 3;
xuint8 Reserved : 2;
xuint8 Immediate : 1;
xuint8 ByteCompare : 1;
xuint8 Fixed : 1;
#endif
xuint8 VerificationLength[3];
xuint8 Control;
} CDB6VERIFY;
//
// SCSI Format CDB
//
struct _CDB6FORMAT {
xuint8 OperationCode; // 0x04 - SCSIOP_FORMAT_UNIT
#if defined(__LITTLE_ENDIAN_BITFIELD)
xuint8 FormatControl : 5;
xuint8 LogicalUnitNumber : 3;
#else
xuint8 LogicalUnitNumber : 3;
xuint8 FormatControl : 5;
#endif
xuint8 FReserved1;
xuint8 InterleaveMsb;
xuint8 InterleaveLsb;
xuint8 FReserved2;
} CDB6FORMAT;
//
// Standard 10-byte CDB
struct _CDB10 {
xuint8 OperationCode;
#if defined(__LITTLE_ENDIAN_BITFIELD)
xuint8 RelativeAddress : 1;
xuint8 Reserved1 : 2;
xuint8 ForceUnitAccess : 1;
xuint8 DisablePageOut : 1;
xuint8 LogicalUnitNumber : 3;
#else
xuint8 LogicalUnitNumber : 3;
xuint8 DisablePageOut : 1;
xuint8 ForceUnitAccess : 1;
xuint8 Reserved1 : 2;
xuint8 RelativeAddress : 1;
#endif
xuint8 LogicalBlockByte0;
xuint8 LogicalBlockByte1;
xuint8 LogicalBlockByte2;
xuint8 LogicalBlockByte3;
xuint8 Reserved2;
xuint8 TransferBlocksMsb;
xuint8 TransferBlocksLsb;
xuint8 Control;
} CDB10;
//
// Standard 12-byte CDB
//
struct _CDB12 {
xuint8 OperationCode;
#if defined(__LITTLE_ENDIAN_BITFIELD)
xuint8 RelativeAddress : 1;
xuint8 Reserved1 : 2;
xuint8 ForceUnitAccess : 1;
xuint8 DisablePageOut : 1;
xuint8 LogicalUnitNumber : 3;
#else
xuint8 LogicalUnitNumber : 3;
xuint8 DisablePageOut : 1;
xuint8 ForceUnitAccess : 1;
xuint8 Reserved1 : 2;
xuint8 RelativeAddress : 1;
#endif
xuint8 LogicalBlock[4];
xuint8 TransferLength[4];
xuint8 Reserved2;
xuint8 Control;
} CDB12;
//
// Standard 16-byte CDB
//
struct _CDB16 {
xuint8 OperationCode;
#if defined(__LITTLE_ENDIAN_BITFIELD)
xuint8 Reserved1 : 3;
xuint8 ForceUnitAccess : 1;
xuint8 DisablePageOut : 1;
xuint8 Protection : 3;
#else
xuint8 Protection : 3;
xuint8 DisablePageOut : 1;
xuint8 ForceUnitAccess : 1;
xuint8 Reserved1 : 3;
#endif
xuint8 LogicalBlock[8];
xuint8 TransferLength[4];
xuint8 Reserved2;
xuint8 Control;
} CDB16;
struct _READ_BUFFER {
xuint8 OperationCode;
#if defined(__LITTLE_ENDIAN_BITFIELD)
xuint8 Mode:5;
xuint8 Reserved:3;
#else
xuint8 Reserved:3;
xuint8 Mode:5;
#endif
xuint8 BufferId;
xuint8 BufferOffset[3];
xuint8 AllocationLength[3];
xuint8 Control;
} READ_BUFFER;
//
// CD Rom Audio CDBs
//
struct _PAUSE_RESUME {
xuint8 OperationCode; // 0x4B - SCSIOP_PAUSE_RESUME
#if defined(__LITTLE_ENDIAN_BITFIELD)
xuint8 Reserved1 : 5;
xuint8 LogicalUnitNumber : 3;
#else
xuint8 LogicalUnitNumber : 3;
xuint8 Reserved1 : 5;
#endif
xuint8 Reserved2[6];
xuint8 Action;
xuint8 Control;
} PAUSE_RESUME;
//
// Read Table of Contents
//
struct _READ_TOC {
xuint8 OperationCode; // 0x43 - SCSIOP_READ_TOC
#if defined(__LITTLE_ENDIAN_BITFIELD)
xuint8 Reserved0 : 1;
xuint8 Msf : 1;
xuint8 Reserved1 : 3;
xuint8 LogicalUnitNumber : 3;
xuint8 Format2 : 4;
xuint8 Reserved2 : 4;
#else
xuint8 LogicalUnitNumber : 3;
xuint8 Reserved1 : 3;
xuint8 Msf : 1;
xuint8 Reserved0 : 1;
xuint8 Reserved2 : 4;
xuint8 Format2 : 4;
#endif
xuint8 Reserved3[3];
xuint8 StartingTrack;
xuint8 AllocationLength[2];
#if defined(__LITTLE_ENDIAN_BITFIELD)
xuint8 Control : 6;
xuint8 Format : 2;
#else
xuint8 Format : 2;
xuint8 Control : 6;
#endif
} READ_TOC;
struct _READ_DISK_INFORMATION {
xuint8 OperationCode; // 0x51 - SCSIOP_READ_DISC_INFORMATION
#if defined(__LITTLE_ENDIAN_BITFIELD)
xuint8 Reserved1 : 5;
xuint8 Lun : 3;
#else
xuint8 Lun : 3;
xuint8 Reserved1 : 5;
#endif
xuint8 Reserved2[5];
xuint8 AllocationLength[2];
xuint8 Control;
} READ_DISK_INFORMATION, READ_DISC_INFORMATION;
struct _READ_TRACK_INFORMATION {
xuint8 OperationCode; // 0x52 - SCSIOP_READ_TRACK_INFORMATION
#if defined(__LITTLE_ENDIAN_BITFIELD)
xuint8 Track : 2;
xuint8 Reserved4 : 3;
xuint8 Lun : 3;
#else
xuint8 Lun : 3;
xuint8 Reserved4 : 3;
xuint8 Track : 2;
#endif
xuint8 BlockAddress[4]; // or Track Number
xuint8 Reserved3;
xuint8 AllocationLength[2];
xuint8 Control;
} READ_TRACK_INFORMATION;
struct _RESERVE_TRACK_RZONE {
xuint8 OperationCode; // 0x53 - SCSIOP_RESERVE_TRACK_RZONE
xuint8 Reserved1[4];
xuint8 ReservationSize[4];
xuint8 Control;
} RESERVE_TRACK_RZONE;
struct _SEND_OPC_INFORMATION {
xuint8 OperationCode; // 0x54 - SCSIOP_SEND_OPC_INFORMATION
#if defined(__LITTLE_ENDIAN_BITFIELD)
xuint8 DoOpc : 1; // perform OPC
xuint8 Reserved : 7;
#else
xuint8 Reserved : 7;
xuint8 DoOpc : 1; // perform OPC
#endif
xuint8 Reserved1[5];
xuint8 ParameterListLength[2];
xuint8 Reserved2;
} SEND_OPC_INFORMATION;
struct _REPAIR_TRACK {
xuint8 OperationCode; // 0x58 - SCSIOP_REPAIR_TRACK
#if defined(__LITTLE_ENDIAN_BITFIELD)
xuint8 Immediate : 1;
xuint8 Reserved1 : 7;
#else
xuint8 Reserved1 : 7;
xuint8 Immediate : 1;
#endif
xuint8 Reserved2[2];
xuint8 TrackNumber[2];
xuint8 Reserved3[3];
xuint8 Control;
} REPAIR_TRACK;
struct _CLOSE_TRACK {
xuint8 OperationCode; // 0x5B - SCSIOP_CLOSE_TRACK_SESSION
#if defined(__LITTLE_ENDIAN_BITFIELD)
xuint8 Immediate : 1;
xuint8 Reserved1 : 7;
xuint8 Track : 1;
xuint8 Session : 1;
xuint8 Reserved2 : 6;
#else
xuint8 Reserved1 : 7;
xuint8 Immediate : 1;
xuint8 Reserved2 : 6;
xuint8 Session : 1;
xuint8 Track : 1;
#endif
xuint8 Reserved3;
xuint8 TrackNumber[2];
xuint8 Reserved4[3];
xuint8 Control;
} CLOSE_TRACK;
struct _READ_BUFFER_CAPACITY {
xuint8 OperationCode; // 0x5C - SCSIOP_READ_BUFFER_CAPACITY
#if defined(__LITTLE_ENDIAN_BITFIELD)
xuint8 BlockInfo : 1;
xuint8 Reserved1 : 7;
#else
xuint8 Reserved1 : 7;
xuint8 BlockInfo : 1;
#endif
xuint8 Reserved2[5];
xuint8 AllocationLength[2];
xuint8 Control;
} READ_BUFFER_CAPACITY;
struct _SEND_CUE_SHEET {
xuint8 OperationCode; // 0x5D - SCSIOP_SEND_CUE_SHEET
xuint8 Reserved[5];
xuint8 CueSheetSize[3];
xuint8 Control;
} SEND_CUE_SHEET;
struct _READ_HEADER {
xuint8 OperationCode; // 0x44 - SCSIOP_READ_HEADER
#if defined(__LITTLE_ENDIAN_BITFIELD)
xuint8 Reserved1 : 1;
xuint8 Msf : 1;
xuint8 Reserved2 : 3;
xuint8 Lun : 3;
#else
xuint8 Lun : 3;
xuint8 Reserved2 : 3;
xuint8 Msf : 1;
xuint8 Reserved1 : 1;
#endif
xuint8 LogicalBlockAddress[4];
xuint8 Reserved3;
xuint8 AllocationLength[2];
xuint8 Control;
} READ_HEADER;
struct _PLAY_AUDIO {
xuint8 OperationCode; // 0x45 - SCSIOP_PLAY_AUDIO
#if defined(__LITTLE_ENDIAN_BITFIELD)
xuint8 Reserved1 : 5;
xuint8 LogicalUnitNumber : 3;
#else
xuint8 LogicalUnitNumber : 3;
xuint8 Reserved1 : 5;
#endif
xuint8 StartingBlockAddress[4];
xuint8 Reserved2;
xuint8 PlayLength[2];
xuint8 Control;
} PLAY_AUDIO;
struct _PLAY_AUDIO_MSF {
xuint8 OperationCode; // 0x47 - SCSIOP_PLAY_AUDIO_MSF
#if defined(__LITTLE_ENDIAN_BITFIELD)
xuint8 Reserved1 : 5;
xuint8 LogicalUnitNumber : 3;
#else
xuint8 LogicalUnitNumber : 3;
xuint8 Reserved1 : 5;
#endif
xuint8 Reserved2;
xuint8 StartingM;
xuint8 StartingS;
xuint8 StartingF;
xuint8 EndingM;
xuint8 EndingS;
xuint8 EndingF;
xuint8 Control;
} PLAY_AUDIO_MSF;
struct _BLANK_MEDIA {
xuint8 OperationCode; // 0xA1 - SCSIOP_BLANK
#if defined(__LITTLE_ENDIAN_BITFIELD)
xuint8 BlankType : 3;
xuint8 Reserved1 : 1;
xuint8 Immediate : 1;
xuint8 Reserved2 : 3;
#else
xuint8 Reserved2 : 3;
xuint8 Immediate : 1;
xuint8 Reserved1 : 1;
xuint8 BlankType : 3;
#endif
xuint8 AddressOrTrack[4];
xuint8 Reserved3[5];
xuint8 Control;
} BLANK_MEDIA;
struct _PLAY_CD {
xuint8 OperationCode; // 0xBC - SCSIOP_PLAY_CD
#if defined(__LITTLE_ENDIAN_BITFIELD)
xuint8 Reserved1 : 1;
xuint8 CMSF : 1; // LBA = 0, MSF = 1
xuint8 ExpectedSectorType : 3;
xuint8 Lun : 3;
#else
xuint8 Lun : 3;
xuint8 ExpectedSectorType : 3;
xuint8 CMSF : 1; // LBA = 0, MSF = 1
xuint8 Reserved1 : 1;
#endif
union {
struct _LBA {
xuint8 StartingBlockAddress[4];
xuint8 PlayLength[4];
} LBA;
struct _MSF {
xuint8 Reserved1;
xuint8 StartingM;
xuint8 StartingS;
xuint8 StartingF;
xuint8 EndingM;
xuint8 EndingS;
xuint8 EndingF;
xuint8 Reserved2;
} MSF;
}u1;
#if defined(__LITTLE_ENDIAN_BITFIELD)
xuint8 Audio : 1;
xuint8 Composite : 1;
xuint8 Port1 : 1;
xuint8 Port2 : 1;
xuint8 Reserved2 : 3;
xuint8 Speed : 1;
#else
xuint8 Speed : 1;
xuint8 Reserved2 : 3;
xuint8 Port2 : 1;
xuint8 Port1 : 1;
xuint8 Composite : 1;
xuint8 Audio : 1;
#endif
xuint8 Control;
} PLAY_CD;
struct _SCAN_CD {
xuint8 OperationCode; // 0xBA - SCSIOP_SCAN_CD
#if defined(__LITTLE_ENDIAN_BITFIELD)
xuint8 RelativeAddress : 1;
xuint8 Reserved1 : 3;
xuint8 Direct : 1;
xuint8 Lun : 3;
#else
xuint8 Lun : 3;
xuint8 Direct : 1;
xuint8 Reserved1 : 3;
xuint8 RelativeAddress : 1;
#endif
xuint8 StartingAddress[4];
xuint8 Reserved2[3];
#if defined(__LITTLE_ENDIAN_BITFIELD)
xuint8 Reserved3 : 6;
xuint8 Type : 2;
#else
xuint8 Type : 2;
xuint8 Reserved3 : 6;
#endif
xuint8 Reserved4;
xuint8 Control;
} SCAN_CD;
struct _STOP_PLAY_SCAN {
xuint8 OperationCode; // 0x4E - SCSIOP_STOP_PLAY_SCAN
#if defined(__LITTLE_ENDIAN_BITFIELD)
xuint8 Reserved1 : 5;
xuint8 Lun : 3;
#else
xuint8 Lun : 3;
xuint8 Reserved1 : 5;
#endif
xuint8 Reserved2[7];
xuint8 Control;
} STOP_PLAY_SCAN;
//
// Read SubChannel Data
//
struct _SUBCHANNEL {
xuint8 OperationCode; // 0x42 - SCSIOP_READ_SUB_CHANNEL
#if defined(__LITTLE_ENDIAN_BITFIELD)
xuint8 Reserved0 : 1;
xuint8 Msf : 1;
xuint8 Reserved1 : 3;
xuint8 LogicalUnitNumber : 3;
xuint8 Reserved2 : 6;
xuint8 SubQ : 1;
xuint8 Reserved3 : 1;
#else
xuint8 LogicalUnitNumber : 3;
xuint8 Reserved1 : 3;
xuint8 Msf : 1;
xuint8 Reserved0 : 1;
xuint8 Reserved3 : 1;
xuint8 SubQ : 1;
xuint8 Reserved2 : 6;
#endif
xuint8 Format;
xuint8 Reserved4[2];
xuint8 TrackNumber;
xuint8 AllocationLength[2];
xuint8 Control;
} SUBCHANNEL;
//
// Read CD. Used by Atapi for raw sector reads.
//
struct _READ_CD {
xuint8 OperationCode; // 0xBE - SCSIOP_READ_CD
#if defined(__LITTLE_ENDIAN_BITFIELD)
xuint8 RelativeAddress : 1;
xuint8 Reserved0 : 1;
xuint8 ExpectedSectorType : 3;
xuint8 Lun : 3;
#else
xuint8 Lun : 3;
xuint8 ExpectedSectorType : 3;
xuint8 Reserved0 : 1;
xuint8 RelativeAddress : 1;
#endif
xuint8 StartingLBA[4];
xuint8 TransferBlocks[3];
#if defined(__LITTLE_ENDIAN_BITFIELD)
xuint8 Reserved2 : 1;
xuint8 ErrorFlags : 2;
xuint8 IncludeEDC : 1;
xuint8 IncludeUserData : 1;
xuint8 HeaderCode : 2;
xuint8 IncludeSyncData : 1;
xuint8 SubChannelSelection : 3;
xuint8 Reserved3 : 5;
#else
xuint8 IncludeSyncData : 1;
xuint8 HeaderCode : 2;
xuint8 IncludeUserData : 1;
xuint8 IncludeEDC : 1;
xuint8 ErrorFlags : 2;
xuint8 Reserved2 : 1;
xuint8 Reserved3 : 5;
xuint8 SubChannelSelection : 3;
#endif
xuint8 Control;
} READ_CD;
struct _READ_CD_MSF {
xuint8 OperationCode; // 0xB9 - SCSIOP_READ_CD_MSF
#if defined(__LITTLE_ENDIAN_BITFIELD)
xuint8 RelativeAddress : 1;
xuint8 Reserved1 : 1;
xuint8 ExpectedSectorType : 3;
xuint8 Lun : 3;
#else
xuint8 Lun : 3;
xuint8 ExpectedSectorType : 3;
xuint8 Reserved1 : 1;
xuint8 RelativeAddress : 1;
#endif
xuint8 Reserved2;
xuint8 StartingM;
xuint8 StartingS;
xuint8 StartingF;
xuint8 EndingM;
xuint8 EndingS;
xuint8 EndingF;
#if defined(__LITTLE_ENDIAN_BITFIELD)
xuint8 Reserved4 : 1;
xuint8 ErrorFlags : 2;
xuint8 IncludeEDC : 1;
xuint8 IncludeUserData : 1;
xuint8 HeaderCode : 2;
xuint8 IncludeSyncData : 1;
xuint8 SubChannelSelection : 3;
xuint8 Reserved5 : 5;
#else
xuint8 IncludeSyncData : 1;
xuint8 HeaderCode : 2;
xuint8 IncludeUserData : 1;
xuint8 IncludeEDC : 1;
xuint8 ErrorFlags : 2;
xuint8 Reserved4 : 1;
xuint8 Reserved5 : 5;
xuint8 SubChannelSelection : 3;
#endif
xuint8 Control;
} READ_CD_MSF;
//
// Plextor Read CD-DA
//
struct _PLXTR_READ_CDDA {
xuint8 OperationCode; // Unknown -- vendor-unique?
#if defined(__LITTLE_ENDIAN_BITFIELD)
xuint8 Reserved0 : 5;
xuint8 LogicalUnitNumber :3;
#else
xuint8 LogicalUnitNumber :3;
xuint8 Reserved0 : 5;
#endif
xuint8 LogicalBlockByte0;
xuint8 LogicalBlockByte1;
xuint8 LogicalBlockByte2;
xuint8 LogicalBlockByte3;
xuint8 TransferBlockByte0;
xuint8 TransferBlockByte1;
xuint8 TransferBlockByte2;
xuint8 TransferBlockByte3;
xuint8 SubCode;
xuint8 Control;
} PLXTR_READ_CDDA;
//
// NEC Read CD-DA
//
struct _NEC_READ_CDDA {
xuint8 OperationCode; // Unknown -- vendor-unique?
xuint8 Reserved0;
xuint8 LogicalBlockByte0;
xuint8 LogicalBlockByte1;
xuint8 LogicalBlockByte2;
xuint8 LogicalBlockByte3;
xuint8 Reserved1;
xuint8 TransferBlockByte0;
xuint8 TransferBlockByte1;
xuint8 Control;
} NEC_READ_CDDA;
//
// Mode sense
//
struct _MODE_SENSE {
xuint8 OperationCode; // 0x1A - SCSIOP_MODE_SENSE
#if defined(__LITTLE_ENDIAN_BITFIELD)
xuint8 Reserved1 : 3;
xuint8 Dbd : 1;
xuint8 Reserved2 : 1;
xuint8 LogicalUnitNumber : 3;
xuint8 PageCode : 6;
xuint8 Pc : 2;
#else
xuint8 LogicalUnitNumber : 3;
xuint8 Reserved2 : 1;
xuint8 Dbd : 1;
xuint8 Reserved1 : 3;
xuint8 Pc : 2;
xuint8 PageCode : 6;
#endif
xuint8 Reserved3;
xuint8 AllocationLength;
xuint8 Control;
} MODE_SENSE;
struct _MODE_SENSE10 {
xuint8 OperationCode; // 0x5A - SCSIOP_MODE_SENSE10
#if defined(__LITTLE_ENDIAN_BITFIELD)
xuint8 Reserved1 : 3;
xuint8 Dbd : 1;
xuint8 Reserved2 : 1;
xuint8 LogicalUnitNumber : 3;
xuint8 PageCode : 6;
xuint8 Pc : 2;
#else
xuint8 LogicalUnitNumber : 3;
xuint8 Reserved2 : 1;
xuint8 Dbd : 1;
xuint8 Reserved1 : 3;
xuint8 Pc : 2;
xuint8 PageCode : 6;
#endif
xuint8 Reserved3[4];
xuint8 AllocationLength[2];
xuint8 Control;
} MODE_SENSE10;
//
// Mode select
//
struct _MODE_SELECT {
xuint8 OperationCode; // 0x15 - SCSIOP_MODE_SELECT
#if defined(__LITTLE_ENDIAN_BITFIELD)
xuint8 SPBit : 1;
xuint8 Reserved1 : 3;
xuint8 PFBit : 1;
xuint8 LogicalUnitNumber : 3;
#else
xuint8 LogicalUnitNumber : 3;
xuint8 PFBit : 1;
xuint8 Reserved1 : 3;
xuint8 SPBit : 1;
#endif
xuint8 Reserved2[2];
xuint8 ParameterListLength;
xuint8 Control;
} MODE_SELECT;
struct _MODE_SELECT10 {
xuint8 OperationCode; // 0x55 - SCSIOP_MODE_SELECT10
#if defined(__LITTLE_ENDIAN_BITFIELD)
xuint8 SPBit : 1;
xuint8 Reserved1 : 3;
xuint8 PFBit : 1;
xuint8 LogicalUnitNumber : 3;
#else
xuint8 LogicalUnitNumber : 3;
xuint8 PFBit : 1;
xuint8 Reserved1 : 3;
xuint8 SPBit : 1;
#endif
xuint8 Reserved2[5];
xuint8 ParameterListLength[2];
xuint8 Control;
} MODE_SELECT10;
struct _LOCATE {
xuint8 OperationCode; // 0x2B - SCSIOP_LOCATE
#if defined(__LITTLE_ENDIAN_BITFIELD)
xuint8 Immediate : 1;
xuint8 CPBit : 1;
xuint8 BTBit : 1;
xuint8 Reserved1 : 2;
xuint8 LogicalUnitNumber : 3;
#else
xuint8 LogicalUnitNumber : 3;
xuint8 Reserved1 : 2;
xuint8 BTBit : 1;
xuint8 CPBit : 1;
xuint8 Immediate : 1;
#endif
xuint8 Reserved3;
xuint8 LogicalBlockAddress[4];
xuint8 Reserved4;
xuint8 Partition;
xuint8 Control;
} LOCATE;
struct _LOGSENSE {
xuint8 OperationCode; // 0x4D - SCSIOP_LOG_SENSE
#if defined(__LITTLE_ENDIAN_BITFIELD)
xuint8 SPBit : 1;
xuint8 PPCBit : 1;
xuint8 Reserved1 : 3;
xuint8 LogicalUnitNumber : 3;
xuint8 PageCode : 6;
xuint8 PCBit : 2;
#else
xuint8 LogicalUnitNumber : 3;
xuint8 Reserved1 : 3;
xuint8 PPCBit : 1;
xuint8 SPBit : 1;
xuint8 PCBit : 2;
xuint8 PageCode : 6;
#endif
xuint8 Reserved2;
xuint8 Reserved3;
xuint8 ParameterPointer[2];
xuint8 AllocationLength[2];
xuint8 Control;
} LOGSENSE;
struct _LOGSELECT {
xuint8 OperationCode; // 0x4C - SCSIOP_LOG_SELECT
#if defined(__LITTLE_ENDIAN_BITFIELD)
xuint8 SPBit : 1;
xuint8 PPCBit : 1;
xuint8 Reserved1 : 3;
xuint8 LogicalUnitNumber : 3;
xuint8 PageCode : 6;
xuint8 PCBit : 2;
#else
xuint8 LogicalUnitNumber : 3;
xuint8 Reserved1 : 3;
xuint8 PPCBit : 1;
xuint8 SPBit : 1;
xuint8 PCBit : 2;
xuint8 PageCode : 6;
#endif
xuint8 Reserved2[4];
xuint8 ParameterListLength[2];
xuint8 Control;
} LOGSELECT;
struct _PRINT {
xuint8 OperationCode; // 0x0A - SCSIOP_PRINT
#if defined(__LITTLE_ENDIAN_BITFIELD)
xuint8 Reserved : 5;
xuint8 LogicalUnitNumber : 3;
#else
xuint8 LogicalUnitNumber : 3;
xuint8 Reserved : 5;
#endif
xuint8 TransferLength[3];
xuint8 Control;
} PRINT;
struct _SEEK {
xuint8 OperationCode; // 0x2B - SCSIOP_SEEK
#if defined(__LITTLE_ENDIAN_BITFIELD)
xuint8 Reserved : 5;
xuint8 LogicalUnitNumber : 3;
#else
xuint8 LogicalUnitNumber : 3;
xuint8 Reserved : 5;
#endif
xuint8 LogicalBlockAddress[4];
xuint8 Reserved2[3];
xuint8 Control;
} SEEK;
struct _ERASE {
xuint8 OperationCode; // 0x19 - SCSIOP_ERASE
#if defined(__LITTLE_ENDIAN_BITFIELD)
xuint8 Long : 1;
xuint8 Immediate : 1;
xuint8 Reserved1 : 3;
xuint8 LogicalUnitNumber : 3;
#else
xuint8 LogicalUnitNumber : 3;
xuint8 Reserved1 : 3;
xuint8 Immediate : 1;
xuint8 Long : 1;
#endif
xuint8 Reserved2[3];
xuint8 Control;
} ERASE;
struct _START_STOP {
xuint8 OperationCode; // 0x1B - SCSIOP_START_STOP_UNIT
#if defined(__LITTLE_ENDIAN_BITFIELD)
xuint8 Immediate: 1;
xuint8 Reserved1 : 4;
xuint8 LogicalUnitNumber : 3;
#else
xuint8 LogicalUnitNumber : 3;
xuint8 Reserved1 : 4;
xuint8 Immediate: 1;
#endif
xuint8 Reserved2[2];
#if defined(__LITTLE_ENDIAN_BITFIELD)
xuint8 Start : 1;
xuint8 LoadEject : 1;
xuint8 Reserved3 : 6;
#else
xuint8 Reserved3 : 6;
xuint8 LoadEject : 1;
xuint8 Start : 1;
#endif
xuint8 Control;
} START_STOP;
struct _MEDIA_REMOVAL {
xuint8 OperationCode; // 0x1E - SCSIOP_MEDIUM_REMOVAL
#if defined(__LITTLE_ENDIAN_BITFIELD)
xuint8 Reserved1 : 5;
xuint8 LogicalUnitNumber : 3;
#else
xuint8 LogicalUnitNumber : 3;
xuint8 Reserved1 : 5;
#endif
xuint8 Reserved2[2];
#if defined(__LITTLE_ENDIAN_BITFIELD)
xuint8 Prevent : 1;
xuint8 Persistant : 1;
xuint8 Reserved3 : 6;
#else
xuint8 Persistant : 1;
xuint8 Reserved3 : 6;
xuint8 Prevent : 1;
#endif
xuint8 Control;
} MEDIA_REMOVAL;
//
// Tape CDBs
//
struct _SEEK_BLOCK {
xuint8 OperationCode; // 0x0C - SCSIOP_SEEK_BLOCK
#if defined(__LITTLE_ENDIAN_BITFIELD)
xuint8 Immediate : 1;
xuint8 Reserved1 : 7;
#else
xuint8 Reserved1 : 7;
xuint8 Immediate : 1;
#endif
xuint8 BlockAddress[3];
#if defined(__LITTLE_ENDIAN_BITFIELD)
xuint8 Link : 1;
xuint8 Flag : 1;
xuint8 Reserved2 : 4;
xuint8 VendorUnique : 2;
#else
xuint8 VendorUnique : 2;
xuint8 Reserved2 : 4;
xuint8 Flag : 1;
xuint8 Link : 1;
#endif
} SEEK_BLOCK;
struct _REQUEST_BLOCK_ADDRESS {
xuint8 OperationCode; // 0x02 - SCSIOP_REQUEST_BLOCK_ADDR
xuint8 Reserved1[3];
xuint8 AllocationLength;
#if defined(__LITTLE_ENDIAN_BITFIELD)
xuint8 Link : 1;
xuint8 Flag : 1;
xuint8 Reserved2 : 4;