4 * SCSI port and class interface.
6 * This file is part of the w32api package.
9 * Created by Casper S. Hornstrup <chorns@users.sourceforge.net>
11 * THIS SOFTWARE IS NOT COPYRIGHTED
13 * This source code is offered for use in the public domain. You may
14 * use, modify or distribute it freely.
16 * This code is distributed in the hope that it will be useful but
17 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
18 * DISCLAIMED. This includes but is not limited to warranties of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
34 UCHAR CommandUniqueBits
: 4;
35 UCHAR LogicalUnitNumber
: 3;
36 UCHAR CommandUniqueBytes
[3];
40 UCHAR VendorUnique
: 2;
41 } CDB6GENERIC
, *PCDB6GENERIC
;
43 struct _CDB6READWRITE
{
45 UCHAR LogicalBlockMsb1
: 5;
46 UCHAR LogicalUnitNumber
: 3;
47 UCHAR LogicalBlockMsb0
;
48 UCHAR LogicalBlockLsb
;
51 } CDB6READWRITE
, *PCDB6READWRITE
;
56 UCHAR LogicalUnitNumber
: 3;
59 UCHAR AllocationLength
;
61 } CDB6INQUIRY
, *PCDB6INQUIRY
;
63 struct _CDB6INQUIRY3
{
65 UCHAR EnableVitalProductData
: 1;
66 UCHAR CommandSupportData
: 1;
70 UCHAR AllocationLength
;
72 } CDB6INQUIRY3
, *PCDB6INQUIRY3
;
77 UCHAR ByteCompare
: 1;
80 UCHAR LogicalUnitNumber
: 3;
81 UCHAR VerificationLength
[3];
83 } CDB6VERIFY
, *PCDB6VERIFY
;
87 UCHAR FormatControl
: 5;
88 UCHAR LogicalUnitNumber
: 3;
93 } CDB6FORMAT
, *PCDB6FORMAT
;
97 UCHAR RelativeAddress
: 1;
99 UCHAR ForceUnitAccess
: 1;
100 UCHAR DisablePageOut
: 1;
101 UCHAR LogicalUnitNumber
: 3;
102 UCHAR LogicalBlockByte0
;
103 UCHAR LogicalBlockByte1
;
104 UCHAR LogicalBlockByte2
;
105 UCHAR LogicalBlockByte3
;
107 UCHAR TransferBlocksMsb
;
108 UCHAR TransferBlocksLsb
;
114 UCHAR RelativeAddress
: 1;
116 UCHAR ForceUnitAccess
: 1;
117 UCHAR DisablePageOut
: 1;
118 UCHAR LogicalUnitNumber
: 3;
119 UCHAR LogicalBlock
[4];
120 UCHAR TransferLength
[4];
128 UCHAR ForceUnitAccess
: 1;
129 UCHAR DisablePageOut
: 1;
130 UCHAR Protection
: 3;
131 UCHAR LogicalBlock
[8];
132 UCHAR TransferLength
[4];
137 struct _PAUSE_RESUME
{
140 UCHAR LogicalUnitNumber
: 3;
144 } PAUSE_RESUME
, *PPAUSE_RESUME
;
151 UCHAR LogicalUnitNumber
: 3;
156 UCHAR AllocationLength
[2];
159 } READ_TOC
, *PREAD_TOC
;
161 struct _READ_DISK_INFORMATION
{
166 UCHAR AllocationLength
[2];
168 } READ_DISK_INFORMATION
, *PREAD_DISK_INFORMATION
;
170 struct _READ_TRACK_INFORMATION
{
176 UCHAR BlockAddress
[4];
178 UCHAR AllocationLength
[2];
180 } READ_TRACK_INFORMATION
, *PREAD_TRACK_INFORMATION
;
182 struct _RESERVE_TRACK_RZONE
{
185 UCHAR ReservationSize
[4];
187 } RESERVE_TRACK_RZONE
, *PRESERVE_TRACK_RZONE
;
189 struct _SEND_OPC_INFORMATION
{
194 UCHAR ParameterListLength
[2];
196 } SEND_OPC_INFORMATION
, *PSEND_OPC_INFORMATION
;
198 struct _CLOSE_TRACK
{
206 UCHAR TrackNumber
[2];
209 } CLOSE_TRACK
, *PCLOSE_TRACK
;
211 struct _SEND_CUE_SHEET
{
214 UCHAR CueSheetSize
[3];
216 } SEND_CUE_SHEET
, *PSEND_CUE_SHEET
;
218 struct _READ_HEADER
{
224 UCHAR LogicalBlockAddress
[4];
226 UCHAR AllocationLength
[2];
228 } READ_HEADER
, *PREAD_HEADER
;
233 UCHAR LogicalUnitNumber
: 3;
234 UCHAR StartingBlockAddress
[4];
238 } PLAY_AUDIO
, *PPLAY_AUDIO
;
240 struct _PLAY_AUDIO_MSF
{
243 UCHAR LogicalUnitNumber
: 3;
252 } PLAY_AUDIO_MSF
, *PPLAY_AUDIO_MSF
;
254 /* FIXME: Should the union be anonymous in C++ too? If so,
255 can't define named types _LBA and _MSF within anonymous union
261 UCHAR ExpectedSectorType
: 3;
268 UCHAR StartingBlockAddress
[4];
295 } PLAY_CD
, *PPLAY_CD
;
299 UCHAR RelativeAddress
: 1;
303 UCHAR StartingAddress
[4];
309 } SCAN_CD
, *PSCAN_CD
;
311 struct _STOP_PLAY_SCAN
{
317 } STOP_PLAY_SCAN
, *PSTOP_PLAY_SCAN
;
324 UCHAR LogicalUnitNumber
: 3;
331 UCHAR AllocationLength
[2];
333 } SUBCHANNEL
, *PSUBCHANNEL
;
337 UCHAR RelativeAddress
: 1;
339 UCHAR ExpectedSectorType
: 3;
341 UCHAR StartingLBA
[4];
342 UCHAR TransferBlocks
[3];
344 UCHAR ErrorFlags
: 2;
345 UCHAR IncludeEDC
: 1;
346 UCHAR IncludeUserData
: 1;
347 UCHAR HeaderCode
: 2;
348 UCHAR IncludeSyncData
: 1;
349 UCHAR SubChannelSelection
: 3;
352 } READ_CD
, *PREAD_CD
;
354 struct _READ_CD_MSF
{
356 UCHAR RelativeAddress
: 1;
358 UCHAR ExpectedSectorType
: 3;
369 UCHAR ErrorFlags
: 2;
370 UCHAR IncludeEDC
: 1;
371 UCHAR IncludeUserData
: 1;
372 UCHAR HeaderCode
: 2;
373 UCHAR IncludeSyncData
: 1;
374 UCHAR SubChannelSelection
: 3;
377 } READ_CD_MSF
, *PREAD_CD_MSF
;
379 struct _PLXTR_READ_CDDA
{
382 UCHAR LogicalUnitNumber
: 3;
383 UCHAR LogicalBlockByte0
;
384 UCHAR LogicalBlockByte1
;
385 UCHAR LogicalBlockByte2
;
386 UCHAR LogicalBlockByte3
;
387 UCHAR TransferBlockByte0
;
388 UCHAR TransferBlockByte1
;
389 UCHAR TransferBlockByte2
;
390 UCHAR TransferBlockByte3
;
393 } PLXTR_READ_CDDA
, *PPLXTR_READ_CDDA
;
395 struct _NEC_READ_CDDA
{
398 UCHAR LogicalBlockByte0
;
399 UCHAR LogicalBlockByte1
;
400 UCHAR LogicalBlockByte2
;
401 UCHAR LogicalBlockByte3
;
403 UCHAR TransferBlockByte0
;
404 UCHAR TransferBlockByte1
;
406 } NEC_READ_CDDA
, *PNEC_READ_CDDA
;
413 UCHAR LogicalUnitNumber
: 3;
417 UCHAR AllocationLength
;
419 } MODE_SENSE
, *PMODE_SENSE
;
421 struct _MODE_SENSE10
{
426 UCHAR LogicalUnitNumber
: 3;
430 UCHAR AllocationLength
[2];
432 } MODE_SENSE10
, *PMODE_SENSE10
;
434 struct _MODE_SELECT
{
439 UCHAR LogicalUnitNumber
: 3;
441 UCHAR ParameterListLength
;
443 } MODE_SELECT
, *PMODE_SELECT
;
445 struct _MODE_SELECT10
{
450 UCHAR LogicalUnitNumber
: 3;
452 UCHAR ParameterListLength
[2];
454 } MODE_SELECT10
, *PMODE_SELECT10
;
462 UCHAR LogicalUnitNumber
: 3;
464 UCHAR LogicalBlockAddress
[4];
475 UCHAR LogicalUnitNumber
: 3;
480 UCHAR ParameterPointer
[2];
481 UCHAR AllocationLength
[2];
483 } LOGSENSE
, *PLOGSENSE
;
490 UCHAR LogicalUnitNumber
: 3;
494 UCHAR ParameterListLength
[2];
496 } LOGSELECT
, *PLOGSELECT
;
501 UCHAR LogicalUnitNumber
: 3;
502 UCHAR TransferLength
[3];
509 UCHAR LogicalUnitNumber
: 3;
510 UCHAR LogicalBlockAddress
[4];
520 UCHAR LogicalUnitNumber
: 3;
529 UCHAR LogicalUnitNumber
: 3;
535 } START_STOP
, *PSTART_STOP
;
537 struct _MEDIA_REMOVAL
{
540 UCHAR LogicalUnitNumber
: 3;
544 UCHAR Persistant
: 1;
548 } MEDIA_REMOVAL
, *PMEDIA_REMOVAL
;
554 UCHAR BlockAddress
[3];
558 UCHAR VendorUnique
: 2;
559 } SEEK_BLOCK
, *PSEEK_BLOCK
;
561 struct _REQUEST_BLOCK_ADDRESS
{
564 UCHAR AllocationLength
;
568 UCHAR VendorUnique
: 2;
569 } REQUEST_BLOCK_ADDRESS
, *PREQUEST_BLOCK_ADDRESS
;
575 UCHAR PartitionSelect
: 6;
578 } PARTITION
, *PPARTITION
;
580 struct _WRITE_TAPE_MARKS
{
583 UCHAR WriteSetMarks
: 1;
585 UCHAR LogicalUnitNumber
: 3;
586 UCHAR TransferLength
[3];
588 } WRITE_TAPE_MARKS
, *PWRITE_TAPE_MARKS
;
590 struct _SPACE_TAPE_MARKS
{
594 UCHAR LogicalUnitNumber
: 3;
604 UCHAR VendorUnique
: 2;
607 } SPACE_TAPE_MARKS
, *PSPACE_TAPE_MARKS
;
609 struct _READ_POSITION
{
616 } READ_POSITION
, *PREAD_POSITION
;
618 struct _CDB6READWRITETAPE
{
620 UCHAR VendorSpecific
: 5;
622 UCHAR TransferLenMSB
;
624 UCHAR TransferLenLSB
;
628 UCHAR VendorUnique
: 2;
629 } CDB6READWRITETAPE
, *PCDB6READWRITETAPE
;
631 struct _INIT_ELEMENT_STATUS
{
634 UCHAR LogicalUnitNubmer
: 3;
638 } INIT_ELEMENT_STATUS
, *PINIT_ELEMENT_STATUS
;
640 struct _INITIALIZE_ELEMENT_RANGE
{
644 UCHAR LogicalUnitNubmer
: 3;
645 UCHAR FirstElementAddress
[2];
647 UCHAR NumberOfElements
[2];
651 } INITIALIZE_ELEMENT_RANGE
, *PINITIALIZE_ELEMENT_RANGE
;
653 struct _POSITION_TO_ELEMENT
{
656 UCHAR LogicalUnitNumber
: 3;
657 UCHAR TransportElementAddress
[2];
658 UCHAR DestinationElementAddress
[2];
663 } POSITION_TO_ELEMENT
, *PPOSITION_TO_ELEMENT
;
665 struct _MOVE_MEDIUM
{
668 UCHAR LogicalUnitNumber
: 3;
669 UCHAR TransportElementAddress
[2];
670 UCHAR SourceElementAddress
[2];
671 UCHAR DestinationElementAddress
[2];
676 } MOVE_MEDIUM
, *PMOVE_MEDIUM
;
678 struct _EXCHANGE_MEDIUM
{
681 UCHAR LogicalUnitNumber
: 3;
682 UCHAR TransportElementAddress
[2];
683 UCHAR SourceElementAddress
[2];
684 UCHAR Destination1ElementAddress
[2];
685 UCHAR Destination2ElementAddress
[2];
690 } EXCHANGE_MEDIUM
, *PEXCHANGE_MEDIUM
;
692 struct _READ_ELEMENT_STATUS
{
694 UCHAR ElementType
: 4;
696 UCHAR LogicalUnitNumber
: 3;
697 UCHAR StartingElementAddress
[2];
698 UCHAR NumberOfElements
[2];
700 UCHAR AllocationLength
[3];
703 } READ_ELEMENT_STATUS
, *PREAD_ELEMENT_STATUS
;
705 struct _SEND_VOLUME_TAG
{
707 UCHAR ElementType
: 4;
709 UCHAR LogicalUnitNumber
: 3;
710 UCHAR StartingElementAddress
[2];
712 UCHAR ActionCode
: 5;
715 UCHAR ParameterListLength
[2];
718 } SEND_VOLUME_TAG
, *PSEND_VOLUME_TAG
;
720 struct _REQUEST_VOLUME_ELEMENT_ADDRESS
{
722 UCHAR ElementType
: 4;
724 UCHAR LogicalUnitNumber
: 3;
725 UCHAR StartingElementAddress
[2];
726 UCHAR NumberElements
[2];
728 UCHAR AllocationLength
[3];
731 } REQUEST_VOLUME_ELEMENT_ADDRESS
, *PREQUEST_VOLUME_ELEMENT_ADDRESS
;
733 struct _LOAD_UNLOAD
{
745 } LOAD_UNLOAD
, *PLOAD_UNLOAD
;
747 struct _MECH_STATUS
{
752 UCHAR AllocationLength
[2];
755 } MECH_STATUS
, *PMECH_STATUS
;
757 struct _SYNCHRONIZE_CACHE10
{
766 UCHAR LogicalBlockAddress
[4];
770 } SYNCHRONIZE_CACHE10
, *PSYNCHRONIZE_CACHE10
;
772 struct _GET_EVENT_STATUS_NOTIFICATION
{
780 UCHAR NotificationClassRequest
;
782 UCHAR EventListLength
[2];
785 } GET_EVENT_STATUS_NOTIFICATION
, *PGET_EVENT_STATUS_NOTIFICATION
;
787 struct _READ_DVD_STRUCTURE
{
791 UCHAR RMDBlockNumber
[4];
794 UCHAR AllocationLength
[2];
798 } READ_DVD_STRUCTURE
, *PREAD_DVD_STRUCTURE
;
800 struct _SEND_DVD_STRUCTURE
{
806 UCHAR ParameterListLength
[2];
809 } SEND_DVD_STRUCTURE
, *PSEND_DVD_STRUCTURE
;
816 UCHAR ParameterListLength
[2];
820 } SEND_KEY
, *PSEND_KEY
;
826 UCHAR LogicalBlockAddress
[4];
828 UCHAR AllocationLength
[2];
832 } REPORT_KEY
, *PREPORT_KEY
;
834 struct _SET_READ_AHEAD
{
839 UCHAR ReadAheadLBA
[4];
842 } SET_READ_AHEAD
, *PSET_READ_AHEAD
;
844 struct _READ_FORMATTED_CAPACITIES
{
849 UCHAR AllocationLength
[2];
851 } READ_FORMATTED_CAPACITIES
, *PREAD_FORMATTED_CAPACITIES
;
853 struct _REPORT_LUNS
{
856 UCHAR AllocationLength
[4];
859 } REPORT_LUNS
, *PREPORT_LUNS
;
861 struct _PERSISTENT_RESERVE_IN
{
863 UCHAR ServiceAction
: 5;
866 UCHAR AllocationLength
[2];
868 } PERSISTENT_RESERVE_IN
, *PPERSISTENT_RESERVE_IN
;
870 struct _PERSISTENT_RESERVE_OUT
{
872 UCHAR ServiceAction
: 5;
877 UCHAR ParameterListLength
[2];
879 } PERSISTENT_RESERVE_OUT
, *PPERSISTENT_RESERVE_OUT
;
881 struct _GET_CONFIGURATION
{
883 UCHAR RequestType
: 1;
885 UCHAR StartingFeature
[2];
887 UCHAR AllocationLength
[2];
889 } GET_CONFIGURATION
, *PGET_CONFIGURATION
;
891 struct _SET_CD_SPEED
{
898 } SET_CD_SPEED
, *PSET_CD_SPEED
;
904 #ifndef _INQUIRYDATA_DEFINED /* also in minitape.h */
905 #define _INQUIRYDATA_DEFINED
907 #define INQUIRYDATABUFFERSIZE 36
909 typedef struct _INQUIRYDATA
{
910 UCHAR DeviceType
: 5;
911 UCHAR DeviceTypeQualifier
: 3;
912 UCHAR DeviceTypeModifier
: 7;
913 UCHAR RemovableMedia
: 1;
914 _ANONYMOUS_UNION
union {
916 _ANONYMOUS_STRUCT
struct {
917 UCHAR ANSIVersion
: 3;
918 UCHAR ECMAVersion
: 3;
919 UCHAR ISOVersion
: 2;
922 UCHAR ResponseDataFormat
: 4;
925 UCHAR TerminateTask
: 1;
927 UCHAR AdditionalLength
;
932 UCHAR MediumChanger
: 1;
934 UCHAR ReservedBit2
: 1;
935 UCHAR EnclosureServices
: 1;
936 UCHAR ReservedBit3
: 1;
938 UCHAR CommandQueue
: 1;
939 UCHAR TransferDisable
: 1;
940 UCHAR LinkedCommands
: 1;
941 UCHAR Synchronous
: 1;
944 UCHAR RelativeAddressing
: 1;
947 UCHAR ProductRevisionLevel
[4];
948 UCHAR VendorSpecific
[20];
950 } INQUIRYDATA
, *PINQUIRYDATA
;
953 /* INQUIRYDATA.DeviceType constants */
954 #define DIRECT_ACCESS_DEVICE 0x00
955 #define SEQUENTIAL_ACCESS_DEVICE 0x01
956 #define PRINTER_DEVICE 0x02
957 #define PROCESSOR_DEVICE 0x03
958 #define WRITE_ONCE_READ_MULTIPLE_DEVICE 0x04
959 #define READ_ONLY_DIRECT_ACCESS_DEVICE 0x05
960 #define SCANNER_DEVICE 0x06
961 #define OPTICAL_DEVICE 0x07
962 #define MEDIUM_CHANGER 0x08
963 #define COMMUNICATION_DEVICE 0x09
964 #define LOGICAL_UNIT_NOT_PRESENT_DEVICE 0x7F
965 #define DEVICE_QUALIFIER_NOT_SUPPORTED 0x03
967 /* INQUIRYDATA.DeviceTypeQualifier constants */
968 #define DEVICE_CONNECTED 0x00
970 #define SCSISTAT_GOOD 0x00
971 #define SCSISTAT_CHECK_CONDITION 0x02
972 #define SCSISTAT_CONDITION_MET 0x04
973 #define SCSISTAT_BUSY 0x08
974 #define SCSISTAT_INTERMEDIATE 0x10
975 #define SCSISTAT_INTERMEDIATE_COND_MET 0x14
976 #define SCSISTAT_RESERVATION_CONFLICT 0x18
977 #define SCSISTAT_COMMAND_TERMINATED 0x22
978 #define SCSISTAT_QUEUE_FULL 0x28
980 /* Mode Sense/Select page constants */
981 #define MODE_PAGE_ERROR_RECOVERY 0x01
982 #define MODE_PAGE_DISCONNECT 0x02
983 #define MODE_PAGE_FORMAT_DEVICE 0x03
984 #define MODE_PAGE_RIGID_GEOMETRY 0x04
985 #define MODE_PAGE_FLEXIBILE 0x05
986 #define MODE_PAGE_WRITE_PARAMETERS 0x05
987 #define MODE_PAGE_VERIFY_ERROR 0x07
988 #define MODE_PAGE_CACHING 0x08
989 #define MODE_PAGE_PERIPHERAL 0x09
990 #define MODE_PAGE_CONTROL 0x0A
991 #define MODE_PAGE_MEDIUM_TYPES 0x0B
992 #define MODE_PAGE_NOTCH_PARTITION 0x0C
993 #define MODE_PAGE_CD_AUDIO_CONTROL 0x0E
994 #define MODE_PAGE_DATA_COMPRESS 0x0F
995 #define MODE_PAGE_DEVICE_CONFIG 0x10
996 #define MODE_PAGE_MEDIUM_PARTITION 0x11
997 #define MODE_PAGE_CDVD_FEATURE_SET 0x18
998 #define MODE_PAGE_POWER_CONDITION 0x1A
999 #define MODE_PAGE_FAULT_REPORTING 0x1C
1000 #define MODE_PAGE_CDVD_INACTIVITY 0x1D
1001 #define MODE_PAGE_ELEMENT_ADDRESS 0x1D
1002 #define MODE_PAGE_TRANSPORT_GEOMETRY 0x1E
1003 #define MODE_PAGE_DEVICE_CAPABILITIES 0x1F
1004 #define MODE_PAGE_CAPABILITIES 0x2A
1005 #define MODE_SENSE_RETURN_ALL 0x3f
1006 #define MODE_SENSE_CURRENT_VALUES 0x00
1007 #define MODE_SENSE_CHANGEABLE_VALUES 0x40
1008 #define MODE_SENSE_DEFAULT_VAULES 0x80
1009 #define MODE_SENSE_SAVED_VALUES 0xc0
1011 /* SCSI CDB operation codes */
1012 #define SCSIOP_TEST_UNIT_READY 0x00
1013 #define SCSIOP_REZERO_UNIT 0x01
1014 #define SCSIOP_REWIND 0x01
1015 #define SCSIOP_REQUEST_BLOCK_ADDR 0x02
1016 #define SCSIOP_REQUEST_SENSE 0x03
1017 #define SCSIOP_FORMAT_UNIT 0x04
1018 #define SCSIOP_READ_BLOCK_LIMITS 0x05
1019 #define SCSIOP_REASSIGN_BLOCKS 0x07
1020 #define SCSIOP_INIT_ELEMENT_STATUS 0x07
1021 #define SCSIOP_READ6 0x08
1022 #define SCSIOP_RECEIVE 0x08
1023 #define SCSIOP_WRITE6 0x0A
1024 #define SCSIOP_PRINT 0x0A
1025 #define SCSIOP_SEND 0x0A
1026 #define SCSIOP_SEEK6 0x0B
1027 #define SCSIOP_TRACK_SELECT 0x0B
1028 #define SCSIOP_SLEW_PRINT 0x0B
1029 #define SCSIOP_SEEK_BLOCK 0x0C
1030 #define SCSIOP_PARTITION 0x0D
1031 #define SCSIOP_READ_REVERSE 0x0F
1032 #define SCSIOP_WRITE_FILEMARKS 0x10
1033 #define SCSIOP_FLUSH_BUFFER 0x10
1034 #define SCSIOP_SPACE 0x11
1035 #define SCSIOP_INQUIRY 0x12
1036 #define SCSIOP_VERIFY6 0x13
1037 #define SCSIOP_RECOVER_BUF_DATA 0x14
1038 #define SCSIOP_MODE_SELECT 0x15
1039 #define SCSIOP_RESERVE_UNIT 0x16
1040 #define SCSIOP_RELEASE_UNIT 0x17
1041 #define SCSIOP_COPY 0x18
1042 #define SCSIOP_ERASE 0x19
1043 #define SCSIOP_MODE_SENSE 0x1A
1044 #define SCSIOP_START_STOP_UNIT 0x1B
1045 #define SCSIOP_STOP_PRINT 0x1B
1046 #define SCSIOP_LOAD_UNLOAD 0x1B
1047 #define SCSIOP_RECEIVE_DIAGNOSTIC 0x1C
1048 #define SCSIOP_SEND_DIAGNOSTIC 0x1D
1049 #define SCSIOP_MEDIUM_REMOVAL 0x1E
1051 #define SCSIOP_READ_FORMATTED_CAPACITY 0x23
1052 #define SCSIOP_READ_CAPACITY 0x25
1053 #define SCSIOP_READ 0x28
1054 #define SCSIOP_WRITE 0x2A
1055 #define SCSIOP_SEEK 0x2B
1056 #define SCSIOP_LOCATE 0x2B
1057 #define SCSIOP_POSITION_TO_ELEMENT 0x2B
1058 #define SCSIOP_WRITE_VERIFY 0x2E
1059 #define SCSIOP_VERIFY 0x2F
1060 #define SCSIOP_SEARCH_DATA_HIGH 0x30
1061 #define SCSIOP_SEARCH_DATA_EQUAL 0x31
1062 #define SCSIOP_SEARCH_DATA_LOW 0x32
1063 #define SCSIOP_SET_LIMITS 0x33
1064 #define SCSIOP_READ_POSITION 0x34
1065 #define SCSIOP_SYNCHRONIZE_CACHE 0x35
1066 #define SCSIOP_COMPARE 0x39
1067 #define SCSIOP_COPY_COMPARE 0x3A
1068 #define SCSIOP_WRITE_DATA_BUFF 0x3B
1069 #define SCSIOP_READ_DATA_BUFF 0x3C
1070 #define SCSIOP_CHANGE_DEFINITION 0x40
1071 #define SCSIOP_READ_SUB_CHANNEL 0x42
1072 #define SCSIOP_READ_TOC 0x43
1073 #define SCSIOP_READ_HEADER 0x44
1074 #define SCSIOP_PLAY_AUDIO 0x45
1075 #define SCSIOP_GET_CONFIGURATION 0x46
1076 #define SCSIOP_PLAY_AUDIO_MSF 0x47
1077 #define SCSIOP_PLAY_TRACK_INDEX 0x48
1078 #define SCSIOP_PLAY_TRACK_RELATIVE 0x49
1079 #define SCSIOP_GET_EVENT_STATUS 0x4A
1080 #define SCSIOP_PAUSE_RESUME 0x4B
1081 #define SCSIOP_LOG_SELECT 0x4C
1082 #define SCSIOP_LOG_SENSE 0x4D
1083 #define SCSIOP_STOP_PLAY_SCAN 0x4E
1084 #define SCSIOP_READ_DISK_INFORMATION 0x51
1085 #define SCSIOP_READ_TRACK_INFORMATION 0x52
1086 #define SCSIOP_RESERVE_TRACK_RZONE 0x53
1087 #define SCSIOP_SEND_OPC_INFORMATION 0x54
1088 #define SCSIOP_MODE_SELECT10 0x55
1089 #define SCSIOP_MODE_SENSE10 0x5A
1090 #define SCSIOP_CLOSE_TRACK_SESSION 0x5B
1091 #define SCSIOP_READ_BUFFER_CAPACITY 0x5C
1092 #define SCSIOP_SEND_CUE_SHEET 0x5D
1093 #define SCSIOP_PERSISTENT_RESERVE_IN 0x5E
1094 #define SCSIOP_PERSISTENT_RESERVE_OUT 0x5F
1096 #define SCSIOP_REPORT_LUNS 0xA0
1097 #define SCSIOP_BLANK 0xA1
1098 #define SCSIOP_SEND_KEY 0xA3
1099 #define SCSIOP_REPORT_KEY 0xA4
1100 #define SCSIOP_MOVE_MEDIUM 0xA5
1101 #define SCSIOP_LOAD_UNLOAD_SLOT 0xA6
1102 #define SCSIOP_EXCHANGE_MEDIUM 0xA6
1103 #define SCSIOP_SET_READ_AHEAD 0xA7
1104 #define SCSIOP_READ_DVD_STRUCTURE 0xAD
1105 #define SCSIOP_REQUEST_VOL_ELEMENT 0xB5
1106 #define SCSIOP_SEND_VOLUME_TAG 0xB6
1107 #define SCSIOP_READ_ELEMENT_STATUS 0xB8
1108 #define SCSIOP_READ_CD_MSF 0xB9
1109 #define SCSIOP_SCAN_CD 0xBA
1110 #define SCSIOP_SET_CD_SPEED 0xBB
1111 #define SCSIOP_PLAY_CD 0xBC
1112 #define SCSIOP_MECHANISM_STATUS 0xBD
1113 #define SCSIOP_READ_CD 0xBE
1114 #define SCSIOP_SEND_DVD_STRUCTURE 0xBF
1115 #define SCSIOP_INIT_ELEMENT_RANGE 0xE7
1117 #define SCSIOP_DENON_EJECT_DISC 0xE6
1118 #define SCSIOP_DENON_STOP_AUDIO 0xE7
1119 #define SCSIOP_DENON_PLAY_AUDIO 0xE8
1120 #define SCSIOP_DENON_READ_TOC 0xE9
1121 #define SCSIOP_DENON_READ_SUBCODE 0xEB
1123 #define SCSIMESS_MODIFY_DATA_POINTER 0x00
1124 #define SCSIMESS_SYNCHRONOUS_DATA_REQ 0x01
1125 #define SCSIMESS_WIDE_DATA_REQUEST 0x03
1127 #define SCSIMESS_MODIFY_DATA_LENGTH 5
1128 #define SCSIMESS_SYNCH_DATA_LENGTH 3
1129 #define SCSIMESS_WIDE_DATA_LENGTH 2
1131 #define SCSIMESS_ABORT 0x06
1132 #define SCSIMESS_ABORT_WITH_TAG 0x0D
1133 #define SCSIMESS_BUS_DEVICE_RESET 0x0C
1134 #define SCSIMESS_CLEAR_QUEUE 0x0E
1135 #define SCSIMESS_COMMAND_COMPLETE 0x00
1136 #define SCSIMESS_DISCONNECT 0x04
1137 #define SCSIMESS_EXTENDED_MESSAGE 0x01
1138 #define SCSIMESS_IDENTIFY 0x80
1139 #define SCSIMESS_IDENTIFY_WITH_DISCON 0xC0
1140 #define SCSIMESS_IGNORE_WIDE_RESIDUE 0x23
1141 #define SCSIMESS_INITIATE_RECOVERY 0x0F
1142 #define SCSIMESS_INIT_DETECTED_ERROR 0x05
1143 #define SCSIMESS_LINK_CMD_COMP 0x0A
1144 #define SCSIMESS_LINK_CMD_COMP_W_FLAG 0x0B
1145 #define SCSIMESS_MESS_PARITY_ERROR 0x09
1146 #define SCSIMESS_MESSAGE_REJECT 0x07
1147 #define SCSIMESS_NO_OPERATION 0x08
1148 #define SCSIMESS_HEAD_OF_QUEUE_TAG 0x21
1149 #define SCSIMESS_ORDERED_QUEUE_TAG 0x22
1150 #define SCSIMESS_SIMPLE_QUEUE_TAG 0x20
1151 #define SCSIMESS_RELEASE_RECOVERY 0x10
1152 #define SCSIMESS_RESTORE_POINTERS 0x03
1153 #define SCSIMESS_SAVE_DATA_POINTER 0x02
1154 #define SCSIMESS_TERMINATE_IO_PROCESS 0x11
1156 #define CDB_FORCE_MEDIA_ACCESS 0x08
1158 #define CDB_RETURN_ON_COMPLETION 0
1159 #define CDB_RETURN_IMMEDIATE 1
1161 #define CDB_INQUIRY_EVPD 0x01
1163 #define LUN0_FORMAT_SAVING_DEFECT_LIST 0
1164 #define USE_DEFAULTMSB 0
1165 #define USE_DEFAULTLSB 0
1167 #define START_UNIT_CODE 0x01
1168 #define STOP_UNIT_CODE 0x00
1170 typedef struct _SENSE_DATA
{
1171 UCHAR ErrorCode
: 7;
1173 UCHAR SegmentNumber
;
1176 UCHAR IncorrectLength
: 1;
1177 UCHAR EndOfMedia
: 1;
1179 UCHAR Information
[4];
1180 UCHAR AdditionalSenseLength
;
1181 UCHAR CommandSpecificInformation
[4];
1182 UCHAR AdditionalSenseCode
;
1183 UCHAR AdditionalSenseCodeQualifier
;
1184 UCHAR FieldReplaceableUnitCode
;
1185 UCHAR SenseKeySpecific
[3];
1186 } SENSE_DATA
, *PSENSE_DATA
;
1188 #define SENSE_BUFFER_SIZE 18
1191 #define SCSI_SENSE_NO_SENSE 0x00
1192 #define SCSI_SENSE_RECOVERED_ERROR 0x01
1193 #define SCSI_SENSE_NOT_READY 0x02
1194 #define SCSI_SENSE_MEDIUM_ERROR 0x03
1195 #define SCSI_SENSE_HARDWARE_ERROR 0x04
1196 #define SCSI_SENSE_ILLEGAL_REQUEST 0x05
1197 #define SCSI_SENSE_UNIT_ATTENTION 0x06
1198 #define SCSI_SENSE_DATA_PROTECT 0x07
1199 #define SCSI_SENSE_BLANK_CHECK 0x08
1200 #define SCSI_SENSE_UNIQUE 0x09
1201 #define SCSI_SENSE_COPY_ABORTED 0x0A
1202 #define SCSI_SENSE_ABORTED_COMMAND 0x0B
1203 #define SCSI_SENSE_EQUAL 0x0C
1204 #define SCSI_SENSE_VOL_OVERFLOW 0x0D
1205 #define SCSI_SENSE_MISCOMPARE 0x0E
1206 #define SCSI_SENSE_RESERVED 0x0F
1208 /* Additional tape bit */
1209 #define SCSI_ILLEGAL_LENGTH 0x20
1210 #define SCSI_EOM 0x40
1211 #define SCSI_FILE_MARK 0x80
1213 /* Additional Sense codes */
1214 #define SCSI_ADSENSE_NO_SENSE 0x00
1215 #define SCSI_ADSENSE_NO_SEEK_COMPLETE 0x02
1216 #define SCSI_ADSENSE_LUN_NOT_READY 0x04
1217 #define SCSI_ADSENSE_WRITE_ERROR 0x0C
1218 #define SCSI_ADSENSE_TRACK_ERROR 0x14
1219 #define SCSI_ADSENSE_SEEK_ERROR 0x15
1220 #define SCSI_ADSENSE_REC_DATA_NOECC 0x17
1221 #define SCSI_ADSENSE_REC_DATA_ECC 0x18
1222 #define SCSI_ADSENSE_ILLEGAL_COMMAND 0x20
1223 #define SCSI_ADSENSE_ILLEGAL_BLOCK 0x21
1224 #define SCSI_ADSENSE_INVALID_CDB 0x24
1225 #define SCSI_ADSENSE_INVALID_LUN 0x25
1226 #define SCSI_ADSENSE_WRITE_PROTECT 0x27
1227 #define SCSI_ADSENSE_MEDIUM_CHANGED 0x28
1228 #define SCSI_ADSENSE_BUS_RESET 0x29
1229 #define SCSI_ADSENSE_INSUFFICIENT_TIME_FOR_OPERATION 0x2E
1230 #define SCSI_ADSENSE_INVALID_MEDIA 0x30
1231 #define SCSI_ADSENSE_NO_MEDIA_IN_DEVICE 0x3a
1232 #define SCSI_ADSENSE_POSITION_ERROR 0x3b
1233 #define SCSI_ADSENSE_OPERATOR_REQUEST 0x5a
1234 #define SCSI_ADSENSE_FAILURE_PREDICTION_THRESHOLD_EXCEEDED 0x5d
1235 #define SCSI_ADSENSE_ILLEGAL_MODE_FOR_THIS_TRACK 0x64
1236 #define SCSI_ADSENSE_COPY_PROTECTION_FAILURE 0x6f
1237 #define SCSI_ADSENSE_POWER_CALIBRATION_ERROR 0x73
1238 #define SCSI_ADSENSE_VENDOR_UNIQUE 0x80
1239 #define SCSI_ADSENSE_MUSIC_AREA 0xA0
1240 #define SCSI_ADSENSE_DATA_AREA 0xA1
1241 #define SCSI_ADSENSE_VOLUME_OVERFLOW 0xA7
1243 #define SCSI_SENSEQ_CAUSE_NOT_REPORTABLE 0x00
1244 #define SCSI_SENSEQ_BECOMING_READY 0x01
1245 #define SCSI_SENSEQ_INIT_COMMAND_REQUIRED 0x02
1246 #define SCSI_SENSEQ_MANUAL_INTERVENTION_REQUIRED 0x03
1247 #define SCSI_SENSEQ_FORMAT_IN_PROGRESS 0x04
1248 #define SCSI_SENSEQ_REBUILD_IN_PROGRESS 0x05
1249 #define SCSI_SENSEQ_RECALCULATION_IN_PROGRESS 0x06
1250 #define SCSI_SENSEQ_OPERATION_IN_PROGRESS 0x07
1251 #define SCSI_SENSEQ_LONG_WRITE_IN_PROGRESS 0x08
1252 #define SCSI_SENSEQ_LOSS_OF_STREAMING 0x09
1253 #define SCSI_SENSEQ_PADDING_BLOCKS_ADDED 0x0A
1256 #define FILE_DEVICE_SCSI 0x0000001b
1258 #define IOCTL_SCSI_EXECUTE_IN ((FILE_DEVICE_SCSI << 16) + 0x0011)
1259 #define IOCTL_SCSI_EXECUTE_OUT ((FILE_DEVICE_SCSI << 16) + 0x0012)
1260 #define IOCTL_SCSI_EXECUTE_NONE ((FILE_DEVICE_SCSI << 16) + 0x0013)
1262 /* SMART support in ATAPI */
1263 #define IOCTL_SCSI_MINIPORT_SMART_VERSION ((FILE_DEVICE_SCSI << 16) + 0x0500)
1264 #define IOCTL_SCSI_MINIPORT_IDENTIFY ((FILE_DEVICE_SCSI << 16) + 0x0501)
1265 #define IOCTL_SCSI_MINIPORT_READ_SMART_ATTRIBS ((FILE_DEVICE_SCSI << 16) + 0x0502)
1266 #define IOCTL_SCSI_MINIPORT_READ_SMART_THRESHOLDS ((FILE_DEVICE_SCSI << 16) + 0x0503)
1267 #define IOCTL_SCSI_MINIPORT_ENABLE_SMART ((FILE_DEVICE_SCSI << 16) + 0x0504)
1268 #define IOCTL_SCSI_MINIPORT_DISABLE_SMART ((FILE_DEVICE_SCSI << 16) + 0x0505)
1269 #define IOCTL_SCSI_MINIPORT_RETURN_STATUS ((FILE_DEVICE_SCSI << 16) + 0x0506)
1270 #define IOCTL_SCSI_MINIPORT_ENABLE_DISABLE_AUTOSAVE ((FILE_DEVICE_SCSI << 16) + 0x0507)
1271 #define IOCTL_SCSI_MINIPORT_SAVE_ATTRIBUTE_VALUES ((FILE_DEVICE_SCSI << 16) + 0x0508)
1272 #define IOCTL_SCSI_MINIPORT_EXECUTE_OFFLINE_DIAGS ((FILE_DEVICE_SCSI << 16) + 0x0509)
1273 #define IOCTL_SCSI_MINIPORT_ENABLE_DISABLE_AUTO_OFFLINE ((FILE_DEVICE_SCSI << 16) + 0x050a)
1274 #define IOCTL_SCSI_MINIPORT_READ_SMART_LOG ((FILE_DEVICE_SCSI << 16) + 0x050b)
1275 #define IOCTL_SCSI_MINIPORT_WRITE_SMART_LOG ((FILE_DEVICE_SCSI << 16) + 0x050c)
1277 /* CLUSTER support */
1278 #define IOCTL_SCSI_MINIPORT_NOT_QUORUM_CAPABLE ((FILE_DEVICE_SCSI << 16) + 0x0520)
1279 #define IOCTL_SCSI_MINIPORT_NOT_CLUSTER_CAPABLE ((FILE_DEVICE_SCSI << 16) + 0x0521)
1281 /* Read Capacity Data. Returned in Big Endian format */
1282 typedef struct _READ_CAPACITY_DATA
{
1283 ULONG LogicalBlockAddress
;
1284 ULONG BytesPerBlock
;
1285 } READ_CAPACITY_DATA
, *PREAD_CAPACITY_DATA
;
1287 /* Read Block Limits Data. Returned in Big Endian format */
1288 typedef struct _READ_BLOCK_LIMITS
{
1290 UCHAR BlockMaximumSize
[3];
1291 UCHAR BlockMinimumSize
[2];
1292 } READ_BLOCK_LIMITS_DATA
, *PREAD_BLOCK_LIMITS_DATA
;
1294 #define MODE_BLOCK_DESC_LENGTH 8
1295 #define MODE_HEADER_LENGTH 4
1296 #define MODE_HEADER_LENGTH10 8
1298 typedef struct _MODE_PARAMETER_HEADER
{
1299 UCHAR ModeDataLength
;
1301 UCHAR DeviceSpecificParameter
;
1302 UCHAR BlockDescriptorLength
;
1303 } MODE_PARAMETER_HEADER
, *PMODE_PARAMETER_HEADER
;
1305 typedef struct _MODE_PARAMETER_HEADER10
{
1306 UCHAR ModeDataLength
[2];
1308 UCHAR DeviceSpecificParameter
;
1310 UCHAR BlockDescriptorLength
[2];
1311 } MODE_PARAMETER_HEADER10
, *PMODE_PARAMETER_HEADER10
;
1313 #define MODE_FD_SINGLE_SIDE 0x01
1314 #define MODE_FD_DOUBLE_SIDE 0x02
1315 #define MODE_FD_MAXIMUM_TYPE 0x1E
1316 #define MODE_DSP_FUA_SUPPORTED 0x10
1317 #define MODE_DSP_WRITE_PROTECT 0x80
1319 typedef struct _MODE_PARAMETER_BLOCK
{
1321 UCHAR NumberOfBlocks
[3];
1323 UCHAR BlockLength
[3];
1324 } MODE_PARAMETER_BLOCK
, *PMODE_PARAMETER_BLOCK
;
1326 typedef struct _MODE_DISCONNECT_PAGE
{
1329 UCHAR PageSavable
: 1;
1331 UCHAR BufferFullRatio
;
1332 UCHAR BufferEmptyRatio
;
1333 UCHAR BusInactivityLimit
[2];
1334 UCHAR BusDisconnectTime
[2];
1335 UCHAR BusConnectTime
[2];
1336 UCHAR MaximumBurstSize
[2];
1337 UCHAR DataTransferDisconnect
: 2;
1339 } MODE_DISCONNECT_PAGE
, *PMODE_DISCONNECT_PAGE
;
1341 typedef struct _MODE_CACHING_PAGE
{
1344 UCHAR PageSavable
: 1;
1346 UCHAR ReadDisableCache
: 1;
1347 UCHAR MultiplicationFactor
: 1;
1348 UCHAR WriteCacheEnable
: 1;
1349 UCHAR Reserved2
: 5;
1350 UCHAR WriteRetensionPriority
: 4;
1351 UCHAR ReadRetensionPriority
: 4;
1352 UCHAR DisablePrefetchTransfer
[2];
1353 UCHAR MinimumPrefetch
[2];
1354 UCHAR MaximumPrefetch
[2];
1355 UCHAR MaximumPrefetchCeiling
[2];
1356 } MODE_CACHING_PAGE
, *PMODE_CACHING_PAGE
;
1358 typedef struct _MODE_CDROM_WRITE_PARAMETERS_PAGE
{
1360 UCHAR WriteType
: 4;
1361 UCHAR TestWrite
: 1;
1362 UCHAR LinkSizeValid
: 1;
1363 UCHAR BufferUnderrunFreeEnabled
: 1;
1364 UCHAR Reserved2
: 1;
1365 UCHAR TrackMode
: 4;
1367 UCHAR FixedPacket
: 1;
1368 UCHAR MultiSession
: 2;
1369 UCHAR DataBlockType
: 4;
1370 UCHAR Reserved3
: 4;
1373 UCHAR HostApplicationCode
: 6;
1374 UCHAR Reserved5
: 2;
1375 UCHAR SessionFormat
;
1377 UCHAR PacketSize
[4];
1378 UCHAR AudioPauseLength
[2];
1379 UCHAR Reserved7
: 7;
1380 UCHAR MediaCatalogNumberValid
: 1;
1381 UCHAR MediaCatalogNumber
[13];
1382 UCHAR MediaCatalogNumberZero
;
1383 UCHAR MediaCatalogNumberAFrame
;
1384 UCHAR Reserved8
: 7;
1385 UCHAR ISRCValid
: 1;
1386 UCHAR ISRCCountry
[2];
1388 UCHAR ISRCRecordingYear
[2];
1389 UCHAR ISRCSerialNumber
[5];
1393 UCHAR SubHeaderData
[4];
1394 } MODE_CDROM_WRITE_PARAMETERS_PAGE
, *PMODE_CDROM_WRITE_PARAMETERS_PAGE
;
1396 typedef struct _MODE_FLEXIBLE_DISK_PAGE
{
1399 UCHAR PageSavable
: 1;
1401 UCHAR TransferRate
[2];
1402 UCHAR NumberOfHeads
;
1403 UCHAR SectorsPerTrack
;
1404 UCHAR BytesPerSector
[2];
1405 UCHAR NumberOfCylinders
[2];
1406 UCHAR StartWritePrecom
[2];
1407 UCHAR StartReducedCurrent
[2];
1409 UCHAR StepPluseWidth
;
1410 UCHAR HeadSettleDelay
[2];
1412 UCHAR MotorOffDelay
;
1413 UCHAR Reserved2
: 5;
1414 UCHAR MotorOnAsserted
: 1;
1415 UCHAR StartSectorNumber
: 1;
1416 UCHAR TrueReadySignal
: 1;
1417 UCHAR StepPlusePerCyclynder
: 4;
1418 UCHAR Reserved3
: 4;
1419 UCHAR WriteCompenstation
;
1420 UCHAR HeadLoadDelay
;
1421 UCHAR HeadUnloadDelay
;
1422 UCHAR Pin2Usage
: 4;
1423 UCHAR Pin34Usage
: 4;
1424 UCHAR Pin1Usage
: 4;
1425 UCHAR Pin4Usage
: 4;
1426 UCHAR MediumRotationRate
[2];
1428 } MODE_FLEXIBLE_DISK_PAGE
, *PMODE_FLEXIBLE_DISK_PAGE
;
1430 typedef struct _MODE_FORMAT_PAGE
{
1433 UCHAR PageSavable
: 1;
1435 UCHAR TracksPerZone
[2];
1436 UCHAR AlternateSectorsPerZone
[2];
1437 UCHAR AlternateTracksPerZone
[2];
1438 UCHAR AlternateTracksPerLogicalUnit
[2];
1439 UCHAR SectorsPerTrack
[2];
1440 UCHAR BytesPerPhysicalSector
[2];
1441 UCHAR Interleave
[2];
1442 UCHAR TrackSkewFactor
[2];
1443 UCHAR CylinderSkewFactor
[2];
1444 UCHAR Reserved2
: 4;
1445 UCHAR SurfaceFirst
: 1;
1446 UCHAR RemovableMedia
: 1;
1447 UCHAR HardSectorFormating
: 1;
1448 UCHAR SoftSectorFormating
: 1;
1450 } MODE_FORMAT_PAGE
, *PMODE_FORMAT_PAGE
;
1452 typedef struct _MODE_RIGID_GEOMETRY_PAGE
{
1455 UCHAR PageSavable
: 1;
1457 UCHAR NumberOfCylinders
[3];
1458 UCHAR NumberOfHeads
;
1459 UCHAR StartWritePrecom
[3];
1460 UCHAR StartReducedCurrent
[3];
1461 UCHAR DriveStepRate
[2];
1462 UCHAR LandZoneCyclinder
[3];
1463 UCHAR RotationalPositionLock
: 2;
1464 UCHAR Reserved2
: 6;
1465 UCHAR RotationOffset
;
1467 UCHAR RoataionRate
[2];
1469 } MODE_RIGID_GEOMETRY_PAGE
, *PMODE_RIGID_GEOMETRY_PAGE
;
1471 typedef struct _MODE_READ_WRITE_RECOVERY_PAGE
{
1473 UCHAR Reserved1
: 1;
1484 UCHAR ReadRetryCount
;
1486 UCHAR WriteRetryCount
;
1488 } MODE_READ_WRITE_RECOVERY_PAGE
, *PMODE_READ_WRITE_RECOVERY_PAGE
;
1490 typedef struct _MODE_READ_RECOVERY_PAGE
{
1492 UCHAR Reserved1
: 1;
1498 UCHAR Reserved2
: 1;
1501 UCHAR Reserved3
: 2;
1502 UCHAR ReadRetryCount
;
1504 } MODE_READ_RECOVERY_PAGE
, *PMODE_READ_RECOVERY_PAGE
;
1506 typedef struct _MODE_INFO_EXCEPTIONS
{
1508 UCHAR Reserved1
: 1;
1511 _ANONYMOUS_UNION
union {
1513 _ANONYMOUS_STRUCT
struct {
1515 UCHAR Reserved2
: 1;
1518 UCHAR Reserved3
: 3;
1522 UCHAR ReportMethod
: 4;
1523 UCHAR Reserved4
: 4;
1524 UCHAR IntervalTimer
[4];
1525 UCHAR ReportCount
[4];
1526 } MODE_INFO_EXCEPTIONS
, *PMODE_INFO_EXCEPTIONS
;
1528 /* CDROM audio control */
1529 #define CDB_AUDIO_PAUSE 0x00
1530 #define CDB_AUDIO_RESUME 0x01
1531 #define CDB_DEVICE_START 0x11
1532 #define CDB_DEVICE_STOP 0x10
1533 #define CDB_EJECT_MEDIA 0x10
1534 #define CDB_LOAD_MEDIA 0x01
1535 #define CDB_SUBCHANNEL_HEADER 0x00
1536 #define CDB_SUBCHANNEL_BLOCK 0x01
1538 #define CDROM_AUDIO_CONTROL_PAGE 0x0E
1539 #define MODE_SELECT_IMMEDIATE 0x04
1540 #define MODE_SELECT_PFBIT 0x10
1542 #define CDB_USE_MSF 0x01
1544 typedef struct _PORT_OUTPUT
{
1545 UCHAR ChannelSelection
;
1547 } PORT_OUTPUT
, *PPORT_OUTPUT
;
1549 typedef struct _AUDIO_OUTPUT
{
1551 UCHAR ParameterLength
;
1555 UCHAR LogicalBlocksPerSecond
[2];
1556 PORT_OUTPUT PortOutput
[4];
1557 } AUDIO_OUTPUT
, *PAUDIO_OUTPUT
;
1559 /* Multisession CDROMs */
1560 #define GET_LAST_SESSION 0x01
1561 #define GET_SESSION_DATA 0x02;
1563 /* Atapi 2.5 changers */
1564 typedef struct _MECHANICAL_STATUS_INFORMATION_HEADER
{
1565 UCHAR CurrentSlot
: 5;
1566 UCHAR ChangerState
: 2;
1569 UCHAR MechanismState
: 3;
1570 UCHAR CurrentLogicalBlockAddress
[3];
1571 UCHAR NumberAvailableSlots
;
1572 UCHAR SlotTableLength
[2];
1573 } MECHANICAL_STATUS_INFORMATION_HEADER
, *PMECHANICAL_STATUS_INFORMATION_HEADER
;
1575 typedef struct _SLOT_TABLE_INFORMATION
{
1576 UCHAR DiscChanged
: 1;
1578 UCHAR DiscPresent
: 1;
1580 } SLOT_TABLE_INFORMATION
, *PSLOT_TABLE_INFORMATION
;
1582 typedef struct _MECHANICAL_STATUS
{
1583 MECHANICAL_STATUS_INFORMATION_HEADER MechanicalStatusHeader
;
1584 SLOT_TABLE_INFORMATION SlotTableInfo
[1];
1585 } MECHANICAL_STATUS
, *PMECHANICAL_STATUS
;
1588 /* Tape definitions */
1589 typedef struct _TAPE_POSITION_DATA
{
1590 UCHAR Reserved1
: 2;
1591 UCHAR BlockPositionUnsupported
: 1;
1592 UCHAR Reserved2
: 3;
1593 UCHAR EndOfPartition
: 1;
1594 UCHAR BeginningOfPartition
: 1;
1595 UCHAR PartitionNumber
;
1597 UCHAR FirstBlock
[4];
1600 UCHAR NumberOfBlocks
[3];
1601 UCHAR NumberOfBytes
[4];
1602 } TAPE_POSITION_DATA
, *PTAPE_POSITION_DATA
;
1604 /* This structure is used to convert little endian ULONGs
1605 to SCSI CDB big endians values. */
1606 typedef union _EIGHT_BYTE
{
1607 _ANONYMOUS_STRUCT
struct {
1617 ULONGLONG AsULongLong
;
1618 } EIGHT_BYTE
, *PEIGHT_BYTE
;
1620 typedef union _FOUR_BYTE
{
1621 _ANONYMOUS_STRUCT
struct {
1628 } FOUR_BYTE
, *PFOUR_BYTE
;
1630 typedef union _TWO_BYTE
{
1631 _ANONYMOUS_STRUCT
struct {
1636 } TWO_BYTE
, *PTWO_BYTE
;
1638 /* Byte reversing macro for converting between
1639 big- and little-endian formats */
1640 #define REVERSE_BYTES_QUAD(Destination, Source) { \
1641 PEIGHT_BYTE _val1 = (PEIGHT_BYTE)(Destination); \
1642 PEIGHT_BYTE _val2 = (PEIGHT_BYTE)(Source); \
1643 _val1->Byte7 = _val2->Byte0; \
1644 _val1->Byte6 = _val2->Byte1; \
1645 _val1->Byte5 = _val2->Byte2; \
1646 _val1->Byte4 = _val2->Byte3; \
1647 _val1->Byte3 = _val2->Byte4; \
1648 _val1->Byte2 = _val2->Byte5; \
1649 _val1->Byte1 = _val2->Byte6; \
1650 _val1->Byte0 = _val2->Byte7; \
1653 #define REVERSE_BYTES(Destination, Source) { \
1654 PFOUR_BYTE _val1 = (PFOUR_BYTE)(Destination); \
1655 PFOUR_BYTE _val2 = (PFOUR_BYTE)(Source); \
1656 _val1->Byte3 = _val2->Byte0; \
1657 _val1->Byte2 = _val2->Byte1; \
1658 _val1->Byte1 = _val2->Byte2; \
1659 _val1->Byte0 = _val2->Byte3; \
1662 #define REVERSE_BYTES_SHORT(Destination, Source) { \
1663 PTWO_BYTE _val1 = (PTWO_BYTE)(Destination); \
1664 PTWO_BYTE _val2 = (PTWO_BYTE)(Source); \
1665 _val1->Byte1 = _val2->Byte0; \
1666 _val1->Byte0 = _val2->Byte1; \
1669 #define REVERSE_SHORT(Short) { \
1671 PTWO_BYTE _val2 = (PTWO_BYTE)(Short); \
1672 _val = _val2->Byte0; \
1673 _val2->Byte0 = _val2->Byte1; \
1674 _val2->Byte1 = _val; \
1677 #define REVERSE_LONG(Long) { \
1679 PFOUR_BYTE _val2 = (PFOUR_BYTE)(Long); \
1680 _val = _val2->Byte3; \
1681 _val2->Byte3 = _val2->Byte0; \
1682 _val2->Byte0 = _val; \
1683 _val = _val2->Byte2; \
1684 _val2->Byte2 = _val2->Byte1; \
1685 _val2->Byte1 = _val; \
1688 #define WHICH_BIT(Data, Bit) { \
1690 for (_val = 0; _val < 32; _val++) { \
1691 if (((Data) >> _val) == 1) { \
1695 ASSERT(_val != 32); \
1703 #endif /* _NTSCSI_ */