2 A Ps2MouseAbsolutePointer driver header file
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
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.
15 #ifndef _PS2MOUSEABSOLUTEPOINTER_H
16 #define _PS2MOUSEABSOLUTEPOINTER_H
19 #include <Framework/StatusCode.h>
21 #include <Protocol/AbsolutePointer.h>
22 #include <Protocol/IsaIo.h>
23 #include <Protocol/DevicePath.h>
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>
34 // PS/2 mouse sample rate
48 // PS/2 mouse resolution
67 // Driver Private Data
69 #define PS2_MOUSE_ABSOLUTE_POINTER_DEV_SIGNATURE SIGNATURE_32 ('p', '2', 's', 't')
75 EFI_ABSOLUTE_POINTER_PROTOCOL AbsolutePointerProtocol
;
76 EFI_ABSOLUTE_POINTER_STATE State
;
77 EFI_ABSOLUTE_POINTER_MODE Mode
;
81 // PS2 Mouse device specific information
86 UINT8 DataPackageSize
;
88 EFI_ISA_IO_PROTOCOL
*IsaIo
;
92 EFI_UNICODE_STRING_TABLE
*ControllerNameTable
;
93 EFI_DEVICE_PATH_PROTOCOL
*DevicePath
;
94 } PS2_MOUSE_ABSOLUTE_POINTER_DEV
;
96 #define PS2_MOUSE_ABSOLUTE_POINTER_DEV_FROM_THIS(a) CR (a, PS2_MOUSE_ABSOLUTE_POINTER_DEV, AbsolutePointerProtocol, PS2_MOUSE_ABSOLUTE_POINTER_DEV_SIGNATURE)
101 extern EFI_DRIVER_BINDING_PROTOCOL gPS2MouseAbsolutePointerDriver
;
102 extern EFI_COMPONENT_NAME_PROTOCOL gPs2MouseAbsolutePointerComponentName
;
103 extern EFI_COMPONENT_NAME2_PROTOCOL gPs2MouseAbsolutePointerComponentName2
;
106 // Function prototypes
110 PS2MouseAbsolutePointerDriverSupported (
111 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
112 IN EFI_HANDLE Controller
,
113 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
118 PS2MouseAbsolutePointerDriverStart (
119 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
120 IN EFI_HANDLE Controller
,
121 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
126 PS2MouseAbsolutePointerDriverStop (
127 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
128 IN EFI_HANDLE Controller
,
129 IN UINTN NumberOfChildren
,
130 IN EFI_HANDLE
*ChildHandleBuffer
134 // EFI Component Name Functions
137 Retrieves a Unicode string that is the user readable name of the driver.
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.
146 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
147 EFI_COMPONENT_NAME_PROTOCOL instance.
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.
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.
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.
167 @retval EFI_INVALID_PARAMETER Language is NULL.
169 @retval EFI_INVALID_PARAMETER DriverName is NULL.
171 @retval EFI_UNSUPPORTED The driver specified by This does not support
172 the language specified by Language.
177 Ps2MouseAbsolutePointerComponentNameGetDriverName (
178 IN EFI_COMPONENT_NAME_PROTOCOL
*This
,
180 OUT CHAR16
**DriverName
185 Retrieves a Unicode string that is the user readable name of the controller
186 that is being managed by a driver.
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.
197 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
198 EFI_COMPONENT_NAME_PROTOCOL instance.
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
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
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.
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
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
235 @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.
237 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid
240 @retval EFI_INVALID_PARAMETER Language is NULL.
242 @retval EFI_INVALID_PARAMETER ControllerName is NULL.
244 @retval EFI_UNSUPPORTED The driver specified by This is not currently
245 managing the controller specified by
246 ControllerHandle and ChildHandle.
248 @retval EFI_UNSUPPORTED The driver specified by This does not support
249 the language specified by Language.
254 Ps2MouseAbsolutePointerComponentNameGetControllerName (
255 IN EFI_COMPONENT_NAME_PROTOCOL
*This
,
256 IN EFI_HANDLE ControllerHandle
,
257 IN EFI_HANDLE ChildHandle OPTIONAL
,
259 OUT CHAR16
**ControllerName
265 MouseAbsolutePointerReset (
266 IN EFI_ABSOLUTE_POINTER_PROTOCOL
*This
,
267 IN BOOLEAN ExtendedVerification
272 MouseAbsolutePointerGetState (
273 IN EFI_ABSOLUTE_POINTER_PROTOCOL
*This
,
274 IN OUT EFI_ABSOLUTE_POINTER_STATE
*State
279 MouseAbsolutePointerWaitForInput (
286 PollMouseAbsolutePointer (
293 IN EFI_ISA_IO_PROTOCOL
*IsaIo
,
297 CheckMouseAbsolutePointerConnect (
298 IN PS2_MOUSE_ABSOLUTE_POINTER_DEV
*MouseAbsolutePointerDev