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.

395 lines
6.7 KiB

  1. /*++
  2. Copyright(c) 1998,99 Microsoft Corporation
  3. Module Name:
  4. nic.h
  5. Abstract:
  6. Windows Load Balancing Service (WLBS)
  7. Driver - upper-level (NIC) layer of intermediate miniport
  8. Author:
  9. kyrilf
  10. --*/
  11. #ifndef _Nic_h_
  12. #define _Nic_h_
  13. #include <ndis.h>
  14. #include "main.h"
  15. /* PROCEDURES */
  16. /* miniport handlers */
  17. extern NDIS_STATUS Nic_init (
  18. PNDIS_STATUS open_status,
  19. PUINT medium_index,
  20. PNDIS_MEDIUM medium_array,
  21. UINT medium_size,
  22. NDIS_HANDLE adapter_handle,
  23. NDIS_HANDLE wrapper_handle);
  24. /*
  25. Responds to protocol open request
  26. returns NDIS_STATUS:
  27. function:
  28. */
  29. extern VOID Nic_halt (
  30. NDIS_HANDLE adapter_handle);
  31. /*
  32. Responds to protocol halt request
  33. returns VOID:
  34. function:
  35. */
  36. extern NDIS_STATUS Nic_info_query (
  37. NDIS_HANDLE adapter_handle,
  38. NDIS_OID Oid,
  39. PVOID info_buf,
  40. ULONG info_len,
  41. PULONG written,
  42. PULONG needed);
  43. /*
  44. Responds to protocol OID query request
  45. returns NDIS_STATUS:
  46. function:
  47. */
  48. extern NDIS_STATUS Nic_info_set (
  49. NDIS_HANDLE adapter_handle,
  50. NDIS_OID oid,
  51. PVOID info_buf,
  52. ULONG info_len,
  53. PULONG read,
  54. PULONG needed);
  55. /*
  56. Responds to protocol OID set request
  57. returns NDIS_STATUS:
  58. function:
  59. */
  60. extern NDIS_STATUS Nic_reset (
  61. PBOOLEAN addr_reset,
  62. NDIS_HANDLE adapter_handle);
  63. /*
  64. Responds to protocol reset request
  65. returns NDIS_STATUS:
  66. function:
  67. */
  68. extern VOID Nic_packets_send (
  69. NDIS_HANDLE adapter_handle,
  70. PNDIS_PACKET * packets,
  71. UINT num_packets);
  72. /*
  73. Responds to protocol send packets request
  74. returns VOID:
  75. function:
  76. */
  77. extern VOID Nic_return (
  78. NDIS_HANDLE adapter_handle,
  79. PNDIS_PACKET packet);
  80. /*
  81. Responds to protocol return packet request
  82. returns NDIS_STATUS:
  83. function:
  84. */
  85. /* These 3 functions have been added for NDIS51 support. */
  86. extern VOID Nic_cancel_send_packets (
  87. NDIS_HANDLE adapter_handle,
  88. PVOID cancel_id);
  89. /*
  90. Responds to CancelSendPackets request
  91. returns None:
  92. function:
  93. */
  94. #if 0
  95. extern VOID Nic_pnpevent_notify (
  96. NDIS_HANDLE adapter_handle,
  97. NDIS_DEVICE_PNP_EVENT pnp_event,
  98. PVOID info_buf,
  99. ULONG info_len);
  100. /*
  101. Responds to PnPEventNotify request
  102. returns None:
  103. function:
  104. */
  105. #endif
  106. extern VOID Nic_adapter_shutdown (
  107. NDIS_HANDLE adapter_handle);
  108. /*
  109. Responds to AdapterShutdown request
  110. returns None:
  111. function:
  112. */
  113. /* helpers for protocol layer */
  114. extern NDIS_STATUS Nic_announce (
  115. PMAIN_CTXT ctxtp);
  116. /*
  117. Announces us to the protocol layer during binding to the lower adapter
  118. returns NDIS_STATUS:
  119. function:
  120. */
  121. extern NDIS_STATUS Nic_unannounce (
  122. PMAIN_CTXT ctxtp);
  123. /*
  124. Unannounces us from the protocol layer during unbinding from the lower adapter
  125. returns NDIS_STATUS:
  126. function:
  127. */
  128. extern VOID Nic_timer (
  129. PVOID dpc,
  130. PVOID ctxtp,
  131. PVOID arg1,
  132. PVOID arg2);
  133. /*
  134. Heartbeat timer handler
  135. returns VOID:
  136. function:
  137. */
  138. extern VOID Nic_sleep (
  139. ULONG msecs);
  140. /*
  141. Sleep helper
  142. returns VOID:
  143. function:
  144. */
  145. /* routines that can be used with Nic_sync */
  146. extern VOID Nic_reset_complete (
  147. PMAIN_CTXT ctxtp,
  148. NDIS_STATUS status);
  149. /*
  150. Propagate reset completion to protocol
  151. returns VOID:
  152. function:
  153. */
  154. extern VOID Nic_request_complete (
  155. NDIS_HANDLE handle,
  156. PVOID actp);
  157. /*
  158. Propagate request completion to protocol
  159. returns VOID:
  160. function:
  161. */
  162. extern VOID Nic_send_complete (
  163. PMAIN_CTXT ctxtp,
  164. NDIS_STATUS status,
  165. PNDIS_PACKET packet);
  166. /*
  167. Propagate packet send completion to protocol
  168. returns VOID:
  169. function:
  170. */
  171. extern VOID Nic_recv_complete (
  172. PMAIN_CTXT ctxtp);
  173. /*
  174. Propagate post-receive completion to protocol
  175. returns VOID:
  176. function:
  177. */
  178. extern NDIS_STATUS Nic_PNP_handle (
  179. PMAIN_CTXT ctxtp,
  180. PNET_PNP_EVENT pnp_event);
  181. /*
  182. Propagate PNP Events to protocol
  183. returns NDIS_STATUS:
  184. function:
  185. */
  186. extern VOID Nic_status (
  187. PMAIN_CTXT ctxtp,
  188. NDIS_STATUS status,
  189. PVOID buf,
  190. UINT len);
  191. /*
  192. Propagate status indication to protocol
  193. returns VOID:
  194. function:
  195. */
  196. extern VOID Nic_status_complete (
  197. PMAIN_CTXT ctxtp);
  198. /*
  199. Propagate status indication completion to protocol
  200. returns VOID:
  201. function:
  202. */
  203. extern VOID Nic_send_resources_signal (
  204. PMAIN_CTXT ctxtp);
  205. /*
  206. Send resource availability message to protocol
  207. returns VOID:
  208. function:
  209. */
  210. extern VOID Nic_recv_packet (
  211. PMAIN_CTXT ctxtp,
  212. PNDIS_PACKET packet);
  213. /*
  214. Propagate received packet to protocol
  215. returns VOID:
  216. function:
  217. */
  218. /* Added from old code for NT 5.1 - ramkrish */
  219. extern VOID Nic_recv_indicate (
  220. PMAIN_CTXT ctxtp,
  221. NDIS_HANDLE recv_handle,
  222. PVOID head_buf,
  223. UINT head_len,
  224. PVOID look_buf,
  225. UINT look_len,
  226. UINT packet_len);
  227. /*
  228. Propagates receive indication to protocol
  229. returns VOID:
  230. function:
  231. */
  232. extern NDIS_STATUS Nic_transfer (
  233. PNDIS_PACKET packet,
  234. PUINT xferred,
  235. NDIS_HANDLE adapter_handle,
  236. NDIS_HANDLE receive_handle,
  237. UINT offset,
  238. UINT len);
  239. /*
  240. Responds to protocol data transfer request
  241. returns NDIS_STATUS:
  242. function:
  243. */
  244. extern VOID Nic_transfer_complete (
  245. PMAIN_CTXT ctxtp,
  246. NDIS_STATUS status,
  247. PNDIS_PACKET packet,
  248. UINT xferred);
  249. /*
  250. Propagates data transfer completion to protocol
  251. returns VOID:
  252. function:
  253. */
  254. /* old code */
  255. #if 0
  256. extern NDIS_STATUS Nic_send (
  257. NDIS_HANDLE adapter_handle,
  258. PNDIS_PACKET packet,
  259. UINT flags);
  260. /*
  261. Responds to protocol packet send request
  262. returns NDIS_STATUS:
  263. function:
  264. */
  265. #endif
  266. #endif /* _Nic_h_ */