remove some comments introduced by tools.
[mirror_edk2.git] / MdeModulePkg / Universal / DebugPortDxe / DebugPort.h
CommitLineData
c1f23d63 1/*++\r
2\r
3Copyright (c) 2006, Intel Corporation \r
4All rights reserved. This program and the accompanying materials \r
5are licensed and made available under the terms and conditions of the BSD License \r
6which accompanies this distribution. The full text of the license may be found at \r
7http://opensource.org/licenses/bsd-license.php \r
8 \r
9THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
10WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
11\r
12Module Name:\r
13 DebugPort.h\r
14\r
15Abstract:\r
16 Definitions and prototypes for DebugPort driver\r
17\r
18--*/\r
19\r
20#ifndef __DEBUGPORT_H__\r
21#define __DEBUGPORT_H__\r
22\r
23//\r
24// The package level header files this module uses\r
25//\r
26#include <Uefi.h>\r
27//\r
28// The protocols, PPI and GUID defintions for this module\r
29//\r
30#include <Protocol/DevicePath.h>\r
31#include <Protocol/ComponentName.h>\r
32#include <Protocol/DriverBinding.h>\r
33#include <Protocol/SerialIo.h>\r
34#include <Protocol/DebugPort.h>\r
35//\r
36// The Library classes this module consumes\r
37//\r
38#include <Library/DebugLib.h>\r
39#include <Library/UefiDriverEntryPoint.h>\r
40#include <Library/UefiLib.h>\r
41#include <Library/BaseMemoryLib.h>\r
42#include <Library/MemoryAllocationLib.h>\r
43#include <Library/UefiBootServicesTableLib.h>\r
44#include <Library/UefiRuntimeServicesTableLib.h>\r
45#include <Library/DevicePathLib.h>\r
46\r
47//\r
48// Driver Binding Externs\r
49//\r
50extern EFI_DRIVER_BINDING_PROTOCOL gDebugPortDriverBinding;\r
51extern EFI_COMPONENT_NAME_PROTOCOL gDebugPortComponentName;\r
52\r
53//\r
54// local type definitions\r
55//\r
56#define DEBUGPORT_DEVICE_SIGNATURE EFI_SIGNATURE_32 ('D', 'B', 'G', 'P')\r
57\r
58//\r
59// Device structure used by driver\r
60//\r
61typedef struct {\r
62 UINT32 Signature;\r
63 EFI_HANDLE DriverBindingHandle;\r
64 EFI_HANDLE DebugPortDeviceHandle;\r
65 VOID *DebugPortVariable;\r
66\r
67 EFI_DRIVER_BINDING_PROTOCOL DriverBindingInterface;\r
68 EFI_COMPONENT_NAME_PROTOCOL ComponentNameInterface;\r
69 EFI_DEVICE_PATH_PROTOCOL *DebugPortDevicePath;\r
70 EFI_DEBUGPORT_PROTOCOL DebugPortInterface;\r
71\r
72 EFI_HANDLE SerialIoDeviceHandle;\r
73 EFI_SERIAL_IO_PROTOCOL *SerialIoBinding;\r
74 UINT64 BaudRate;\r
75 UINT32 ReceiveFifoDepth;\r
76 UINT32 Timeout;\r
77 EFI_PARITY_TYPE Parity;\r
78 UINT8 DataBits;\r
79 EFI_STOP_BITS_TYPE StopBits;\r
80} DEBUGPORT_DEVICE;\r
81\r
82#define DEBUGPORT_DEVICE_FROM_THIS(a) CR (a, DEBUGPORT_DEVICE, DebugPortInterface, DEBUGPORT_DEVICE_SIGNATURE)\r
83\r
84#define EFI_ACPI_PC_COMPORT_HID EISA_PNP_ID (0x0500)\r
85#define EFI_ACPI_16550UART_HID EISA_PNP_ID (0x0501)\r
86\r
87#define DEBUGPORT_UART_DEFAULT_BAUDRATE 115200\r
88#define DEBUGPORT_UART_DEFAULT_PARITY 0\r
89#define DEBUGPORT_UART_DEFAULT_FIFO_DEPTH 16\r
90#define DEBUGPORT_UART_DEFAULT_TIMEOUT 50000 // 5 ms\r
91#define DEBUGPORT_UART_DEFAULT_DATA_BITS 8\r
92#define DEBUGPORT_UART_DEFAULT_STOP_BITS 1\r
93\r
94#define DEBUGPORT_DRIVER_VERSION 1\r
95\r
96#define EfiIsUartDevicePath(dp) (DevicePathType (dp) == MESSAGING_DEVICE_PATH && DevicePathSubType (dp) == MSG_UART_DP)\r
97\r
98//\r
99// globals\r
100//\r
101extern DEBUGPORT_DEVICE *gDebugPortDevice;\r
102\r
103//\r
104// Driver binding interface functions...\r
105//\r
106EFI_STATUS\r
107DebugPortEntryPoint (\r
108 IN EFI_HANDLE ImageHandle,\r
109 IN EFI_SYSTEM_TABLE *SystemTable\r
110 )\r
111;\r
112\r
113EFI_STATUS\r
114EFIAPI\r
115DebugPortSupported (\r
116 IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
117 IN EFI_HANDLE Controller,\r
118 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath\r
119 )\r
120;\r
121\r
122EFI_STATUS\r
123EFIAPI\r
124DebugPortStart (\r
125 IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
126 IN EFI_HANDLE Controller,\r
127 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath\r
128 )\r
129;\r
130\r
131EFI_STATUS\r
132EFIAPI\r
133DebugPortStop (\r
134 IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
135 IN EFI_HANDLE Controller,\r
136 IN UINTN NumberOfChildren,\r
137 IN EFI_HANDLE *ChildHandleBuffer\r
138 )\r
139;\r
140\r
141//\r
142// EFI Component Name Functions\r
143//\r
144EFI_STATUS\r
145EFIAPI\r
146DebugPortComponentNameGetDriverName (\r
147 IN EFI_COMPONENT_NAME_PROTOCOL *This,\r
148 IN CHAR8 *Language,\r
149 OUT CHAR16 **DriverName\r
150 )\r
151;\r
152\r
153EFI_STATUS\r
154EFIAPI\r
155DebugPortComponentNameGetControllerName (\r
156 IN EFI_COMPONENT_NAME_PROTOCOL *This,\r
157 IN EFI_HANDLE ControllerHandle,\r
158 IN EFI_HANDLE ChildHandle OPTIONAL,\r
159 IN CHAR8 *Language,\r
160 OUT CHAR16 **ControllerName\r
161 )\r
162;\r
163\r
164//\r
165// DebugPort member functions\r
166//\r
167EFI_STATUS\r
168EFIAPI\r
169DebugPortReset (\r
170 IN EFI_DEBUGPORT_PROTOCOL *This\r
171 )\r
172;\r
173\r
174EFI_STATUS\r
175EFIAPI\r
176DebugPortRead (\r
177 IN EFI_DEBUGPORT_PROTOCOL *This,\r
178 IN UINT32 Timeout,\r
179 IN OUT UINTN *BufferSize,\r
180 IN VOID *Buffer\r
181 )\r
182;\r
183\r
184EFI_STATUS\r
185EFIAPI\r
186DebugPortWrite (\r
187 IN EFI_DEBUGPORT_PROTOCOL *This,\r
188 IN UINT32 Timeout,\r
189 IN OUT UINTN *BufferSize,\r
190 OUT VOID *Buffer\r
191 )\r
192;\r
193\r
194EFI_STATUS\r
195EFIAPI\r
196DebugPortPoll (\r
197 IN EFI_DEBUGPORT_PROTOCOL *This\r
198 )\r
199;\r
200\r
201#endif\r