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