]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Bus/Usb/UsbMouseDxe/UsbMouse.h
Clean up to fix build break.
[mirror_edk2.git] / MdeModulePkg / Bus / Usb / UsbMouseDxe / UsbMouse.h
CommitLineData
ed838d0c 1/** @file\r
2\r
bb80e3b2 3 Helper routine and corrsponding data struct used by USB Mouse Driver.\r
4\r
5Copyright (c) 2004 - 2008, Intel Corporation\r
ed838d0c 6All rights reserved. This program and the accompanying materials\r
7are licensed and made available under the terms and conditions of the BSD License\r
8which accompanies this distribution. The full text of the license may be found at\r
9http://opensource.org/licenses/bsd-license.php\r
10\r
11THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
12WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
13\r
ed838d0c 14**/\r
15\r
bb80e3b2 16#ifndef _EFI_USB_MOUSE_H_\r
17#define _EFI_USB_MOUSE_H_\r
ed838d0c 18\r
ed7748fe 19\r
60c93673 20#include <Uefi.h>\r
ed7748fe 21\r
ed838d0c 22#include <Protocol/SimplePointer.h>\r
23#include <Protocol/UsbIo.h>\r
24#include <Protocol/DevicePath.h>\r
ed7748fe 25\r
ed838d0c 26#include <Library/ReportStatusCodeLib.h>\r
27#include <Library/BaseMemoryLib.h>\r
28#include <Library/UefiDriverEntryPoint.h>\r
29#include <Library/UefiBootServicesTableLib.h>\r
30#include <Library/UefiLib.h>\r
31#include <Library/MemoryAllocationLib.h>\r
32#include <Library/PcdLib.h>\r
dfb74df5 33#include <Library/UefiUsbLib.h>\r
ed838d0c 34\r
35#include <IndustryStandard/Usb.h>\r
36\r
37#define CLASS_HID 3\r
38#define SUBCLASS_BOOT 1\r
39#define PROTOCOL_MOUSE 2\r
40\r
41#define BOOT_PROTOCOL 0\r
42#define REPORT_PROTOCOL 1\r
43\r
44#define USB_MOUSE_DEV_SIGNATURE EFI_SIGNATURE_32 ('u', 'm', 'o', 'u')\r
45\r
46typedef struct {\r
47 BOOLEAN ButtonDetected;\r
48 UINT8 ButtonMinIndex;\r
49 UINT8 ButtonMaxIndex;\r
50 UINT8 Reserved;\r
51} PRIVATE_DATA;\r
52\r
53typedef struct {\r
54 UINTN Signature;\r
55 EFI_DEVICE_PATH_PROTOCOL *DevicePath;\r
56 EFI_EVENT DelayedRecoveryEvent;\r
57 EFI_USB_IO_PROTOCOL *UsbIo;\r
58 EFI_USB_INTERFACE_DESCRIPTOR *InterfaceDescriptor;\r
59 EFI_USB_ENDPOINT_DESCRIPTOR *IntEndpointDescriptor;\r
60 UINT8 NumberOfButtons;\r
61 INT32 XLogicMax;\r
62 INT32 XLogicMin;\r
63 INT32 YLogicMax;\r
64 INT32 YLogicMin;\r
65 EFI_SIMPLE_POINTER_PROTOCOL SimplePointerProtocol;\r
66 EFI_SIMPLE_POINTER_STATE State;\r
67 EFI_SIMPLE_POINTER_MODE Mode;\r
68 BOOLEAN StateChanged;\r
69 PRIVATE_DATA PrivateData;\r
70 EFI_UNICODE_STRING_TABLE *ControllerNameTable;\r
71} USB_MOUSE_DEV;\r
72\r
73#define USB_MOUSE_DEV_FROM_MOUSE_PROTOCOL(a) \\r
74 CR(a, USB_MOUSE_DEV, SimplePointerProtocol, USB_MOUSE_DEV_SIGNATURE)\r
75\r
bb80e3b2 76\r
77/**\r
78 Timer handler for Delayed Recovery timer.\r
79\r
80 @param Event The Delayed Recovery event.\r
81 @param Context Points to the USB_KB_DEV instance.\r
82\r
83\r
84**/\r
ed838d0c 85VOID\r
86EFIAPI\r
87USBMouseRecoveryHandler (\r
88 IN EFI_EVENT Event,\r
89 IN VOID *Context\r
90 );\r
91\r
92//\r
93// Global Variables\r
94//\r
62b9bb55 95extern EFI_DRIVER_BINDING_PROTOCOL gUsbMouseDriverBinding;\r
96extern EFI_COMPONENT_NAME_PROTOCOL gUsbMouseComponentName;\r
97extern EFI_COMPONENT_NAME2_PROTOCOL gUsbMouseComponentName2;\r
98extern EFI_GUID gEfiUsbMouseDriverGuid;\r
ed838d0c 99\r
bb80e3b2 100\r
101/**\r
102 Report Status Code in Usb Bot Driver.\r
103\r
104 @param DevicePath Use this to get Device Path\r
105 @param CodeType Status Code Type\r
106 @param CodeValue Status Code Value\r
107\r
108 @return None\r
109\r
110**/\r
ed838d0c 111VOID\r
112MouseReportStatusCode (\r
113 IN EFI_DEVICE_PATH_PROTOCOL *DevicePath,\r
114 IN EFI_STATUS_CODE_TYPE CodeType,\r
115 IN EFI_STATUS_CODE_VALUE Value\r
116 );\r
117\r
118#endif\r