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.

117 lines
3.7 KiB

  1. /*******************************************************************
  2. *
  3. * MPINIT.H
  4. *
  5. * Copyright (C) 1995 SGS-THOMSON Microelectronics.
  6. *
  7. *
  8. * Prototypes for MPINIT.C
  9. *
  10. *******************************************************************/
  11. #ifndef __MPINIT_H__
  12. #define __MPINIT_H__
  13. #define NO_ERROR 0
  14. #ifndef NULL
  15. #define NULL 0
  16. #endif
  17. #define ERROR_CARD_NOT_FOUND 1
  18. #define ERROR_NOT_ENOUGH_MEMORY 2
  19. #define ERROR_COMMAND_NOT_IMPLEMENTED 3
  20. // BGP #define VIDEO_PACKET_TIMER (10*1000)
  21. #define VIDEO_PACKET_TIMER (5*1000)
  22. #define AUDIO_PACKET_TIMER (10*1000)
  23. #define MEM_WINDOW_SIZE (128*1024)
  24. typedef struct _VIDEO_DEVICE_EXTENSION {
  25. BOOLEAN EOSInProgress; // End Of Stream ha been sent to device
  26. KSSTATE DeviceState;
  27. STREAM_SYSTEM_TIME videoSTC;
  28. PHW_STREAM_REQUEST_BLOCK pCurrentSRB;
  29. ULONG StarvationCount; // number of times device was starved since last reset
  30. ULONG cPacket; // current packet in process
  31. ULONG cOffs; // offset into the current packet
  32. PKSDATA_PACKET pPacket;
  33. PVOID pDMABuf;
  34. } VIDEO_DEVICE_EXTENSION, *PVIDEO_DEVICE_EXTENSION;
  35. typedef struct _AUDIO_DEVICE_EXTENSION {
  36. STREAM_SYSTEM_TIME audioSTC;
  37. KSSTATE DeviceState;
  38. PHW_STREAM_REQUEST_BLOCK pCurrentSRB;
  39. ULONG StarvationCount; // number of times device was starved since last reset
  40. ULONG ByteSent;
  41. ULONG cPacket; // current packet in process
  42. ULONG cOffs; // offset into the current packet
  43. PKSDATA_PACKET pPacket;
  44. } AUDIO_DEVICE_EXTENSION, *PAUDIO_DEVICE_EXTENSION;
  45. typedef struct _HW_DEVICE_EXTENSION {
  46. KSSTATE stState;
  47. PUSHORT ioBaseLocal;
  48. PUSHORT ioBasePCI9060;
  49. USHORT Irq;
  50. BOOLEAN bVideoInt;
  51. BOOLEAN bAudioInt;
  52. PHW_STREAM_REQUEST_BLOCK AudioQ;
  53. PHW_STREAM_REQUEST_BLOCK VideoQ;
  54. VIDEO_DEVICE_EXTENSION VideoDeviceExt;
  55. AUDIO_DEVICE_EXTENSION AudioDeviceExt;
  56. PHW_STREAM_REQUEST_BLOCK pCurSrb;
  57. PHW_STREAM_REQUEST_BLOCK pSrbQ;
  58. } HW_DEVICE_EXTENSION, *PHW_DEVICE_EXTENSION;
  59. typedef VOID (*PFN_WRITE_DATA) (PHW_STREAM_REQUEST_BLOCK pSrb);
  60. typedef struct _STREAMEX {
  61. PFN_WRITE_DATA pfnWriteData;
  62. PFN_WRITE_DATA pfnSetState;
  63. PFN_WRITE_DATA pfnGetProp;
  64. } STREAMEX, *PSTREAMEX;
  65. typedef struct _MRP_EXTENSION {
  66. ULONG Status;
  67. } MRP_EXTENSION, * PMRP_EXTENSION;
  68. NTSTATUS HwInitialize (IN PHW_STREAM_REQUEST_BLOCK pSrb );
  69. BOOLEAN HwUnInitialize ( IN PVOID DeviceExtension);
  70. BOOLEAN HwInterrupt ( IN PVOID pDeviceExtension );
  71. VOID AudioEnableInterrupts(IN PVOID pHwDeviceExtension);
  72. VOID STEnableInterrupts( IN PVOID pHwDeviceExtension );
  73. VOID STDeferredCallback ( IN PVOID pHwDeviceExtension );
  74. VOID TmpDeferredCallback ( IN PVOID pHwDeviceExtension );
  75. VOID AudioTimerCallBack(IN PHW_DEVICE_EXTENSION pDeviceExtension);
  76. ULONG DriverEntry (PVOID Context1, PVOID Context2);
  77. // Function Prototype for the locally defined functions
  78. BOOLEAN HwStartIo (
  79. IN PVOID DeviceExtension,
  80. PHW_STREAM_REQUEST_BLOCK pMrb
  81. );
  82. VOID AdapterOpenStream(PHW_STREAM_REQUEST_BLOCK pSrb);
  83. VOID AdapterCloseStream(PHW_STREAM_REQUEST_BLOCK pSrb);
  84. VOID STREAMAPI AdapterReceivePacket(IN PHW_STREAM_REQUEST_BLOCK Srb);
  85. VOID STREAMAPI AdapterCancelPacket(IN PHW_STREAM_REQUEST_BLOCK Srb);
  86. VOID STREAMAPI AdapterTimeoutPacket(IN PHW_STREAM_REQUEST_BLOCK Srb);
  87. VOID HostDisableIT(VOID);
  88. VOID HostEnableIT(VOID);
  89. PHW_STREAM_REQUEST_BLOCK Dequeue(PHW_DEVICE_EXTENSION pdevext);
  90. VOID STREAMAPI StreamReceiveDataPacket(IN PHW_STREAM_REQUEST_BLOCK pSrb);
  91. VOID STREAMAPI StreamReceiveCtrlPacket(IN PHW_STREAM_REQUEST_BLOCK pSrb);
  92. VOID AdapterStreamInfo(PHW_STREAM_REQUEST_BLOCK pSrb);
  93. VOID StreamStartCommand (PHW_DEVICE_EXTENSION pdevext);
  94. void Enqueue (PHW_STREAM_REQUEST_BLOCK pSrb, PHW_DEVICE_EXTENSION pdevext);
  95. #endif //__MPINIT_H__
  96.