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.
25 // The package level header files this module uses
29 // The protocols, PPI and GUID defintions for this module
31 #include <Protocol/SimplePointer.h>
32 #include <Protocol/UsbIo.h>
33 #include <Protocol/DevicePath.h>
35 // The Library classes this module consumes
37 #include <Library/ReportStatusCodeLib.h>
38 #include <Library/BaseMemoryLib.h>
39 #include <Library/UefiDriverEntryPoint.h>
40 #include <Library/UefiBootServicesTableLib.h>
41 #include <Library/UefiLib.h>
42 #include <Library/MemoryAllocationLib.h>
43 #include <Library/PcdLib.h>
44 #include <Library/UsbLib.h>
46 #include <IndustryStandard/Usb.h>
49 #define SUBCLASS_BOOT 1
50 #define PROTOCOL_MOUSE 2
52 #define BOOT_PROTOCOL 0
53 #define REPORT_PROTOCOL 1
55 #define USB_MOUSE_DEV_SIGNATURE EFI_SIGNATURE_32 ('u', 'm', 'o', 'u')
58 BOOLEAN ButtonDetected
;
66 EFI_DEVICE_PATH_PROTOCOL
*DevicePath
;
67 EFI_EVENT DelayedRecoveryEvent
;
68 EFI_USB_IO_PROTOCOL
*UsbIo
;
69 EFI_USB_INTERFACE_DESCRIPTOR
*InterfaceDescriptor
;
70 EFI_USB_ENDPOINT_DESCRIPTOR
*IntEndpointDescriptor
;
71 UINT8 NumberOfButtons
;
76 EFI_SIMPLE_POINTER_PROTOCOL SimplePointerProtocol
;
77 EFI_SIMPLE_POINTER_STATE State
;
78 EFI_SIMPLE_POINTER_MODE Mode
;
80 PRIVATE_DATA PrivateData
;
81 EFI_UNICODE_STRING_TABLE
*ControllerNameTable
;
84 #define USB_MOUSE_DEV_FROM_MOUSE_PROTOCOL(a) \
85 CR(a, USB_MOUSE_DEV, SimplePointerProtocol, USB_MOUSE_DEV_SIGNATURE)
89 USBMouseRecoveryHandler (
97 extern EFI_DRIVER_BINDING_PROTOCOL gUsbMouseDriverBinding
;
98 extern EFI_COMPONENT_NAME_PROTOCOL gUsbMouseComponentName
;
99 extern EFI_GUID gEfiUsbMouseDriverGuid
;
102 MouseReportStatusCode (
103 IN EFI_DEVICE_PATH_PROTOCOL
*DevicePath
,
104 IN EFI_STATUS_CODE_TYPE CodeType
,
105 IN EFI_STATUS_CODE_VALUE Value