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.

122 lines
4.9 KiB

  1. /*++
  2. *****************************************************************************
  3. * *
  4. * This software contains proprietary and confidential information of *
  5. * *
  6. * Digi International Inc. *
  7. * *
  8. * By accepting transfer of this copy, Recipient agrees to retain this *
  9. * software in confidence, to prevent disclosure to others, and to make *
  10. * no use of this software other than that for which it was delivered. *
  11. * This is an unpublished copyrighted work of Digi International Inc. *
  12. * Except as permitted by federal law, 17 USC 117, copying is strictly *
  13. * prohibited. *
  14. * *
  15. *****************************************************************************
  16. Module Name:
  17. digiser.h
  18. Abstract:
  19. This file contains the recommended extensions to the Microsoft Windows NT
  20. Serial Interface (NTDDSER.H) needed to support hardware framing.
  21. Revision History:
  22. $Log: digiser.h $
  23. Revision 1.3 1995/09/15 14:55:24 dirkh
  24. Remove SERIAL_ERROR_CRC (use STATUS_CRC_ERROR instead).
  25. Comments are more explicit.
  26. Revision 1.2 1995/06/12 15:23:44 dirkh
  27. Merge two structures (SERIAL_GET_FRAMING and SERIAL_SET_FRAMING)
  28. into one (SERIAL_FRAMING_STATE). Document relationship with IOCTLs.
  29. Revision 1.1 1995/05/31 15:05:19 mikez
  30. Initial revision
  31. --*/
  32. //
  33. // NtDeviceIoControlFile IoControlCode values for this device
  34. //
  35. #ifndef Microsoft_Adopts_These_Changes
  36. #define IOCTL_SERIAL_QUERY_FRAMING CTL_CODE(FILE_DEVICE_SERIAL_PORT,0x801,METHOD_BUFFERED,FILE_ANY_ACCESS)
  37. #define IOCTL_SERIAL_SET_FRAMING CTL_CODE(FILE_DEVICE_SERIAL_PORT,0x802,METHOD_BUFFERED,FILE_ANY_ACCESS)
  38. #define IOCTL_SERIAL_GET_FRAMING CTL_CODE(FILE_DEVICE_SERIAL_PORT,0x803,METHOD_BUFFERED,FILE_ANY_ACCESS)
  39. #else
  40. #define IOCTL_SERIAL_QUERY_FRAMING CTL_CODE(FILE_DEVICE_SERIAL_PORT,35,METHOD_BUFFERED,FILE_ANY_ACCESS)
  41. #define IOCTL_SERIAL_SET_FRAMING CTL_CODE(FILE_DEVICE_SERIAL_PORT,36,METHOD_BUFFERED,FILE_ANY_ACCESS)
  42. #define IOCTL_SERIAL_GET_FRAMING CTL_CODE(FILE_DEVICE_SERIAL_PORT,37,METHOD_BUFFERED,FILE_ANY_ACCESS)
  43. #endif
  44. //
  45. // Provider capabilities flags (IOCTL_SERIAL_GET_PROPERTIES)
  46. //
  47. #define SERIAL_PCF_FRAMING ((ULONG)0x0400)
  48. //
  49. // Defines the bitmask that the driver can use to notify
  50. // state changes via IOCTL_SERIAL_SET_WAIT_MASK and IOCTL_SERIAL_WAIT_ON_MASK.
  51. //
  52. // Note that these events will *not* be delivered if there is an outstanding read IRP.
  53. // The status of the read IRP serves as notification of the receipt of a (good or bad) frame.
  54. // Repeat: These events will be detected and delivered only if the read queue is empty.
  55. //
  56. #define SERIAL_EV_RXFRAME 0x2000 // A valid frame was received
  57. #define SERIAL_EV_BADFRAME 0x4000 // An errored frame was received.
  58. //
  59. // Read IRPs are always completed when a frame is received.
  60. // Following are the values that can be returned by the
  61. // driver in IoStatus.Status of the read IRP.
  62. //
  63. // STATUS_SUCCESS (good frame, data length is IoStatus.Information)
  64. // STATUS_CRC_ERROR
  65. // STATUS_DATA_ERROR (abort frame)
  66. // STATUS_DATA_OVERRUN (buffer overrun -- note that buffer must have space for CRC bytes, although CRC bytes will not be indicated on STATUS_SUCCESS)
  67. //
  68. //
  69. // This structure is used to query the framing options
  70. // supported by hardware (IOCTL_SERIAL_QUERY_FRAMING).
  71. //
  72. typedef struct _SERIAL_FRAMING_INFO {
  73. OUT ULONG FramingBits; // Standard NDIS_WAN_INFO field
  74. OUT ULONG HdrCompressionBits; // Standard NDIS_WAN_INFO field
  75. OUT ULONG DataCompressionBits; // To be decided
  76. OUT ULONG DataEncryptionBits; // To be decided
  77. } SERIAL_FRAMING_INFO, *PSERIAL_FRAMING_INFO;
  78. //
  79. // This structure is used to set and retrieve
  80. // the current hardware framing settings
  81. // (IOCTL_SERIAL_SET_FRAMING, IOCTL_SERIAL_GET_FRAMING).
  82. //
  83. // Valid values for [Send,Recv]FramingBits include (for example)
  84. // PPP_FRAMING, PPP_ACCM_SUPPORTED, and ISO3309_FRAMING.
  85. //
  86. typedef struct _SERIAL_FRAMING_STATE {
  87. IN OUT ULONG BitMask; // 0: 16 bit CRC
  88. // 1: 32 bit CRC
  89. IN OUT ULONG SendFramingBits; // Standard NDIS_WAN_SET_LINK_INFO field
  90. IN OUT ULONG RecvFramingBits; // Standard NDIS_WAN_SET_LINK_INFO field
  91. IN OUT ULONG SendCompressionBits; // Standard NDIS_WAN_SET_LINK_INFO field
  92. IN OUT ULONG RecvCompressionBits; // Standard NDIS_WAN_SET_LINK_INFO field
  93. IN OUT ULONG SendEncryptionBits; // To be decided
  94. IN OUT ULONG RecvEncryptionBits; // To be decided
  95. IN OUT ULONG SendACCM; // Standard NDIS_WAN_SET_LINK_INFO field
  96. IN OUT ULONG RecvACCM; // Standard NDIS_WAN_SET_LINK_INFO field
  97. } SERIAL_FRAMING_STATE, *PSERIAL_FRAMING_STATE;