]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - sys/boot/efi/include/efiser.h
This commit was generated by cvs2svn to compensate for changes in r159985,
[FreeBSD/FreeBSD.git] / sys / boot / efi / include / efiser.h
1 /* $FreeBSD$ */
2 #ifndef _EFI_SER_H
3 #define _EFI_SER_H
4
5 /*++
6
7 Copyright (c) 1998  Intel Corporation
8
9 Module Name:
10
11     efiser.h
12
13 Abstract:
14
15     EFI serial protocol
16
17 Revision History
18
19 --*/
20
21 /*
22  * Serial protocol
23  */
24
25 #define SERIAL_IO_PROTOCOL \
26     { 0xBB25CF6F, 0xF1D4, 0x11D2, 0x9A, 0x0C, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0xFD }
27
28 INTERFACE_DECL(_SERIAL_IO_INTERFACE);
29
30 typedef enum {
31     DefaultParity,      
32     NoParity,           
33     EvenParity,
34     OddParity,
35     MarkParity,
36     SpaceParity
37 } EFI_PARITY_TYPE;
38
39 typedef enum {
40         DefaultStopBits,
41         OneStopBit,
42         OneFiveStopBits,
43         TwoStopBits
44 } EFI_STOP_BITS_TYPE;
45
46 #define EFI_SERIAL_CLEAR_TO_SEND                   0x0010
47 #define EFI_SERIAL_DATA_SET_READY                  0x0020
48 #define EFI_SERIAL_RING_INDICATE                   0x0040
49 #define EFI_SERIAL_CARRIER_DETECT                  0x0080
50 #define EFI_SERIAL_REQUEST_TO_SEND                 0x0002
51 #define EFI_SERIAL_DATA_TERMINAL_READY             0x0001
52 #define EFI_SERIAL_INPUT_BUFFER_EMPTY              0x0100
53 #define EFI_SERIAL_OUTPUT_BUFFER_EMPTY             0x0200
54 #define EFI_SERIAL_HARDWARE_LOOPBACK_ENABLE        0x1000
55 #define EFI_SERIAL_SOFTWARE_LOOPBACK_ENABLE        0x2000
56 #define EFI_SERIAL_HARDWARE_FLOW_CONTROL_ENABLE    0x4000
57
58 typedef
59 EFI_STATUS
60 (EFIAPI *EFI_SERIAL_RESET) (
61     IN struct _SERIAL_IO_INTERFACE  *This
62     );
63
64 typedef
65 EFI_STATUS
66 (EFIAPI *EFI_SERIAL_SET_ATTRIBUTES) (
67     IN struct _SERIAL_IO_INTERFACE  *This,
68     IN UINT64                       BaudRate,
69     IN UINT32                       ReceiveFifoDepth,
70     IN UINT32                       Timeout,
71     IN EFI_PARITY_TYPE              Parity,
72     IN UINT8                        DataBits,
73     IN EFI_STOP_BITS_TYPE           StopBits
74     );
75
76 typedef
77 EFI_STATUS
78 (EFIAPI *EFI_SERIAL_SET_CONTROL_BITS) (
79     IN struct _SERIAL_IO_INTERFACE  *This,
80     IN UINT32                       Control
81     );
82
83 typedef
84 EFI_STATUS
85 (EFIAPI *EFI_SERIAL_GET_CONTROL_BITS) (
86     IN struct _SERIAL_IO_INTERFACE  *This,
87     OUT UINT32                      *Control
88     );
89
90 typedef
91 EFI_STATUS
92 (EFIAPI *EFI_SERIAL_WRITE) (
93     IN struct _SERIAL_IO_INTERFACE  *This,
94     IN OUT UINTN                    *BufferSize,
95     IN VOID                         *Buffer
96     );
97
98 typedef
99 EFI_STATUS
100 (EFIAPI *EFI_SERIAL_READ) (
101     IN struct _SERIAL_IO_INTERFACE  *This,
102     IN OUT UINTN                    *BufferSize,
103     OUT VOID                        *Buffer
104     );
105
106 typedef struct {
107     UINT32                  ControlMask;
108
109         /* current Attributes. */
110     UINT32                  Timeout;
111     UINT64                  BaudRate;
112     UINT32                  ReceiveFifoDepth;
113     UINT32                  DataBits;
114     UINT32                  Parity;
115     UINT32                  StopBits;
116 } SERIAL_IO_MODE;
117
118 #define SERIAL_IO_INTERFACE_REVISION    0x00010000
119
120 typedef struct _SERIAL_IO_INTERFACE {
121     UINT32                       Revision;
122     EFI_SERIAL_RESET             Reset;
123     EFI_SERIAL_SET_ATTRIBUTES    SetAttributes;
124     EFI_SERIAL_SET_CONTROL_BITS  SetControl;
125     EFI_SERIAL_GET_CONTROL_BITS  GetControl;
126     EFI_SERIAL_WRITE             Write;
127     EFI_SERIAL_READ              Read;
128
129     SERIAL_IO_MODE               *Mode;
130 } SERIAL_IO_INTERFACE;
131
132 #endif