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.

944 lines
29 KiB

  1. /*++
  2. Copyright (c) 1994 - 1995 Microsoft Corporation. All Rights Reserved.
  3. Module Name:
  4. MPEGMINI.H
  5. Abstract:
  6. This file defines the interface between MPEG mini-port drivers and the
  7. MPEG port driver.
  8. Author:
  9. Paul Shih (paulsh) 27-Mar-1994
  10. Paul Lever (a-paull)
  11. Environment:
  12. Kernel mode only
  13. Revision History:
  14. --*/
  15. #ifndef _MPEGMINI_H
  16. #define _MPEGMINI_H
  17. #include "mpegcmn.h"
  18. #define MPEGAPI __stdcall
  19. typedef enum { // Use the given level to indicate:
  20. DebugLevelFatal = 0, // * imminent nonrecoverable system failure
  21. DebugLevelError, // * serious error, though recoverable
  22. DebugLevelWarning, // * warnings of unusual occurances
  23. DebugLevelInfo, // * status and other information - normal though
  24. // perhaps unusual events. System MUST remain
  25. // responsive.
  26. DebugLevelTrace, // * trace information - normal events
  27. // system need not ramain responsive
  28. DebugLevelVerbose, // * verbose trace information
  29. // system need not remain responsive
  30. DebugLevelMaximum
  31. } DEBUG_LEVEL;
  32. #if DBG
  33. #define DEBUG_PRINT(x) MpegDebugPrint x
  34. #define DEBUG_BREAKPOINT MpegDebugBreakPoint
  35. #define DEBUG_ASSERT(exp) \
  36. if ( !(exp) ) { \
  37. MpegDebugAssert( __FILE__, __LINE__, #exp, exp); \
  38. }
  39. #else
  40. #define DEBUG_PRINT(x)
  41. #define DEBUG_BREAKPOINT
  42. #define DEBUG_ASSERT(exp)
  43. #endif
  44. // Uninitialized flag value.
  45. #define MP_UNINITIALIZED_VALUE ((ULONG) ~0)
  46. // Devices supported on an HBA
  47. typedef enum _CONTROL_DEVICE
  48. {
  49. VideoDevice,
  50. AudioDevice,
  51. OverlayDevice,
  52. MaximumControlDevice
  53. } CONTROL_DEVICE;
  54. //
  55. // MRB code, and strctus
  56. //
  57. // MRB command codes
  58. typedef enum _MRB_COMMAND { // Parameter structure
  59. MrbCommandVideoReset = 0x100, // no parameters
  60. MrbCommandVideoCancel, // no parameters
  61. MrbCommandVideoPlay, // no parameters
  62. MrbCommandVideoPause, // no parameters
  63. MrbCommandVideoStop, // no parameters
  64. MrbCommandVideoGetStc, // MPEG_TIMESTAMP
  65. MrbCommandVideoSetStc, // MPEG_TIMESTAMP
  66. MrbCommandVideoQueryInfo, // VIDEO_DEVICE_INFO
  67. MrbCommandVideoEndOfStream, // no parameters
  68. MrbCommandVideoPacket, // MPEG_PACKET
  69. MrbCommandVideoClearBuffer, // no parameters
  70. MrbCommandVideoGetAttribute, // MPEG_ATTRIBUTE
  71. MrbCommandVideoSetAttribute, // MPEG_ATTRIBUTE
  72. MrbCommandAudioReset = 0x200, // no parameters
  73. MrbCommandAudioCancel, // no parameters
  74. MrbCommandAudioPlay, // no parameters
  75. MrbCommandAudioPause, // no parameters
  76. MrbCommandAudioStop, // no parameters
  77. MrbCommandAudioGetStc, // MPEG_TIMESTAMP
  78. MrbCommandAudioSetStc, // MPEG_TIMESTAMP
  79. MrbCommandAudioQueryInfo, // AUDIO_DEVICE_INFO
  80. MrbCommandAudioEndOfStream, // no parameters
  81. MrbCommandAudioPacket, // MPEG_PACKET
  82. MrbCommandAudioGetAttribute, // MPEG_ATTRIBUTE
  83. MrbCommandAudioSetAttribute, // MPEG_ATTRIBUTE
  84. MrbCommandOverlayGetMode = 0x400, // OVERLAY_MODE
  85. MrbCommandOverlaySetMode, // OVERLAY_MODE
  86. MrbCommandOverlayGetVgaKey, // OVERLAY_KEY
  87. MrbCommandOverlaySetVgaKey, // OVERLAY_KEY
  88. MrbCommandOverlayGetDestination, // OVERLAY_PLACEMENT
  89. MrbCommandOverlaySetDestination, // OVERLAY_PLACEMENT
  90. MrbCommandOverlayEnable, // OVERLAY_ENABLE
  91. MrbCommandOverlayDisable, // no parameters
  92. MrbCommandOverlayUpdateClut, // OVERLAY_CLUT
  93. MrbCommandOverlayGetAttribute, // MPEG_ATTRIBUTE
  94. MrbCommandOverlaySetAttribute, // MPEG_ATTRIBUTE
  95. MrbCommandOverlayQueryInfo, // OVERLAY_DEVICE_INFO
  96. MrbCommandOverlaySetBitMask // MPEG_OVERLAY_BIT_MASK
  97. } MRB_COMMAND;
  98. // MRB status (command completion) codes
  99. typedef enum _MRB_STATUS {
  100. MrbStatusSuccess = 0,
  101. MrbStatusCancelled,
  102. MrbStatusError,
  103. MrbStatusInvalidParameter,
  104. MrbStatusInvalidData,
  105. MrbStatusDeviceFailure,
  106. MrbStatusVersionMismatch,
  107. MrbStatusUnsupportedComand,
  108. MrbStatusDeviceBusy,
  109. } MRB_STATUS;
  110. #define MRB_INVALID_STATUS 0xffff
  111. // MPEG packet header information
  112. typedef struct _MPEG_PACKET {
  113. ULONGLONG PtsValue; // presentation time stamp
  114. ULONGLONG DtsValue; // decode time stamp
  115. ULONG StreamNumber; // packet stream id
  116. ULONG PacketTotalSize; // total size of the packet including header
  117. ULONG PacketHeaderSize; // size of compressed header (in bytes)
  118. ULONG PacketPayloadSize; // size of the actuly data (full packet-header)
  119. PVOID PacketData; // pointer to the MPEG packet
  120. ULONGLONG ScrValue; // system SCR time for this packet
  121. } MPEG_PACKET,*PMPEG_PACKET;
  122. // Audio device information
  123. typedef struct _AUDIO_DEVICEINFO {
  124. MPEG_DEVICE_STATE DeviceState;// MPEG device decode state
  125. ULONG DecoderBufferSize; // Size of the decoder buffer
  126. ULONG DecoderBufferFullness; // Byte count of data in decoder buffer
  127. ULONG StarvationCount; // Number of times device was starved
  128. } AUDIO_DEVICEINFO,*PAUDIO_DEVICEINFO;
  129. // Video device information
  130. typedef struct _VIDEO_DEVICEINFO {
  131. MPEG_DEVICE_STATE DeviceState;// MPEG device decode state
  132. ULONG DecoderBufferSize; // Size of the decoder buffer
  133. ULONG DecoderBufferFullness; // Byte count of data in decoder buffer
  134. ULONG DecompressHeight; // Native MPEG decompress height
  135. ULONG DecompressWidth; // Native MPEG decompress width
  136. ULONG StarvationCount; // Number of times device was starved
  137. } VIDEO_DEVICEINFO,*PVIDEO_DEVICEINFO;
  138. // Overlay device information
  139. typedef struct _OVERLAY_DEVICEINFO {
  140. ULONG MinDestinationHeight; // Minimum height of overlay
  141. ULONG MaxDestinationHeight; // Maximum height of overlay
  142. ULONG MinDestinationWidth; // Minimum width of overlay
  143. ULONG MaxDestinationWidth; // Maximum width of overlay
  144. } OVERLAY_DEVICEINFO, *POVERLAY_DEVICEINFO;
  145. // Overlay VGA key
  146. typedef struct _OVERLAY_KEY {
  147. ULONG Key; // palette index or RGB color
  148. ULONG Mask; // significant bits in color
  149. } OVERLAY_KEY,*POVERLAY_KEY;
  150. // Overlay enable
  151. typedef struct _OVERLAY_ENABLE {
  152. LONG DisWMax; // display width
  153. LONG DisHMax; // display height
  154. LONG ScreenStride; // Bytes per line
  155. LONG DisXAdj; // overlay X alignment adjustment
  156. LONG DisYAdj; // overlay Y alignment adjustment
  157. LONG BitsPerPixel; // bits used to represent a pixel
  158. LONG NumberRedBits; // in DAC on graphics card
  159. LONG NumberGreenBits;
  160. LONG NumberBlueBits;
  161. LONG RedMask; // Red color mask for device w/ direct color modes
  162. LONG GreenMask;
  163. LONG BlueMask;
  164. LONG AttributeFlags;
  165. } OVERLAY_ENABLE,*POVERLAY_ENABLE;
  166. typedef struct _RGBX {
  167. UCHAR Red; // red bits of the pixel
  168. UCHAR Green; // green bits of the pixel
  169. UCHAR Blue; // blue bits of the pixel
  170. UCHAR Unused;
  171. } RGBX, *PRGBX;
  172. typedef union {
  173. RGBX RgbColor;
  174. ULONG RgbLong;
  175. } COLORLUT, *PCOLORLUT;
  176. typedef struct _COLORLUT_DATA {
  177. USHORT NumEntries; // Number of entries in the CLUT RGBArray
  178. USHORT FirstEntry; // Location in the device palette to which the
  179. // first entry in the CLUT is copied. The other
  180. // entries in the CLUT are copied sequentially
  181. // into the device palette from the starting
  182. // point.
  183. PCOLORLUT RgbArray; // The CLUT to copy into the device color registers
  184. // (palette).
  185. } COLORLUT_DATA, *PCOLORLUT_DATA;
  186. // Overlay CLUT
  187. typedef struct _OVERLAY_CLUT {
  188. PCOLORLUT_DATA ClutData; // pointer to CLUT data
  189. } OVERLAY_CLUT,*POVERLAY_CLUT;
  190. // MPEG I/O Request Block
  191. typedef struct _MPEG_REQUEST_BLOCK {
  192. ULONG Length; // sizeof MPEG_REQUEST_BLOCK (version check)
  193. MRB_COMMAND Command; // MRB command, see MRB_COMMAND_xxx
  194. MRB_STATUS Status; // MRB completion status, see MRB_STATUS_xxx
  195. ULONG Reserved; // reserved for use by the port driver
  196. union _commandData {
  197. MPEG_PACKET Packet;
  198. MPEG_SYSTEM_TIME Timestamp;
  199. AUDIO_DEVICEINFO AudioDeviceInfo;
  200. VIDEO_DEVICEINFO VideoDeviceInfo;
  201. MPEG_OVERLAY_MODE Mode;
  202. OVERLAY_KEY Key;
  203. MPEG_OVERLAY_PLACEMENT Placement;
  204. OVERLAY_ENABLE Enable;
  205. MPEG_OVERLAY_BIT_MASK OverlayBitMask;
  206. OVERLAY_CLUT Clut;
  207. OVERLAY_DEVICEINFO OverlayDeviceInfo;
  208. MPEG_ATTRIBUTE_PARAMS Attribute;
  209. } CommandData;
  210. } MPEG_REQUEST_BLOCK, *PMPEG_REQUEST_BLOCK;
  211. #define MPEG_REQUEST_BLOCK_SIZE sizeof(MPEG_REQUEST_BLOCK)
  212. // Interrupt Configuration Information
  213. typedef struct _INTERRUPT_CONFIGURATION
  214. {
  215. ULONG BusInterruptLevel; // Interrupt request level for device
  216. ULONG BusInterruptVector; // Bus interrupt vector used with hardware
  217. // buses which use a vector as
  218. // well as level, such as internal buses.
  219. KINTERRUPT_MODE InterruptMode; // Interrupt mode (level-sensitive or
  220. // edge-triggered)
  221. } INTERRUPT_CONFIGURATION, *PINTERRUPT_CONFIGURATION;
  222. // DMA Channel Configuration Information
  223. typedef struct _DMA_CONFIGURATION
  224. {
  225. ULONG DmaChannel; // Specifies the DMA channel used by a
  226. // slave HBA. By default, the value of
  227. // this member is 0xFFFFFFFF. If the
  228. // HBA uses a system DMA controller and
  229. // the given AdapterInterfaceType is
  230. // any value except MicroChannel, the
  231. // miniport driver must reset this member.
  232. ULONG DmaPort; // Specifies the DMA port used by a slave
  233. // HBA. By default, the value of this
  234. // member is zero. If the HBA uses a
  235. // system DMA controller and the given
  236. // AdapterInterfaceType is MicroChannel,
  237. // the miniport driver must reset this
  238. // member.
  239. DMA_WIDTH DmaWidth; // Specifies the width of the DMA transfer:
  240. // Width8Bits, Width16Bits or Width32Bits
  241. DMA_SPEED DmaSpeed; // Specifies the DMA transfer speed for EISA
  242. // type HBAs. By default, the value specifies
  243. // compatibility timing: Compatible,
  244. // TypeA, TypeB or TypeC
  245. BOOLEAN Dma32BitAddresses; // TRUE indicates that the HBA has 32 address
  246. // lines and can access memory with physical
  247. // addresses greater than 24 bits.
  248. BOOLEAN DemandMode; // TRUE indicates the system DMA controller
  249. // should be programmed for demand-mode rather
  250. // than single-cycle operations. If the HBA
  251. // is not a slave device, this member should
  252. // be FALSE. ?????
  253. BOOLEAN Master; // Indicates that the adapter is a bus master ????
  254. BOOLEAN MapBuffers; // Buffers must be mapped into system space
  255. ULONG MaximumTransferLength; // max number of bytes device can handle per
  256. // DMA operation
  257. } DMA_CONFIGURATION, *PDMA_CONFIGURATION;
  258. // Special Initialization Data Configuration Information
  259. // This data may be obtained by the Port driver from a Registry or Initialzation
  260. // file or sequence.
  261. typedef struct _SPECIAL_INIT_CONFIGURATION
  262. {
  263. ULONG Length; // Specifies the length of the data buffer in bytes
  264. PVOID DataBuffer; // Pointer to data buffer
  265. } SPECIAL_INIT_CONFIGURATION, *PSPECIAL_INIT_CONFIGURATION;
  266. // Video Mode information passed to the mini-port on start-up
  267. typedef struct _VIDEO_MODE_DATA {
  268. ULONG ScreenWidth; // Number of visible horizontal pixels on a scan line
  269. ULONG ScreenHeight; // Numbee, in pixels, of visible scan lines.
  270. ULONG ScreenStride; // Bytes per line
  271. ULONG NumberOfPlanes; // Number of separate planes combined by the video hardware
  272. ULONG BitsPerPlane; // Number of bits per pixel on a plane
  273. ULONG Frequency; // Frequency of the screen, in hertz.
  274. ULONG NumberRedBits; // Number of bits in the red DAC
  275. ULONG NumberGreenBits; // Number of bits in the Green DAC.
  276. ULONG NumberBlueBits; // Number of bits in the blue DAC.
  277. ULONG RedMask; // Red color mask. Bits turned on indicated the color red
  278. ULONG GreenMask; // Green color mask. Bits turned on indicated the color green
  279. ULONG BlueMask; // Blue color mask. Bits turned on indicated the color blue
  280. ULONG AttributeFlags; // Flags indicating certain device behavior.
  281. // It's an logical-OR summation of MODE_xxx flags.
  282. } VIDEO_MODE_DATA, *PVIDEO_MODE_DATA;
  283. // AttributeFlags definitions
  284. #define MODE_COLOR 0x01 // 0 = monochrome; 1 = color
  285. #define MODE_GRAPHICS 0x02 // 0 = text mode; 1 = graphics mode
  286. #define MODE_INTERLACED 0x04 // 0 = non-interlaced; 1 = interlaced
  287. #define MODE_PALETTE_DRIVEN 0x08 // 0 = colors direct; 1 = colors indexed to a palette
  288. #define MODE_VALID_DATA 0x8000 // 0 = VIDEO_MADE_DATA not valid; 1 = VIDEO_MODE_DATA valid
  289. // if MODE_INVALID_DATA is 0, then none of the data
  290. // within the VIDEO_MODE_DATA structure is valid
  291. typedef PHYSICAL_ADDRESS MPEG_PHYSICAL_ADDRESS, *PMPEG_PHYSICAL_ADDRESS;
  292. // I/O and Memory address ranges
  293. typedef struct _ACCESS_RANGE {
  294. MPEG_PHYSICAL_ADDRESS RangeStart;
  295. ULONG RangeLength;
  296. BOOLEAN RangeInMemory;
  297. } ACCESS_RANGE, *PACCESS_RANGE;
  298. // Configuration information structure. Contains the information necessary
  299. // to initialize the adapter.
  300. typedef struct _PORT_CONFIGURATION_INFORMATION
  301. {
  302. ULONG Length; // Size of this structure, used as version check
  303. ULONG SystemIoBusNumber; // IO bus number (0 for machines that have
  304. // only 1 IO bus)
  305. INTERFACE_TYPE AdapterInterfaceType; // Adapter interface type supported by HBA:
  306. // Internal
  307. // Isa
  308. // Eisa
  309. // MicroChannel
  310. // TurboChannel
  311. // PCIBus
  312. // VMEBus
  313. // NuBus
  314. // PCMCIABus
  315. // CBus
  316. // MPIBus
  317. // MPSABus
  318. // Interrupt descriptions
  319. INTERRUPT_CONFIGURATION Interrupts[MaximumControlDevice];
  320. // DMA CHannel descriptions
  321. DMA_CONFIGURATION DmaChannels[MaximumControlDevice];
  322. ULONG NumberOfAccessRanges; // Number of access ranges allocated
  323. // Specifies the number of AccessRanges elements in the array,
  324. // described next. The OS-specific port driver always sets this
  325. // member to the value passed in the HW_INITIALIZATION_DATA
  326. // structure when the miniport driver called MpegPortInitialize.
  327. ACCESS_RANGE (*AccessRanges)[]; // Pointer to array of access range elements
  328. // Points to an array of ACCESS_RANGE-type elements. The given
  329. // NumberOfAccessRanges determines how many elements must be
  330. // configured with bus-relative range values. The AccessRanges
  331. // pointer must be NULL if NumberOfAccessRanges is zero.
  332. // Initialization special data,
  333. // miniport dependent.
  334. SPECIAL_INIT_CONFIGURATION Special[MaximumControlDevice];
  335. ULONGLONG CounterFrequency; // frequency of high resolution counter
  336. // in Hertz (cycles per second)
  337. VIDEO_MODE_DATA VideoMode; // Video mode information
  338. } PORT_CONFIGURATION_INFORMATION, *PPORT_CONFIGURATION_INFORMATION;
  339. // MPEG Adapter Dependent Routines
  340. typedef
  341. BOOLEAN
  342. (MPEGAPI *PHW_INITIALIZE) (
  343. IN PVOID DeviceExtension
  344. );
  345. typedef
  346. BOOLEAN
  347. (MPEGAPI *PHW_UNINITIALIZE) (
  348. IN PVOID DeviceExtension
  349. );
  350. typedef
  351. BOOLEAN
  352. (MPEGAPI *PHW_STARTIO) (
  353. IN PVOID DeviceExtension,
  354. IN PMPEG_REQUEST_BLOCK Mrb
  355. );
  356. typedef
  357. BOOLEAN
  358. (MPEGAPI *PHW_INTERRUPT) (
  359. IN PVOID DeviceExtension
  360. );
  361. typedef
  362. VOID
  363. (MPEGAPI *PHW_TIMER) (
  364. IN PVOID DeviceExtension
  365. );
  366. typedef
  367. VOID
  368. (MPEGAPI *PHW_DEFFERED_CALLBACK) (
  369. IN PVOID DeviceExtension
  370. );
  371. typedef
  372. VOID
  373. (MPEGAPI *PHW_ENABLE_BOARD_INTERRUPTS) (
  374. IN PVOID DeviceExtension
  375. );
  376. typedef
  377. VOID
  378. (MPEGAPI *PHW_DMA_STARTED) (
  379. IN PVOID DeviceExtension
  380. );
  381. typedef
  382. ULONG
  383. (MPEGAPI *PHW_FIND_ADAPTER) (
  384. IN PVOID DeviceExtension,
  385. IN PVOID HwContext,
  386. IN PVOID BusInformation,
  387. IN PCHAR ArgumentString,
  388. IN OUT PPORT_CONFIGURATION_INFORMATION ConfigInfo,
  389. OUT PBOOLEAN Again
  390. );
  391. // Structure passed between Miniport initialization
  392. // and MPEG port initialization
  393. typedef struct _HW_INITIALIZATION_DATA {
  394. ULONG HwInitializationDataSize; // Size of this structure, used as version check
  395. INTERFACE_TYPE AdapterInterfaceType; // Adapter interface type supported by HBA:
  396. // Internal
  397. // Isa
  398. // Eisa
  399. // MicroChannel
  400. // TurboChannel
  401. // PCIBus
  402. // VMEBus
  403. // NuBus
  404. // PCMCIABus
  405. // CBus
  406. // MPIBus
  407. // MPSABus
  408. // Miniport driver routine pointers:
  409. PHW_INITIALIZE HwInitialize; // points to miniport's HwMpegInitialize routine
  410. PHW_UNINITIALIZE HwUnInitialize; // points to miniport's HwMpegUnInitialize routine
  411. PHW_STARTIO HwStartIo; // points to miniport's HwMpegStartIo routine
  412. PHW_FIND_ADAPTER HwFindAdapter; // points to miniport's HwMpegFindAdapter routine
  413. // points to miniport's HwMpegXXXInterrupt routines
  414. PHW_INTERRUPT HwInterrupt[MaximumControlDevice];
  415. // Miniport driver resources
  416. ULONG DeviceExtensionSize; // size in bytes of the miniports per-HBA device
  417. // extension data
  418. ULONG NumberOfAccessRanges; // number of access ranges required by miniport
  419. // (memory or I/O addresses)
  420. ULONG NumberOfTimers; // Number of timers required by Miniport
  421. // Vendor and Device identification
  422. USHORT VendorIdLength; // size in bytes of VendorId
  423. PVOID VendorId; // points to ASCII byte string identifying
  424. // the manufacturer of the HBA. If
  425. // AdapterInterfaceType is PCIBus, then the
  426. // vendor ID is a USHORT represented as a
  427. // string (ID 1001 is '1','0','0','1')
  428. USHORT DeviceIdLength; // size in bytes of DeviceId
  429. PVOID DeviceId; // points to ASCII byte string identifying
  430. // the HBA model supported by the miniport.
  431. // If AdapterInterfaceType is PCIBus, then
  432. // the device ID is a USHORT represented as a
  433. // string. If the miniport can support PCI
  434. // devices with IDs 8040 and 8050,it might
  435. // set the DeviceId with a pointer to the
  436. // byte string ('8','0')
  437. BOOLEAN NoDynamicRelocation; // On dynamically configurable I/O busses, when set
  438. // to TRUE, inhibits re-configuring. Currently this
  439. // is limited to PCIbus. This flag can be set when a
  440. // PCI Mpeg device is on the same adapter (and same
  441. // function code) as the Video hardware and therefore
  442. // can't be moved.
  443. } HW_INITIALIZATION_DATA, *PHW_INITIALIZATION_DATA;
  444. //
  445. // MRB Functions
  446. //
  447. //
  448. // MRB Status
  449. //
  450. //
  451. // MRB Flag Bits
  452. //
  453. //
  454. // Port driver error codes
  455. //
  456. //
  457. // Return values for MPEG_HW_FIND_ADAPTER and HardwareInitialization
  458. //
  459. typedef enum _MP_RETURN_CODES{
  460. MP_RETURN_FOUND, // adapter found OK
  461. MP_RETURN_NOT_FOUND, // adapter not found
  462. MP_RETURN_ERROR, // generic error
  463. MP_RETURN_BAD_CONFIG, // configuration structure invalid
  464. MP_RETURN_REVISION_MISMATCH, // configuration structure size mismatch
  465. MP_RETURN_INSUFFICIENT_RESOURCES, // Not enough access ranges
  466. MP_RETURN_INVALID_INTERRUPT, // no interrupt specified, or unusable interrupt
  467. MP_RETURN_INVALID_DMA, // No DMA channel specified or usuable channel
  468. MP_RETURN_NO_DMA_BUFFER, // DMA buffer of sufficient size not available
  469. MP_RETURN_INVALID_MEMORY, // no Memory I/O address specified or unusable address
  470. MP_RETURN_INVALID_PORT, // no Port I/O address specified or unusable address
  471. MP_RETURN_HW_REVISION, // revision of H/W detected is not supported by driver
  472. MP_RETURN_BAD_VIDEO_MODE, // Video data supplied is insufficient or unsupported
  473. MP_RETURN_VIDEO_INITIALIZATION_FAILED, // Video failed to initialize
  474. MP_RETURN_AUDIO_INITIALIZATION_FAILED, // Audio failed to initialize
  475. MP_RETURN_OVERLAY_INITIALIZATION_FAILED, // Overlay failed to initialize
  476. MP_RETURN_VIDEO_FAILED, // Video failed
  477. MP_RETURN_AUDIO_FAILED, // Audio failed
  478. MP_RETURN_OVERLAY_FAILED, // Overlay failed
  479. } MP_RETURN_CODES, *PMP_RETURN_CODES;
  480. //
  481. // Port driver error codes
  482. //
  483. #define MP_INTERNAL_ADAPTER_ERROR 0x0006
  484. #define MP_IRQ_NOT_RESPONDING 0x0008
  485. //
  486. // Notification Event Types
  487. //
  488. typedef enum _MPEG_NOTIFICATION_TYPE {
  489. RequestComplete,
  490. NextRequest,
  491. CallDisableInterrupts,
  492. CallEnableInterrupts,
  493. RequestTimerCall,
  494. StatusPending,
  495. DeviceFailure,
  496. LogError,
  497. NotificationMaximum
  498. } MPEG_NOTIFICATION_TYPE, *PMPEG_NOTIFICATION_TYPE;
  499. //
  500. // Port export routines
  501. //
  502. ULONG
  503. MPEGAPI
  504. MpegPortInitialize(
  505. IN PVOID Argument1,
  506. IN PVOID Argument2,
  507. IN PHW_INITIALIZATION_DATA HwInitializationData,
  508. IN PVOID HwContext OPTIONAL
  509. );
  510. VOID
  511. MPEGAPI
  512. MpegPortRequestDma(
  513. IN CONTROL_DEVICE DeviceType,
  514. IN PVOID HwDeviceExtension,
  515. IN PHW_DMA_STARTED HwDmaStarted,
  516. IN PMPEG_REQUEST_BLOCK Mrb,
  517. IN PVOID LogicalAddress,
  518. IN ULONG Length
  519. );
  520. VOID
  521. MPEGAPI
  522. MpegPortNotification(
  523. IN MPEG_NOTIFICATION_TYPE NotificationType,
  524. IN CONTROL_DEVICE DeviceType,
  525. IN PVOID HwDeviceExtension,
  526. ...
  527. );
  528. VOID
  529. MPEGAPI
  530. MpegPortZeroMemory(
  531. IN PVOID WriteBuffer,
  532. IN ULONG Length
  533. );
  534. VOID
  535. MPEGAPI
  536. MpegPortMoveMemory(
  537. IN PVOID WriteBuffer,
  538. IN PVOID ReadBuffer,
  539. IN ULONG Length
  540. );
  541. MPEG_PHYSICAL_ADDRESS
  542. MPEGAPI
  543. MpegPortConvertUlongToPhysicalAddress(
  544. IN ULONG UlongAddress
  545. );
  546. ULONG
  547. MPEGAPI
  548. MpegPortConvertPhysicalAddressToUlong(
  549. IN MPEG_PHYSICAL_ADDRESS Address
  550. );
  551. #define MPEG_PORT_CONVERT_PHYSICAL_ADDRESS_TO_ULONG(Address) ((Address).LowPart)
  552. VOID
  553. MPEGAPI
  554. MpegPortFlushDma(
  555. IN CONTROL_DEVICE DeviceType,
  556. IN PVOID HwDeviceExtension
  557. );
  558. PVOID
  559. MPEGAPI
  560. MpegPortGetDeviceBase(
  561. IN PVOID HwDeviceExtension,
  562. IN INTERFACE_TYPE BusType,
  563. IN ULONG SystemIoBusNumber,
  564. IN MPEG_PHYSICAL_ADDRESS IoAddress,
  565. IN ULONG NumberOfBytes,
  566. IN BOOLEAN InIoSpace
  567. );
  568. VOID
  569. MPEGAPI
  570. MpegPortFreeDeviceBase(
  571. IN PVOID HwDeviceExtension,
  572. IN PVOID MappedAddress
  573. );
  574. PVOID
  575. MPEGAPI
  576. MpegPortGetDmaBuffer(
  577. IN PVOID HwDeviceExtension,
  578. IN CONTROL_DEVICE DeviceType,
  579. IN PPORT_CONFIGURATION_INFORMATION ConfigInfo,
  580. IN ULONG NumberOfBytes
  581. );
  582. ULONG
  583. MPEGAPI
  584. MpegPortGetBusData(
  585. IN PVOID HwDeviceExtension,
  586. IN ULONG BusDataType,
  587. IN ULONG SystemIoBusNumber,
  588. IN ULONG SlotNumber,
  589. IN PVOID Buffer,
  590. IN ULONG Length
  591. );
  592. MPEG_PHYSICAL_ADDRESS
  593. MPEGAPI
  594. MpegPortGetPhysicalAddress(
  595. IN PVOID HwDeviceExtension,
  596. IN PMPEG_REQUEST_BLOCK Mrb,
  597. IN PVOID VirtualAddress,
  598. OUT PULONG pLength
  599. );
  600. PVOID
  601. MPEGAPI
  602. MpegPortGetVirtualAddress(
  603. IN PVOID HwDeviceExtension,
  604. IN MPEG_PHYSICAL_ADDRESS PhysicalAddress
  605. );
  606. VOID
  607. MPEGAPI
  608. MpegPortStallExecution(
  609. IN ULONG Delay
  610. );
  611. UCHAR
  612. MPEGAPI
  613. MpegPortReadPortUchar(
  614. IN PUCHAR Port
  615. );
  616. USHORT
  617. MPEGAPI
  618. MpegPortReadPortUshort(
  619. IN PUSHORT Port
  620. );
  621. ULONG
  622. MPEGAPI
  623. MpegPortReadPortUlong(
  624. IN PULONG Port
  625. );
  626. UCHAR
  627. MPEGAPI
  628. MpegPortReadRegisterUchar(
  629. IN PUCHAR Register
  630. );
  631. USHORT
  632. MPEGAPI
  633. MpegPortReadRegisterUshort(
  634. IN PUSHORT Register
  635. );
  636. ULONG
  637. MPEGAPI
  638. MpegPortReadRegisterUlong(
  639. IN PULONG Register
  640. );
  641. VOID
  642. MPEGAPI
  643. MpegPortReadPortBufferUchar(
  644. IN PUCHAR Port,
  645. IN PUCHAR Buffer,
  646. IN ULONG Count
  647. );
  648. VOID
  649. MPEGAPI
  650. MpegPortReadPortBufferUshort(
  651. IN PUSHORT Port,
  652. IN PUSHORT Buffer,
  653. IN ULONG Count
  654. );
  655. VOID
  656. MPEGAPI
  657. MpegPortReadPortBufferUlong(
  658. IN PULONG Port,
  659. IN PULONG Buffer,
  660. IN ULONG Count
  661. );
  662. VOID
  663. MPEGAPI
  664. MpegPortReadRegisterBufferUchar(
  665. IN PUCHAR Register,
  666. IN PUCHAR Buffer,
  667. IN ULONG Count
  668. );
  669. VOID
  670. MPEGAPI
  671. MpegPortReadRegisterBufferUshort(
  672. IN PUSHORT Register,
  673. IN PUSHORT Buffer,
  674. IN ULONG Count
  675. );
  676. VOID
  677. MPEGAPI
  678. MpegPortReadRegisterBufferUlong(
  679. IN PULONG Register,
  680. IN PULONG Buffer,
  681. IN ULONG Count
  682. );
  683. VOID
  684. MPEGAPI
  685. MpegPortWritePortUchar(
  686. IN PUCHAR Port,
  687. IN UCHAR Value
  688. );
  689. VOID
  690. MPEGAPI
  691. MpegPortWritePortUshort(
  692. IN PUSHORT Port,
  693. IN USHORT Value
  694. );
  695. VOID
  696. MPEGAPI
  697. MpegPortWritePortUlong(
  698. IN PULONG Port,
  699. IN ULONG Value
  700. );
  701. VOID
  702. MPEGAPI
  703. MpegPortWriteRegisterUchar(
  704. IN PUCHAR Register,
  705. IN UCHAR Value
  706. );
  707. VOID
  708. MPEGAPI
  709. MpegPortWriteRegisterUshort(
  710. IN PUSHORT Register,
  711. IN USHORT Value
  712. );
  713. VOID
  714. MPEGAPI
  715. MpegPortWriteRegisterUlong(
  716. IN PULONG Register,
  717. IN ULONG Value
  718. );
  719. VOID
  720. MPEGAPI
  721. MpegPortWritePortBufferUchar(
  722. IN PUCHAR Port,
  723. IN PUCHAR Buffer,
  724. IN ULONG Count
  725. );
  726. VOID
  727. MPEGAPI
  728. MpegPortWritePortBufferUshort(
  729. IN PUSHORT Port,
  730. IN PUSHORT Buffer,
  731. IN ULONG Count
  732. );
  733. VOID
  734. MPEGAPI
  735. MpegPortWritePortBufferUlong(
  736. IN PULONG Port,
  737. IN PULONG Buffer,
  738. IN ULONG Count
  739. );
  740. VOID
  741. MPEGAPI
  742. MpegPortWriteRegisterBufferUchar(
  743. IN PUCHAR Register,
  744. IN PUCHAR Buffer,
  745. IN ULONG Count
  746. );
  747. VOID
  748. MPEGAPI
  749. MpegPortWriteRegisterBufferUshort(
  750. IN PUSHORT Register,
  751. IN PUSHORT Buffer,
  752. IN ULONG Count
  753. );
  754. VOID
  755. MPEGAPI
  756. MpegPortWriteRegisterBufferUlong(
  757. IN PULONG Register,
  758. IN PULONG Buffer,
  759. IN ULONG Count
  760. );
  761. ULONGLONG
  762. MPEGAPI
  763. MpegPortQueryCounter(
  764. VOID
  765. );
  766. VOID
  767. MPEGAPI
  768. MpegDebugPrint(
  769. IN DEBUG_LEVEL DebugPrintLevel,
  770. IN PCHAR DebugMessage,
  771. ...
  772. );
  773. VOID
  774. MPEGAPI
  775. MpegDebugBreakPoint(
  776. VOID
  777. );
  778. VOID
  779. MPEGAPI
  780. MpegDebugAssert(
  781. IN PCHAR File,
  782. IN ULONG Line,
  783. IN PCHAR AssertText,
  784. IN ULONG AssertValue
  785. );
  786. #endif