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.

181 lines
4.1 KiB

  1. /*++
  2. Copyright (c) 1999 Microsoft Corporation
  3. Module Name:
  4. mp_nic.h
  5. Abstract:
  6. Function prototypes for mp_nic.c, mp_init.c and mp_req.c
  7. Revision History:
  8. Who When What
  9. -------- -------- ----------------------------------------------
  10. DChen 11-01-99 created
  11. Notes:
  12. --*/
  13. #ifndef _MP_NIC_H
  14. #define _MP_NIC_H
  15. #define NIC_INTERRUPT_DISABLED(_adapter) \
  16. (_adapter->CSRAddress->ScbCommandHigh & SCB_INT_MASK)
  17. #define NIC_INTERRUPT_ACTIVE(_adapter) \
  18. (_adapter->CSRAddress->ScbStatus & SCB_ACK_MASK)
  19. #define NIC_ACK_INTERRUPT(_adapter, _value) { \
  20. _value = _adapter->CSRAddress->ScbStatus & SCB_ACK_MASK; \
  21. _adapter->CSRAddress->ScbStatus = _value; }
  22. #define NIC_IS_RECV_READY(_adapter) \
  23. ((_adapter->CSRAddress->ScbStatus & SCB_RUS_MASK) == SCB_RUS_READY)
  24. __inline VOID NICDisableInterrupt(
  25. IN PMP_ADAPTER Adapter)
  26. {
  27. Adapter->CSRAddress->ScbCommandHigh = SCB_INT_MASK;
  28. }
  29. __inline VOID NICEnableInterrupt(
  30. IN PMP_ADAPTER Adapter)
  31. {
  32. Adapter->CSRAddress->ScbCommandHigh = 0;
  33. }
  34. //
  35. // MP_NIC.C
  36. //
  37. NDIS_STATUS MpSendPacket(
  38. IN PMP_ADAPTER Adapter,
  39. IN PNDIS_PACKET Packet,
  40. IN BOOLEAN bFromQueue);
  41. NDIS_STATUS NICSendPacket(
  42. IN PMP_ADAPTER Adapter,
  43. IN PMP_TCB pMpTcb,
  44. IN PMP_FRAG_LIST pFragList);
  45. ULONG MpCopyPacket(
  46. IN PNDIS_BUFFER CurrBuffer,
  47. IN PMP_TXBUF pMpTxbuf);
  48. VOID MpStartPacketPhysicalMapping(
  49. IN PMP_ADAPTER Adapter,
  50. IN PNDIS_BUFFER CurrBuffer,
  51. OUT PMP_FRAG_LIST pFragList);
  52. NDIS_STATUS NICStartSend(
  53. IN PMP_ADAPTER Adapter,
  54. IN PMP_TCB pMpTcb);
  55. NDIS_STATUS MpHandleSendInterrupt(
  56. IN PMP_ADAPTER Adapter);
  57. VOID MpHandleRecvInterrupt(
  58. IN PMP_ADAPTER Adapter);
  59. VOID NICReturnRFD(
  60. IN PMP_ADAPTER Adapter,
  61. IN PMP_RFD pMpRfd);
  62. NDIS_STATUS NICStartRecv(
  63. IN PMP_ADAPTER Adapter);
  64. VOID MpFreeQueuedSendPackets(
  65. IN PMP_ADAPTER Adapter);
  66. void MpFreeBusySendPackets(
  67. IN PMP_ADAPTER Adapter);
  68. void NICResetRecv(
  69. IN PMP_ADAPTER Adapter);
  70. VOID MpLinkDetectionDpc(
  71. IN PVOID SystemSpecific1,
  72. IN PVOID FunctionContext,
  73. IN PVOID SystemSpecific2,
  74. IN PVOID SystemSpecific3);
  75. //
  76. // MP_INIT.C
  77. //
  78. NDIS_STATUS MpFindAdapter(
  79. IN PMP_ADAPTER Adapter,
  80. IN NDIS_HANDLE WrapperConfigurationContext);
  81. NDIS_STATUS NICReadAdapterInfo(
  82. IN PMP_ADAPTER Adapter);
  83. NDIS_STATUS MpAllocAdapterBlock(
  84. OUT PMP_ADAPTER *pAdapter);
  85. void MpFreeAdapter(
  86. IN PMP_ADAPTER Adapter);
  87. NDIS_STATUS NICReadRegParameters(
  88. IN PMP_ADAPTER Adapter,
  89. IN NDIS_HANDLE WrapperConfigurationContext);
  90. NDIS_STATUS NICAllocAdapterMemory(
  91. IN PMP_ADAPTER Adapter);
  92. VOID NICInitSend(
  93. IN PMP_ADAPTER Adapter);
  94. NDIS_STATUS NICInitRecv(
  95. IN PMP_ADAPTER Adapter);
  96. ULONG NICAllocRfd(
  97. IN PMP_ADAPTER Adapter,
  98. IN PMP_RFD pMpRfd);
  99. VOID NICFreeRfd(
  100. IN PMP_ADAPTER Adapter,
  101. IN PMP_RFD pMpRfd);
  102. NDIS_STATUS NICSelfTest(
  103. IN PMP_ADAPTER Adapter);
  104. NDIS_STATUS NICInitializeAdapter(
  105. IN PMP_ADAPTER Adapter);
  106. VOID HwSoftwareReset(
  107. IN PMP_ADAPTER Adapter);
  108. NDIS_STATUS HwConfigure(
  109. IN PMP_ADAPTER Adapter);
  110. NDIS_STATUS HwSetupIAAddress(
  111. IN PMP_ADAPTER Adapter);
  112. NDIS_STATUS HwClearAllCounters(
  113. IN PMP_ADAPTER Adapter);
  114. //
  115. // MP_REQ.C
  116. //
  117. NDIS_STATUS NICGetStatsCounters(
  118. IN PMP_ADAPTER Adapter,
  119. IN NDIS_OID Oid,
  120. OUT PULONG64 pCounter);
  121. NDIS_STATUS NICSetPacketFilter(
  122. IN PMP_ADAPTER Adapter,
  123. IN ULONG PacketFilter);
  124. NDIS_STATUS NICSetMulticastList(
  125. IN PMP_ADAPTER Adapter);
  126. ULONG NICGetMediaConnectStatus(
  127. IN PMP_ADAPTER Adapter);
  128. #endif // MP_NIC_H