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