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.

160 lines
3.4 KiB

  1. extern ULONG gulBytesAllocated;
  2. extern ULONG gulBytesFreed;
  3. #define GET_PENTIUM_CLOCK_COUNT(u,l)\
  4. { \
  5. _asm push eax \
  6. _asm push ebx \
  7. _asm _emit 0x0f \
  8. _asm _emit 0x31 \
  9. _asm mov l,eax \
  10. _asm mov u,edx \
  11. _asm pop ebx \
  12. _asm pop eax \
  13. }
  14. #define FIRE_OFF_CATC outp (0x378, 00)
  15. #define RESTART_CATC outp (0x378, 0xFF)
  16. // My own Assert where I don't want to continue if I hit this error condition
  17. // DON'T append a semicolon to this.
  18. #define ISO_ASSERT( exp ) \
  19. if (!(exp)) { \
  20. RtlAssert( #exp, __FILE__, __LINE__, NULL ); \
  21. return (0); \
  22. }
  23. #define PIPEINFO_FROM_DEVOBJ(D,I,P) (&(D->Interface[I]->Pipes[P]));
  24. typedef struct __IsoTransferContext__ {
  25. PURB urb;
  26. PDEVICE_OBJECT DeviceObject;
  27. PUSBD_PIPE_INFORMATION PipeInfo;
  28. PIRP irp;
  29. PVOID pvBuffer;
  30. ULONG ulBufferLen;
  31. ULONG NumPackets;
  32. ULONG PipeNumber;
  33. ULONG ulLastData;
  34. BOOLEAN bFirstUrb;
  35. KTIMER Timer;
  36. KDPC Dpc;
  37. }IsoTxferContext, *PIsoTxterContext;
  38. NTSTATUS
  39. ISOPERF_StartIsoTest (
  40. IN PDEVICE_OBJECT DeviceObject,
  41. IN PIRP Irp
  42. );
  43. NTSTATUS
  44. ISOPERF_RefreshIsoUrb(
  45. PURB urb,
  46. USHORT packetSize,
  47. USBD_PIPE_HANDLE pipeHandle,
  48. PVOID pvDataBuffer,
  49. ULONG ulDataBufferLen
  50. );
  51. NTSTATUS
  52. ISOPERF_IsoInCompletion(
  53. IN PDEVICE_OBJECT DeviceObject,
  54. IN PIRP Irp,
  55. IN PVOID Context
  56. );
  57. PURB
  58. ISOPERF_BuildIsoRequest(
  59. IN PDEVICE_OBJECT DeviceObject,
  60. IN PUSBD_PIPE_INFORMATION pPipeDesc,
  61. IN BOOLEAN Read,
  62. IN ULONG length,
  63. IN ULONG ulFrameNumber,
  64. IN PVOID pvTransferBuffer,
  65. IN PMDL pMDL
  66. );
  67. ULONG
  68. ISOPERF_StartIsoInTest (
  69. PDEVICE_OBJECT DeviceObject,
  70. PIRP pIrp
  71. );
  72. PVOID
  73. ISOPERF_GetBuff (
  74. PDEVICE_OBJECT DeviceObject,
  75. ULONG ulPipeNumber,
  76. ULONG ulInterfaceNumber,
  77. ULONG ulNumberOfFrames,
  78. PULONG pulBufferSize
  79. );
  80. NTSTATUS
  81. ISOPERF_ResetPipe(
  82. IN PDEVICE_OBJECT DeviceObject,
  83. IN USBD_PIPE_INFORMATION * pPipeInfo
  84. );
  85. ULONG
  86. ISOPERF_GetCurrentFrame(
  87. IN PDEVICE_OBJECT DeviceObject
  88. );
  89. NTSTATUS
  90. ISOPERF_StopIsoInTest (
  91. IN PDEVICE_OBJECT DeviceObject,
  92. IN PIRP Irp
  93. );
  94. BOOLEAN
  95. ISOPERF_IsDataGood(PIsoTxterContext pIsoContext);
  96. NTSTATUS
  97. ISOPERF_GetStats (
  98. IN PDEVICE_OBJECT DeviceObject,
  99. IN PIRP Irp,
  100. IN OUT pConfig_Stat_Info pStatInfo,
  101. IN ULONG ulBufferLen
  102. );
  103. NTSTATUS
  104. ISOPERF_SetDriverConfig (
  105. IN PDEVICE_OBJECT DeviceObject,
  106. IN PIRP Irp,
  107. IN OUT pConfig_Stat_Info pConfInfoIn,
  108. IN ULONG ulBufferLen
  109. );
  110. NTSTATUS
  111. ISOPERF_FindMateDevice (
  112. PDEVICE_OBJECT DeviceObject
  113. );
  114. VOID
  115. ISOPERF_StartIsoOutTest (
  116. IN PISOPERF_WORKITEM IsoperfWorkItem
  117. );
  118. NTSTATUS
  119. ISOPERF_IsoOutCompletion(
  120. IN PDEVICE_OBJECT DeviceObject,
  121. IN PIRP Irp,
  122. IN PVOID Context
  123. );
  124. NTSTATUS
  125. ISOPERF_TimeStampUrb ( PVOID urb,
  126. PULONG pulLower,
  127. PULONG pulUpper
  128. );
  129. NTSTATUS
  130. ISOPERF_GetUrbTimeStamp ( PVOID urb,
  131. PULONG pulLower,
  132. PULONG pulUpper
  133. );