3 Copyright (c) 2004 - 2007, 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
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.
27 #include <Protocol/SimplePointer.h>
28 #include <Protocol/UsbIo.h>
29 #include <Protocol/DevicePath.h>
31 #include <Library/ReportStatusCodeLib.h>
32 #include <Library/BaseMemoryLib.h>
33 #include <Library/UefiDriverEntryPoint.h>
34 #include <Library/UefiBootServicesTableLib.h>
35 #include <Library/UefiLib.h>
36 #include <Library/MemoryAllocationLib.h>
37 #include <Library/PcdLib.h>
38 #include <Library/UsbLib.h>
40 #include <IndustryStandard/Usb.h>
43 #define SUBCLASS_BOOT 1
44 #define PROTOCOL_MOUSE 2
46 #define BOOT_PROTOCOL 0
47 #define REPORT_PROTOCOL 1
49 #define USB_MOUSE_DEV_SIGNATURE EFI_SIGNATURE_32 ('u', 'm', 'o', 'u')
52 BOOLEAN ButtonDetected
;
60 EFI_DEVICE_PATH_PROTOCOL
*DevicePath
;
61 EFI_EVENT DelayedRecoveryEvent
;
62 EFI_USB_IO_PROTOCOL
*UsbIo
;
63 EFI_USB_INTERFACE_DESCRIPTOR
*InterfaceDescriptor
;
64 EFI_USB_ENDPOINT_DESCRIPTOR
*IntEndpointDescriptor
;
65 UINT8 NumberOfButtons
;
70 EFI_SIMPLE_POINTER_PROTOCOL SimplePointerProtocol
;
71 EFI_SIMPLE_POINTER_STATE State
;
72 EFI_SIMPLE_POINTER_MODE Mode
;
74 PRIVATE_DATA PrivateData
;
75 EFI_UNICODE_STRING_TABLE
*ControllerNameTable
;
78 #define USB_MOUSE_DEV_FROM_MOUSE_PROTOCOL(a) \
79 CR(a, USB_MOUSE_DEV, SimplePointerProtocol, USB_MOUSE_DEV_SIGNATURE)
83 USBMouseRecoveryHandler (
91 extern EFI_DRIVER_BINDING_PROTOCOL gUsbMouseDriverBinding
;
92 extern EFI_COMPONENT_NAME_PROTOCOL gUsbMouseComponentName
;
93 extern EFI_GUID gEfiUsbMouseDriverGuid
;
96 MouseReportStatusCode (
97 IN EFI_DEVICE_PATH_PROTOCOL
*DevicePath
,
98 IN EFI_STATUS_CODE_TYPE CodeType
,
99 IN EFI_STATUS_CODE_VALUE Value