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.

216 lines
6.8 KiB

  1. #if defined(NDIS_WRAPPER)
  2. typedef
  3. BOOLEAN
  4. (*PNDIS_INTERRUPT_SERVICE)(
  5. IN PVOID InterruptContext
  6. );
  7. typedef
  8. VOID
  9. (*PNDIS_DEFERRED_PROCESSING)(
  10. IN PVOID SystemSpecific1,
  11. IN PVOID InterruptContext,
  12. IN PVOID SystemSpecific2,
  13. IN PVOID SystemSpecific3
  14. );
  15. #endif // defined(NDIS_WRAPPER)
  16. //
  17. // The following handlers are used in the OPEN_BLOCK
  18. //
  19. typedef
  20. NDIS_STATUS
  21. (*WAN_SEND_HANDLER)(
  22. IN NDIS_HANDLE NdisBindingHandle,
  23. IN NDIS_HANDLE LinkHandle,
  24. IN PVOID Packet
  25. );
  26. typedef
  27. NDIS_STATUS
  28. (*SEND_HANDLER)(
  29. IN NDIS_HANDLE NdisBindingHandle,
  30. IN PNDIS_PACKET Packet
  31. );
  32. typedef
  33. NDIS_STATUS
  34. (*TRANSFER_DATA_HANDLER)(
  35. IN NDIS_HANDLE NdisBindingHandle,
  36. IN NDIS_HANDLE MacReceiveContext,
  37. IN UINT ByteOffset,
  38. IN UINT BytesToTransfer,
  39. OUT PNDIS_PACKET Packet,
  40. OUT PUINT BytesTransferred
  41. );
  42. typedef
  43. NDIS_STATUS
  44. (*RESET_HANDLER)(
  45. IN NDIS_HANDLE NdisBindingHandle
  46. );
  47. typedef
  48. NDIS_STATUS
  49. (*REQUEST_HANDLER)(
  50. IN NDIS_HANDLE NdisBindingHandle,
  51. IN PNDIS_REQUEST NdisRequest
  52. );
  53. typedef
  54. VOID
  55. (*SEND_PACKETS_HANDLER)(
  56. IN NDIS_HANDLE MiniportAdapterContext,
  57. IN PPNDIS_PACKET PacketArray,
  58. IN UINT NumberOfPackets
  59. );
  60. typedef struct _NDIS_COMMON_OPEN_BLOCK
  61. {
  62. PVOID MacHandle; // needed for backward compatibility
  63. NDIS_HANDLE BindingHandle; // Miniport's open context
  64. PNDIS_MINIPORT_BLOCK MiniportHandle; // pointer to the miniport
  65. PNDIS_PROTOCOL_BLOCK ProtocolHandle; // pointer to our protocol
  66. NDIS_HANDLE ProtocolBindingContext;// context when calling ProtXX funcs
  67. PNDIS_OPEN_BLOCK MiniportNextOpen; // used by adapter's OpenQueue
  68. PNDIS_OPEN_BLOCK ProtocolNextOpen; // used by protocol's OpenQueue
  69. NDIS_HANDLE MiniportAdapterContext; // context for miniport
  70. BOOLEAN Reserved1;
  71. BOOLEAN Reserved2;
  72. BOOLEAN Reserved3;
  73. BOOLEAN Reserved4;
  74. PNDIS_STRING BindDeviceName;
  75. KSPIN_LOCK Reserved5;
  76. PNDIS_STRING RootDeviceName;
  77. //
  78. // These are referenced by the macros used by protocols to call.
  79. // All of the ones referenced by the macros are internal NDIS handlers for the miniports
  80. //
  81. union
  82. {
  83. SEND_HANDLER SendHandler;
  84. WAN_SEND_HANDLER WanSendHandler;
  85. };
  86. TRANSFER_DATA_HANDLER TransferDataHandler;
  87. //
  88. // These are referenced internally by NDIS
  89. //
  90. SEND_COMPLETE_HANDLER SendCompleteHandler;
  91. TRANSFER_DATA_COMPLETE_HANDLER TransferDataCompleteHandler;
  92. RECEIVE_HANDLER ReceiveHandler;
  93. RECEIVE_COMPLETE_HANDLER ReceiveCompleteHandler;
  94. WAN_RECEIVE_HANDLER WanReceiveHandler;
  95. REQUEST_COMPLETE_HANDLER RequestCompleteHandler;
  96. //
  97. // NDIS 4.0 extensions
  98. //
  99. RECEIVE_PACKET_HANDLER ReceivePacketHandler;
  100. SEND_PACKETS_HANDLER SendPacketsHandler;
  101. //
  102. // More Cached Handlers
  103. //
  104. RESET_HANDLER ResetHandler;
  105. REQUEST_HANDLER RequestHandler;
  106. RESET_COMPLETE_HANDLER ResetCompleteHandler;
  107. STATUS_HANDLER StatusHandler;
  108. STATUS_COMPLETE_HANDLER StatusCompleteHandler;
  109. #if defined(NDIS_WRAPPER)
  110. ULONG Flags;
  111. LONG References;
  112. KSPIN_LOCK SpinLock; // guards Closing
  113. NDIS_HANDLE FilterHandle;
  114. ULONG ProtocolOptions;
  115. USHORT CurrentLookahead;
  116. USHORT ConnectDampTicks;
  117. USHORT DisconnectDampTicks;
  118. //
  119. // These are optimizations for getting to driver routines. They are not
  120. // necessary, but are here to save a dereference through the Driver block.
  121. //
  122. W_SEND_HANDLER WSendHandler;
  123. W_TRANSFER_DATA_HANDLER WTransferDataHandler;
  124. //
  125. // NDIS 4.0 miniport entry-points
  126. //
  127. W_SEND_PACKETS_HANDLER WSendPacketsHandler;
  128. W_CANCEL_SEND_PACKETS_HANDLER CancelSendPacketsHandler;
  129. //
  130. // Contains the wake-up events that are enabled for the open.
  131. //
  132. ULONG WakeUpEnable;
  133. //
  134. // event to be signalled when close complets
  135. //
  136. PKEVENT CloseCompleteEvent;
  137. QUEUED_CLOSE QC;
  138. LONG AfReferences;
  139. PNDIS_OPEN_BLOCK NextGlobalOpen;
  140. #endif
  141. } NDIS_COMMON_OPEN_BLOCK;
  142. //
  143. // one of these per open on an adapter/protocol
  144. //
  145. struct _NDIS_OPEN_BLOCK
  146. {
  147. #ifdef __cplusplus
  148. NDIS_COMMON_OPEN_BLOCK NdisCommonOpenBlock;
  149. #else
  150. NDIS_COMMON_OPEN_BLOCK;
  151. #endif
  152. #if defined(NDIS_WRAPPER)
  153. //
  154. // The stuff below is for CO drivers/protocols. This part is not allocated for CL drivers.
  155. //
  156. struct _NDIS_OPEN_CO
  157. {
  158. //
  159. // this is the list of the call manager opens done on this adapter
  160. //
  161. struct _NDIS_CO_AF_BLOCK * NextAf;
  162. //
  163. // NDIS 5.0 miniport entry-points, filled in at open time.
  164. //
  165. W_CO_CREATE_VC_HANDLER MiniportCoCreateVcHandler;
  166. W_CO_REQUEST_HANDLER MiniportCoRequestHandler;
  167. //
  168. // NDIS 5.0 protocol completion routines, filled in at RegisterAf/OpenAf time
  169. //
  170. CO_CREATE_VC_HANDLER CoCreateVcHandler;
  171. CO_DELETE_VC_HANDLER CoDeleteVcHandler;
  172. CM_ACTIVATE_VC_COMPLETE_HANDLER CmActivateVcCompleteHandler;
  173. CM_DEACTIVATE_VC_COMPLETE_HANDLER CmDeactivateVcCompleteHandler;
  174. CO_REQUEST_COMPLETE_HANDLER CoRequestCompleteHandler;
  175. //
  176. // lists for queuing connections. There is both a queue for currently
  177. // active connections and a queue for connections that are not active.
  178. //
  179. LIST_ENTRY ActiveVcHead;
  180. LIST_ENTRY InactiveVcHead;
  181. LONG PendingAfNotifications;
  182. PKEVENT AfNotifyCompleteEvent;
  183. };
  184. #endif
  185. };