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.

492 lines
8.2 KiB

  1. //
  2. // Copyright (c) 1998-1999, Microsoft Corporation, all rights reserved
  3. //
  4. // receive.h
  5. //
  6. // IEEE1394 mini-port/call-manager driver
  7. //
  8. // Mini-port Receive routines
  9. //
  10. // 2/13/1998 ADube Created
  11. //
  12. #define ISOCH_PREFIX_LENGTH (sizeof(LONG) + sizeof (ISOCH_HEADER))
  13. VOID
  14. nicAbortReassembly (
  15. IN PNDIS1394_REASSEMBLY_STRUCTURE pReassembly
  16. );
  17. VOID
  18. nicAllocateAddressRangeCallback(
  19. IN PNOTIFICATION_INFO NotificationInfo
  20. );
  21. VOID
  22. nicAllocateAddressRangeDebugSpew(
  23. IN PIRB pIrb
  24. );
  25. NDIS_STATUS
  26. nicAllocateAddressRangeSucceeded (
  27. IN PIRB pIrb,
  28. IN OUT PRECVFIFO_VCCB pRecvFIFOVc
  29. );
  30. NDIS_STATUS
  31. nicGetInitializedAddressFifoElement(
  32. IN UINT BufferLength,
  33. IN OUT PADDRESS_FIFO *ppElement
  34. );
  35. NDIS_STATUS
  36. nicInitAllocateAddressIrb(
  37. IN PIRB pIrb,
  38. IN PVOID pContext,
  39. IN ULONG fulFlags,
  40. IN ULONG nLength,
  41. IN ULONG MaxSegmentSize,
  42. IN ULONG fulAccessType,
  43. IN ULONG fulNotificationOptions,
  44. IN PADDRESS_OFFSET pOffset,
  45. IN PRECVFIFO_VCCB pRecvFIFOVc
  46. );
  47. NDIS_STATUS
  48. nicGetEmptyAddressFifoElement(
  49. IN PADDRESS_FIFO *ppElement
  50. );
  51. NDIS_STATUS
  52. nicAllocateAddressRange(
  53. IN PADAPTERCB pAdapter,
  54. IN PRECVFIFO_VCCB pRecvFIFOVc
  55. );
  56. NDIS_STATUS
  57. nicFillAllocateAddressRangeSList(
  58. IN RECVFIFO_VCCB *pRecvFIFO,
  59. IN UINT *Num
  60. );
  61. NDIS_STATUS
  62. nicFreeRecvFifoAddressRange(
  63. IN REMOTE_NODE *pRemoteNode
  64. );
  65. NDIS_STATUS
  66. nicFreeRecvFifoAddressRangeOnAllRemoteNodes (
  67. IN PADAPTERCB pAdapter
  68. );
  69. NDIS_STATUS
  70. nicFreeAllAllocatedAddressRangesOnPdo (
  71. IN PREMOTE_NODE pRemoteNode
  72. );
  73. VOID
  74. nicFreeAllocateAddressRangeSList(
  75. IN PRECVFIFO_VCCB pRecvFIFOVc
  76. );
  77. NDIS_STATUS
  78. nicGetNdisBuffer(
  79. IN UINT Length,
  80. IN PVOID pLocalBuffer,
  81. IN OUT PNDIS_BUFFER *ppNdisBuffer
  82. );
  83. VOID
  84. nicFreeAddressFifo(
  85. IN PADDRESS_FIFO pAddressFifo,
  86. IN PRECVFIFO_VCCB pRecvFIFOVc
  87. );
  88. VOID
  89. nicFifoReturnPacket (
  90. IN PVCCB pVc,
  91. IN PNDIS_PACKET pMyPacket
  92. );
  93. //
  94. // Isoch Functions
  95. //
  96. NDIS_STATUS
  97. nicAllocateAndInitializeIsochDescriptors (
  98. IN PCHANNEL_VCCB pChannelVc,
  99. IN UINT NumDescriptors,
  100. IN UINT BufferLength,
  101. IN OUT PPISOCH_DESCRIPTOR ppIsochDescriptor
  102. );
  103. NDIS_STATUS
  104. nicFreeIsochDescriptors(
  105. IN UINT Num,
  106. IN PISOCH_DESCRIPTOR pIsochDescriptor,
  107. IN PVCCB pVc
  108. );
  109. NDIS_STATUS
  110. nicFreeSingleIsochDescriptor(
  111. IN PISOCH_DESCRIPTOR pIsochDescriptor,
  112. IN PVCCB pVc
  113. );
  114. VOID
  115. nicReturnNdisBufferChain (
  116. IN PNDIS_BUFFER pNdisBuffer,
  117. IN PVCCB pVc
  118. );
  119. VOID
  120. nicChannelReturnPacket (
  121. IN PVCCB pVc,
  122. IN PNDIS_PACKET pMyPacket
  123. );
  124. NDIS_STATUS
  125. nicFindReassemblyStructure (
  126. IN PREMOTE_NODE pRemoteNode,
  127. IN USHORT dgl,
  128. IN BUS_OPERATION BusOp,
  129. IN PVCCB pVc,
  130. OUT PNDIS1394_REASSEMBLY_STRUCTURE* ppReassembly
  131. );
  132. NDIS_STATUS
  133. nicGetReassemblyStructure (
  134. IN PNDIS1394_REASSEMBLY_STRUCTURE* ppReassembly
  135. );
  136. VOID
  137. nicFreeReassemblyStructure (
  138. IN PNDIS1394_REASSEMBLY_STRUCTURE pReassembly
  139. );
  140. NDIS_STATUS
  141. nicInitializeReassemblyStructure (
  142. IN PNDIS1394_REASSEMBLY_STRUCTURE pReassembly,
  143. IN USHORT Dgl,
  144. IN PREMOTE_NODE pRemoteNode,
  145. IN PVCCB pVc,
  146. IN BUS_OPERATION ReceiveOp
  147. );
  148. VOID
  149. nicReturnFifoChain (
  150. IN PADDRESS_FIFO pAddressFifo,
  151. IN PRECVFIFO_VCCB pRecvFifoVc
  152. );
  153. VOID
  154. nicReturnDescriptorChain (
  155. IN PISOCH_DESCRIPTOR pIsochDescriptor ,
  156. IN PCHANNEL_VCCB pChannelVc
  157. );
  158. VOID
  159. nicInternalReturnPacket(
  160. IN PVCCB pVc ,
  161. IN PNDIS_PACKET pPacket
  162. );
  163. //
  164. // Generic Receive functions
  165. //
  166. VOID
  167. NicReturnPacket(
  168. IN NDIS_HANDLE MiniportAdapterContext,
  169. IN PNDIS_PACKET pPacket
  170. );
  171. VOID
  172. nicIndicateNdisPacketToNdis (
  173. PNDIS_PACKET pPacket,
  174. PVCCB pVc,
  175. PADAPTERCB pAdapter
  176. );
  177. VOID
  178. RcvIndicateTimer (
  179. IN PVOID SystemSpecific1,
  180. IN PVOID FunctionContext,
  181. IN PVOID SystemSpecific2,
  182. IN PVOID SystemSpecific3
  183. );
  184. VOID
  185. nicIndicateMultiplePackets(
  186. PNDIS_PACKET *ppPacket,
  187. NDIS_HANDLE NdisVcHandle,
  188. PADAPTERCB pAdapter,
  189. ULONG NumPackets
  190. );
  191. VOID
  192. nicAbortReassemblyList (
  193. PLIST_ENTRY pToBeFreedList
  194. );
  195. VOID
  196. nicFreeAllPendingReassemblyStructures(
  197. IN PADAPTERCB pAdapter
  198. );
  199. ULONG
  200. nicDereferenceReassembly (
  201. IN PNDIS1394_REASSEMBLY_STRUCTURE pReassembly,
  202. PCHAR pString
  203. );
  204. ULONG
  205. nicReferenceReassembly (
  206. IN PNDIS1394_REASSEMBLY_STRUCTURE pReassembly,
  207. PCHAR pString
  208. );
  209. NDIS_STATUS
  210. nicValidateRecvData(
  211. IN PMDL pMdl,
  212. IN BUS_OPERATION RecvOp,
  213. IN PVOID pIndicatedStruct,
  214. IN PVCCB pVc,
  215. OUT PNIC_RECV_DATA_INFO pInfo
  216. );
  217. VOID
  218. nicInitRecvDataFragmented (
  219. IN PMDL pMdl,
  220. IN BUS_OPERATION RecvOp,
  221. IN PVOID pIndicatedStruct,
  222. OUT PNIC_RECV_DATA_INFO pRcvInfo
  223. );
  224. NDIS_STATUS
  225. nicReceiveInOrderReassembly (
  226. PNDIS1394_REASSEMBLY_STRUCTURE pReassembly,
  227. PVOID pIndicatedStructure,
  228. PNDIS_BUFFER pNdisBuffer,
  229. PVOID pNdisBufferStartData,
  230. ULONG IPLength,
  231. PNDIS1394_FRAGMENT_HEADER pHeader,
  232. IN ULONG FragOffset
  233. );
  234. NDIS_STATUS
  235. nicReceiveOutOfOrderReassembly (
  236. PNDIS1394_REASSEMBLY_STRUCTURE pReassembly,
  237. PVOID pIndicatedStructure,
  238. PNDIS_BUFFER pNdisBuffer,
  239. PVOID pNdisBufferStartData,
  240. ULONG IPLength,
  241. PNDIS1394_FRAGMENT_HEADER pHeader,
  242. IN ULONG FragOffset
  243. );
  244. VOID
  245. nicInsertEarliestFragment (
  246. PMDL pMdl,
  247. PNDIS_BUFFER pNdisBuffer,
  248. PVOID pStartData,
  249. PVOID pIndicatedStructure,
  250. ULONG CurrFragOffset,
  251. ULONG IPLength,
  252. PNDIS1394_FRAGMENT_HEADER pHeader,
  253. PNDIS1394_REASSEMBLY_STRUCTURE pReassembly
  254. );
  255. BOOLEAN
  256. nicIsOutOfOrderReassemblyComplete (
  257. IN PNDIS1394_REASSEMBLY_STRUCTURE pReassembly
  258. );
  259. NDIS_STATUS
  260. nicValidateOutOfOrder(
  261. IN PNDIS1394_REASSEMBLY_STRUCTURE pReassembly,
  262. IN ULONG CurrFragOffset,
  263. IN ULONG IPLength,
  264. OUT PULONG pFragmentNum,
  265. OUT PREASSEMBLY_INSERT_TYPE pInsertionManner,
  266. OUT PBOOLEAN pfAbort
  267. );
  268. NDIS_STATUS
  269. nicDoReassembly (
  270. IN PNIC_RECV_DATA_INFO pRcvInfo,
  271. OUT PNDIS1394_REASSEMBLY_STRUCTURE *ppReassembly,
  272. PBOOLEAN pfReassemblyComplete
  273. );
  274. VOID
  275. nicAddUnfragmentedHeader (
  276. IN PNDIS1394_REASSEMBLY_STRUCTURE pReassembly,
  277. IN PVOID pEncapHeader
  278. );
  279. VOID
  280. nicReceiveCommonCallback (
  281. IN PVOID pIndicatedStruct,
  282. IN PVCCB pVc,
  283. BUS_OPERATION RecvOp,
  284. PMDL pMdl
  285. );
  286. NDIS_STATUS
  287. nicGetNdisBufferForReassembly(
  288. IN PNIC_RECV_DATA_INFO pRcvInfo,
  289. OUT PNDIS_BUFFER *ppNdisBuffer
  290. );
  291. NDIS_STATUS
  292. nicInsertFragmentInReassembly (
  293. PNDIS1394_REASSEMBLY_STRUCTURE pReassembly,
  294. PNIC_RECV_DATA_INFO pRcvInfo
  295. );
  296. VOID
  297. nicFindInsertionPosition (
  298. PNDIS1394_REASSEMBLY_STRUCTURE pReassmbly,
  299. ULONG FragOffset,
  300. ULONG IPLength,
  301. PULONG pFragmentNum
  302. );
  303. VOID
  304. nicChainReassembly (
  305. PNDIS1394_REASSEMBLY_STRUCTURE pReassembly
  306. );
  307. VOID
  308. nicRecvNoRemoteNode(
  309. PADAPTERCB pAdapter
  310. );
  311. VOID
  312. nicInsertNodeAddressAtHead (
  313. IN PNDIS_PACKET pPacket,
  314. IN PNIC_RECV_DATA_INFO pRcvInfo
  315. );
  316. VOID
  317. nicUpdateNodeTable(
  318. NDIS_WORK_ITEM* pUpdateTable,
  319. IN PVOID Context
  320. );
  321. NDIS_STATUS
  322. nicInitSerializedReassemblyStruct(
  323. PADAPTERCB pAdapter
  324. );
  325. VOID
  326. nicDeInitSerializedReassmblyStruct(
  327. PADAPTERCB pAdapter
  328. );
  329. NDIS_STATUS
  330. nicQueueReassemblyTimer(
  331. PADAPTERCB pAdapter,
  332. BOOLEAN fIsLastTimer
  333. );