change "UsbMouseSimulateTouchPad" to "UsbMouseAbsolutePointer" for more clearing the name's meaning.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4336 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
eric_tian 2007-11-28 03:37:58 +00:00
parent 7e6ae4d97f
commit 2170f9dd36
7 changed files with 226 additions and 226 deletions

View File

@ -11,14 +11,14 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: Module Name:
UsbMouseSimulateTouchPadComponentName.c UsbMouseAbsolutePointerComponentName.c
Abstract: Abstract:
**/ **/
#include "UsbMouseSimulateTouchPad.h" #include "UsbMouseAbsolutePointer.h"
#include <Library/DebugLib.h> #include <Library/DebugLib.h>
// //
@ -65,7 +65,7 @@ Abstract:
**/ **/
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
UsbMouseSimulateTouchPadComponentNameGetDriverName ( UsbMouseAbsolutePointerComponentNameGetDriverName (
IN EFI_COMPONENT_NAME_PROTOCOL *This, IN EFI_COMPONENT_NAME_PROTOCOL *This,
IN CHAR8 *Language, IN CHAR8 *Language,
OUT CHAR16 **DriverName OUT CHAR16 **DriverName
@ -142,7 +142,7 @@ UsbMouseSimulateTouchPadComponentNameGetDriverName (
**/ **/
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
UsbMouseSimulateTouchPadComponentNameGetControllerName ( UsbMouseAbsolutePointerComponentNameGetControllerName (
IN EFI_COMPONENT_NAME_PROTOCOL *This, IN EFI_COMPONENT_NAME_PROTOCOL *This,
IN EFI_HANDLE ControllerHandle, IN EFI_HANDLE ControllerHandle,
IN EFI_HANDLE ChildHandle OPTIONAL, IN EFI_HANDLE ChildHandle OPTIONAL,
@ -154,24 +154,24 @@ UsbMouseSimulateTouchPadComponentNameGetControllerName (
// //
// EFI Component Name Protocol // EFI Component Name Protocol
// //
GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL gUsbMouseSimulateTouchPadComponentName = { GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL gUsbMouseAbsolutePointerComponentName = {
UsbMouseSimulateTouchPadComponentNameGetDriverName, UsbMouseAbsolutePointerComponentNameGetDriverName,
UsbMouseSimulateTouchPadComponentNameGetControllerName, UsbMouseAbsolutePointerComponentNameGetControllerName,
"eng" "eng"
}; };
// //
// EFI Component Name 2 Protocol // EFI Component Name 2 Protocol
// //
GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL gUsbMouseSimulateTouchPadComponentName2 = { GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL gUsbMouseAbsolutePointerComponentName2 = {
(EFI_COMPONENT_NAME2_GET_DRIVER_NAME) UsbMouseSimulateTouchPadComponentNameGetDriverName, (EFI_COMPONENT_NAME2_GET_DRIVER_NAME) UsbMouseAbsolutePointerComponentNameGetDriverName,
(EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) UsbMouseSimulateTouchPadComponentNameGetControllerName, (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) UsbMouseAbsolutePointerComponentNameGetControllerName,
"en" "en"
}; };
GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mUsbMouseSimulateTouchPadDriverNameTable[] = { GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mUsbMouseAbsolutePointerDriverNameTable[] = {
{ "eng;en", L"Usb Mouse Simulate TouchPad Driver" }, { "eng;en", L"Usb Mouse Simulate TouchPad Driver" },
{ NULL , NULL } { NULL , NULL }
}; };
@ -218,7 +218,7 @@ GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mUsbMouseSimulateTouchPad
**/ **/
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
UsbMouseSimulateTouchPadComponentNameGetDriverName ( UsbMouseAbsolutePointerComponentNameGetDriverName (
IN EFI_COMPONENT_NAME_PROTOCOL *This, IN EFI_COMPONENT_NAME_PROTOCOL *This,
IN CHAR8 *Language, IN CHAR8 *Language,
OUT CHAR16 **DriverName OUT CHAR16 **DriverName
@ -227,9 +227,9 @@ UsbMouseSimulateTouchPadComponentNameGetDriverName (
return LookupUnicodeString2 ( return LookupUnicodeString2 (
Language, Language,
This->SupportedLanguages, This->SupportedLanguages,
mUsbMouseSimulateTouchPadDriverNameTable, mUsbMouseAbsolutePointerDriverNameTable,
DriverName, DriverName,
(BOOLEAN)(This == &gUsbMouseSimulateTouchPadComponentName) (BOOLEAN)(This == &gUsbMouseAbsolutePointerComponentName)
); );
} }
@ -303,7 +303,7 @@ UsbMouseSimulateTouchPadComponentNameGetDriverName (
**/ **/
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
UsbMouseSimulateTouchPadComponentNameGetControllerName ( UsbMouseAbsolutePointerComponentNameGetControllerName (
IN EFI_COMPONENT_NAME_PROTOCOL *This, IN EFI_COMPONENT_NAME_PROTOCOL *This,
IN EFI_HANDLE ControllerHandle, IN EFI_HANDLE ControllerHandle,
IN EFI_HANDLE ChildHandle OPTIONAL, IN EFI_HANDLE ChildHandle OPTIONAL,
@ -312,7 +312,7 @@ UsbMouseSimulateTouchPadComponentNameGetControllerName (
) )
{ {
EFI_STATUS Status; EFI_STATUS Status;
USB_MOUSE_SIMULATE_TOUCHPAD_DEV *UsbMouseSimulateTouchPadDev; USB_MOUSE_ABSOLUTE_POINTER_DEV *UsbMouseAbsolutePointerDev;
EFI_ABSOLUTE_POINTER_PROTOCOL *AbsolutePointerProtocol; EFI_ABSOLUTE_POINTER_PROTOCOL *AbsolutePointerProtocol;
EFI_USB_IO_PROTOCOL *UsbIoProtocol; EFI_USB_IO_PROTOCOL *UsbIoProtocol;
@ -330,7 +330,7 @@ UsbMouseSimulateTouchPadComponentNameGetControllerName (
ControllerHandle, ControllerHandle,
&gEfiUsbIoProtocolGuid, &gEfiUsbIoProtocolGuid,
(VOID **) &UsbIoProtocol, (VOID **) &UsbIoProtocol,
gUsbMouseSimulateTouchPadDriverBinding.DriverBindingHandle, gUsbMouseAbsolutePointerDriverBinding.DriverBindingHandle,
ControllerHandle, ControllerHandle,
EFI_OPEN_PROTOCOL_BY_DRIVER EFI_OPEN_PROTOCOL_BY_DRIVER
); );
@ -338,7 +338,7 @@ UsbMouseSimulateTouchPadComponentNameGetControllerName (
gBS->CloseProtocol ( gBS->CloseProtocol (
ControllerHandle, ControllerHandle,
&gEfiUsbIoProtocolGuid, &gEfiUsbIoProtocolGuid,
gUsbMouseSimulateTouchPadDriverBinding.DriverBindingHandle, gUsbMouseAbsolutePointerDriverBinding.DriverBindingHandle,
ControllerHandle ControllerHandle
); );
@ -355,7 +355,7 @@ UsbMouseSimulateTouchPadComponentNameGetControllerName (
ControllerHandle, ControllerHandle,
&gEfiAbsolutePointerProtocolGuid, &gEfiAbsolutePointerProtocolGuid,
(VOID **) &AbsolutePointerProtocol, (VOID **) &AbsolutePointerProtocol,
gUsbMouseSimulateTouchPadDriverBinding.DriverBindingHandle, gUsbMouseAbsolutePointerDriverBinding.DriverBindingHandle,
ControllerHandle, ControllerHandle,
EFI_OPEN_PROTOCOL_GET_PROTOCOL EFI_OPEN_PROTOCOL_GET_PROTOCOL
); );
@ -364,14 +364,14 @@ UsbMouseSimulateTouchPadComponentNameGetControllerName (
return Status; return Status;
} }
UsbMouseSimulateTouchPadDev = USB_MOUSE_SIMULATE_TOUCHPAD_DEV_FROM_MOUSE_PROTOCOL (AbsolutePointerProtocol); UsbMouseAbsolutePointerDev = USB_MOUSE_ABSOLUTE_POINTER_DEV_FROM_MOUSE_PROTOCOL (AbsolutePointerProtocol);
return LookupUnicodeString2 ( return LookupUnicodeString2 (
Language, Language,
This->SupportedLanguages, This->SupportedLanguages,
UsbMouseSimulateTouchPadDev->ControllerNameTable, UsbMouseAbsolutePointerDev->ControllerNameTable,
ControllerName, ControllerName,
(BOOLEAN)(This == &gUsbMouseSimulateTouchPadComponentName) (BOOLEAN)(This == &gUsbMouseAbsolutePointerComponentName)
); );
} }

View File

@ -11,14 +11,14 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: Module Name:
UsbMouseSimulateTouchPad.c UsbMouseAbsolutePointer.c
Abstract: Abstract:
**/ **/
#include "UsbMouseSimulateTouchPad.h" #include "UsbMouseAbsolutePointer.h"
#include <Library/DebugLib.h> #include <Library/DebugLib.h>
#include <IndustryStandard/Usb.h> #include <IndustryStandard/Usb.h>
@ -31,14 +31,14 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
// //
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
USBMouseSimulateTouchPadDriverBindingEntryPoint ( USBMouseAbsolutePointerDriverBindingEntryPoint (
IN EFI_HANDLE ImageHandle, IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable IN EFI_SYSTEM_TABLE *SystemTable
); );
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
USBMouseSimulateTouchPadDriverBindingSupported ( USBMouseAbsolutePointerDriverBindingSupported (
IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_DRIVER_BINDING_PROTOCOL *This,
IN EFI_HANDLE Controller, IN EFI_HANDLE Controller,
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
@ -46,7 +46,7 @@ USBMouseSimulateTouchPadDriverBindingSupported (
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
USBMouseSimulateTouchPadDriverBindingStart ( USBMouseAbsolutePointerDriverBindingStart (
IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_DRIVER_BINDING_PROTOCOL *This,
IN EFI_HANDLE Controller, IN EFI_HANDLE Controller,
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
@ -54,21 +54,21 @@ USBMouseSimulateTouchPadDriverBindingStart (
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
USBMouseSimulateTouchPadDriverBindingStop ( USBMouseAbsolutePointerDriverBindingStop (
IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_DRIVER_BINDING_PROTOCOL *This,
IN EFI_HANDLE Controller, IN EFI_HANDLE Controller,
IN UINTN NumberOfChildren, IN UINTN NumberOfChildren,
IN EFI_HANDLE *ChildHandleBuffer IN EFI_HANDLE *ChildHandleBuffer
); );
EFI_GUID gEfiUsbMouseSimulateTouchPadDriverGuid = { EFI_GUID gEfiUsbMouseAbsolutePointerDriverGuid = {
0xa579f729, 0xa71d, 0x4b45, { 0xbe, 0xd7, 0xd, 0xb0, 0xa8, 0x7c, 0x3e, 0x8d } 0xa579f729, 0xa71d, 0x4b45, { 0xbe, 0xd7, 0xd, 0xb0, 0xa8, 0x7c, 0x3e, 0x8d }
}; };
EFI_DRIVER_BINDING_PROTOCOL gUsbMouseSimulateTouchPadDriverBinding = { EFI_DRIVER_BINDING_PROTOCOL gUsbMouseAbsolutePointerDriverBinding = {
USBMouseSimulateTouchPadDriverBindingSupported, USBMouseAbsolutePointerDriverBindingSupported,
USBMouseSimulateTouchPadDriverBindingStart, USBMouseAbsolutePointerDriverBindingStart,
USBMouseSimulateTouchPadDriverBindingStop, USBMouseAbsolutePointerDriverBindingStop,
0x1, 0x1,
NULL, NULL,
NULL NULL
@ -79,20 +79,20 @@ EFI_DRIVER_BINDING_PROTOCOL gUsbMouseSimulateTouchPadDriverBinding = {
// //
STATIC STATIC
BOOLEAN BOOLEAN
IsUsbMouseSimulateTouchPad ( IsUsbMouseAbsolutePointer (
IN EFI_USB_IO_PROTOCOL *UsbIo IN EFI_USB_IO_PROTOCOL *UsbIo
); );
STATIC STATIC
EFI_STATUS EFI_STATUS
InitializeUsbMouseSimulateTouchPadDevice ( InitializeUsbMouseAbsolutePointerDevice (
IN USB_MOUSE_SIMULATE_TOUCHPAD_DEV *UsbMouseSimulateTouchPadDev IN USB_MOUSE_ABSOLUTE_POINTER_DEV *UsbMouseAbsolutePointerDev
); );
STATIC STATIC
VOID VOID
EFIAPI EFIAPI
UsbMouseSimulateTouchPadWaitForInput ( UsbMouseAbsolutePointerWaitForInput (
IN EFI_EVENT Event, IN EFI_EVENT Event,
IN VOID *Context IN VOID *Context
); );
@ -103,7 +103,7 @@ UsbMouseSimulateTouchPadWaitForInput (
STATIC STATIC
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
OnMouseSimulateTouchPadInterruptComplete ( OnMouseAbsolutePointerInterruptComplete (
IN VOID *Data, IN VOID *Data,
IN UINTN DataLength, IN UINTN DataLength,
IN VOID *Context, IN VOID *Context,
@ -116,15 +116,15 @@ OnMouseSimulateTouchPadInterruptComplete (
STATIC STATIC
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
GetMouseSimulateTouchPadState ( GetMouseAbsolutePointerState (
IN EFI_ABSOLUTE_POINTER_PROTOCOL *This, IN EFI_ABSOLUTE_POINTER_PROTOCOL *This,
OUT EFI_ABSOLUTE_POINTER_STATE *MouseSimulateTouchPadState OUT EFI_ABSOLUTE_POINTER_STATE *MouseAbsolutePointerState
); );
STATIC STATIC
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
UsbMouseSimulateTouchPadReset ( UsbMouseAbsolutePointerReset (
IN EFI_ABSOLUTE_POINTER_PROTOCOL *This, IN EFI_ABSOLUTE_POINTER_PROTOCOL *This,
IN BOOLEAN ExtendedVerification IN BOOLEAN ExtendedVerification
); );
@ -134,7 +134,7 @@ UsbMouseSimulateTouchPadReset (
// //
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
USBMouseSimulateTouchPadDriverBindingEntryPoint ( USBMouseAbsolutePointerDriverBindingEntryPoint (
IN EFI_HANDLE ImageHandle, IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable IN EFI_SYSTEM_TABLE *SystemTable
) )
@ -155,10 +155,10 @@ USBMouseSimulateTouchPadDriverBindingEntryPoint (
return EfiLibInstallDriverBindingComponentName2 ( return EfiLibInstallDriverBindingComponentName2 (
ImageHandle, ImageHandle,
SystemTable, SystemTable,
&gUsbMouseSimulateTouchPadDriverBinding, &gUsbMouseAbsolutePointerDriverBinding,
ImageHandle, ImageHandle,
&gUsbMouseSimulateTouchPadComponentName, &gUsbMouseAbsolutePointerComponentName,
&gUsbMouseSimulateTouchPadComponentName2 &gUsbMouseAbsolutePointerComponentName2
); );
} }
@ -177,7 +177,7 @@ USBMouseSimulateTouchPadDriverBindingEntryPoint (
**/ **/
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
USBMouseSimulateTouchPadDriverBindingSupported ( USBMouseAbsolutePointerDriverBindingSupported (
IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_DRIVER_BINDING_PROTOCOL *This,
IN EFI_HANDLE Controller, IN EFI_HANDLE Controller,
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
@ -208,7 +208,7 @@ USBMouseSimulateTouchPadDriverBindingSupported (
// the Mouse controller that can be managed by this driver. // the Mouse controller that can be managed by this driver.
// //
Status = EFI_SUCCESS; Status = EFI_SUCCESS;
if (!IsUsbMouseSimulateTouchPad (UsbIo)) { if (!IsUsbMouseAbsolutePointer (UsbIo)) {
Status = EFI_UNSUPPORTED; Status = EFI_UNSUPPORTED;
} }
@ -240,7 +240,7 @@ USBMouseSimulateTouchPadDriverBindingSupported (
**/ **/
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
USBMouseSimulateTouchPadDriverBindingStart ( USBMouseAbsolutePointerDriverBindingStart (
IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_DRIVER_BINDING_PROTOCOL *This,
IN EFI_HANDLE Controller, IN EFI_HANDLE Controller,
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
@ -249,14 +249,14 @@ USBMouseSimulateTouchPadDriverBindingStart (
EFI_STATUS Status; EFI_STATUS Status;
EFI_USB_IO_PROTOCOL *UsbIo; EFI_USB_IO_PROTOCOL *UsbIo;
EFI_USB_ENDPOINT_DESCRIPTOR *EndpointDesc; EFI_USB_ENDPOINT_DESCRIPTOR *EndpointDesc;
USB_MOUSE_SIMULATE_TOUCHPAD_DEV *UsbMouseSimulateTouchPadDevice; USB_MOUSE_ABSOLUTE_POINTER_DEV *UsbMouseAbsolutePointerDevice;
UINT8 EndpointNumber; UINT8 EndpointNumber;
UINT8 Index; UINT8 Index;
UINT8 EndpointAddr; UINT8 EndpointAddr;
UINT8 PollingInterval; UINT8 PollingInterval;
UINT8 PacketSize; UINT8 PacketSize;
UsbMouseSimulateTouchPadDevice = NULL; UsbMouseAbsolutePointerDevice = NULL;
Status = EFI_SUCCESS; Status = EFI_SUCCESS;
Status = gBS->OpenProtocol ( Status = gBS->OpenProtocol (
@ -271,19 +271,19 @@ USBMouseSimulateTouchPadDriverBindingStart (
goto ErrorExit; goto ErrorExit;
} }
UsbMouseSimulateTouchPadDevice = AllocateZeroPool (sizeof (USB_MOUSE_SIMULATE_TOUCHPAD_DEV)); UsbMouseAbsolutePointerDevice = AllocateZeroPool (sizeof (USB_MOUSE_ABSOLUTE_POINTER_DEV));
if (UsbMouseSimulateTouchPadDevice == NULL) { if (UsbMouseAbsolutePointerDevice == NULL) {
Status = EFI_OUT_OF_RESOURCES; Status = EFI_OUT_OF_RESOURCES;
goto ErrorExit; goto ErrorExit;
} }
UsbMouseSimulateTouchPadDevice->UsbIo = UsbIo; UsbMouseAbsolutePointerDevice->UsbIo = UsbIo;
UsbMouseSimulateTouchPadDevice->Signature = USB_MOUSE_SIMULATE_TOUCHPAD_DEV_SIGNATURE; UsbMouseAbsolutePointerDevice->Signature = USB_MOUSE_ABSOLUTE_POINTER_DEV_SIGNATURE;
UsbMouseSimulateTouchPadDevice->InterfaceDescriptor = AllocatePool (sizeof (EFI_USB_INTERFACE_DESCRIPTOR)); UsbMouseAbsolutePointerDevice->InterfaceDescriptor = AllocatePool (sizeof (EFI_USB_INTERFACE_DESCRIPTOR));
if (UsbMouseSimulateTouchPadDevice->InterfaceDescriptor == NULL) { if (UsbMouseAbsolutePointerDevice->InterfaceDescriptor == NULL) {
Status = EFI_OUT_OF_RESOURCES; Status = EFI_OUT_OF_RESOURCES;
goto ErrorExit; goto ErrorExit;
} }
@ -299,7 +299,7 @@ USBMouseSimulateTouchPadDriverBindingStart (
Status = gBS->OpenProtocol ( Status = gBS->OpenProtocol (
Controller, Controller,
&gEfiDevicePathProtocolGuid, &gEfiDevicePathProtocolGuid,
(VOID **) &UsbMouseSimulateTouchPadDevice->DevicePath, (VOID **) &UsbMouseAbsolutePointerDevice->DevicePath,
This->DriverBindingHandle, This->DriverBindingHandle,
Controller, Controller,
EFI_OPEN_PROTOCOL_GET_PROTOCOL EFI_OPEN_PROTOCOL_GET_PROTOCOL
@ -313,10 +313,10 @@ USBMouseSimulateTouchPadDriverBindingStart (
// //
UsbIo->UsbGetInterfaceDescriptor ( UsbIo->UsbGetInterfaceDescriptor (
UsbIo, UsbIo,
UsbMouseSimulateTouchPadDevice->InterfaceDescriptor UsbMouseAbsolutePointerDevice->InterfaceDescriptor
); );
EndpointNumber = UsbMouseSimulateTouchPadDevice->InterfaceDescriptor->NumEndpoints; EndpointNumber = UsbMouseAbsolutePointerDevice->InterfaceDescriptor->NumEndpoints;
for (Index = 0; Index < EndpointNumber; Index++) { for (Index = 0; Index < EndpointNumber; Index++) {
UsbIo->UsbGetEndpointDescriptor ( UsbIo->UsbGetEndpointDescriptor (
@ -330,11 +330,11 @@ USBMouseSimulateTouchPadDriverBindingStart (
// //
// We only care interrupt endpoint here // We only care interrupt endpoint here
// //
UsbMouseSimulateTouchPadDevice->IntEndpointDescriptor = EndpointDesc; UsbMouseAbsolutePointerDevice->IntEndpointDescriptor = EndpointDesc;
} }
} }
if (UsbMouseSimulateTouchPadDevice->IntEndpointDescriptor == NULL) { if (UsbMouseAbsolutePointerDevice->IntEndpointDescriptor == NULL) {
// //
// No interrupt endpoint, then error // No interrupt endpoint, then error
// //
@ -342,10 +342,10 @@ USBMouseSimulateTouchPadDriverBindingStart (
goto ErrorExit; goto ErrorExit;
} }
Status = InitializeUsbMouseSimulateTouchPadDevice (UsbMouseSimulateTouchPadDevice); Status = InitializeUsbMouseAbsolutePointerDevice (UsbMouseAbsolutePointerDevice);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
MouseSimulateTouchPadReportStatusCode ( MouseAbsolutePointerReportStatusCode (
UsbMouseSimulateTouchPadDevice->DevicePath, UsbMouseAbsolutePointerDevice->DevicePath,
EFI_ERROR_CODE | EFI_ERROR_MINOR, EFI_ERROR_CODE | EFI_ERROR_MINOR,
PcdGet32 (PcdStatusCodeValueMouseInterfaceError) PcdGet32 (PcdStatusCodeValueMouseInterfaceError)
); );
@ -353,16 +353,16 @@ USBMouseSimulateTouchPadDriverBindingStart (
goto ErrorExit; goto ErrorExit;
} }
UsbMouseSimulateTouchPadDevice->AbsolutePointerProtocol.GetState = GetMouseSimulateTouchPadState; UsbMouseAbsolutePointerDevice->AbsolutePointerProtocol.GetState = GetMouseAbsolutePointerState;
UsbMouseSimulateTouchPadDevice->AbsolutePointerProtocol.Reset = UsbMouseSimulateTouchPadReset; UsbMouseAbsolutePointerDevice->AbsolutePointerProtocol.Reset = UsbMouseAbsolutePointerReset;
UsbMouseSimulateTouchPadDevice->AbsolutePointerProtocol.Mode = &UsbMouseSimulateTouchPadDevice->AbsolutePointerMode; UsbMouseAbsolutePointerDevice->AbsolutePointerProtocol.Mode = &UsbMouseAbsolutePointerDevice->AbsolutePointerMode;
Status = gBS->CreateEvent ( Status = gBS->CreateEvent (
EVT_NOTIFY_WAIT, EVT_NOTIFY_WAIT,
TPL_NOTIFY, TPL_NOTIFY,
UsbMouseSimulateTouchPadWaitForInput, UsbMouseAbsolutePointerWaitForInput,
UsbMouseSimulateTouchPadDevice, UsbMouseAbsolutePointerDevice,
&((UsbMouseSimulateTouchPadDevice->AbsolutePointerProtocol).WaitForInput) &((UsbMouseAbsolutePointerDevice->AbsolutePointerProtocol).WaitForInput)
); );
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
goto ErrorExit; goto ErrorExit;
@ -372,7 +372,7 @@ USBMouseSimulateTouchPadDriverBindingStart (
&Controller, &Controller,
&gEfiAbsolutePointerProtocolGuid, &gEfiAbsolutePointerProtocolGuid,
EFI_NATIVE_INTERFACE, EFI_NATIVE_INTERFACE,
&UsbMouseSimulateTouchPadDevice->AbsolutePointerProtocol &UsbMouseAbsolutePointerDevice->AbsolutePointerProtocol
); );
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
@ -386,8 +386,8 @@ USBMouseSimulateTouchPadDriverBindingStart (
// the enable action of the mouse // the enable action of the mouse
// //
MouseSimulateTouchPadReportStatusCode ( MouseAbsolutePointerReportStatusCode (
UsbMouseSimulateTouchPadDevice->DevicePath, UsbMouseAbsolutePointerDevice->DevicePath,
EFI_PROGRESS_CODE, EFI_PROGRESS_CODE,
PcdGet32 (PcdStatusCodeValueMouseEnable) PcdGet32 (PcdStatusCodeValueMouseEnable)
); );
@ -395,9 +395,9 @@ USBMouseSimulateTouchPadDriverBindingStart (
// //
// submit async interrupt transfer // submit async interrupt transfer
// //
EndpointAddr = UsbMouseSimulateTouchPadDevice->IntEndpointDescriptor->EndpointAddress; EndpointAddr = UsbMouseAbsolutePointerDevice->IntEndpointDescriptor->EndpointAddress;
PollingInterval = UsbMouseSimulateTouchPadDevice->IntEndpointDescriptor->Interval; PollingInterval = UsbMouseAbsolutePointerDevice->IntEndpointDescriptor->Interval;
PacketSize = (UINT8) (UsbMouseSimulateTouchPadDevice->IntEndpointDescriptor->MaxPacketSize); PacketSize = (UINT8) (UsbMouseAbsolutePointerDevice->IntEndpointDescriptor->MaxPacketSize);
Status = UsbIo->UsbAsyncInterruptTransfer ( Status = UsbIo->UsbAsyncInterruptTransfer (
UsbIo, UsbIo,
@ -405,24 +405,24 @@ USBMouseSimulateTouchPadDriverBindingStart (
TRUE, TRUE,
PollingInterval, PollingInterval,
PacketSize, PacketSize,
OnMouseSimulateTouchPadInterruptComplete, OnMouseAbsolutePointerInterruptComplete,
UsbMouseSimulateTouchPadDevice UsbMouseAbsolutePointerDevice
); );
if (!EFI_ERROR (Status)) { if (!EFI_ERROR (Status)) {
UsbMouseSimulateTouchPadDevice->ControllerNameTable = NULL; UsbMouseAbsolutePointerDevice->ControllerNameTable = NULL;
AddUnicodeString2 ( AddUnicodeString2 (
"eng", "eng",
gUsbMouseSimulateTouchPadComponentName.SupportedLanguages, gUsbMouseAbsolutePointerComponentName.SupportedLanguages,
&UsbMouseSimulateTouchPadDevice->ControllerNameTable, &UsbMouseAbsolutePointerDevice->ControllerNameTable,
L"Generic Usb Mouse Simulate TouchPad", L"Generic Usb Mouse Simulate TouchPad",
TRUE TRUE
); );
AddUnicodeString2 ( AddUnicodeString2 (
"en", "en",
gUsbMouseSimulateTouchPadComponentName2.SupportedLanguages, gUsbMouseAbsolutePointerComponentName2.SupportedLanguages,
&UsbMouseSimulateTouchPadDevice->ControllerNameTable, &UsbMouseAbsolutePointerDevice->ControllerNameTable,
L"Generic Usb Mouse Simulate TouchPad2", L"Generic Usb Mouse Simulate TouchPad2",
FALSE FALSE
); );
@ -438,7 +438,7 @@ USBMouseSimulateTouchPadDriverBindingStart (
gBS->UninstallProtocolInterface ( gBS->UninstallProtocolInterface (
Controller, Controller,
&gEfiAbsolutePointerProtocolGuid, &gEfiAbsolutePointerProtocolGuid,
&UsbMouseSimulateTouchPadDevice->AbsolutePointerProtocol &UsbMouseAbsolutePointerDevice->AbsolutePointerProtocol
); );
ErrorExit: ErrorExit:
@ -450,21 +450,21 @@ ErrorExit:
Controller Controller
); );
if (UsbMouseSimulateTouchPadDevice != NULL) { if (UsbMouseAbsolutePointerDevice != NULL) {
if (UsbMouseSimulateTouchPadDevice->InterfaceDescriptor != NULL) { if (UsbMouseAbsolutePointerDevice->InterfaceDescriptor != NULL) {
gBS->FreePool (UsbMouseSimulateTouchPadDevice->InterfaceDescriptor); gBS->FreePool (UsbMouseAbsolutePointerDevice->InterfaceDescriptor);
} }
if (UsbMouseSimulateTouchPadDevice->IntEndpointDescriptor != NULL) { if (UsbMouseAbsolutePointerDevice->IntEndpointDescriptor != NULL) {
gBS->FreePool (UsbMouseSimulateTouchPadDevice->IntEndpointDescriptor); gBS->FreePool (UsbMouseAbsolutePointerDevice->IntEndpointDescriptor);
} }
if ((UsbMouseSimulateTouchPadDevice->AbsolutePointerProtocol).WaitForInput != NULL) { if ((UsbMouseAbsolutePointerDevice->AbsolutePointerProtocol).WaitForInput != NULL) {
gBS->CloseEvent ((UsbMouseSimulateTouchPadDevice->AbsolutePointerProtocol).WaitForInput); gBS->CloseEvent ((UsbMouseAbsolutePointerDevice->AbsolutePointerProtocol).WaitForInput);
} }
gBS->FreePool (UsbMouseSimulateTouchPadDevice); gBS->FreePool (UsbMouseAbsolutePointerDevice);
UsbMouseSimulateTouchPadDevice = NULL; UsbMouseAbsolutePointerDevice = NULL;
} }
} }
@ -488,7 +488,7 @@ ErrorExit:
**/ **/
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
USBMouseSimulateTouchPadDriverBindingStop ( USBMouseAbsolutePointerDriverBindingStop (
IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_DRIVER_BINDING_PROTOCOL *This,
IN EFI_HANDLE Controller, IN EFI_HANDLE Controller,
IN UINTN NumberOfChildren, IN UINTN NumberOfChildren,
@ -496,7 +496,7 @@ USBMouseSimulateTouchPadDriverBindingStop (
) )
{ {
EFI_STATUS Status; EFI_STATUS Status;
USB_MOUSE_SIMULATE_TOUCHPAD_DEV *UsbMouseSimulateTouchPadDevice; USB_MOUSE_ABSOLUTE_POINTER_DEV *UsbMouseAbsolutePointerDevice;
EFI_ABSOLUTE_POINTER_PROTOCOL *AbsolutePointerProtocol; EFI_ABSOLUTE_POINTER_PROTOCOL *AbsolutePointerProtocol;
EFI_USB_IO_PROTOCOL *UsbIo; EFI_USB_IO_PROTOCOL *UsbIo;
@ -515,7 +515,7 @@ USBMouseSimulateTouchPadDriverBindingStop (
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
return EFI_UNSUPPORTED; return EFI_UNSUPPORTED;
} }
UsbMouseSimulateTouchPadDevice = USB_MOUSE_SIMULATE_TOUCHPAD_DEV_FROM_MOUSE_PROTOCOL (AbsolutePointerProtocol); UsbMouseAbsolutePointerDevice = USB_MOUSE_ABSOLUTE_POINTER_DEV_FROM_MOUSE_PROTOCOL (AbsolutePointerProtocol);
gBS->CloseProtocol ( gBS->CloseProtocol (
Controller, Controller,
@ -524,14 +524,14 @@ USBMouseSimulateTouchPadDriverBindingStop (
Controller Controller
); );
UsbIo = UsbMouseSimulateTouchPadDevice->UsbIo; UsbIo = UsbMouseAbsolutePointerDevice->UsbIo;
// //
// Uninstall the Asyn Interrupt Transfer from this device // Uninstall the Asyn Interrupt Transfer from this device
// will disable the mouse data input from this device // will disable the mouse data input from this device
// //
MouseSimulateTouchPadReportStatusCode ( MouseAbsolutePointerReportStatusCode (
UsbMouseSimulateTouchPadDevice->DevicePath, UsbMouseAbsolutePointerDevice->DevicePath,
EFI_PROGRESS_CODE, EFI_PROGRESS_CODE,
PcdGet32 (PcdStatusCodeValueMouseDisable) PcdGet32 (PcdStatusCodeValueMouseDisable)
); );
@ -541,25 +541,25 @@ USBMouseSimulateTouchPadDriverBindingStop (
// //
UsbIo->UsbAsyncInterruptTransfer ( UsbIo->UsbAsyncInterruptTransfer (
UsbIo, UsbIo,
UsbMouseSimulateTouchPadDevice->IntEndpointDescriptor->EndpointAddress, UsbMouseAbsolutePointerDevice->IntEndpointDescriptor->EndpointAddress,
FALSE, FALSE,
UsbMouseSimulateTouchPadDevice->IntEndpointDescriptor->Interval, UsbMouseAbsolutePointerDevice->IntEndpointDescriptor->Interval,
0, 0,
NULL, NULL,
NULL NULL
); );
gBS->CloseEvent (UsbMouseSimulateTouchPadDevice->AbsolutePointerProtocol.WaitForInput); gBS->CloseEvent (UsbMouseAbsolutePointerDevice->AbsolutePointerProtocol.WaitForInput);
if (UsbMouseSimulateTouchPadDevice->DelayedRecoveryEvent) { if (UsbMouseAbsolutePointerDevice->DelayedRecoveryEvent) {
gBS->CloseEvent (UsbMouseSimulateTouchPadDevice->DelayedRecoveryEvent); gBS->CloseEvent (UsbMouseAbsolutePointerDevice->DelayedRecoveryEvent);
UsbMouseSimulateTouchPadDevice->DelayedRecoveryEvent = 0; UsbMouseAbsolutePointerDevice->DelayedRecoveryEvent = 0;
} }
Status = gBS->UninstallProtocolInterface ( Status = gBS->UninstallProtocolInterface (
Controller, Controller,
&gEfiAbsolutePointerProtocolGuid, &gEfiAbsolutePointerProtocolGuid,
&UsbMouseSimulateTouchPadDevice->AbsolutePointerProtocol &UsbMouseAbsolutePointerDevice->AbsolutePointerProtocol
); );
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
return Status; return Status;
@ -572,14 +572,14 @@ USBMouseSimulateTouchPadDriverBindingStop (
Controller Controller
); );
gBS->FreePool (UsbMouseSimulateTouchPadDevice->InterfaceDescriptor); gBS->FreePool (UsbMouseAbsolutePointerDevice->InterfaceDescriptor);
gBS->FreePool (UsbMouseSimulateTouchPadDevice->IntEndpointDescriptor); gBS->FreePool (UsbMouseAbsolutePointerDevice->IntEndpointDescriptor);
if (UsbMouseSimulateTouchPadDevice->ControllerNameTable) { if (UsbMouseAbsolutePointerDevice->ControllerNameTable) {
FreeUnicodeStringTable (UsbMouseSimulateTouchPadDevice->ControllerNameTable); FreeUnicodeStringTable (UsbMouseAbsolutePointerDevice->ControllerNameTable);
} }
gBS->FreePool (UsbMouseSimulateTouchPadDevice); gBS->FreePool (UsbMouseAbsolutePointerDevice);
return EFI_SUCCESS; return EFI_SUCCESS;
@ -596,7 +596,7 @@ USBMouseSimulateTouchPadDriverBindingStop (
**/ **/
BOOLEAN BOOLEAN
IsUsbMouseSimulateTouchPad ( IsUsbMouseAbsolutePointer (
IN EFI_USB_IO_PROTOCOL *UsbIo IN EFI_USB_IO_PROTOCOL *UsbIo
) )
{ {
@ -631,7 +631,7 @@ IsUsbMouseSimulateTouchPad (
/** /**
Initialize the Usb Mouse Simulate TouchPad Device. Initialize the Usb Mouse Simulate TouchPad Device.
@param UsbMouseSimulateTouchPadDev Device instance to be initialized @param UsbMouseAbsolutePointerDev Device instance to be initialized
@retval EFI_SUCCESS Success @retval EFI_SUCCESS Success
@retval EFI_DEVICE_ERROR Init error. EFI_OUT_OF_RESOURCES- Can't allocate @retval EFI_DEVICE_ERROR Init error. EFI_OUT_OF_RESOURCES- Can't allocate
@ -640,8 +640,8 @@ IsUsbMouseSimulateTouchPad (
**/ **/
STATIC STATIC
EFI_STATUS EFI_STATUS
InitializeUsbMouseSimulateTouchPadDevice ( InitializeUsbMouseAbsolutePointerDevice (
IN USB_MOUSE_SIMULATE_TOUCHPAD_DEV *UsbMouseSimulateTouchPadDev IN USB_MOUSE_ABSOLUTE_POINTER_DEV *UsbMouseAbsolutePointerDev
) )
{ {
EFI_USB_IO_PROTOCOL *UsbIo; EFI_USB_IO_PROTOCOL *UsbIo;
@ -650,14 +650,14 @@ InitializeUsbMouseSimulateTouchPadDevice (
EFI_USB_HID_DESCRIPTOR MouseHidDesc; EFI_USB_HID_DESCRIPTOR MouseHidDesc;
UINT8 *ReportDesc; UINT8 *ReportDesc;
UsbIo = UsbMouseSimulateTouchPadDev->UsbIo; UsbIo = UsbMouseAbsolutePointerDev->UsbIo;
// //
// Get HID descriptor // Get HID descriptor
// //
Status = UsbGetHidDescriptor ( Status = UsbGetHidDescriptor (
UsbIo, UsbIo,
UsbMouseSimulateTouchPadDev->InterfaceDescriptor->InterfaceNumber, UsbMouseAbsolutePointerDev->InterfaceDescriptor->InterfaceNumber,
&MouseHidDesc &MouseHidDesc
); );
@ -679,7 +679,7 @@ InitializeUsbMouseSimulateTouchPadDevice (
Status = UsbGetReportDescriptor ( Status = UsbGetReportDescriptor (
UsbIo, UsbIo,
UsbMouseSimulateTouchPadDev->InterfaceDescriptor->InterfaceNumber, UsbMouseAbsolutePointerDev->InterfaceDescriptor->InterfaceNumber,
MouseHidDesc.HidClassDesc[0].DescriptorLength, MouseHidDesc.HidClassDesc[0].DescriptorLength,
ReportDesc ReportDesc
); );
@ -693,7 +693,7 @@ InitializeUsbMouseSimulateTouchPadDevice (
// Parse report descriptor // Parse report descriptor
// //
Status = ParseMouseReportDescriptor ( Status = ParseMouseReportDescriptor (
UsbMouseSimulateTouchPadDev, UsbMouseAbsolutePointerDev,
ReportDesc, ReportDesc,
MouseHidDesc.HidClassDesc[0].DescriptorLength MouseHidDesc.HidClassDesc[0].DescriptorLength
); );
@ -703,13 +703,13 @@ InitializeUsbMouseSimulateTouchPadDevice (
return Status; return Status;
} }
UsbMouseSimulateTouchPadDev->AbsolutePointerMode.AbsoluteMaxX = 1024; UsbMouseAbsolutePointerDev->AbsolutePointerMode.AbsoluteMaxX = 1024;
UsbMouseSimulateTouchPadDev->AbsolutePointerMode.AbsoluteMaxY = 1024; UsbMouseAbsolutePointerDev->AbsolutePointerMode.AbsoluteMaxY = 1024;
UsbMouseSimulateTouchPadDev->AbsolutePointerMode.AbsoluteMaxZ = 0; UsbMouseAbsolutePointerDev->AbsolutePointerMode.AbsoluteMaxZ = 0;
UsbMouseSimulateTouchPadDev->AbsolutePointerMode.AbsoluteMinX = 0; UsbMouseAbsolutePointerDev->AbsolutePointerMode.AbsoluteMinX = 0;
UsbMouseSimulateTouchPadDev->AbsolutePointerMode.AbsoluteMinY = 0; UsbMouseAbsolutePointerDev->AbsolutePointerMode.AbsoluteMinY = 0;
UsbMouseSimulateTouchPadDev->AbsolutePointerMode.AbsoluteMinZ = 0; UsbMouseAbsolutePointerDev->AbsolutePointerMode.AbsoluteMinZ = 0;
UsbMouseSimulateTouchPadDev->AbsolutePointerMode.Attributes = 0x3; UsbMouseAbsolutePointerDev->AbsolutePointerMode.Attributes = 0x3;
// //
// Here we just assume interface 0 is the mouse interface // Here we just assume interface 0 is the mouse interface
@ -745,17 +745,17 @@ InitializeUsbMouseSimulateTouchPadDevice (
gBS->FreePool (ReportDesc); gBS->FreePool (ReportDesc);
if (UsbMouseSimulateTouchPadDev->DelayedRecoveryEvent) { if (UsbMouseAbsolutePointerDev->DelayedRecoveryEvent) {
gBS->CloseEvent (UsbMouseSimulateTouchPadDev->DelayedRecoveryEvent); gBS->CloseEvent (UsbMouseAbsolutePointerDev->DelayedRecoveryEvent);
UsbMouseSimulateTouchPadDev->DelayedRecoveryEvent = 0; UsbMouseAbsolutePointerDev->DelayedRecoveryEvent = 0;
} }
Status = gBS->CreateEvent ( Status = gBS->CreateEvent (
EVT_TIMER | EVT_NOTIFY_SIGNAL, EVT_TIMER | EVT_NOTIFY_SIGNAL,
TPL_NOTIFY, TPL_NOTIFY,
USBMouseSimulateTouchPadRecoveryHandler, USBMouseAbsolutePointerRecoveryHandler,
UsbMouseSimulateTouchPadDev, UsbMouseAbsolutePointerDev,
&UsbMouseSimulateTouchPadDev->DelayedRecoveryEvent &UsbMouseAbsolutePointerDev->DelayedRecoveryEvent
); );
return EFI_SUCCESS; return EFI_SUCCESS;
@ -778,33 +778,33 @@ InitializeUsbMouseSimulateTouchPadDevice (
STATIC STATIC
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
OnMouseSimulateTouchPadInterruptComplete ( OnMouseAbsolutePointerInterruptComplete (
IN VOID *Data, IN VOID *Data,
IN UINTN DataLength, IN UINTN DataLength,
IN VOID *Context, IN VOID *Context,
IN UINT32 Result IN UINT32 Result
) )
{ {
USB_MOUSE_SIMULATE_TOUCHPAD_DEV *UsbMouseSimulateTouchPadDevice; USB_MOUSE_ABSOLUTE_POINTER_DEV *UsbMouseAbsolutePointerDevice;
EFI_USB_IO_PROTOCOL *UsbIo; EFI_USB_IO_PROTOCOL *UsbIo;
UINT8 EndpointAddr; UINT8 EndpointAddr;
UINT32 UsbResult; UINT32 UsbResult;
UsbMouseSimulateTouchPadDevice = (USB_MOUSE_SIMULATE_TOUCHPAD_DEV *) Context; UsbMouseAbsolutePointerDevice = (USB_MOUSE_ABSOLUTE_POINTER_DEV *) Context;
UsbIo = UsbMouseSimulateTouchPadDevice->UsbIo; UsbIo = UsbMouseAbsolutePointerDevice->UsbIo;
if (Result != EFI_USB_NOERROR) { if (Result != EFI_USB_NOERROR) {
// //
// Some errors happen during the process // Some errors happen during the process
// //
MouseSimulateTouchPadReportStatusCode ( MouseAbsolutePointerReportStatusCode (
UsbMouseSimulateTouchPadDevice->DevicePath, UsbMouseAbsolutePointerDevice->DevicePath,
EFI_ERROR_CODE | EFI_ERROR_MINOR, EFI_ERROR_CODE | EFI_ERROR_MINOR,
PcdGet32 (PcdStatusCodeValueMouseInputError) PcdGet32 (PcdStatusCodeValueMouseInputError)
); );
if ((Result & EFI_USB_ERR_STALL) == EFI_USB_ERR_STALL) { if ((Result & EFI_USB_ERR_STALL) == EFI_USB_ERR_STALL) {
EndpointAddr = UsbMouseSimulateTouchPadDevice->IntEndpointDescriptor->EndpointAddress; EndpointAddr = UsbMouseAbsolutePointerDevice->IntEndpointDescriptor->EndpointAddress;
UsbClearEndpointHalt ( UsbClearEndpointHalt (
UsbIo, UsbIo,
@ -815,7 +815,7 @@ OnMouseSimulateTouchPadInterruptComplete (
UsbIo->UsbAsyncInterruptTransfer ( UsbIo->UsbAsyncInterruptTransfer (
UsbIo, UsbIo,
UsbMouseSimulateTouchPadDevice->IntEndpointDescriptor->EndpointAddress, UsbMouseAbsolutePointerDevice->IntEndpointDescriptor->EndpointAddress,
FALSE, FALSE,
0, 0,
0, 0,
@ -824,7 +824,7 @@ OnMouseSimulateTouchPadInterruptComplete (
); );
gBS->SetTimer ( gBS->SetTimer (
UsbMouseSimulateTouchPadDevice->DelayedRecoveryEvent, UsbMouseAbsolutePointerDevice->DelayedRecoveryEvent,
TimerRelative, TimerRelative,
EFI_USB_INTERRUPT_DELAY EFI_USB_INTERRUPT_DELAY
); );
@ -838,13 +838,13 @@ OnMouseSimulateTouchPadInterruptComplete (
// //
//Check mouse Data //Check mouse Data
// //
UsbMouseSimulateTouchPadDevice->AbsolutePointerStateChanged = TRUE; UsbMouseAbsolutePointerDevice->AbsolutePointerStateChanged = TRUE;
UsbMouseSimulateTouchPadDevice->AbsolutePointerState.CurrentX += *((INT8 *) Data + 1); UsbMouseAbsolutePointerDevice->AbsolutePointerState.CurrentX += *((INT8 *) Data + 1);
UsbMouseSimulateTouchPadDevice->AbsolutePointerState.CurrentY += *((INT8 *) Data + 2); UsbMouseAbsolutePointerDevice->AbsolutePointerState.CurrentY += *((INT8 *) Data + 2);
if (DataLength > 3) { if (DataLength > 3) {
UsbMouseSimulateTouchPadDevice->AbsolutePointerState.CurrentZ += *((INT8 *) Data + 3); UsbMouseAbsolutePointerDevice->AbsolutePointerState.CurrentZ += *((INT8 *) Data + 3);
} }
UsbMouseSimulateTouchPadDevice->AbsolutePointerState.ActiveButtons = *(UINT8 *)Data & 0x3; UsbMouseAbsolutePointerDevice->AbsolutePointerState.ActiveButtons = *(UINT8 *)Data & 0x3;
return EFI_SUCCESS; return EFI_SUCCESS;
} }
@ -863,38 +863,38 @@ OnMouseSimulateTouchPadInterruptComplete (
STATIC STATIC
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
GetMouseSimulateTouchPadState ( GetMouseAbsolutePointerState (
IN EFI_ABSOLUTE_POINTER_PROTOCOL *This, IN EFI_ABSOLUTE_POINTER_PROTOCOL *This,
OUT EFI_ABSOLUTE_POINTER_STATE *MouseSimulateTouchPadState OUT EFI_ABSOLUTE_POINTER_STATE *MouseAbsolutePointerState
) )
{ {
USB_MOUSE_SIMULATE_TOUCHPAD_DEV *MouseSimulateTouchPadDev; USB_MOUSE_ABSOLUTE_POINTER_DEV *MouseAbsolutePointerDev;
if (MouseSimulateTouchPadState == NULL) { if (MouseAbsolutePointerState == NULL) {
return EFI_DEVICE_ERROR; return EFI_DEVICE_ERROR;
} }
MouseSimulateTouchPadDev = USB_MOUSE_SIMULATE_TOUCHPAD_DEV_FROM_MOUSE_PROTOCOL (This); MouseAbsolutePointerDev = USB_MOUSE_ABSOLUTE_POINTER_DEV_FROM_MOUSE_PROTOCOL (This);
if (!MouseSimulateTouchPadDev->AbsolutePointerStateChanged) { if (!MouseAbsolutePointerDev->AbsolutePointerStateChanged) {
return EFI_NOT_READY; return EFI_NOT_READY;
} }
CopyMem ( CopyMem (
MouseSimulateTouchPadState, MouseAbsolutePointerState,
&MouseSimulateTouchPadDev->AbsolutePointerState, &MouseAbsolutePointerDev->AbsolutePointerState,
sizeof (EFI_ABSOLUTE_POINTER_STATE) sizeof (EFI_ABSOLUTE_POINTER_STATE)
); );
// //
// Clear previous move state // Clear previous move state
// //
MouseSimulateTouchPadDev->AbsolutePointerState.CurrentX = 0; MouseAbsolutePointerDev->AbsolutePointerState.CurrentX = 0;
MouseSimulateTouchPadDev->AbsolutePointerState.CurrentY = 0; MouseAbsolutePointerDev->AbsolutePointerState.CurrentY = 0;
MouseSimulateTouchPadDev->AbsolutePointerState.CurrentZ = 0; MouseAbsolutePointerDev->AbsolutePointerState.CurrentZ = 0;
MouseSimulateTouchPadDev->AbsolutePointerState.ActiveButtons = 0; MouseAbsolutePointerDev->AbsolutePointerState.ActiveButtons = 0;
MouseSimulateTouchPadDev->AbsolutePointerStateChanged = FALSE; MouseAbsolutePointerDev->AbsolutePointerStateChanged = FALSE;
return EFI_SUCCESS; return EFI_SUCCESS;
} }
@ -912,26 +912,26 @@ GetMouseSimulateTouchPadState (
STATIC STATIC
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
UsbMouseSimulateTouchPadReset ( UsbMouseAbsolutePointerReset (
IN EFI_ABSOLUTE_POINTER_PROTOCOL *This, IN EFI_ABSOLUTE_POINTER_PROTOCOL *This,
IN BOOLEAN ExtendedVerification IN BOOLEAN ExtendedVerification
) )
{ {
USB_MOUSE_SIMULATE_TOUCHPAD_DEV *UsbMouseSimulateTouchPadDevice; USB_MOUSE_ABSOLUTE_POINTER_DEV *UsbMouseAbsolutePointerDevice;
UsbMouseSimulateTouchPadDevice = USB_MOUSE_SIMULATE_TOUCHPAD_DEV_FROM_MOUSE_PROTOCOL (This); UsbMouseAbsolutePointerDevice = USB_MOUSE_ABSOLUTE_POINTER_DEV_FROM_MOUSE_PROTOCOL (This);
MouseSimulateTouchPadReportStatusCode ( MouseAbsolutePointerReportStatusCode (
UsbMouseSimulateTouchPadDevice->DevicePath, UsbMouseAbsolutePointerDevice->DevicePath,
EFI_PROGRESS_CODE, EFI_PROGRESS_CODE,
PcdGet32 (PcdStatusCodeValueMouseReset) PcdGet32 (PcdStatusCodeValueMouseReset)
); );
ZeroMem ( ZeroMem (
&UsbMouseSimulateTouchPadDevice->AbsolutePointerState, &UsbMouseAbsolutePointerDevice->AbsolutePointerState,
sizeof (EFI_ABSOLUTE_POINTER_STATE) sizeof (EFI_ABSOLUTE_POINTER_STATE)
); );
UsbMouseSimulateTouchPadDevice->AbsolutePointerStateChanged = FALSE; UsbMouseAbsolutePointerDevice->AbsolutePointerStateChanged = FALSE;
return EFI_SUCCESS; return EFI_SUCCESS;
} }
@ -948,20 +948,20 @@ UsbMouseSimulateTouchPadReset (
STATIC STATIC
VOID VOID
EFIAPI EFIAPI
UsbMouseSimulateTouchPadWaitForInput ( UsbMouseAbsolutePointerWaitForInput (
IN EFI_EVENT Event, IN EFI_EVENT Event,
IN VOID *Context IN VOID *Context
) )
{ {
USB_MOUSE_SIMULATE_TOUCHPAD_DEV *UsbMouseSimulateTouchPadDev; USB_MOUSE_ABSOLUTE_POINTER_DEV *UsbMouseAbsolutePointerDev;
UsbMouseSimulateTouchPadDev = (USB_MOUSE_SIMULATE_TOUCHPAD_DEV *) Context; UsbMouseAbsolutePointerDev = (USB_MOUSE_ABSOLUTE_POINTER_DEV *) Context;
// //
// Someone is waiting on the mouse event, if there's // Someone is waiting on the mouse event, if there's
// input from mouse, signal the event // input from mouse, signal the event
// //
if (UsbMouseSimulateTouchPadDev->AbsolutePointerStateChanged) { if (UsbMouseAbsolutePointerDev->AbsolutePointerStateChanged) {
gBS->SignalEvent (Event); gBS->SignalEvent (Event);
} }
} }
@ -976,26 +976,26 @@ UsbMouseSimulateTouchPadWaitForInput (
**/ **/
VOID VOID
EFIAPI EFIAPI
USBMouseSimulateTouchPadRecoveryHandler ( USBMouseAbsolutePointerRecoveryHandler (
IN EFI_EVENT Event, IN EFI_EVENT Event,
IN VOID *Context IN VOID *Context
) )
{ {
USB_MOUSE_SIMULATE_TOUCHPAD_DEV *UsbMouseSimulateTouchPadDev; USB_MOUSE_ABSOLUTE_POINTER_DEV *UsbMouseAbsolutePointerDev;
EFI_USB_IO_PROTOCOL *UsbIo; EFI_USB_IO_PROTOCOL *UsbIo;
UsbMouseSimulateTouchPadDev = (USB_MOUSE_SIMULATE_TOUCHPAD_DEV *) Context; UsbMouseAbsolutePointerDev = (USB_MOUSE_ABSOLUTE_POINTER_DEV *) Context;
UsbIo = UsbMouseSimulateTouchPadDev->UsbIo; UsbIo = UsbMouseAbsolutePointerDev->UsbIo;
UsbIo->UsbAsyncInterruptTransfer ( UsbIo->UsbAsyncInterruptTransfer (
UsbIo, UsbIo,
UsbMouseSimulateTouchPadDev->IntEndpointDescriptor->EndpointAddress, UsbMouseAbsolutePointerDev->IntEndpointDescriptor->EndpointAddress,
TRUE, TRUE,
UsbMouseSimulateTouchPadDev->IntEndpointDescriptor->Interval, UsbMouseAbsolutePointerDev->IntEndpointDescriptor->Interval,
UsbMouseSimulateTouchPadDev->IntEndpointDescriptor->MaxPacketSize, UsbMouseAbsolutePointerDev->IntEndpointDescriptor->MaxPacketSize,
OnMouseSimulateTouchPadInterruptComplete, OnMouseAbsolutePointerInterruptComplete,
UsbMouseSimulateTouchPadDev UsbMouseAbsolutePointerDev
); );
} }
@ -1011,7 +1011,7 @@ USBMouseSimulateTouchPadRecoveryHandler (
**/ **/
VOID VOID
MouseSimulateTouchPadReportStatusCode ( MouseAbsolutePointerReportStatusCode (
IN EFI_DEVICE_PATH_PROTOCOL *DevicePath, IN EFI_DEVICE_PATH_PROTOCOL *DevicePath,
IN EFI_STATUS_CODE_TYPE CodeType, IN EFI_STATUS_CODE_TYPE CodeType,
IN EFI_STATUS_CODE_VALUE Value IN EFI_STATUS_CODE_VALUE Value

View File

@ -11,15 +11,15 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: Module Name:
UsbMouseSimulateTouchPad.h UsbMouseAbsolutePointer.h
Abstract: Abstract:
**/ **/
#ifndef _USB_MOUSE_SIMULATE_TOUCHPAD_H #ifndef _USB_MOUSE_ABSOLUTE_POINTER_H
#define _USB_MOUSE_SIMULATE_TOUCHPAD_H #define _USB_MOUSE_ABSOLUTE_POINTER_H
#include <PiDxe.h> #include <PiDxe.h>
@ -47,7 +47,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#define BOOT_PROTOCOL 0 #define BOOT_PROTOCOL 0
#define REPORT_PROTOCOL 1 #define REPORT_PROTOCOL 1
#define USB_MOUSE_SIMULATE_TOUCHPAD_DEV_SIGNATURE EFI_SIGNATURE_32 ('u', 'm', 's', 't') #define USB_MOUSE_ABSOLUTE_POINTER_DEV_SIGNATURE EFI_SIGNATURE_32 ('u', 'm', 's', 't')
typedef struct { typedef struct {
BOOLEAN ButtonDetected; BOOLEAN ButtonDetected;
@ -76,14 +76,14 @@ typedef struct {
PRIVATE_DATA PrivateData; PRIVATE_DATA PrivateData;
EFI_UNICODE_STRING_TABLE *ControllerNameTable; EFI_UNICODE_STRING_TABLE *ControllerNameTable;
} USB_MOUSE_SIMULATE_TOUCHPAD_DEV; } USB_MOUSE_ABSOLUTE_POINTER_DEV;
#define USB_MOUSE_SIMULATE_TOUCHPAD_DEV_FROM_MOUSE_PROTOCOL(a) \ #define USB_MOUSE_ABSOLUTE_POINTER_DEV_FROM_MOUSE_PROTOCOL(a) \
CR(a, USB_MOUSE_SIMULATE_TOUCHPAD_DEV, AbsolutePointerProtocol, USB_MOUSE_SIMULATE_TOUCHPAD_DEV_SIGNATURE) CR(a, USB_MOUSE_ABSOLUTE_POINTER_DEV, AbsolutePointerProtocol, USB_MOUSE_ABSOLUTE_POINTER_DEV_SIGNATURE)
VOID VOID
EFIAPI EFIAPI
USBMouseSimulateTouchPadRecoveryHandler ( USBMouseAbsolutePointerRecoveryHandler (
IN EFI_EVENT Event, IN EFI_EVENT Event,
IN VOID *Context IN VOID *Context
); );
@ -91,13 +91,13 @@ USBMouseSimulateTouchPadRecoveryHandler (
// //
// Global Variables // Global Variables
// //
extern EFI_DRIVER_BINDING_PROTOCOL gUsbMouseSimulateTouchPadDriverBinding; extern EFI_DRIVER_BINDING_PROTOCOL gUsbMouseAbsolutePointerDriverBinding;
extern EFI_COMPONENT_NAME_PROTOCOL gUsbMouseSimulateTouchPadComponentName; extern EFI_COMPONENT_NAME_PROTOCOL gUsbMouseAbsolutePointerComponentName;
extern EFI_COMPONENT_NAME2_PROTOCOL gUsbMouseSimulateTouchPadComponentName2; extern EFI_COMPONENT_NAME2_PROTOCOL gUsbMouseAbsolutePointerComponentName2;
extern EFI_GUID gEfiUsbMouseSimulateTouchPadDriverGuid; extern EFI_GUID gEfiUsbMouseAbsolutePointerDriverGuid;
VOID VOID
MouseSimulateTouchPadReportStatusCode ( MouseAbsolutePointerReportStatusCode (
IN EFI_DEVICE_PATH_PROTOCOL *DevicePath, IN EFI_DEVICE_PATH_PROTOCOL *DevicePath,
IN EFI_STATUS_CODE_TYPE CodeType, IN EFI_STATUS_CODE_TYPE CodeType,
IN EFI_STATUS_CODE_VALUE Value IN EFI_STATUS_CODE_VALUE Value

View File

@ -1,5 +1,5 @@
#/** @file #/** @file
# Component name for module UsbMouseSimulateTouchPad # Component name for module UsbMouseAbsolutePointerDxe
# #
# FIX ME! # FIX ME!
# Copyright (c) 2006, Intel Corporation. # Copyright (c) 2006, Intel Corporation.
@ -17,14 +17,14 @@
[Defines] [Defines]
INF_VERSION = 0x00010005 INF_VERSION = 0x00010005
BASE_NAME = UsbMouseSimulateTouchPadDxe BASE_NAME = UsbMouseAbsolutePointerDxe
FILE_GUID = 4EA43463-747C-46eb-97FB-B0E5C5F05306 FILE_GUID = 4EA43463-747C-46eb-97FB-B0E5C5F05306
MODULE_TYPE = DXE_DRIVER MODULE_TYPE = DXE_DRIVER
VERSION_STRING = 1.0 VERSION_STRING = 1.0
EDK_RELEASE_VERSION = 0x00020000 EDK_RELEASE_VERSION = 0x00020000
EFI_SPECIFICATION_VERSION = 0x00020000 EFI_SPECIFICATION_VERSION = 0x00020000
ENTRY_POINT = USBMouseSimulateTouchPadDriverBindingEntryPoint ENTRY_POINT = USBMouseAbsolutePointerDriverBindingEntryPoint
# #
# The following information is for reference only and not required by the build tools. # The following information is for reference only and not required by the build tools.
@ -35,9 +35,9 @@
[Sources.common] [Sources.common]
mousehid.h mousehid.h
ComponentName.c ComponentName.c
UsbMouseSimulateTouchPad.c UsbMouseAbsolutePointer.c
mousehid.c mousehid.c
UsbMouseSimulateTouchPad.h UsbMouseAbsolutePointer.h
[Packages] [Packages]
MdePkg/MdePkg.dec MdePkg/MdePkg.dec

View File

@ -1,10 +1,10 @@
<ModuleSurfaceArea xmlns="http://www.TianoCore.org/2006/Edk2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <ModuleSurfaceArea xmlns="http://www.TianoCore.org/2006/Edk2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<MsaHeader> <MsaHeader>
<ModuleName>UsbMouseSimulateTouchPadDxe</ModuleName> <ModuleName>UsbMouseAbsolutePointerDxe</ModuleName>
<ModuleType>DXE_DRIVER</ModuleType> <ModuleType>DXE_DRIVER</ModuleType>
<GuidValue>4EA43463-747C-46eb-97FB-B0E5C5F05306</GuidValue> <GuidValue>4EA43463-747C-46eb-97FB-B0E5C5F05306</GuidValue>
<Version>1.0</Version> <Version>1.0</Version>
<Abstract>Component name for module UsbMouseSimulateTouchPad</Abstract> <Abstract>Component name for module UsbMouseAbsolutePointer</Abstract>
<Description>FIX ME!</Description> <Description>FIX ME!</Description>
<Copyright>Copyright (c) 2006, Intel Corporation. </Copyright> <Copyright>Copyright (c) 2006, Intel Corporation. </Copyright>
<License>All rights reserved. This program and the accompanying materials <License>All rights reserved. This program and the accompanying materials
@ -19,7 +19,7 @@
<ModuleDefinitions> <ModuleDefinitions>
<SupportedArchitectures>IA32 X64 IPF EBC</SupportedArchitectures> <SupportedArchitectures>IA32 X64 IPF EBC</SupportedArchitectures>
<BinaryModule>false</BinaryModule> <BinaryModule>false</BinaryModule>
<OutputFileBasename>UsbMouseSimulateTouchPadDxe</OutputFileBasename> <OutputFileBasename>UsbMouseAbsolutePointerDxe</OutputFileBasename>
</ModuleDefinitions> </ModuleDefinitions>
<LibraryClassDefinitions> <LibraryClassDefinitions>
<LibraryClass Usage="ALWAYS_CONSUMED"> <LibraryClass Usage="ALWAYS_CONSUMED">
@ -42,9 +42,9 @@
</LibraryClass> </LibraryClass>
</LibraryClassDefinitions> </LibraryClassDefinitions>
<SourceFiles> <SourceFiles>
<Filename>UsbMouseSimulateTouchPad.h</Filename> <Filename>UsbMouseAbsolutePointer.h</Filename>
<Filename>mousehid.c</Filename> <Filename>mousehid.c</Filename>
<Filename>UsbMouseSimulateTouchPad.c</Filename> <Filename>UsbMouseAbsolutePointer.c</Filename>
<Filename>ComponentName.c</Filename> <Filename>ComponentName.c</Filename>
<Filename>mousehid.h</Filename> <Filename>mousehid.h</Filename>
</SourceFiles> </SourceFiles>
@ -67,7 +67,7 @@
<Specification>EFI_SPECIFICATION_VERSION 0x00020000</Specification> <Specification>EFI_SPECIFICATION_VERSION 0x00020000</Specification>
<Specification>EDK_RELEASE_VERSION 0x00020000</Specification> <Specification>EDK_RELEASE_VERSION 0x00020000</Specification>
<Extern> <Extern>
<ModuleEntryPoint>USBMouseSimulateTouchPadDriverBindingEntryPoint</ModuleEntryPoint> <ModuleEntryPoint>USBMouseAbsolutePointerDriverBindingEntryPoint</ModuleEntryPoint>
</Extern> </Extern>
</Externs> </Externs>
</ModuleSurfaceArea> </ModuleSurfaceArea>

View File

@ -164,7 +164,7 @@ GetItemData (
/** /**
Parse Local Item Parse Local Item
@param UsbMouseSimulateTouchPad USB_MOUSE_SIMULATE_TOUCHPAD_DEV @param UsbMouseAbsolutePointer USB_MOUSE_ABSOLUTE_POINTER_DEV
@param LocalItem Local Item @param LocalItem Local Item
@ -172,7 +172,7 @@ GetItemData (
STATIC STATIC
VOID VOID
ParseLocalItem ( ParseLocalItem (
IN USB_MOUSE_SIMULATE_TOUCHPAD_DEV *UsbMouseSimulateTouchPad, IN USB_MOUSE_ABSOLUTE_POINTER_DEV *UsbMouseAbsolutePointer,
IN HID_ITEM *LocalItem IN HID_ITEM *LocalItem
) )
{ {
@ -199,16 +199,16 @@ ParseLocalItem (
return ; return ;
case HID_LOCAL_ITEM_TAG_USAGE_MINIMUM: case HID_LOCAL_ITEM_TAG_USAGE_MINIMUM:
if (UsbMouseSimulateTouchPad->PrivateData.ButtonDetected) { if (UsbMouseAbsolutePointer->PrivateData.ButtonDetected) {
UsbMouseSimulateTouchPad->PrivateData.ButtonMinIndex = (UINT8) Data; UsbMouseAbsolutePointer->PrivateData.ButtonMinIndex = (UINT8) Data;
} }
return ; return ;
case HID_LOCAL_ITEM_TAG_USAGE_MAXIMUM: case HID_LOCAL_ITEM_TAG_USAGE_MAXIMUM:
{ {
if (UsbMouseSimulateTouchPad->PrivateData.ButtonDetected) { if (UsbMouseAbsolutePointer->PrivateData.ButtonDetected) {
UsbMouseSimulateTouchPad->PrivateData.ButtonMaxIndex = (UINT8) Data; UsbMouseAbsolutePointer->PrivateData.ButtonMaxIndex = (UINT8) Data;
} }
return ; return ;
@ -219,7 +219,7 @@ ParseLocalItem (
STATIC STATIC
VOID VOID
ParseGlobalItem ( ParseGlobalItem (
IN USB_MOUSE_SIMULATE_TOUCHPAD_DEV *UsbMouseSimulateTouchPad, IN USB_MOUSE_ABSOLUTE_POINTER_DEV *UsbMouseAbsolutePointer,
IN HID_ITEM *GlobalItem IN HID_ITEM *GlobalItem
) )
{ {
@ -237,7 +237,7 @@ ParseGlobalItem (
// //
// Button Page // Button Page
// //
UsbMouseSimulateTouchPad->PrivateData.ButtonDetected = TRUE; UsbMouseAbsolutePointer->PrivateData.ButtonDetected = TRUE;
return ; return ;
} }
break; break;
@ -251,7 +251,7 @@ ParseGlobalItem (
/** /**
Parse Main Item Parse Main Item
@param UsbMouseSimulateTouchPad USB_MOUSE_SIMULATE_TOUCHPAD_DEV @param UsbMouseAbsolutePointer USB_MOUSE_ABSOLUTE_POINTER_DEV
@param MainItem HID_ITEM to parse @param MainItem HID_ITEM to parse
@return VOID @return VOID
@ -260,7 +260,7 @@ ParseGlobalItem (
STATIC STATIC
VOID VOID
ParseMainItem ( ParseMainItem (
IN USB_MOUSE_SIMULATE_TOUCHPAD_DEV *UsbMouseSimulateTouchPad, IN USB_MOUSE_ABSOLUTE_POINTER_DEV *UsbMouseAbsolutePointer,
IN HID_ITEM *MainItem IN HID_ITEM *MainItem
) )
{ {
@ -274,7 +274,7 @@ ParseMainItem (
/** /**
Parse Hid Item Parse Hid Item
@param UsbMouseSimulateTouchPad USB_MOUSE_SIMULATE_TOUCHPAD_DEV @param UsbMouseAbsolutePointer USB_MOUSE_ABSOLUTE_POINTER_DEV
@param HidItem HidItem to parse @param HidItem HidItem to parse
@return VOID @return VOID
@ -283,7 +283,7 @@ ParseMainItem (
STATIC STATIC
VOID VOID
ParseHidItem ( ParseHidItem (
IN USB_MOUSE_SIMULATE_TOUCHPAD_DEV *UsbMouseSimulateTouchPad, IN USB_MOUSE_ABSOLUTE_POINTER_DEV *UsbMouseAbsolutePointer,
IN HID_ITEM *HidItem IN HID_ITEM *HidItem
) )
{ {
@ -293,21 +293,21 @@ ParseHidItem (
// //
// For Main Item, parse main item // For Main Item, parse main item
// //
ParseMainItem (UsbMouseSimulateTouchPad, HidItem); ParseMainItem (UsbMouseAbsolutePointer, HidItem);
break; break;
case HID_ITEM_TYPE_GLOBAL: case HID_ITEM_TYPE_GLOBAL:
// //
// For global Item, parse global item // For global Item, parse global item
// //
ParseGlobalItem (UsbMouseSimulateTouchPad, HidItem); ParseGlobalItem (UsbMouseAbsolutePointer, HidItem);
break; break;
case HID_ITEM_TYPE_LOCAL: case HID_ITEM_TYPE_LOCAL:
// //
// For Local Item, parse local item // For Local Item, parse local item
// //
ParseLocalItem (UsbMouseSimulateTouchPad, HidItem); ParseLocalItem (UsbMouseAbsolutePointer, HidItem);
break; break;
} }
} }
@ -328,7 +328,7 @@ ParseHidItem (
**/ **/
EFI_STATUS EFI_STATUS
ParseMouseReportDescriptor ( ParseMouseReportDescriptor (
IN USB_MOUSE_SIMULATE_TOUCHPAD_DEV *UsbMouseSimulateTouchPad, IN USB_MOUSE_ABSOLUTE_POINTER_DEV *UsbMouseAbsolutePointer,
IN UINT8 *ReportDescriptor, IN UINT8 *ReportDescriptor,
IN UINTN ReportSize IN UINTN ReportSize
) )
@ -349,14 +349,14 @@ ParseMouseReportDescriptor (
return EFI_DEVICE_ERROR; return EFI_DEVICE_ERROR;
} }
ParseHidItem (UsbMouseSimulateTouchPad, &HidItem); ParseHidItem (UsbMouseAbsolutePointer, &HidItem);
ptr = GetNextItem (ptr, DescriptorEnd, &HidItem); ptr = GetNextItem (ptr, DescriptorEnd, &HidItem);
} }
UsbMouseSimulateTouchPad->NumberOfButtons = (UINT8) (UsbMouseSimulateTouchPad->PrivateData.ButtonMaxIndex - UsbMouseSimulateTouchPad->PrivateData.ButtonMinIndex + 1); UsbMouseAbsolutePointer->NumberOfButtons = (UINT8) (UsbMouseAbsolutePointer->PrivateData.ButtonMaxIndex - UsbMouseAbsolutePointer->PrivateData.ButtonMinIndex + 1);
UsbMouseSimulateTouchPad->XLogicMax = UsbMouseSimulateTouchPad->YLogicMax = 1023; UsbMouseAbsolutePointer->XLogicMax = UsbMouseAbsolutePointer->YLogicMax = 1023;
UsbMouseSimulateTouchPad->XLogicMin = UsbMouseSimulateTouchPad->YLogicMin = -1023; UsbMouseAbsolutePointer->XLogicMin = UsbMouseAbsolutePointer->YLogicMin = -1023;
return EFI_SUCCESS; return EFI_SUCCESS;
} }

View File

@ -21,7 +21,7 @@ Abstract:
#ifndef __MOUSE_HID_H #ifndef __MOUSE_HID_H
#define __MOUSE_HID_H #define __MOUSE_HID_H
#include "UsbMouseSimulateTouchPad.h" #include "UsbMouseAbsolutePointer.h"
// //
// HID Item general structure // HID Item general structure
@ -77,7 +77,7 @@ typedef struct {
EFI_STATUS EFI_STATUS
ParseMouseReportDescriptor ( ParseMouseReportDescriptor (
IN USB_MOUSE_SIMULATE_TOUCHPAD_DEV *UsbMouseSimulateTouchPad, IN USB_MOUSE_ABSOLUTE_POINTER_DEV *UsbMouseAbsolutePointer,
IN UINT8 *ReportDescriptor, IN UINT8 *ReportDescriptor,
IN UINTN ReportSize IN UINTN ReportSize
); );