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.

170 lines
4.4 KiB

  1. /***************************************************************************
  2. Copyright (c) 1999 Microsoft Corporation
  3. Module Name:
  4. RNDISAPI.H
  5. Abstract:
  6. This module defines the Remote NDIS Wrapper API set.
  7. Environment:
  8. kernel mode only
  9. Notes:
  10. THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
  11. KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  12. IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
  13. PURPOSE.
  14. Copyright (c) 1999 Microsoft Corporation. All Rights Reserved.
  15. Revision History:
  16. 2/8/99 : created
  17. Authors:
  18. Arvind Murching and Tom Green
  19. ****************************************************************************/
  20. #ifndef _RNDISAPI_H_
  21. #define _RNDISAPI_H_
  22. #define RNDIS_VERSION 0x00010000
  23. //
  24. // RNDIS Microport Channel type definitions.
  25. //
  26. typedef enum _RM_CHANNEL_TYPE
  27. {
  28. RMC_DATA, // for NDIS Packet messages
  29. RMC_CONTROL // all other messages (Init/Query/Set)
  30. } RM_CHANNEL_TYPE, *PRM_CHANNEL_TYPE;
  31. //
  32. // RNDIS Microport handler templates:
  33. //
  34. typedef
  35. NDIS_STATUS
  36. (*RM_DEVICE_INIT_HANDLER)(
  37. OUT PNDIS_HANDLE pMicroportAdapterContext,
  38. OUT PULONG pMaxReceiveSize,
  39. IN NDIS_HANDLE MiniportAdapterContext,
  40. IN NDIS_HANDLE NdisMiniportHandle,
  41. IN NDIS_HANDLE WrapperConfigurationContext,
  42. IN PDEVICE_OBJECT Pdo
  43. );
  44. typedef
  45. NDIS_STATUS
  46. (*RM_DEVICE_INIT_CMPLT_NOTIFY_HANDLER)(
  47. IN NDIS_HANDLE MicroportAdapterContext,
  48. IN ULONG DeviceFlags,
  49. IN OUT PULONG pMaxTransferSize
  50. );
  51. typedef
  52. VOID
  53. (*RM_DEVICE_HALT_HANDLER)(
  54. IN NDIS_HANDLE MicroportAdapterContext
  55. );
  56. typedef
  57. VOID
  58. (*RM_SHUTDOWN_HANDLER)(
  59. IN NDIS_HANDLE MicroportAdapterContext
  60. );
  61. typedef
  62. VOID
  63. (*RM_UNLOAD_HANDLER)(
  64. IN NDIS_HANDLE MicroportContext
  65. );
  66. typedef
  67. VOID
  68. (*RM_SEND_MESSAGE_HANDLER)(
  69. IN NDIS_HANDLE MicroportAdapterContext,
  70. IN PMDL pMessageHead,
  71. IN NDIS_HANDLE RndisMessageHandle,
  72. IN RM_CHANNEL_TYPE ChannelType
  73. );
  74. typedef
  75. VOID
  76. (*RM_RETURN_MESSAGE_HANDLER)(
  77. IN NDIS_HANDLE MicroportAdapterContext,
  78. IN PMDL pMessageHead,
  79. IN NDIS_HANDLE MicroportMessageContext
  80. );
  81. typedef struct _RNDIS_MICROPORT_CHARACTERISTICS
  82. {
  83. ULONG RndisVersion; // RNDIS_VERSION
  84. ULONG Reserved; // Should be 0
  85. RM_DEVICE_INIT_HANDLER RmInitializeHandler;
  86. RM_DEVICE_INIT_CMPLT_NOTIFY_HANDLER RmInitCompleteNotifyHandler;
  87. RM_DEVICE_HALT_HANDLER RmHaltHandler;
  88. RM_SHUTDOWN_HANDLER RmShutdownHandler;
  89. RM_UNLOAD_HANDLER RmUnloadHandler;
  90. RM_SEND_MESSAGE_HANDLER RmSendMessageHandler;
  91. RM_RETURN_MESSAGE_HANDLER RmReturnMessageHandler;
  92. } RNDIS_MICROPORT_CHARACTERISTICS, *PRNDIS_MICROPORT_CHARACTERISTICS;
  93. //
  94. // RNDIS APIs
  95. //
  96. #ifndef RNDISMP
  97. DECLSPEC_IMPORT
  98. #endif
  99. NDIS_STATUS
  100. RndisMInitializeWrapper(
  101. OUT PNDIS_HANDLE pNdisWrapperHandle,
  102. IN PVOID MicroportContext,
  103. IN PVOID DriverObject,
  104. IN PVOID RegistryPath,
  105. IN PRNDIS_MICROPORT_CHARACTERISTICS pCharacteristics
  106. );
  107. #ifndef RNDISMP
  108. DECLSPEC_IMPORT
  109. #endif
  110. VOID
  111. RndisMSendComplete(
  112. IN NDIS_HANDLE MiniportAdapterContext,
  113. IN NDIS_HANDLE RndisMessageHandle,
  114. IN NDIS_STATUS SendStatus
  115. );
  116. #ifndef RNDISMP
  117. DECLSPEC_IMPORT
  118. #endif
  119. VOID
  120. RndisMIndicateReceive(
  121. IN NDIS_HANDLE MiniportAdapterContext,
  122. IN PMDL pMessageHead,
  123. IN NDIS_HANDLE MicroportMessageContext,
  124. IN RM_CHANNEL_TYPE ChannelType,
  125. IN NDIS_STATUS ReceiveStatus
  126. );
  127. #endif // _RNDISAPI_H_