Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

278 lines
8.8 KiB

  1. /****************************************************************************
  2. **
  3. ** Copyright 1999 Adaptec, Inc., All Rights Reserved.
  4. **
  5. ** This software contains the valuable trade secrets of Adaptec. The
  6. ** software is protected under copyright laws as an unpublished work of
  7. ** Adaptec. Notice is for informational purposes only and does not imply
  8. ** publication. The user of this software may make copies of the software
  9. ** for use with parts manufactured by Adaptec or under license from Adaptec
  10. ** and for no other use.
  11. **
  12. ****************************************************************************/
  13. /****************************************************************************
  14. **
  15. ** Module Name: MmcThings.h
  16. **
  17. ** Description: MMC Structures and OpCodes
  18. **
  19. ** Programmers: Daniel Evers (dle)
  20. ** Tom Halloran (tgh)
  21. ** Don Lilly (drl)
  22. ** Daniel Polfer (dap)
  23. **
  24. ** History: 8/18/99 (dap) Opened history and added header.
  25. **
  26. ** Notes: This file created using 4 spaces per tab.
  27. **
  28. ****************************************************************************/
  29. #ifndef __MMCTHINGS_H__
  30. #define __MMCTHINGS_H__
  31. #ifdef __cplusplus
  32. extern "C" {
  33. #endif //__cplusplus
  34. #define MMC_CDR_1X_SPEED_KB 176
  35. // MMC SCSI Opcodes
  36. #define MMC_CDBOPCODE_BLANK 0xa1
  37. #define MMC_CDBLENGTH_BLANK 12
  38. #define MMC_CDBOPCODE_CLOSE_TRACK_SESSION 0x5b
  39. #define MMC_CDBLENGTH_CLOSE_TRACK_SESSION 10
  40. #define MMC_CDBOPCODE_PREVENTALLOWREMOVAL 0x1e
  41. #define MMC_CDBLENGTH_PREVENTALLOWREMOVAL 6 // drl - this is the length for the hp9200
  42. #define MMC_CDBOPCODE_READ_DISC_INFO 0x51
  43. #define MMC_CDBLENGTH_READ_DISC_INFO 10
  44. #define MMC_CDBOPCODE_READ_TRACK_INFO 0x52
  45. #define MMC_CDBLENGTH_READ_TRACK_INFO 10
  46. #define MMC_CDBOPCODE_SETCDSPEED 0xbb
  47. #define MMC_CDBLENGTH_SETCDSPEED 12 // drl - this is the length for the hp9200
  48. #define MMC_CDBOPCODE_STARTSTOPUNIT 0x1b
  49. #define MMC_CDBLENGTH_STARTSTOPUNIT 6 // drl - this is the length for the hp9200
  50. #define MMC_CDBOPCODE_SYNCHRONIZE_CACHE 0x35
  51. #define MMC_CDBLENGTH_SYNCHRONIZE_CACHE 10
  52. #define MMC_CDBOPCODE_WRITE 0x2a
  53. #define MMC_CDBLENGTH_WRITE 10
  54. #define MMC_CDBOPCODE_READ 0x28
  55. #define MMC_CDBLENGTH_READ 10
  56. #define MMC_CDB_BLANK_BLANKINGTYPE_FULL 0x00
  57. #define MMC_CDB_BLANK_BLANKINGTYPE_MINIMAL 0x01
  58. // MMC Structs
  59. #define MMC_CLOSE_TRACK_SESSION_FLAG_SESSION 0x02
  60. #define MMC_CLOSE_TRACK_SESSION_FLAG_TRACK 0x01
  61. #define MMC_CLOSE_TRACK_SESSION_FLAG_IMMED 0x01
  62. #define MMC_DISC_INFO_DISC_STATUS_EMPTY 0x00
  63. #define MMC_DISC_INFO_DISC_STATUS_INCOMPLETE 0x01
  64. #define MMC_DISC_INFO_DISC_STATUS_COMPLETE 0x02
  65. #define MMC_DISC_INFO_DISC_STATUS_MASK 0x03
  66. #define MMC_DISC_INFO_LAST_SESSION_STATE_EMPTY 0x00
  67. #define MMC_DISC_INFO_LAST_SESSION_STATE_INCOMPLETE 0x04
  68. #define MMC_DISC_INFO_LAST_SESSION_STATE_COMPLETE 0x0c
  69. #define MMC_DISC_INFO_LAST_SESSION_STATE_MASK 0x0c
  70. #define MMC_DISC_INFO_ERASEABLE_MASK 0x10
  71. #define MMC_DISC_INFO_DISC_TYPE_CDDA_CDROM 0x00
  72. #define MMC_DISC_INFO_DISC_TYPE_CD_I 0x10
  73. #define MMC_DISC_INFO_DISC_TYPE_CDROM_XA 0x20
  74. #define MMC_DISC_INFO_DISC_TYPE_UNDEFINED 0xff
  75. #pragma pack(push,1)
  76. typedef struct {
  77. BYTE byDataLengthHi;
  78. BYTE byDataLengthLo;
  79. BYTE byDiscStatus;
  80. BYTE byFirstTrackNumber;
  81. BYTE bySessionCount;
  82. BYTE byFirstTrackInLastSession;
  83. BYTE byLastTrackInLastSession;
  84. BYTE byDIDVDBCVURU;
  85. BYTE byDiscType;
  86. BYTE byaReserved0[ 3 ];
  87. BYTE byaDiscId[ 4 ];
  88. BYTE byaLastSessionLeadInStartTimeMSF[ 4 ];
  89. BYTE byaLastPossStartTimeforLeadOutMSF[ 4 ];
  90. BYTE byaDiscBarcode[ 8 ];
  91. BYTE byReserved1;
  92. BYTE byOpcTableEntriesCount;
  93. BYTE byaOPCTableEntries[ 100 ];
  94. } MMC_DISC_INFO_BLOCK, *PMMC_DISC_INFO_BLOCK;
  95. #pragma pack(pop)
  96. //#define MMC_EXPECTED_RT_BLANK_PACKET_FP_DATAMODE_AUDIO 0x4f
  97. #define MMC_EXPECTED_RT_BLANK_PACKET_FP_DATAMODE_AUDIO 0x0f
  98. #define MMC_EXPECTED_RT_BLANK_PACKET_FP_DATAMODE_MODE1 0x41
  99. #define MMC_TIB_RT_BLANK_PACKET_FP_DATAMODE_RESERVEDTRACK 0x80
  100. #define MMC_TIB_RT_BLANK_PACKET_FP_DATAMODE_BLANK 0x40
  101. #define MMC_TIB_RT_BLANK_PACKET_FP_DATAMODE_PACKET 0x20
  102. #define MMC_TIB_RT_BLANK_PACKET_FP_DATAMODE_FIXEDPACKET 0x10
  103. #define MMC_TIB_RT_BLANK_PACKET_FP_DATAMODE_MODE1 0x01
  104. #define MMC_TIB_RT_BLANK_PACKET_FP_DATAMODE_MODE2 0x02
  105. #define MMC_TIB_RT_BLANK_PACKET_FP_DATAMODE_UNKNOWN 0x0f
  106. #pragma pack(push,1)
  107. typedef struct {
  108. BYTE byaDataLength[ 2 ];
  109. BYTE byTrackNumber;
  110. BYTE bySessionNumber;
  111. BYTE byReserved0;
  112. BYTE byDamage_Copy_TrackMode;
  113. BYTE byRT_Blank_Packet_FP_DataMode;
  114. BYTE byNWA_V;
  115. BYTE byaTrackStartAddress[ 4 ];
  116. BYTE byaNextWritableAddress[ 4 ];
  117. BYTE byaFreeBlocks[ 4 ];
  118. BYTE byaFixedPacketSize[ 4 ];
  119. // tgh - the 9200 spec says that there is another field here: Track Length.
  120. BYTE byaTrackLength[ 4 ];
  121. } MMC_TRACK_INFO_BLOCK, *PMMC_TRACK_INFO_BLOCK;
  122. #pragma pack(pop)
  123. #define MMC_MODE_PAGE_CODE_WRITE_PARAMETERS 0x05
  124. #define MMC_WP_TEST_WRITING_FLAG 0x10
  125. #define MMC_WP_WRITE_TYPE_TRACK_AT_ONCE 0x01
  126. #define MMC_WP_DATA_BLOCK_TYPE_RAW_DATA 0x00
  127. #define MMC_WP_DATA_BLOCK_TYPE_MODE1 0x08
  128. #define MMC_WP_DATA_BLOCK_TYPE_MODE2_FORM1 0x0A
  129. #define MMC_WP_SESSION_FORMAT_CDDAorCDROM 0x00
  130. #define MMC_WP_SESSION_FORMAT_CDROM_XA 0x20
  131. #define MMC_SUBCHANNEL_Q_BIT_AUDIOPREEMPHASIS 0x01
  132. #define MMC_SUBCHANNEL_Q_BIT_DIGITALCOPYPERMITTED 0x02
  133. #define MMC_SUBCHANNEL_Q_BIT_AUDIOTRACK 0x00
  134. #define MMC_SUBCHANNEL_Q_BIT_DATATRACK 0x04
  135. #define MMC_SUBCHANNEL_Q_BIT_FOURCHANNELAUDIO 0x08
  136. #pragma pack(push,1)
  137. typedef struct {
  138. BYTE byaModeDataLength[ 2 ];
  139. BYTE byaMediumType;
  140. BYTE byaReserved[ 3 ];
  141. BYTE byaBlockDescriptorLength[ 2 ];
  142. BYTE byaBlockDescriptor[ 8 ];
  143. } MMC_MODE_PARAMETER_HEADER, *PMMC_MODE_PARAMETER_HEADER;
  144. #pragma pack(pop)
  145. #pragma pack(push,1)
  146. typedef struct {
  147. BYTE byPageCode; // 0x05
  148. BYTE byPageLength; // 0x32
  149. // BYTE byTW_WriteType;
  150. BYTE bfWriteType:4;
  151. BYTE bfTestWrite:1;
  152. BYTE bfLS_V:1;
  153. BYTE bfBufferUnderrunFree:1;
  154. BYTE bfreserved1:1;
  155. // BYTE byMS_FP_Copy_TrackMode;
  156. BYTE bfTrackMode:4;
  157. BYTE bfCopyRight:1;
  158. BYTE bfFixedPacket:1;
  159. BYTE bfMultiSession:2;
  160. // BYTE byDataBlockType;
  161. BYTE bfDataBlockType:4;
  162. BYTE bfreserved2:4;
  163. BYTE byLinkSize;
  164. BYTE byreserved3;
  165. BYTE bfHostApplicationCode:6;
  166. BYTE bfreserved4:2;
  167. BYTE bySessionFormat;
  168. BYTE byreserved5;
  169. BYTE byaPacketSize[ 4 ];
  170. BYTE byaAudioPauseLength[ 2 ];
  171. BYTE byMCVAL;
  172. BYTE byaN1thruN13[ 13 ];
  173. BYTE byZero1;
  174. BYTE byAframe1;
  175. BYTE byTCVAL;
  176. BYTE byI1CountryCode;
  177. BYTE byI2A_Z;
  178. BYTE byI3OwnerCode;
  179. BYTE byI4;
  180. BYTE byI5A_Z_0_9;
  181. BYTE byI6YearOfRecording;
  182. BYTE byI7;
  183. BYTE byI8SerialNumber;
  184. BYTE byI9;
  185. BYTE byI10;
  186. BYTE byI11;
  187. BYTE byI12;
  188. BYTE byZero2;
  189. BYTE byAframe2;
  190. BYTE byReserved2;
  191. BYTE byaSubheader[ 4 ];
  192. //BYTE byaAdditionalLength[ 80 ];
  193. } MMC_MODE_PAGE_WRITE_PARAMETERS, *PMMC_MODE_PAGE_WRITE_PARAMETERS;
  194. #pragma pack(pop)
  195. #pragma pack(push,1)
  196. typedef struct {
  197. MMC_MODE_PARAMETER_HEADER header;
  198. MMC_MODE_PAGE_WRITE_PARAMETERS page;
  199. } MMC_MODE_WRITE_PARAMETERS, *PMMC_MODE_WRITE_PARAMETERS;
  200. #pragma pack(pop)
  201. #define MMC_MODE_PAGE_CODE_CAPABILITIES_PARAMETERS 0x2A
  202. #pragma pack(push,1)
  203. typedef struct {
  204. BYTE byPageCode; // 0x2a
  205. BYTE byPageLength; // 0x18
  206. BYTE byReadType;
  207. BYTE byWriterType;
  208. BYTE byMultiSession : 7;
  209. BYTE bfBufferUnderrunFreeCapable : 1;
  210. BYTE byReadBarCode;
  211. BYTE byEjectLock;
  212. BYTE byLeadIn;
  213. BYTE byMaxReadSpeed[2];
  214. BYTE byVolumeLevels[2];
  215. BYTE byBufferSizeSupported[2];
  216. BYTE byCurrentReadSpeed[2];
  217. BYTE byReserved[2];
  218. BYTE byMaxWriteSpeed[2];
  219. BYTE byCurrentWriteSpeed[2];
  220. BYTE byManagement[2];
  221. BYTE byReserved2[2];
  222. } MMC_MODE_PAGE_CAPABILITY_PARAMETERS, *PMMC_MODE_PAGE_CAPABILITY_PARAMETERS;
  223. #pragma pack(pop)
  224. #pragma pack(push,1)
  225. typedef struct {
  226. MMC_MODE_PARAMETER_HEADER header;
  227. MMC_MODE_PAGE_CAPABILITY_PARAMETERS page;
  228. } MMC_MODE_CAPABILITY_PARAMETERS, *PMMC_MODE_CAPABILITY_PARAMETERS;
  229. #pragma pack(pop)
  230. #ifdef __cplusplus
  231. }
  232. #endif //__cplusplus
  233. #endif //__MMCTHINGS_H__