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.

413 lines
6.6 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. #if 0
  129. extern ULONG Nic_sync_queue (
  130. PMAIN_CTXT ctxtp,
  131. UNIV_SYNC_CALLB callb,
  132. PVOID callb_ctxtp,
  133. ULONG queue);
  134. /*
  135. Perform synchronization by switching to miniport mode or queueing callback
  136. returns ULONG :
  137. TRUE => succeeded
  138. FALSE => failed
  139. function:
  140. */
  141. #endif
  142. extern VOID Nic_timer (
  143. PVOID dpc,
  144. PVOID ctxtp,
  145. PVOID arg1,
  146. PVOID arg2);
  147. /*
  148. Heartbeat timer handler
  149. returns VOID:
  150. function:
  151. */
  152. extern VOID Nic_sleep (
  153. ULONG msecs);
  154. /*
  155. Sleep helper
  156. returns VOID:
  157. function:
  158. */
  159. /* routines that can be used with Nic_sync */
  160. extern VOID Nic_reset_complete (
  161. PMAIN_CTXT ctxtp,
  162. NDIS_STATUS status);
  163. /*
  164. Propagate reset completion to protocol
  165. returns VOID:
  166. function:
  167. */
  168. extern VOID Nic_request_complete (
  169. NDIS_HANDLE handle,
  170. PVOID actp);
  171. /*
  172. Propagate request completion to protocol
  173. returns VOID:
  174. function:
  175. */
  176. extern VOID Nic_send_complete (
  177. PMAIN_CTXT ctxtp,
  178. NDIS_STATUS status,
  179. PNDIS_PACKET packet);
  180. /*
  181. Propagate packet send completion to protocol
  182. returns VOID:
  183. function:
  184. */
  185. extern VOID Nic_recv_complete (
  186. PMAIN_CTXT ctxtp);
  187. /*
  188. Propagate post-receive completion to protocol
  189. returns VOID:
  190. function:
  191. */
  192. extern NDIS_STATUS Nic_PNP_handle (
  193. PMAIN_CTXT ctxtp,
  194. PNET_PNP_EVENT pnp_event);
  195. /*
  196. Propagate PNP Events to protocol
  197. returns NDIS_STATUS:
  198. function:
  199. */
  200. extern VOID Nic_status (
  201. PMAIN_CTXT ctxtp,
  202. NDIS_STATUS status,
  203. PVOID buf,
  204. UINT len);
  205. /*
  206. Propagate status indication to protocol
  207. returns VOID:
  208. function:
  209. */
  210. extern VOID Nic_status_complete (
  211. PMAIN_CTXT ctxtp);
  212. /*
  213. Propagate status indication completion to protocol
  214. returns VOID:
  215. function:
  216. */
  217. extern VOID Nic_send_resources_signal (
  218. PMAIN_CTXT ctxtp);
  219. /*
  220. Send resource availability message to protocol
  221. returns VOID:
  222. function:
  223. */
  224. extern VOID Nic_recv_packet (
  225. PMAIN_CTXT ctxtp,
  226. PNDIS_PACKET packet);
  227. /*
  228. Propagate received packet to protocol
  229. returns VOID:
  230. function:
  231. */
  232. /* Added from old code for NT 5.1 - ramkrish */
  233. extern VOID Nic_recv_indicate (
  234. PMAIN_CTXT ctxtp,
  235. NDIS_HANDLE recv_handle,
  236. PVOID head_buf,
  237. UINT head_len,
  238. PVOID look_buf,
  239. UINT look_len,
  240. UINT packet_len);
  241. /*
  242. Propagates receive indication to protocol
  243. returns VOID:
  244. function:
  245. */
  246. extern NDIS_STATUS Nic_transfer (
  247. PNDIS_PACKET packet,
  248. PUINT xferred,
  249. NDIS_HANDLE adapter_handle,
  250. NDIS_HANDLE receive_handle,
  251. UINT offset,
  252. UINT len);
  253. /*
  254. Responds to protocol data transfer request
  255. returns NDIS_STATUS:
  256. function:
  257. */
  258. extern VOID Nic_transfer_complete (
  259. PMAIN_CTXT ctxtp,
  260. NDIS_STATUS status,
  261. PNDIS_PACKET packet,
  262. UINT xferred);
  263. /*
  264. Propagates data transfer completion to protocol
  265. returns VOID:
  266. function:
  267. */
  268. /* old code */
  269. #if 0
  270. extern NDIS_STATUS Nic_send (
  271. NDIS_HANDLE adapter_handle,
  272. PNDIS_PACKET packet,
  273. UINT flags);
  274. /*
  275. Responds to protocol packet send request
  276. returns NDIS_STATUS:
  277. function:
  278. */
  279. #endif
  280. #endif /* _Nic_h_ */