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.

428 lines
8.9 KiB

  1. #ifndef _MINIPORT_H
  2. #define _MINIPORT_H
  3. //-------------------------------------------------------------//
  4. // //
  5. // Headers and Lengths used for Ethernet packets //
  6. // //
  7. //-------------------------------------------------------------//
  8. #define MINIMUM_ETHERNET_LENGTH 64
  9. #define ETHERNET_PADDING_LENGTH 2
  10. // 64 bytes of zeroes - used in padding ethernet packets
  11. extern UCHAR gPaddingBytes[MINIMUM_ETHERNET_LENGTH];
  12. //-------------------------------------------------------------//
  13. // //
  14. // Function declarations //
  15. // //
  16. //-------------------------------------------------------------//
  17. PRM_OBJECT_HEADER
  18. epvcIMiniportCreate(
  19. PRM_OBJECT_HEADER pParentObject,
  20. PVOID pCreateParams,
  21. PRM_STACK_RECORD psr
  22. );
  23. VOID
  24. epvcIMiniportDelete (
  25. PRM_OBJECT_HEADER pObj,
  26. PRM_STACK_RECORD psr
  27. );
  28. BOOLEAN
  29. epvcIMiniportCompareKey(
  30. PVOID pKey,
  31. PRM_HASH_LINK pItem
  32. );
  33. ULONG
  34. epvcIMiniportHash(
  35. PVOID pKey
  36. );
  37. VOID
  38. epvcVcSetupDone (
  39. PTASK_VC pTaskVc,
  40. PEPVC_I_MINIPORT pMiniport
  41. );
  42. VOID
  43. epvcVcTeardownDone(
  44. PTASK_VC pTaskVc,
  45. PEPVC_I_MINIPORT pMiniport
  46. );
  47. NDIS_STATUS
  48. epvcSetPacketFilter(
  49. IN PEPVC_I_MINIPORT pMiniport,
  50. IN ULONG Filter,
  51. PRM_STACK_RECORD pSR
  52. );
  53. NDIS_STATUS
  54. EpvcInitialize(
  55. OUT PNDIS_STATUS OpenErrorStatus,
  56. OUT PUINT SelectedMediumIndex,
  57. IN PNDIS_MEDIUM MediumArray,
  58. IN UINT MediumArraySize,
  59. IN NDIS_HANDLE MiniportAdapterHandle,
  60. IN NDIS_HANDLE WrapperConfigurationContext
  61. );
  62. VOID
  63. EpvcHalt(
  64. IN NDIS_HANDLE MiniportAdapterContext
  65. );
  66. NDIS_STATUS
  67. EpvcMpQueryInformation(
  68. IN NDIS_HANDLE MiniportAdapterContext,
  69. IN NDIS_OID Oid,
  70. IN PVOID InformationBuffer,
  71. IN ULONG InformationBufferLength,
  72. OUT PULONG BytesWritten,
  73. OUT PULONG BytesNeeded
  74. );
  75. NDIS_STATUS
  76. EpvcMpSetInformation(
  77. IN NDIS_HANDLE MiniportAdapterContext,
  78. IN NDIS_OID Oid,
  79. IN PVOID InformationBuffer,
  80. IN ULONG InformationBufferLength,
  81. OUT PULONG BytesRead,
  82. OUT PULONG BytesNeeded
  83. );
  84. NDIS_STATUS
  85. epvcMpSetNetworkAddresses(
  86. IN PEPVC_I_MINIPORT pMiniport,
  87. IN PVOID InformationBuffer,
  88. IN ULONG InformationBufferLength,
  89. IN PRM_STACK_RECORD pSR,
  90. OUT PULONG BytesRead,
  91. OUT PULONG BytesNeeded
  92. );
  93. NDIS_STATUS
  94. epvcMpSetNetworkAddresses(
  95. IN PEPVC_I_MINIPORT pMiniport,
  96. IN PVOID InformationBuffer,
  97. IN ULONG InformationBufferLength,
  98. IN PRM_STACK_RECORD pSR,
  99. OUT PULONG BytesRead,
  100. OUT PULONG BytesNeeded
  101. );
  102. VOID
  103. epvcSetupMakeCallParameters(
  104. PEPVC_I_MINIPORT pMiniport,
  105. PCO_CALL_PARAMETERS *ppCallParameters
  106. );
  107. VOID
  108. epvcInitiateMiniportHalt(
  109. IN PEPVC_I_MINIPORT pMiniport,
  110. IN PRM_STACK_RECORD pSR
  111. );
  112. VOID
  113. epvcMpHaltDoUnbind(
  114. PEPVC_I_MINIPORT pMiniport,
  115. PRM_STACK_RECORD pSR
  116. );
  117. NDIS_STATUS
  118. epvcTaskHaltMiniport(
  119. IN struct _RM_TASK * pTask,
  120. IN RM_TASK_OPERATION Code,
  121. IN UINT_PTR UserParam,
  122. IN PRM_STACK_RECORD pSR
  123. );
  124. NDIS_STATUS
  125. epvcAddLLCEncapsulation (
  126. PEPVC_I_MINIPORT pMiniport ,
  127. PNDIS_PACKET pOldPkt,
  128. PNDIS_PACKET pNewPkt,
  129. PRM_STACK_RECORD pSR
  130. );
  131. NDIS_STATUS
  132. epvcAdapterSend(
  133. IN PEPVC_I_MINIPORT pMiniport,
  134. IN PNDIS_PACKET pPkt,
  135. PRM_STACK_RECORD pSR
  136. );
  137. VOID
  138. epvcGetSendPkt (
  139. IN PEPVC_I_MINIPORT pMiniport,
  140. IN PNDIS_PACKET pSentPkt,
  141. IN PEPVC_SEND_STRUCT pSendStruct,
  142. IN PRM_STACK_RECORD pSR
  143. );
  144. VOID
  145. epvcFreeSendPkt(
  146. PEPVC_I_MINIPORT pMiniport,
  147. IN PEPVC_SEND_STRUCT pSendStruct
  148. );
  149. NDIS_STATUS
  150. epvcRemoveSendEncapsulation (
  151. PEPVC_I_MINIPORT pMiniport ,
  152. PNDIS_PACKET pNewPkt
  153. );
  154. NDIS_STATUS
  155. epvcAddRecvEncapsulation (
  156. PEPVC_I_MINIPORT pMiniport ,
  157. PNDIS_PACKET pNewPkt
  158. );
  159. NDIS_STATUS
  160. epvcRemoveSendEncapsulation (
  161. PEPVC_I_MINIPORT pMiniport ,
  162. PNDIS_PACKET pNewPkt
  163. );
  164. NDIS_STATUS
  165. epvcRemoveRecvEncapsulation (
  166. PEPVC_I_MINIPORT pMiniport ,
  167. PNDIS_PACKET pNewPkt
  168. );
  169. VOID
  170. EpvcSendPackets(
  171. IN NDIS_HANDLE MiniportAdapterContext,
  172. IN PPNDIS_PACKET PacketArray,
  173. IN UINT NumberOfPackets
  174. );
  175. NDIS_STATUS
  176. epvcMiniportReadConfig(
  177. IN PEPVC_I_MINIPORT pMiniport,
  178. NDIS_HANDLE WrapperConfigurationContext,
  179. PRM_STACK_RECORD pSR
  180. );
  181. VOID
  182. epvcDumpPkt (
  183. IN PNDIS_PACKET pPkt
  184. );
  185. BOOLEAN
  186. epvcCheckAndReturnArps (
  187. IN PEPVC_I_MINIPORT pMiniport,
  188. IN PNDIS_PACKET pPkt,
  189. IN PEPVC_SEND_STRUCT pSendStruct,
  190. IN PRM_STACK_RECORD pSR
  191. );
  192. VOID
  193. epvcFormulateArpResponse (
  194. IN PEPVC_I_MINIPORT pMiniport,
  195. IN PEPVC_ARP_CONTEXT pArpContext,
  196. IN PRM_STACK_RECORD pSR
  197. );
  198. VOID
  199. epvcInitializeMiniportLookasideLists (
  200. IN PEPVC_I_MINIPORT pMiniport
  201. );
  202. NDIS_STATUS
  203. epvcInitializeMiniportPacketPools (
  204. IN PEPVC_I_MINIPORT pMiniport
  205. );
  206. VOID
  207. epvcDeleteMiniportLookasideLists (
  208. IN PEPVC_I_MINIPORT pMiniport
  209. );
  210. VOID
  211. epvcDeleteMiniportPacketPools (
  212. IN PEPVC_I_MINIPORT pMiniport
  213. );
  214. NDIS_STATUS
  215. epvcTaskRespondToArp(
  216. IN struct _RM_TASK * pTask,
  217. IN RM_TASK_OPERATION Code,
  218. IN UINT_PTR UserParam,
  219. IN PRM_STACK_RECORD pSR
  220. );
  221. VOID
  222. epvcArpTimer(
  223. IN PVOID SystemSpecific1,
  224. IN PVOID FunctionContext,
  225. IN PVOID SystemSpecific2,
  226. IN PVOID SystemSpecific3
  227. );
  228. VOID
  229. epvcExtractPktInfo (
  230. PEPVC_I_MINIPORT pMiniport,
  231. PNDIS_PACKET pPacket ,
  232. PEPVC_SEND_STRUCT SendStruct
  233. );
  234. NDIS_STATUS
  235. epvcRemoveEthernetHeader (
  236. PEPVC_SEND_STRUCT pSendStruct,
  237. IN PRM_STACK_RECORD pSR
  238. );
  239. NDIS_STATUS
  240. epvcSendRoutine(
  241. IN PEPVC_I_MINIPORT pMiniport,
  242. IN PNDIS_PACKET Packet,
  243. PRM_STACK_RECORD pSR
  244. );
  245. VOID
  246. epvcSetPacketContext (
  247. IN PEPVC_SEND_STRUCT pSendStruct,
  248. PRM_STACK_RECORD pSR
  249. );
  250. VOID
  251. epvcInitializeMiniportParameters(
  252. PEPVC_I_MINIPORT pMiniport
  253. );
  254. VOID
  255. epvcReturnPacketUsingAllocation(
  256. IN PEPVC_I_MINIPORT pMiniport,
  257. IN PNDIS_PACKET Packet,
  258. OUT PNDIS_PACKET *ppOriginalPacket,
  259. IN PRM_STACK_RECORD pSR
  260. );
  261. VOID
  262. epvcReturnPacketUsingStacks (
  263. IN PEPVC_I_MINIPORT pMiniport,
  264. IN PNDIS_PACKET Packet,
  265. IN PRM_STACK_RECORD pSR
  266. );
  267. VOID
  268. EpvcReturnPacket(
  269. IN NDIS_HANDLE MiniportAdapterContext,
  270. IN PNDIS_PACKET Packet
  271. );
  272. VOID
  273. epvcDerefSendPkt (
  274. PNDIS_PACKET pNdisPacket,
  275. PRM_OBJECT_HEADER pHdr
  276. );
  277. VOID
  278. epvcDerefRecvPkt (
  279. PNDIS_PACKET pNdisPacket,
  280. PRM_OBJECT_HEADER pHdr
  281. );
  282. VOID
  283. epvcRefRecvPkt(
  284. PNDIS_PACKET pNdisPacket,
  285. PRM_OBJECT_HEADER pHdr // either an adapter or a miniport
  286. );
  287. NDIS_STATUS
  288. epvcTaskCloseAddressFamily(
  289. IN struct _RM_TASK * pTask,
  290. IN RM_TASK_OPERATION Code,
  291. IN UINT_PTR UserParam,
  292. IN PRM_STACK_RECORD pSR
  293. );
  294. VOID
  295. epvcProcessReturnPacket (
  296. IN PEPVC_I_MINIPORT pMiniport,
  297. IN PNDIS_PACKET Packet,
  298. OUT PPNDIS_PACKET ppOrigPacket,
  299. IN PRM_STACK_RECORD pSR
  300. );
  301. NDIS_STATUS
  302. epvcAddEthernetTail(
  303. PEPVC_SEND_STRUCT pSendStruct,
  304. IN PRM_STACK_RECORD pSR
  305. );
  306. VOID
  307. epvcRemoveEthernetTail (
  308. IN PEPVC_I_MINIPORT pMiniport,
  309. IN PNDIS_PACKET pPacket,
  310. IN PEPVC_PKT_CONTEXT pContext
  311. );
  312. VOID
  313. epvcRemoveEthernetPad (
  314. IN PEPVC_I_MINIPORT pMiniport,
  315. IN PNDIS_PACKET pPacket
  316. );
  317. NDIS_STATUS
  318. epvcAddEthernetPad(
  319. PEPVC_SEND_STRUCT pSendStruct,
  320. IN PRM_STACK_RECORD pSR
  321. );
  322. VOID
  323. epvcCancelDeviceInstance(
  324. IN PEPVC_I_MINIPORT pMiniport ,
  325. IN PRM_STACK_RECORD pSR
  326. );
  327. #endif