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.

271 lines
8.8 KiB

  1. /*++
  2. Copyright (c) 1990-1995 Microsoft Corporation
  3. Module Name:
  4. ndis_co.h
  5. Abstract:
  6. NDIS wrapper CO definitions
  7. Author:
  8. Environment:
  9. Kernel mode, FSD
  10. Revision History:
  11. Jan-98 Jameel Hyder Split up from ndisco.h
  12. --*/
  13. #ifndef _NDIS_CO_
  14. #define _NDIS_CO_
  15. //
  16. // NDIS_CO_AF_BLOCK:
  17. //
  18. // This structure represents a client's open of an address family on an adapter.
  19. // An NdisAfHandle points to one of these.
  20. //
  21. // Creation: NdisClOpenAddressFamily
  22. // Deletion: Ndis[M]CmCloseAddressFamilyComplete
  23. //
  24. typedef struct _NDIS_CO_AF_BLOCK
  25. {
  26. struct _NDIS_CO_AF_BLOCK * NextAf; // the next open of the call manager per adapter open
  27. ULONG Flags;
  28. LONG References;
  29. PNDIS_MINIPORT_BLOCK Miniport; // pointer to the miniport in question
  30. //
  31. // Cached call manager entry points
  32. //
  33. PNDIS_CALL_MANAGER_CHARACTERISTICS CallMgrEntries;
  34. PNDIS_OPEN_BLOCK CallMgrOpen; // pointer to the call manager's open adapter:
  35. // this is NULL iff combined Miniport+CM
  36. NDIS_HANDLE CallMgrContext; // context when calling CM's ProtXX funcs
  37. //
  38. // Cached client entry points
  39. //
  40. NDIS_CLIENT_CHARACTERISTICS ClientEntries;
  41. PNDIS_OPEN_BLOCK ClientOpen; // pointer to the client's open adapter
  42. NDIS_HANDLE ClientContext; // context when calling Client's ProtXX funcs
  43. KSPIN_LOCK Lock;
  44. } NDIS_CO_AF_BLOCK, *PNDIS_CO_AF_BLOCK;
  45. //
  46. // Bit definitions for Flags in NDIS_CO_AF_BLOCK
  47. //
  48. #define AF_COMBO 0x00000001 // Set iff combined Miniport+CM
  49. #define AF_CLOSING 0x80000000
  50. //
  51. // NDIS_CO_SAP_BLOCK:
  52. //
  53. // Service Access Point (Sap) structure. The NdisSapHandle points to one of these.
  54. // A SAP is associated with an open AF block.
  55. //
  56. // Creation: NdisClRegisterSap
  57. // Deletion: Ndis[M]CmDeregisterSapComplete
  58. //
  59. typedef struct _NDIS_CO_SAP_BLOCK
  60. {
  61. NDIS_HANDLE CallMgrContext;
  62. NDIS_HANDLE ClientContext;
  63. PNDIS_CO_AF_BLOCK AfBlock;
  64. PCO_SAP Sap;
  65. ULONG Flags;
  66. LONG References;
  67. KSPIN_LOCK Lock;
  68. } NDIS_CO_SAP_BLOCK, *PNDIS_CO_SAP_BLOCK;
  69. //
  70. // Definitions for Flags in NDIS_CO_SAP_BLOCK:
  71. //
  72. #define SAP_CLOSING 0x80000000
  73. //
  74. // NDIS_CO_VC_BLOCK:
  75. //
  76. // The Virtual Connection structure. The NdisVcHandle points to a NDIS_CO_VC_PTR,
  77. // which points to one of these.
  78. //
  79. // Creation: NdisCoCreateVc, NdisMCmCreateVc
  80. // Deletion: NdisCoDeleteVc, NdisMCmDeleteVc
  81. //
  82. typedef struct _NDIS_CO_VC_BLOCK
  83. {
  84. ULONG References;
  85. ULONG Flags; // to track closes
  86. KSPIN_LOCK Lock;
  87. PNDIS_OPEN_BLOCK ClientOpen; // identifies the client for miniport
  88. // IndicatePacket
  89. //
  90. // References for client and call-manager
  91. //
  92. NDIS_HANDLE ClientContext; // passed up to the client on indications
  93. struct _NDIS_CO_VC_PTR_BLOCK * pProxyVcPtr; // Pointer to Proxy's VcPr
  94. struct _NDIS_CO_VC_PTR_BLOCK * pClientVcPtr; // Pointer to Client's VcPtr
  95. //
  96. // Clients cached entry points
  97. //
  98. CO_SEND_COMPLETE_HANDLER CoSendCompleteHandler;
  99. CO_RECEIVE_PACKET_HANDLER CoReceivePacketHandler;
  100. PNDIS_OPEN_BLOCK CallMgrOpen; // identifies the call-manager
  101. NDIS_HANDLE CallMgrContext; // passed up to the call manager on indications
  102. //
  103. // Call-manager cached entry points duplicates of VC_PTR_BLOCK
  104. //
  105. CM_ACTIVATE_VC_COMPLETE_HANDLER CmActivateVcCompleteHandler;
  106. CM_DEACTIVATE_VC_COMPLETE_HANDLER CmDeactivateVcCompleteHandler;
  107. CM_MODIFY_CALL_QOS_HANDLER CmModifyCallQoSHandler;
  108. //
  109. // Miniport's context and some cached entry-points
  110. //
  111. PNDIS_MINIPORT_BLOCK Miniport; // pointer to the miniport in question
  112. NDIS_HANDLE MiniportContext;// passed down to the miniport
  113. ULONGLONG VcId; // opaque ID for the VC, picked
  114. // up from MediaParameters when
  115. // the VC is activated
  116. } NDIS_CO_VC_BLOCK, *PNDIS_CO_VC_BLOCK;
  117. //
  118. // NDIS_CO_VC_PTR_BLOCK:
  119. //
  120. // The VC Pointer structure. The NdisVcHandle points to one of these.
  121. // When a VC is created, one VC Block structure and one VC pointer structure
  122. // are created.
  123. //
  124. //
  125. typedef struct _NDIS_CO_VC_PTR_BLOCK
  126. {
  127. LONG References;
  128. ULONG CallFlags; // call state of this VC Ptr
  129. PLONG pVcFlags;
  130. KSPIN_LOCK Lock;
  131. NDIS_HANDLE ClientContext; // passed up to the client
  132. // on indications and completes
  133. LIST_ENTRY ClientLink;
  134. LIST_ENTRY VcLink;
  135. PNDIS_CO_AF_BLOCK AfBlock; // OPTIONAL - NULL for call-mgr owned VCs
  136. //
  137. // Miniport VC
  138. //
  139. PNDIS_CO_VC_BLOCK VcBlock;
  140. //
  141. // Identifies the client. This could be the call-manager open if the
  142. // Vc is call-manager owned, i.e. doesn't have an client association.
  143. //
  144. PNDIS_OPEN_BLOCK ClientOpen;
  145. LONG OwnsVcBlock;
  146. //
  147. // The non-creator's handler and context
  148. //
  149. CO_DELETE_VC_HANDLER CoDeleteVcHandler;
  150. NDIS_HANDLE DeleteVcContext;
  151. //
  152. // Clients cached entry points
  153. //
  154. CL_MODIFY_CALL_QOS_COMPLETE_HANDLER ClModifyCallQoSCompleteHandler;
  155. CL_INCOMING_CALL_QOS_CHANGE_HANDLER ClIncomingCallQoSChangeHandler;
  156. CL_CALL_CONNECTED_HANDLER ClCallConnectedHandler;
  157. PNDIS_OPEN_BLOCK CallMgrOpen; // identifies the call-manager
  158. NDIS_HANDLE CallMgrContext; // passed up to the call manager on indications
  159. LIST_ENTRY CallMgrLink;
  160. //
  161. // Call-manager cached entry points duplicates of VC_BLOCK
  162. //
  163. CM_ACTIVATE_VC_COMPLETE_HANDLER CmActivateVcCompleteHandler;
  164. CM_DEACTIVATE_VC_COMPLETE_HANDLER CmDeactivateVcCompleteHandler;
  165. CM_MODIFY_CALL_QOS_HANDLER CmModifyCallQoSHandler;
  166. //
  167. // Miniport's context and some cached entry-points
  168. //
  169. PNDIS_MINIPORT_BLOCK Miniport; // pointer to the miniport in question
  170. NDIS_HANDLE MiniportContext;// passed down to the miniport
  171. W_CO_SEND_PACKETS_HANDLER WCoSendPacketsHandler;
  172. W_CO_DELETE_VC_HANDLER WCoDeleteVcHandler;
  173. W_CO_ACTIVATE_VC_HANDLER WCoActivateVcHandler;
  174. W_CO_DEACTIVATE_VC_HANDLER WCoDeactivateVcHandler;
  175. UNICODE_STRING VcInstanceName; // Used to query this specific VC via WMI.
  176. LARGE_INTEGER VcIndex; // Used to build the instance name.
  177. LIST_ENTRY WmiLink; // List of WMI enabled VCs
  178. } NDIS_CO_VC_PTR_BLOCK, *PNDIS_CO_VC_PTR_BLOCK;
  179. #define VC_ACTIVE 0x00000001
  180. #define VC_ACTIVATE_PENDING 0x00000002
  181. #define VC_DEACTIVATE_PENDING 0x00000004
  182. #define VC_DELETE_PENDING 0x00000008
  183. #define VC_HANDOFF_IN_PROGRESS 0x00000010 // Being handed off to proxied client
  184. //
  185. // VC Call states:
  186. //
  187. #define VC_CALL_ACTIVE 0x00000008
  188. #define VC_CALL_PENDING 0x00000010
  189. #define VC_CALL_CLOSE_PENDING 0x00000020
  190. #define VC_CALL_ABORTED 0x00000040
  191. #define VC_PTR_BLOCK_CLOSING 0x80000000
  192. //
  193. // Structure to represent a handle generated when a multi-party call is generated.
  194. // This handle can ONLY be used for NdisCoDropParty call.
  195. //
  196. typedef struct _NDIS_CO_PARTY_BLOCK
  197. {
  198. PNDIS_CO_VC_PTR_BLOCK VcPtr;
  199. NDIS_HANDLE CallMgrContext;
  200. NDIS_HANDLE ClientContext;
  201. //
  202. // Cached client Handlers
  203. //
  204. CL_INCOMING_DROP_PARTY_HANDLER ClIncomingDropPartyHandler;
  205. CL_DROP_PARTY_COMPLETE_HANDLER ClDropPartyCompleteHandler;
  206. } NDIS_CO_PARTY_BLOCK, *PNDIS_CO_PARTY_BLOCK;
  207. NTSTATUS
  208. ndisUnicodeStringToPointer (
  209. IN PUNICODE_STRING String,
  210. IN ULONG Base OPTIONAL,
  211. OUT PVOID *Value
  212. );
  213. #endif // _NDIS_CO_