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.

356 lines
7.7 KiB

  1. #ifndef _PROTOCOL_H
  2. #define PROTOCOL_H
  3. //----------------------------------------------------------//
  4. // Local structures //
  5. //----------------------------------------------------------//
  6. typedef struct _STATUS_INDICATION_CONTEXT
  7. {
  8. PVOID StatusBuffer;
  9. UINT StatusBufferSize;
  10. NDIS_STATUS GeneralStatus;
  11. } STATUS_INDICATION_CONTEXT, *PSTATUS_INDICATION_CONTEXT;
  12. //----------------------------------------------------------//
  13. // epvc protocol helper functions //
  14. //----------------------------------------------------------//
  15. VOID
  16. epvcAdapterDelete (
  17. PRM_OBJECT_HEADER pObj,
  18. PRM_STACK_RECORD psr
  19. );
  20. PRM_OBJECT_HEADER
  21. epvcAdapterCreate(
  22. PRM_OBJECT_HEADER pParentObject,
  23. PVOID pCreateParams,
  24. PRM_STACK_RECORD psr
  25. );
  26. ULONG
  27. epvcAdapterHash(
  28. PVOID pKey
  29. );
  30. BOOLEAN
  31. epvcAdapterCompareKey(
  32. PVOID pKey,
  33. PRM_HASH_LINK pItem
  34. );
  35. NDIS_STATUS
  36. epvcTaskInitializeAdapter(
  37. IN struct _RM_TASK * pTask,
  38. IN RM_TASK_OPERATION Code,
  39. IN UINT_PTR UserParam,
  40. IN PRM_STACK_RECORD pSR
  41. );
  42. NDIS_STATUS
  43. epvcTaskActivateAdapter(
  44. IN struct _RM_TASK * pTask,
  45. IN RM_TASK_OPERATION Code,
  46. IN UINT_PTR UserParam,
  47. IN PRM_STACK_RECORD pSR
  48. );
  49. NDIS_STATUS
  50. epvcTaskDeactivateAdapter(
  51. IN struct _RM_TASK * pTask,
  52. IN RM_TASK_OPERATION Code,
  53. IN UINT_PTR UserParam,
  54. IN PRM_STACK_RECORD pSR
  55. );
  56. NDIS_STATUS
  57. epvcReadIntermediateMiniportConfiguration(
  58. IN PEPVC_ADAPTER pAdapter,
  59. IN NDIS_HANDLE MiniportListConfigName,
  60. IN PRM_STACK_RECORD pSR
  61. );
  62. NDIS_STATUS
  63. epvcReadAdapterConfiguration(
  64. PEPVC_ADAPTER pAdapter,
  65. PRM_STACK_RECORD pSR
  66. );
  67. NDIS_STATUS
  68. epvcTaskShutdownAdapter(
  69. IN struct _RM_TASK * pTask,
  70. IN RM_TASK_OPERATION Code,
  71. IN UINT_PTR UserParam,
  72. IN PRM_STACK_RECORD pSR
  73. );
  74. NDIS_STATUS
  75. epvcTaskStartIMiniport(
  76. IN struct _RM_TASK * pTask,
  77. IN RM_TASK_OPERATION Code,
  78. IN UINT_PTR UserParam,
  79. IN PRM_STACK_RECORD pSR
  80. );
  81. INT
  82. epvcAfInitEnumerate(
  83. PRM_OBJECT_HEADER pHdr,
  84. PVOID pvContext, // Unused
  85. PRM_STACK_RECORD pSR
  86. );
  87. VOID
  88. epvcInstantiateMiniport(
  89. IN PEPVC_ADAPTER pAdapter,
  90. NDIS_HANDLE MIniportConfigHandle,
  91. PRM_STACK_RECORD pSR
  92. );
  93. VOID
  94. epvcGetAdapterInfo(
  95. IN PEPVC_ADAPTER pAdapter,
  96. IN PRM_STACK_RECORD pSR,
  97. IN PRM_TASK pTask // OPTIONAL
  98. );
  99. INT
  100. epvcProcessStatusIndication (
  101. PRM_OBJECT_HEADER pHdr,
  102. PVOID pvContext,
  103. PRM_STACK_RECORD pSR
  104. );
  105. VOID
  106. epvcMediaWorkItem(
  107. PNDIS_WORK_ITEM pWorkItem,
  108. PVOID Context
  109. );
  110. NDIS_STATUS
  111. epvcTaskCloseIMiniport(
  112. IN struct _RM_TASK * pTask,
  113. IN RM_TASK_OPERATION Code,
  114. IN UINT_PTR UserParam,
  115. IN PRM_STACK_RECORD pSR
  116. );
  117. INT
  118. epvcReconfigureMiniport (
  119. PRM_OBJECT_HEADER pHdr,
  120. PVOID pvContext,
  121. PRM_STACK_RECORD pSR
  122. );
  123. NDIS_STATUS
  124. epvcPtNetEventReconfigure(
  125. IN PEPVC_ADAPTER pAdapter,
  126. IN PVOID pBuffer,
  127. IN PRM_STACK_RECORD pSR
  128. );
  129. INT
  130. epvcMiniportDoUnbind(
  131. PRM_OBJECT_HEADER pHdr,
  132. PVOID pvContext,
  133. PRM_STACK_RECORD pSR
  134. );
  135. INT
  136. epvcMiniportCloseAf(
  137. IN PEPVC_I_MINIPORT pMiniport,
  138. PRM_STACK_RECORD pSR
  139. );
  140. NDIS_STATUS
  141. epvcProcessOidCloseAf(
  142. PEPVC_I_MINIPORT pMiniport,
  143. PRM_STACK_RECORD pSR
  144. );
  145. VOID
  146. nicCloseAfWotkItem(
  147. IN PNDIS_WORK_ITEM pWorkItem,
  148. IN PVOID Context
  149. );
  150. //----------------------------------------------------------//
  151. // epvc protocol entry functions //
  152. //----------------------------------------------------------//
  153. VOID
  154. EpvcRequestComplete(
  155. IN NDIS_HANDLE ProtocolBindingContext,
  156. IN PNDIS_REQUEST NdisRequest,
  157. IN NDIS_STATUS Status
  158. );
  159. VOID
  160. EpvcUnbindAdapter(
  161. OUT PNDIS_STATUS pStatus,
  162. IN NDIS_HANDLE ProtocolBindingContext,
  163. IN NDIS_HANDLE UnbindContext
  164. );
  165. VOID
  166. EpvcOpenAdapterComplete(
  167. IN NDIS_HANDLE ProtocolBindingContext,
  168. IN NDIS_STATUS Status,
  169. IN NDIS_STATUS OpenErrorStatus
  170. );
  171. VOID
  172. EpvcCloseAdapterComplete(
  173. IN NDIS_HANDLE ProtocolBindingContext,
  174. IN NDIS_STATUS Status
  175. );
  176. VOID
  177. EpvcBindAdapter(
  178. OUT PNDIS_STATUS pStatus,
  179. IN NDIS_HANDLE BindContext,
  180. IN PNDIS_STRING pDeviceName,
  181. IN PVOID SystemSpecific1,
  182. IN PVOID SystemSpecific2
  183. );
  184. NDIS_STATUS
  185. EpvcPtPNPHandler(
  186. IN NDIS_HANDLE ProtocolBindingContext,
  187. IN PNET_PNP_EVENT pNetPnPEvent
  188. );
  189. VOID
  190. EpvcPtSendComplete(
  191. IN NDIS_STATUS Status,
  192. IN NDIS_HANDLE ProtocolVcContext,
  193. IN PNDIS_PACKET Packet
  194. );
  195. UINT
  196. EpvcPtCoReceive(
  197. IN NDIS_HANDLE ProtocolBindingContext,
  198. IN NDIS_HANDLE ProtocolVcContext,
  199. IN PNDIS_PACKET Packet
  200. );
  201. VOID
  202. EpvcPtReceiveComplete(
  203. IN NDIS_HANDLE ProtocolBindingContext
  204. );
  205. VOID
  206. epvcRemoveExtraNdisBuffers (
  207. IN PEPVC_I_MINIPORT pMiniport,
  208. IN PEPVC_SEND_COMPLETE pStruct
  209. );
  210. VOID
  211. epvcExtractSendCompleteInfo (
  212. OUT PEPVC_SEND_COMPLETE pStruct,
  213. PEPVC_I_MINIPORT pMiniport,
  214. PNDIS_PACKET pPacket
  215. );
  216. NDIS_STATUS
  217. epvcGetRecvPkt (
  218. IN PEPVC_RCV_STRUCT pRcvStruct,
  219. IN PEPVC_I_MINIPORT pMiniport,
  220. IN PNDIS_PACKET Packet
  221. );
  222. NDIS_STATUS
  223. epvcAddEthHeaderToNewPacket (
  224. IN PEPVC_RCV_STRUCT pRcvStruct,
  225. IN PEPVC_I_MINIPORT pMiniport
  226. );
  227. NDIS_STATUS
  228. epvcStripLLCHeaderFromNewPacket (
  229. IN PEPVC_RCV_STRUCT pRcvStruct,
  230. IN PEPVC_I_MINIPORT pMiniport
  231. );
  232. VOID
  233. epvcReturnPacketToOriginalState (
  234. IN PEPVC_RCV_STRUCT pRcvStruct,
  235. IN PEPVC_I_MINIPORT pMiniport,
  236. IN PNDIS_PACKET Packet
  237. );
  238. UINT
  239. EpvcCoReceive(
  240. IN NDIS_HANDLE ProtocolBindingContext,
  241. IN NDIS_HANDLE ProtocolVcContext,
  242. IN PNDIS_PACKET Packet
  243. );
  244. NDIS_STATUS
  245. epvcCopyNdisBufferChain (
  246. IN PEPVC_RCV_STRUCT pRcvStruct,
  247. IN PNDIS_BUFFER pInBuffer,
  248. IN PUCHAR pCurrOffset
  249. );
  250. VOID
  251. epvcValidatePacket (
  252. IN PNDIS_PACKET pPacket
  253. );
  254. INT
  255. epvcReconfigureAdapter(
  256. PRM_OBJECT_HEADER pHdr,
  257. PVOID pvContext,
  258. PRM_STACK_RECORD pSR
  259. );
  260. BOOLEAN
  261. epvcIsPacketLengthAcceptable (
  262. IN PNDIS_PACKET Packet,
  263. IN PEPVC_I_MINIPORT pMiniport
  264. );
  265. VOID
  266. EpvcStatus(
  267. IN NDIS_HANDLE ProtocolBindingContext,
  268. IN NDIS_STATUS GeneralStatus,
  269. IN PVOID StatusBuffer,
  270. IN UINT StatusBufferSize
  271. );
  272. NDIS_STATUS
  273. epvcStripHeaderFromNewPacket (
  274. IN PEPVC_RCV_STRUCT pRcvStruct,
  275. IN PEPVC_I_MINIPORT pMiniport
  276. );
  277. #endif