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.

333 lines
5.5 KiB

  1. //
  2. // Copyright (c) 1998-1999, Microsoft Corporation, all rights reserved
  3. //
  4. // send.h
  5. //
  6. // IEEE1394 mini-port/call-manager driver
  7. //
  8. // Send.h - Mini-port Send routines
  9. //
  10. // 06/20/1999 ADube Created,
  11. //
  12. //
  13. // A Send follows this simple algorithm:
  14. // Copy incoming data to local buffers
  15. // Insert Fragment Headers if necessary
  16. // Create an Mdl for the local copy
  17. // Store the IRB and VC in the ndispacket
  18. // Use the ndispacket as context in the irp's completion routine
  19. //
  20. NDIS_STATUS
  21. AsyncStreamSendPacketsHandler (
  22. IN PVCCB pChannelVc,
  23. IN PNDIS_PACKET pPacket
  24. );
  25. NDIS_STATUS
  26. AsyncWriteSendPacketsHandler(
  27. IN VCCB *pVC,
  28. IN NDIS_PACKET *Packet
  29. );
  30. NDIS_STATUS
  31. nicCopyNdisBufferChainToBuffer(
  32. IN PNDIS_BUFFER pInMdl,
  33. IN OUT PVOID pLocalBuffer,
  34. IN UINT Length
  35. );
  36. NDIS_STATUS
  37. nicFreeIrb(
  38. IN PIRB pIrb
  39. );
  40. NDIS_STATUS
  41. nicFreeIrp(
  42. IN PIRP pIrp
  43. );
  44. NDIS_STATUS
  45. nicFreeLocalBuffer(
  46. IN UINT Length,
  47. IN PVOID pLocalBuffer
  48. );
  49. NDIS_STATUS
  50. nicGetIrb(
  51. OUT PIRB *ppIrb
  52. );
  53. NDIS_STATUS
  54. nicGetIrp(
  55. IN PDEVICE_OBJECT pPdo,
  56. OUT PIRP *ppIrp
  57. );
  58. NDIS_STATUS
  59. nicFreeMdl(
  60. IN PMDL pMdl
  61. );
  62. NDIS_STATUS
  63. nicFreePrivateIrb(
  64. PNDIS1394_IRB pIrb
  65. );
  66. NDIS_STATUS
  67. nicGetPrivateIrb(
  68. IN PADAPTERCB pAdapter OPTIONAL,
  69. IN PREMOTE_NODE pRemoteNode OPTIONAL,
  70. IN PVCCB pVc,
  71. IN PVOID pContext,
  72. OUT PNDIS1394_IRB *ppIrb
  73. );
  74. NDIS_STATUS
  75. nicGetLocalBuffer(
  76. IN ULONG Length,
  77. OUT PVOID *ppLocalBuffer
  78. );
  79. PVOID
  80. nicGetLookasideBuffer(
  81. IN PNIC_NPAGED_LOOKASIDE_LIST pLookasideList
  82. );
  83. NDIS_STATUS
  84. nicGetMdl(
  85. IN UINT Length,
  86. IN PVOID LocalBuffer,
  87. OUT PMDL *ppMyMdl
  88. );
  89. NDIS_STATUS
  90. nicGetMdlToTransmit(
  91. IN PNDIS_PACKET pPacket,
  92. OUT PMDL *ppMyMdl
  93. );
  94. NDIS_STATUS
  95. DummySendPacketsHandler(
  96. IN PVCCB pVc,
  97. IN PNDIS_PACKET pPacket
  98. );
  99. VOID
  100. nicSendFailureInvalidGeneration(
  101. PVCCB pVc
  102. );
  103. //-----------------------------------------------------------------------------
  104. // Local prototypes (alphabetically)
  105. //-----------------------------------------------------------------------------
  106. NTSTATUS
  107. AsyncStreamDummySendComplete(
  108. IN PDEVICE_OBJECT DeviceObject,
  109. IN PIRP pMyIrp,
  110. IN PVOID Context
  111. );
  112. NTSTATUS
  113. AsyncWriteStreamSendComplete(
  114. IN PDEVICE_OBJECT DeviceObject,
  115. IN PIRP pMyIrp,
  116. IN PVOID Context
  117. );
  118. NTSTATUS
  119. AsyncStreamSendComplete(
  120. IN PDEVICE_OBJECT DeviceObject,
  121. IN PIRP pMyIrp,
  122. IN PVOID Context
  123. );
  124. NDIS_STATUS
  125. nicFreeAsyncWritePacketDataStructures(
  126. IN PVCCB pVc,
  127. IN PIRP pIrp OPTIONAL,
  128. IN PVOID pLocalBuffer OPTIONAL,
  129. IN PNIC_NPAGED_LOOKASIDE_LIST pLookasideList OPTIONAL
  130. );
  131. NDIS_STATUS
  132. nicEthernetVcSend(
  133. IN PVCCB pVc,
  134. IN PNDIS_PACKET pPacket
  135. );
  136. VOID
  137. nicInitAsyncStreamIrb(
  138. IN PCHANNEL_VCCB pChannelVc,
  139. IN PMDL pMdl,
  140. IN OUT PIRB pIrb
  141. );
  142. VOID
  143. nicInitAsyncWriteIrb(
  144. IN PSENDFIFO_VCCB pVc,
  145. IN PMDL pMyMdl,
  146. IN OUT PIRB pMyIrb
  147. );
  148. NDIS_STATUS
  149. nicInsertGaspHeader (
  150. IN PADAPTERCB pAdapter,
  151. IN PNDIS_PACKET pNdisPacket
  152. );
  153. NDIS_STATUS
  154. nicGetGaspHeader (
  155. IN OUT PNDIS_BUFFER *ppNdisBuffer
  156. );
  157. VOID
  158. nicFreeGaspHeader (
  159. IN PNDIS_BUFFER pGaspNdisBuffer
  160. );
  161. VOID
  162. nicFreeToNPagedLookasideList (
  163. IN PNIC_NPAGED_LOOKASIDE_LIST pLookasideList,
  164. IN PVOID pBuffer
  165. );
  166. VOID
  167. nicMakeGaspHeader (
  168. IN PADAPTERCB pAdapter,
  169. IN PGASP_HEADER pGaspHeader
  170. );
  171. NDIS_STATUS
  172. nicCopyOneFragment (
  173. PFRAGMENTATION_STRUCTURE pFragment
  174. );
  175. VOID
  176. nicCopyUnfragmentedHeader (
  177. IN PNIC1394_UNFRAGMENTED_HEADER pDestUnfragmentedHeader,
  178. IN PVOID pSrcUnfragmentedHeader
  179. );
  180. NDIS_STATUS
  181. nicFirstFragmentInitialization (
  182. IN PNDIS_BUFFER pStartNdisBuffer,
  183. IN ULONG DatagramLabelLong,
  184. OUT PFRAGMENTATION_STRUCTURE pFragment
  185. );
  186. VOID
  187. nicInitializeLookasideListHeader (
  188. IN OUT PLOOKASIDE_BUFFER_HEADER pHeader,
  189. IN PNDIS_PACKET pNdisPacket,
  190. IN PVCCB pVc,
  191. IN PNDIS_BUFFER pCurrNdisBuffer,
  192. IN BUS_OPERATION AsyncOp,
  193. IN PADAPTERCB pAdapter
  194. );
  195. NDIS_STATUS
  196. nicCopyNdisPacketToUnfragmentedBuffer(
  197. IN PNIC_NPAGED_LOOKASIDE_LIST pLookasideList,
  198. IN PNDIS_BUFFER pStartNdisBuffer,
  199. IN ULONG PacketLength,
  200. IN BUS_OPERATION AsyncOp,
  201. IN PGASP_HEADER pGaspHeader,
  202. OUT PVOID* ppStartFragmentAddress,
  203. OUT PVOID *ppLookasideListBuffer
  204. );
  205. VOID
  206. nicAddFragmentHeader (
  207. IN PVOID pStartFragmentData,
  208. IN PFRAGMENTATION_STRUCTURE pFragmentStructure,
  209. IN ULONG BufferSize
  210. );
  211. NDIS_STATUS
  212. nicFreeAsyncStreamPacketDataStructures(
  213. IN PVCCB pVc,
  214. IN PIRP pIrp OPTIONAL,
  215. IN PVOID pLocalBuffer OPTIONAL,
  216. IN PNIC_NPAGED_LOOKASIDE_LIST pLookasideList OPTIONAL
  217. );
  218. VOID
  219. nicGetGenerationWorkItem(
  220. NDIS_WORK_ITEM* pGetGenerationWorkItem,
  221. IN PVOID Context
  222. );
  223. VOID
  224. nicMpCoSendComplete (
  225. NDIS_STATUS NdisStatus,
  226. PVCCB pVc,
  227. PNDIS_PACKET pPacket
  228. );
  229. VOID
  230. nicSendTimer (
  231. IN PVOID SystemSpecific1,
  232. IN PVOID FunctionContext,
  233. IN PVOID SystemSpecific2,
  234. IN PVOID SystemSpecific3
  235. );
  236. UINT
  237. nicNumFragmentsNeeded (
  238. UINT PacketLength ,
  239. UINT MaxPayload,
  240. UINT FragmentOverhead
  241. );