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.

159 lines
5.4 KiB

  1. /*++
  2. Copyright (c) 1990-1996 Microsoft Corporation
  3. Module Name:
  4. asyncpub.h
  5. Abstract:
  6. This file contains all public data structures and defines used
  7. by asyncmac. It defines the Ioctl interface to asyncmac.
  8. Author:
  9. Tony Bell (TonyBe) October 16, 1996
  10. Environment:
  11. Kernel Mode
  12. Revision History:
  13. TonyBe 10/16/96 Created
  14. --*/
  15. #ifndef _ASYNCMAC_PUB_
  16. #define _ASYNCMAC_PUB_
  17. //------------------------------------------------------------------------
  18. //--------------------- OLD RAS COMPRESSION INFORMATION ------------------
  19. //------------------------------------------------------------------------
  20. // The defines below are for the compression bitmap field.
  21. // No bits are set if compression is not available at all
  22. #define COMPRESSION_NOT_AVAILABLE 0x00000000
  23. // This bit is set if the mac can do version 1 compressed frames
  24. #define COMPRESSION_VERSION1_8K 0x00000001
  25. #define COMPRESSION_VERSION1_16K 0x00000002
  26. #define COMPRESSION_VERSION1_32K 0x00000004
  27. #define COMPRESSION_VERSION1_64K 0x00000008
  28. // And this to turn off any compression feature bit
  29. #define COMPRESSION_OFF_BIT_MASK (~( COMPRESSION_VERSION1_8K | \
  30. COMPRESSION_VERSION1_16K | \
  31. COMPRESSION_VERSION1_32K | \
  32. COMPRESSION_VERSION1_64K ))
  33. // We need to find a place to put the following supported featurettes...
  34. #define XON_XOFF_SUPPORTED 0x00000010
  35. #define COMPRESS_BROADCAST_FRAMES 0x00000080
  36. #define UNKNOWN_FRAMING 0x00010000
  37. #define NO_FRAMING 0x00020000
  38. #define NT31RAS_COMPRESSION 254
  39. #define FUNC_ASYCMAC_OPEN 0
  40. #define FUNC_ASYCMAC_CLOSE 1
  41. #define FUNC_ASYCMAC_TRACE 2
  42. #define FUNC_ASYCMAC_DCDCHANGE 3
  43. #ifdef MY_DEVICE_OBJECT
  44. #define FILE_DEVICE_ASYMAC 0x031
  45. #define ASYMAC_CTL_CODE(_Function) CTL_CODE(FILE_DEVICE_ASYMAC, _Function, METHOD_BUFFERED, FILE_ANY_ACCESS)
  46. #else
  47. #define ASYMAC_CTL_CODE(_Function) CTL_CODE(FILE_DEVICE_NETWORK, _Function, METHOD_BUFFERED, FILE_ANY_ACCESS)
  48. #endif
  49. #define IOCTL_ASYMAC_OPEN ASYMAC_CTL_CODE(FUNC_ASYCMAC_OPEN )
  50. #define IOCTL_ASYMAC_CLOSE ASYMAC_CTL_CODE(FUNC_ASYCMAC_CLOSE )
  51. #define IOCTL_ASYMAC_TRACE ASYMAC_CTL_CODE(FUNC_ASYCMAC_TRACE )
  52. #define IOCTL_ASYMAC_DCDCHANGE ASYMAC_CTL_CODE(FUNC_ASYCMAC_DCDCHANGE )
  53. //
  54. // Asyncmac error messages
  55. //
  56. // All AsyncMac errors start with this base number
  57. #define ASYBASE 700
  58. // The Mac has not bound to an upper protocol, or the
  59. // previous binding to AsyncMac has been destroyed.
  60. #define ASYNC_ERROR_NO_ADAPTER ASYBASE+0
  61. // A port was attempted to be open that was not CLOSED yet.
  62. #define ASYNC_ERROR_ALREADY_OPEN ASYBASE+1
  63. // All the ports (allocated) are used up or there is
  64. // no binding to the AsyncMac at all (and thus no ports).
  65. // The number of ports allocated comes from the registry.
  66. #define ASYNC_ERROR_NO_PORT_AVAILABLE ASYBASE+2
  67. // In the open IOCtl to the AsyncParameter the Adapter
  68. // parameter passed was invalid.
  69. #define ASYNC_ERROR_BAD_ADAPTER_PARAM ASYBASE+3
  70. // During a close or compress request, the port
  71. // specified did not exist.
  72. #define ASYNC_ERROR_PORT_NOT_FOUND ASYBASE+4
  73. // A request came in for the port which could not
  74. // be handled because the port was in a bad state.
  75. // i.e. you can't a close a port if its state is OPENING
  76. #define ASYNC_ERROR_PORT_BAD_STATE ASYBASE+5
  77. // A call to ASYMAC_COMPRESS was bad with bad
  78. // parameters. That is, parameters that were not
  79. // supported. The fields will not be set to the bad params.
  80. #define ASYNC_ERROR_BAD_COMPRESSION_INFO ASYBASE+6
  81. // this structure is passed in as the input buffer when opening a port
  82. typedef struct ASYMAC_OPEN ASYMAC_OPEN, *PASYMAC_OPEN;
  83. struct ASYMAC_OPEN {
  84. OUT NDIS_HANDLE hNdisEndpoint; // unique for each endpoint assigned
  85. IN ULONG LinkSpeed; // RAW link speed in bits per sec
  86. IN USHORT QualOfConnect; // NdisAsyncRaw, NdisAsyncErrorControl, ...
  87. IN HANDLE FileHandle; // the Win32 or Nt File Handle
  88. };
  89. // this structure is passed in as the input buffer when closing a port
  90. typedef struct ASYMAC_CLOSE ASYMAC_CLOSE, *PASYMAC_CLOSE;
  91. struct ASYMAC_CLOSE {
  92. NDIS_HANDLE hNdisEndpoint; // unique for each endpoint assigned
  93. PVOID MacAdapter; // Which binding to AsyMac to use -- if set
  94. // to NULL, will default to last binding
  95. };
  96. typedef struct ASYMAC_DCDCHANGE ASYMAC_DCDCHANGE, *PASYMAC_DCDCHANGE;
  97. struct ASYMAC_DCDCHANGE {
  98. NDIS_HANDLE hNdisEndpoint; // unique for each endpoint assigned
  99. PVOID MacAdapter; // Which binding to AsyMac to use -- if set
  100. // to NULL, will default to last binding
  101. };
  102. // this structure is used to read/set configurable 'feature' options
  103. // during authentication this structure is passed and an
  104. // agreement is made which features to support
  105. typedef struct ASYMAC_FEATURES ASYMAC_FEATURES, *PASYMAC_FEATURES;
  106. struct ASYMAC_FEATURES {
  107. ULONG SendFeatureBits; // A bit field of compression/features sendable
  108. ULONG RecvFeatureBits; // A bit field of compression/features receivable
  109. ULONG MaxSendFrameSize; // Maximum frame size that can be sent
  110. // must be less than or equal default
  111. ULONG MaxRecvFrameSize; // Maximum frame size that can be rcvd
  112. // must be less than or equal default
  113. ULONG LinkSpeed; // New RAW link speed in bits/sec
  114. // Ignored if 0
  115. };
  116. #endif // ASYNC_PUB