]> git.proxmox.com Git - mirror_edk2.git/blame - IntelFrameworkModulePkg/Bus/Isa/Ps2MouseAbsolutePointerDxe/Ps2MouseAbsolutePointer.h
removing return cursor to old position...
[mirror_edk2.git] / IntelFrameworkModulePkg / Bus / Isa / Ps2MouseAbsolutePointerDxe / Ps2MouseAbsolutePointer.h
CommitLineData
afd0fe22 1/**@file\r
2 A Ps2MouseAbsolutePointer driver header file\r
3 \r
4Copyright (c) 2006 - 2007, Intel Corporation\r
5All rights reserved. This program and the accompanying materials\r
6are licensed and made available under the terms and conditions of the BSD License\r
7which accompanies this distribution. The full text of the license may be found at\r
8http://opensource.org/licenses/bsd-license.php\r
9\r
10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
13**/\r
14\r
15#ifndef _PS2MOUSEABSOLUTEPOINTER_H\r
16#define _PS2MOUSEABSOLUTEPOINTER_H\r
17\r
18#include <PiDxe.h>\r
19#include <Framework/StatusCode.h>\r
20\r
21#include <Protocol/AbsolutePointer.h>\r
22#include <Protocol/IsaIo.h>\r
23#include <Protocol/DevicePath.h>\r
24\r
25#include <Library/DebugLib.h>\r
26#include <Library/UefiDriverEntryPoint.h>\r
27#include <Library/UefiLib.h>\r
28#include <Library/BaseMemoryLib.h>\r
29#include <Library/MemoryAllocationLib.h>\r
30#include <Library/UefiBootServicesTableLib.h>\r
31#include <Library/ReportStatusCodeLib.h>\r
32\r
9f6531d1 33//\r
34// Global Variables\r
35//\r
36extern EFI_DRIVER_BINDING_PROTOCOL gPS2MouseAbsolutePointerDriver;\r
37extern EFI_COMPONENT_NAME_PROTOCOL gPs2MouseAbsolutePointerComponentName;\r
38extern EFI_COMPONENT_NAME2_PROTOCOL gPs2MouseAbsolutePointerComponentName2;\r
39\r
afd0fe22 40//\r
41// PS/2 mouse sample rate\r
42//\r
43typedef enum {\r
44 SSR_10,\r
45 SSR_20,\r
46 SSR_40,\r
47 SSR_60,\r
48 SSR_80,\r
49 SSR_100,\r
50 SSR_200,\r
51 MAX_SR\r
52} MOUSE_SR;\r
53\r
54//\r
55// PS/2 mouse resolution\r
56//\r
57typedef enum {\r
58 CMR1,\r
59 CMR2,\r
60 CMR4,\r
61 CMR8,\r
62 MAX_CMR\r
63} MOUSE_RE;\r
64\r
65//\r
66// PS/2 mouse scaling\r
67//\r
68typedef enum {\r
69 SF1,\r
70 SF2\r
71} MOUSE_SF;\r
72\r
73//\r
74// Driver Private Data\r
75//\r
f02bd376 76#define PS2_MOUSE_ABSOLUTE_POINTER_DEV_SIGNATURE SIGNATURE_32 ('p', '2', 's', 't')\r
afd0fe22 77\r
78typedef struct {\r
79 UINTN Signature;\r
80\r
81 EFI_HANDLE Handle;\r
82 EFI_ABSOLUTE_POINTER_PROTOCOL AbsolutePointerProtocol;\r
83 EFI_ABSOLUTE_POINTER_STATE State;\r
84 EFI_ABSOLUTE_POINTER_MODE Mode;\r
85 BOOLEAN StateChanged;\r
86\r
87 //\r
88 // PS2 Mouse device specific information\r
89 //\r
90 MOUSE_SR SampleRate;\r
91 MOUSE_RE Resolution;\r
92 MOUSE_SF Scaling;\r
93 UINT8 DataPackageSize;\r
94\r
95 EFI_ISA_IO_PROTOCOL *IsaIo;\r
96\r
97 EFI_EVENT TimerEvent;\r
98\r
99 EFI_UNICODE_STRING_TABLE *ControllerNameTable;\r
100 EFI_DEVICE_PATH_PROTOCOL *DevicePath;\r
101} PS2_MOUSE_ABSOLUTE_POINTER_DEV;\r
102\r
103#define PS2_MOUSE_ABSOLUTE_POINTER_DEV_FROM_THIS(a) CR (a, PS2_MOUSE_ABSOLUTE_POINTER_DEV, AbsolutePointerProtocol, PS2_MOUSE_ABSOLUTE_POINTER_DEV_SIGNATURE)\r
104\r
afd0fe22 105//\r
106// Function prototypes\r
107//\r
108EFI_STATUS\r
109EFIAPI\r
110PS2MouseAbsolutePointerDriverSupported (\r
111 IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
112 IN EFI_HANDLE Controller,\r
113 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath\r
114 );\r
115\r
116EFI_STATUS\r
117EFIAPI\r
118PS2MouseAbsolutePointerDriverStart (\r
119 IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
120 IN EFI_HANDLE Controller,\r
121 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath\r
122 );\r
123\r
124EFI_STATUS\r
125EFIAPI\r
126PS2MouseAbsolutePointerDriverStop (\r
127 IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
128 IN EFI_HANDLE Controller,\r
129 IN UINTN NumberOfChildren,\r
130 IN EFI_HANDLE *ChildHandleBuffer\r
131 );\r
132\r
133//\r
134// EFI Component Name Functions\r
135//\r
136/**\r
137 Retrieves a Unicode string that is the user readable name of the driver.\r
138\r
139 This function retrieves the user readable name of a driver in the form of a\r
140 Unicode string. If the driver specified by This has a user readable name in\r
141 the language specified by Language, then a pointer to the driver name is\r
142 returned in DriverName, and EFI_SUCCESS is returned. If the driver specified\r
143 by This does not support the language specified by Language,\r
144 then EFI_UNSUPPORTED is returned.\r
145\r
146 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
147 EFI_COMPONENT_NAME_PROTOCOL instance.\r
148\r
149 @param Language[in] A pointer to a Null-terminated ASCII string\r
150 array indicating the language. This is the\r
151 language of the driver name that the caller is\r
152 requesting, and it must match one of the\r
153 languages specified in SupportedLanguages. The\r
154 number of languages supported by a driver is up\r
155 to the driver writer. Language is specified\r
4bca47e1 156 in RFC 4646 or ISO 639-2 language code format.\r
afd0fe22 157\r
158 @param DriverName[out] A pointer to the Unicode string to return.\r
159 This Unicode string is the name of the\r
160 driver specified by This in the language\r
161 specified by Language.\r
162\r
163 @retval EFI_SUCCESS The Unicode string for the Driver specified by\r
164 This and the language specified by Language was\r
165 returned in DriverName.\r
166\r
167 @retval EFI_INVALID_PARAMETER Language is NULL.\r
168\r
169 @retval EFI_INVALID_PARAMETER DriverName is NULL.\r
170\r
171 @retval EFI_UNSUPPORTED The driver specified by This does not support\r
172 the language specified by Language.\r
173\r
174**/\r
175EFI_STATUS\r
176EFIAPI\r
177Ps2MouseAbsolutePointerComponentNameGetDriverName (\r
178 IN EFI_COMPONENT_NAME_PROTOCOL *This,\r
179 IN CHAR8 *Language,\r
180 OUT CHAR16 **DriverName\r
181 );\r
182\r
183\r
184/**\r
185 Retrieves a Unicode string that is the user readable name of the controller\r
186 that is being managed by a driver.\r
187\r
188 This function retrieves the user readable name of the controller specified by\r
189 ControllerHandle and ChildHandle in the form of a Unicode string. If the\r
190 driver specified by This has a user readable name in the language specified by\r
191 Language, then a pointer to the controller name is returned in ControllerName,\r
192 and EFI_SUCCESS is returned. If the driver specified by This is not currently\r
193 managing the controller specified by ControllerHandle and ChildHandle,\r
194 then EFI_UNSUPPORTED is returned. If the driver specified by This does not\r
195 support the language specified by Language, then EFI_UNSUPPORTED is returned.\r
196\r
197 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
198 EFI_COMPONENT_NAME_PROTOCOL instance.\r
199\r
200 @param ControllerHandle[in] The handle of a controller that the driver\r
201 specified by This is managing. This handle\r
202 specifies the controller whose name is to be\r
203 returned.\r
204\r
205 @param ChildHandle[in] The handle of the child controller to retrieve\r
206 the name of. This is an optional parameter that\r
207 may be NULL. It will be NULL for device\r
208 drivers. It will also be NULL for a bus drivers\r
209 that wish to retrieve the name of the bus\r
210 controller. It will not be NULL for a bus\r
211 driver that wishes to retrieve the name of a\r
212 child controller.\r
213\r
214 @param Language[in] A pointer to a Null-terminated ASCII string\r
215 array indicating the language. This is the\r
216 language of the driver name that the caller is\r
217 requesting, and it must match one of the\r
218 languages specified in SupportedLanguages. The\r
219 number of languages supported by a driver is up\r
220 to the driver writer. Language is specified in\r
4bca47e1 221 RFC 4646 or ISO 639-2 language code format.\r
afd0fe22 222\r
223 @param ControllerName[out] A pointer to the Unicode string to return.\r
224 This Unicode string is the name of the\r
225 controller specified by ControllerHandle and\r
226 ChildHandle in the language specified by\r
227 Language from the point of view of the driver\r
228 specified by This.\r
229\r
230 @retval EFI_SUCCESS The Unicode string for the user readable name in\r
231 the language specified by Language for the\r
232 driver specified by This was returned in\r
233 DriverName.\r
234\r
235 @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r
236\r
237 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid\r
238 EFI_HANDLE.\r
239\r
240 @retval EFI_INVALID_PARAMETER Language is NULL.\r
241\r
242 @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r
243\r
244 @retval EFI_UNSUPPORTED The driver specified by This is not currently\r
245 managing the controller specified by\r
246 ControllerHandle and ChildHandle.\r
247\r
248 @retval EFI_UNSUPPORTED The driver specified by This does not support\r
249 the language specified by Language.\r
250\r
251**/\r
252EFI_STATUS\r
253EFIAPI\r
254Ps2MouseAbsolutePointerComponentNameGetControllerName (\r
255 IN EFI_COMPONENT_NAME_PROTOCOL *This,\r
256 IN EFI_HANDLE ControllerHandle,\r
257 IN EFI_HANDLE ChildHandle OPTIONAL,\r
258 IN CHAR8 *Language,\r
259 OUT CHAR16 **ControllerName\r
260 );\r
261\r
262\r
263EFI_STATUS\r
264EFIAPI\r
265MouseAbsolutePointerReset (\r
266 IN EFI_ABSOLUTE_POINTER_PROTOCOL *This,\r
267 IN BOOLEAN ExtendedVerification\r
268 );\r
269\r
270EFI_STATUS\r
271EFIAPI\r
272MouseAbsolutePointerGetState (\r
273 IN EFI_ABSOLUTE_POINTER_PROTOCOL *This,\r
274 IN OUT EFI_ABSOLUTE_POINTER_STATE *State\r
275 );\r
276\r
277VOID\r
278EFIAPI\r
279MouseAbsolutePointerWaitForInput (\r
280 IN EFI_EVENT Event,\r
281 IN VOID *Context\r
282 );\r
283\r
284VOID\r
285EFIAPI\r
286PollMouseAbsolutePointer (\r
287 IN EFI_EVENT Event,\r
288 IN VOID *Context\r
289 );\r
290\r
291EFI_STATUS\r
292In8042Data (\r
293 IN EFI_ISA_IO_PROTOCOL *IsaIo,\r
294 IN OUT UINT8 *Data\r
295 );\r
296BOOLEAN\r
297CheckMouseAbsolutePointerConnect (\r
298 IN PS2_MOUSE_ABSOLUTE_POINTER_DEV *MouseAbsolutePointerDev\r
299 );\r
300\r
301#endif\r