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.

127 lines
3.1 KiB

  1. #ifndef _EFI_SER_H
  2. #define _EFI_SER_H
  3. /*++
  4. Copyright (c) 1998 Intel Corporation
  5. Module Name:
  6. efiser.h
  7. Abstract:
  8. EFI serial protocol
  9. Revision History
  10. --*/
  11. /*
  12. * Serial protocol
  13. */
  14. #define SERIAL_IO_PROTOCOL \
  15. { 0xBB25CF6F, 0xF1D4, 0x11D2, 0x9A, 0x0C, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0xFD }
  16. INTERFACE_DECL(_SERIAL_IO_INTERFACE);
  17. typedef enum {
  18. DefaultParity,
  19. NoParity,
  20. EvenParity,
  21. OddParity,
  22. MarkParity,
  23. SpaceParity
  24. } EFI_PARITY_TYPE;
  25. typedef enum {
  26. DefaultStopBits,
  27. OneStopBit, /* 1 stop bit */
  28. OneFiveStopBits, /* 1.5 stop bits */
  29. TwoStopBits /* 2 stop bits */
  30. } EFI_STOP_BITS_TYPE;
  31. #define EFI_SERIAL_CLEAR_TO_SEND 0x0010 /* RO */
  32. #define EFI_SERIAL_DATA_SET_READY 0x0020 /* RO */
  33. #define EFI_SERIAL_RING_INDICATE 0x0040 /* RO */
  34. #define EFI_SERIAL_CARRIER_DETECT 0x0080 /* RO */
  35. #define EFI_SERIAL_REQUEST_TO_SEND 0x0002 /* WO */
  36. #define EFI_SERIAL_DATA_TERMINAL_READY 0x0001 /* WO */
  37. #define EFI_SERIAL_INPUT_BUFFER_EMPTY 0x0100 /* RO */
  38. typedef
  39. EFI_STATUS
  40. (EFIAPI *EFI_SERIAL_RESET) (
  41. IN struct _SERIAL_IO_INTERFACE *This
  42. );
  43. typedef
  44. EFI_STATUS
  45. (EFIAPI *EFI_SERIAL_SET_ATTRIBUTES) (
  46. IN struct _SERIAL_IO_INTERFACE *This,
  47. IN UINT64 BaudRate,
  48. IN UINT32 ReceiveFifoDepth,
  49. IN UINT32 Timeout,
  50. IN EFI_PARITY_TYPE Parity,
  51. IN UINT8 DataBits,
  52. IN EFI_STOP_BITS_TYPE StopBits
  53. );
  54. typedef
  55. EFI_STATUS
  56. (EFIAPI *EFI_SERIAL_SET_CONTROL_BITS) (
  57. IN struct _SERIAL_IO_INTERFACE *This,
  58. IN UINT32 Control
  59. );
  60. typedef
  61. EFI_STATUS
  62. (EFIAPI *EFI_SERIAL_GET_CONTROL_BITS) (
  63. IN struct _SERIAL_IO_INTERFACE *This,
  64. OUT UINT32 *Control
  65. );
  66. typedef
  67. EFI_STATUS
  68. (EFIAPI *EFI_SERIAL_WRITE) (
  69. IN struct _SERIAL_IO_INTERFACE *This,
  70. IN OUT UINTN *BufferSize,
  71. IN VOID *Buffer
  72. );
  73. typedef
  74. EFI_STATUS
  75. (EFIAPI *EFI_SERIAL_READ) (
  76. IN struct _SERIAL_IO_INTERFACE *This,
  77. IN OUT UINTN *BufferSize,
  78. OUT VOID *Buffer
  79. );
  80. typedef struct {
  81. UINT32 ControlMask;
  82. /* current Attributes */
  83. UINT32 Timeout;
  84. UINT64 BaudRate;
  85. UINT32 ReceiveFifoDepth;
  86. UINT32 DataBits;
  87. UINT32 Parity;
  88. UINT32 StopBits;
  89. } SERIAL_IO_MODE;
  90. #define SERIAL_IO_INTERFACE_REVISION 0x00010000
  91. typedef struct _SERIAL_IO_INTERFACE {
  92. UINT32 Revision;
  93. EFI_SERIAL_RESET Reset;
  94. EFI_SERIAL_SET_ATTRIBUTES SetAttributes;
  95. EFI_SERIAL_SET_CONTROL_BITS SetControl;
  96. EFI_SERIAL_GET_CONTROL_BITS GetControl;
  97. EFI_SERIAL_WRITE Write;
  98. EFI_SERIAL_READ Read;
  99. SERIAL_IO_MODE *Mode;
  100. } SERIAL_IO_INTERFACE;
  101. #endif