Adding upstream version 6.03~pre2+dfsg.
[syslinux-debian/hramrach.git] / efi32 / include / efi / efiser.h
blobfcc97a19dc949c610626805cba921835bc3684d5
1 #ifndef _EFI_SER_H
2 #define _EFI_SER_H
4 /*++
6 Copyright (c) 1998 Intel Corporation
8 Module Name:
10 efiser.h
12 Abstract:
14 EFI serial protocol
16 Revision History
18 --*/
21 // Serial protocol
24 #define SERIAL_IO_PROTOCOL \
25 { 0xBB25CF6F, 0xF1D4, 0x11D2, {0x9A, 0x0C, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0xFD} }
27 INTERFACE_DECL(_SERIAL_IO_INTERFACE);
29 typedef enum {
30 DefaultParity,
31 NoParity,
32 EvenParity,
33 OddParity,
34 MarkParity,
35 SpaceParity
36 } EFI_PARITY_TYPE;
38 typedef enum {
39 DefaultStopBits,
40 OneStopBit, // 1 stop bit
41 OneFiveStopBits, // 1.5 stop bits
42 TwoStopBits // 2 stop bits
43 } EFI_STOP_BITS_TYPE;
45 #define EFI_SERIAL_CLEAR_TO_SEND 0x0010 // RO
46 #define EFI_SERIAL_DATA_SET_READY 0x0020 // RO
47 #define EFI_SERIAL_RING_INDICATE 0x0040 // RO
48 #define EFI_SERIAL_CARRIER_DETECT 0x0080 // RO
49 #define EFI_SERIAL_REQUEST_TO_SEND 0x0002 // WO
50 #define EFI_SERIAL_DATA_TERMINAL_READY 0x0001 // WO
51 #define EFI_SERIAL_INPUT_BUFFER_EMPTY 0x0100 // RO
52 #define EFI_SERIAL_OUTPUT_BUFFER_EMPTY 0x0200 // RO
53 #define EFI_SERIAL_HARDWARE_LOOPBACK_ENABLE 0x1000 // RW
54 #define EFI_SERIAL_SOFTWARE_LOOPBACK_ENABLE 0x2000 // RW
55 #define EFI_SERIAL_HARDWARE_FLOW_CONTROL_ENABLE 0x4000 // RW
57 typedef
58 EFI_STATUS
59 (EFIAPI *EFI_SERIAL_RESET) (
60 IN struct _SERIAL_IO_INTERFACE *This
63 typedef
64 EFI_STATUS
65 (EFIAPI *EFI_SERIAL_SET_ATTRIBUTES) (
66 IN struct _SERIAL_IO_INTERFACE *This,
67 IN UINT64 BaudRate,
68 IN UINT32 ReceiveFifoDepth,
69 IN UINT32 Timeout,
70 IN EFI_PARITY_TYPE Parity,
71 IN UINT8 DataBits,
72 IN EFI_STOP_BITS_TYPE StopBits
75 typedef
76 EFI_STATUS
77 (EFIAPI *EFI_SERIAL_SET_CONTROL_BITS) (
78 IN struct _SERIAL_IO_INTERFACE *This,
79 IN UINT32 Control
82 typedef
83 EFI_STATUS
84 (EFIAPI *EFI_SERIAL_GET_CONTROL_BITS) (
85 IN struct _SERIAL_IO_INTERFACE *This,
86 OUT UINT32 *Control
89 typedef
90 EFI_STATUS
91 (EFIAPI *EFI_SERIAL_WRITE) (
92 IN struct _SERIAL_IO_INTERFACE *This,
93 IN OUT UINTN *BufferSize,
94 IN VOID *Buffer
97 typedef
98 EFI_STATUS
99 (EFIAPI *EFI_SERIAL_READ) (
100 IN struct _SERIAL_IO_INTERFACE *This,
101 IN OUT UINTN *BufferSize,
102 OUT VOID *Buffer
105 typedef struct {
106 UINT32 ControlMask;
108 // current Attributes
109 UINT32 Timeout;
110 UINT64 BaudRate;
111 UINT32 ReceiveFifoDepth;
112 UINT32 DataBits;
113 UINT32 Parity;
114 UINT32 StopBits;
115 } SERIAL_IO_MODE;
117 #define SERIAL_IO_INTERFACE_REVISION 0x00010000
119 typedef struct _SERIAL_IO_INTERFACE {
120 UINT32 Revision;
121 EFI_SERIAL_RESET Reset;
122 EFI_SERIAL_SET_ATTRIBUTES SetAttributes;
123 EFI_SERIAL_SET_CONTROL_BITS SetControl;
124 EFI_SERIAL_GET_CONTROL_BITS GetControl;
125 EFI_SERIAL_WRITE Write;
126 EFI_SERIAL_READ Read;
128 SERIAL_IO_MODE *Mode;
129 } SERIAL_IO_INTERFACE;
131 #endif