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