Windows NT 4.0 source code leak
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.

132 lines
4.3 KiB

4 years ago
  1. /*++
  2. Copyright (c) 1990-1995 Microsoft Corporation
  3. Module Name:
  4. Adapter.h
  5. Abstract:
  6. This file contains major data structures used by the NdisWan driver
  7. Author:
  8. Tony Bell (TonyBe) June 06, 1995
  9. Environment:
  10. Kernel Mode
  11. Revision History:
  12. TonyBe 06/06/95 Created
  13. --*/
  14. #ifndef _NDISWAN_ADAPTER_
  15. #define _NDISWAN_ADAPTER_
  16. //
  17. // This is the control block for the NdisWan adapter that is created by the NDIS Wrapper
  18. // making a call to NdisWanInitialize. There should only be one call to initialize and
  19. // therefore only one adapter created.
  20. //
  21. typedef struct _ADAPTERCB {
  22. LIST_ENTRY Linkage; // Used to link adapter into global list
  23. ULONG ulAllocationSize; // Size of memory allocated
  24. NDIS_SPIN_LOCK Lock; // Structure access lock
  25. ULONG ulReferenceCount; // Adapter reference count
  26. NDIS_HANDLE hMiniportHandle; // Assigned in MiniportInitialize
  27. #define RESET_IN_PROGRESS 0x00000001
  28. #define ASK_FOR_RESET 0x00000002
  29. #define MINIPORT_LOCK_OWNER 0x00000004
  30. #ifdef USE_NDIS_MINIPORT_CALLBACK
  31. #define DEFERRED_CALLBACK_SET 0x00000008
  32. #else // end of USE_NDIS_MINIPORT_CALLBACK
  33. #define DEFERRED_TIMER_SET 0x00000008
  34. #endif // end of !USE_NDIS_MINIPORT_CALLBACK
  35. #define RECEIVE_COMPLETE 0x00000010
  36. ULONG Flags;
  37. #ifdef USE_NDIS_MINIPORT_LOCKING
  38. NDIS_HANDLE SwitchHandle;
  39. #else // end of USE_NDIS_MINIPORT_LOCKING
  40. WAN_IRQL MiniportLockIrql;
  41. WAN_IRQL SavedIrql;
  42. #endif // end of !USE_NDIS_MINIPORT_LOCKING
  43. DEFERRED_QUEUE FreeDeferredQueue;
  44. DEFERRED_QUEUE DeferredQueue[MAX_DEFERRED_QUEUE_TYPES];
  45. #ifndef USE_NDIS_MINIPORT_CALLBACK
  46. NDIS_MINIPORT_TIMER DeferredTimer;
  47. #endif // end of !USE_NDIS_MINIPORT_CALLBACK
  48. NDIS_MEDIUM MediumType; // Medium type that we are emulating
  49. NDIS_HARDWARE_STATUS HardwareStatus; // Hardware status (????)
  50. NDIS_STRING AdapterName; // Adapter Name (????)
  51. UCHAR NetworkAddress[ETH_LENGTH_OF_ADDRESS]; // Ethernet address for this adapter
  52. ULONG ulNumberofProtocols;
  53. USHORT ProtocolType;
  54. struct _BUNDLECB *NbfBundleCB;
  55. NDIS_HANDLE NbfProtocolHandle;
  56. #if DBG
  57. LIST_ENTRY DbgNdisPacketList;
  58. #endif
  59. } ADAPTERCB, *PADAPTERCB;
  60. //
  61. // This is the control block for each WAN Miniport adapter that NdisWan binds to through
  62. // the NDIS Wrapper as a "protocol".
  63. //
  64. typedef struct _WAN_ADAPTERCB {
  65. LIST_ENTRY Linkage; // Used to link adapter into global list
  66. ULONG ulAllocationSize; // Size of memory allocated
  67. NDIS_SPIN_LOCK Lock; // Structure access lock
  68. LIST_ENTRY FreeLinkCBList; // Free pool of link control blocks for this WAN Miniport
  69. NDIS_HANDLE hNdisBindingHandle; // Binding handle
  70. NDIS_STRING MiniportName; // WAN Miniport name
  71. NDIS_MEDIUM MediumType; // WAN Miniport medium type
  72. NDIS_WAN_MEDIUM_SUBTYPE MediumSubType; // WAN Miniport medium subtype
  73. NDIS_WAN_HEADER_FORMAT WanHeaderFormat; // WAN Miniport header type
  74. WAN_EVENT NotificationEvent; // Async notification event for adapter operations (open, close, ...)
  75. NDIS_STATUS NotificationStatus; // Notification status for async adapter events
  76. PWAN_REQUEST pWanRequest; // 1st entry on WanRequest queue
  77. PWAN_REQUEST pLastWanRequest; // Last entry on WanRequest queue
  78. NDIS_WAN_INFO WanInfo; // WanInfo structure
  79. #if DBG
  80. LIST_ENTRY DbgWanPacketList;
  81. #endif
  82. } WAN_ADAPTERCB, *PWAN_ADAPTERCB;
  83. //
  84. // Main control block for all global data
  85. //
  86. typedef struct _NDISWANCB {
  87. NDIS_SPIN_LOCK Lock; // Structure access lock
  88. NDIS_HANDLE hNdisWrapperHandle; // NDIS Wrapper handle
  89. NDIS_HANDLE hProtocolHandle; // Our protocol handle
  90. ULONG ulNumberOfProtocols; // Total number of protocols that we are bound to
  91. ULONG ulNumberOfLinks; // Total number of links for all WAN Miniport Adapters
  92. ULONG ulMinFragmentSize; // Minimum fragment size
  93. ULONG ulTraceLevel; // Trace Level values 0 - 10 (10 verbose)
  94. ULONG ulTraceMask; // Trace bit mask
  95. PVOID pDriverObject; // Pointer to the NT Driver Object
  96. PVOID pDeviceObject; // Pointer to the device object
  97. ULONG SendCount;
  98. ULONG SendCompleteCount;
  99. ULONG IORecvError1;
  100. ULONG IORecvError2;
  101. PADAPTERCB PromiscuousAdapter;
  102. NDIS_MINIPORT_TIMER RecvFlushTimer;
  103. #ifdef NT
  104. PDRIVER_DISPATCH MajorFunction[IRP_MJ_MAXIMUM_FUNCTION+1]; // Device dispatch functions
  105. #endif
  106. }NDISWANCB, *PNDISWANCB;
  107. #endif // _NDISWAN_ADAPTER_