Leaked source code of windows server 2003
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.

178 lines
3.2 KiB

  1. /////////////////////////////////////////////////////////////////////////////
  2. //
  3. //
  4. // Copyright (c) 1996, 1997 Microsoft Corporation
  5. //
  6. //
  7. // Module Name:
  8. // frame.h
  9. //
  10. // Abstract:
  11. //
  12. // This file is the include file for frame objects
  13. //
  14. // Author:
  15. //
  16. // P Porzuczek
  17. //
  18. // Environment:
  19. //
  20. // Revision History:
  21. //
  22. //
  23. //////////////////////////////////////////////////////////////////////////////
  24. /////////////////////////////////////////////////////////////////////////////
  25. //
  26. //
  27. #define IPSINK_NDIS_MAX_BUFFERS 64
  28. #define MAX_IP_PACKET_SIZE 4082
  29. #define IPSINK_NDIS_BUFFER_SIZE 4096
  30. //////////////////////////////////////////////////////////
  31. //
  32. //
  33. //
  34. typedef enum
  35. {
  36. FRAME_STATE_AVAILABLE = 0x00000001,
  37. FRAME_STATE_INDICATED,
  38. MAX_FRAME_STATES
  39. } FRAME_STATE;
  40. //////////////////////////////////////////////////////////
  41. //
  42. //
  43. //
  44. typedef struct _MEDIA_SPECIFIC_INFORMATION_
  45. {
  46. PFRAME pFrame;
  47. } IPSINK_MEDIA_SPECIFIC_INFORMATION, *PIPSINK_MEDIA_SPECIFIC_INFORAMTION;
  48. //////////////////////////////////////////////////////////
  49. //
  50. //
  51. //
  52. typedef struct _FRAME_
  53. {
  54. LIST_ENTRY leLinkage;
  55. ULONG ulRefCount;
  56. ULONG ulFrameSize;
  57. ULONG ulState;
  58. ULONG ulcbData;
  59. PFRAME_POOL pFramePool;
  60. PVOID pvMemory;
  61. PNDIS_BUFFER pNdisBuffer;
  62. PFRAME_VTABLE lpVTable;
  63. IPSINK_MEDIA_SPECIFIC_INFORMATION MediaSpecificInformation;
  64. };
  65. //////////////////////////////////////////////////////////
  66. //
  67. //
  68. //
  69. typedef struct _FRAME_POOL_
  70. {
  71. PADAPTER pAdapter;
  72. ULONG ulRefCount;
  73. ULONG ulNumFrames;
  74. ULONG ulFrameSize;
  75. ULONG ulState;
  76. NDIS_HANDLE ndishBufferPool;
  77. NDIS_HANDLE ndishPacketPool;
  78. LIST_ENTRY leAvailableQueue;
  79. LIST_ENTRY leIndicateQueue;
  80. NDIS_SPIN_LOCK SpinLock;
  81. PFRAME_POOL_VTABLE lpVTable;
  82. };
  83. ///////////////////////////////////////////////////////////////////////////////////
  84. //
  85. //
  86. //
  87. NTSTATUS
  88. CreateFramePool (
  89. PADAPTER pAdapter,
  90. PFRAME_POOL *pFramePool,
  91. ULONG ulNumFrames,
  92. ULONG ulFrameSize,
  93. ULONG ulcbMediaInformation
  94. );
  95. NDIS_STATUS
  96. FreeFramePool (
  97. PFRAME_POOL pFramePool
  98. );
  99. NTSTATUS
  100. FramePool_QueryInterface (
  101. PFRAME_POOL pFramePool
  102. );
  103. ULONG
  104. FramePool_AddRef (
  105. PFRAME_POOL pFramePool
  106. );
  107. ULONG
  108. FramePool_Release (
  109. PFRAME_POOL pFramePool
  110. );
  111. PFRAME
  112. GetFrame (
  113. PFRAME_POOL pFramePool,
  114. PLIST_ENTRY pQueue
  115. );
  116. PFRAME
  117. PutFrame (
  118. PFRAME_POOL pFramePool,
  119. PLIST_ENTRY pQueue,
  120. PFRAME pFrame
  121. );
  122. ///////////////////////////////////////////////////////////////////////////////////
  123. //
  124. //
  125. //
  126. NTSTATUS
  127. CreateFrame (
  128. PFRAME *pFrame,
  129. ULONG ulFrameSize,
  130. NDIS_HANDLE ndishBufferPool,
  131. PFRAME_POOL pFramePool
  132. );
  133. NTSTATUS
  134. Frame_QueryInterface (
  135. PFRAME pFrame
  136. );
  137. ULONG
  138. Frame_AddRef (
  139. PFRAME pFrame
  140. );
  141. ULONG
  142. Frame_Release (
  143. PFRAME pFrame
  144. );
  145. NTSTATUS
  146. IndicateFrame (
  147. IN PFRAME pFrame,
  148. IN ULONG ulcbData
  149. );
  150. void
  151. SourceRoutingStatusPoll(
  152. );