]>
Commit | Line | Data |
---|---|---|
ed838d0c | 1 | /** @file\r |
2 | \r | |
3 | Copyright (c) 2004 - 2007, Intel Corporation\r | |
4 | All rights reserved. This program and the accompanying materials\r | |
5 | are licensed and made available under the terms and conditions of the BSD License\r | |
6 | which accompanies this distribution. The full text of the license may be found at\r | |
7 | http://opensource.org/licenses/bsd-license.php\r | |
8 | \r | |
9 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
10 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
11 | \r | |
12 | Module Name:\r | |
13 | \r | |
14 | UsbMouse.h\r | |
15 | \r | |
16 | Abstract:\r | |
17 | \r | |
18 | \r | |
19 | **/\r | |
20 | \r | |
21 | #ifndef _USB_MOUSE_H\r | |
22 | #define _USB_MOUSE_H\r | |
23 | \r | |
ed7748fe | 24 | \r |
ed838d0c | 25 | #include <PiDxe.h>\r |
ed7748fe | 26 | \r |
ed838d0c | 27 | #include <Protocol/SimplePointer.h>\r |
28 | #include <Protocol/UsbIo.h>\r | |
29 | #include <Protocol/DevicePath.h>\r | |
ed7748fe | 30 | \r |
ed838d0c | 31 | #include <Library/ReportStatusCodeLib.h>\r |
32 | #include <Library/BaseMemoryLib.h>\r | |
33 | #include <Library/UefiDriverEntryPoint.h>\r | |
34 | #include <Library/UefiBootServicesTableLib.h>\r | |
35 | #include <Library/UefiLib.h>\r | |
36 | #include <Library/MemoryAllocationLib.h>\r | |
37 | #include <Library/PcdLib.h>\r | |
38 | #include <Library/UsbLib.h>\r | |
39 | \r | |
40 | #include <IndustryStandard/Usb.h>\r | |
41 | \r | |
42 | #define CLASS_HID 3\r | |
43 | #define SUBCLASS_BOOT 1\r | |
44 | #define PROTOCOL_MOUSE 2\r | |
45 | \r | |
46 | #define BOOT_PROTOCOL 0\r | |
47 | #define REPORT_PROTOCOL 1\r | |
48 | \r | |
49 | #define USB_MOUSE_DEV_SIGNATURE EFI_SIGNATURE_32 ('u', 'm', 'o', 'u')\r | |
50 | \r | |
51 | typedef struct {\r | |
52 | BOOLEAN ButtonDetected;\r | |
53 | UINT8 ButtonMinIndex;\r | |
54 | UINT8 ButtonMaxIndex;\r | |
55 | UINT8 Reserved;\r | |
56 | } PRIVATE_DATA;\r | |
57 | \r | |
58 | typedef struct {\r | |
59 | UINTN Signature;\r | |
60 | EFI_DEVICE_PATH_PROTOCOL *DevicePath;\r | |
61 | EFI_EVENT DelayedRecoveryEvent;\r | |
62 | EFI_USB_IO_PROTOCOL *UsbIo;\r | |
63 | EFI_USB_INTERFACE_DESCRIPTOR *InterfaceDescriptor;\r | |
64 | EFI_USB_ENDPOINT_DESCRIPTOR *IntEndpointDescriptor;\r | |
65 | UINT8 NumberOfButtons;\r | |
66 | INT32 XLogicMax;\r | |
67 | INT32 XLogicMin;\r | |
68 | INT32 YLogicMax;\r | |
69 | INT32 YLogicMin;\r | |
70 | EFI_SIMPLE_POINTER_PROTOCOL SimplePointerProtocol;\r | |
71 | EFI_SIMPLE_POINTER_STATE State;\r | |
72 | EFI_SIMPLE_POINTER_MODE Mode;\r | |
73 | BOOLEAN StateChanged;\r | |
74 | PRIVATE_DATA PrivateData;\r | |
75 | EFI_UNICODE_STRING_TABLE *ControllerNameTable;\r | |
76 | } USB_MOUSE_DEV;\r | |
77 | \r | |
78 | #define USB_MOUSE_DEV_FROM_MOUSE_PROTOCOL(a) \\r | |
79 | CR(a, USB_MOUSE_DEV, SimplePointerProtocol, USB_MOUSE_DEV_SIGNATURE)\r | |
80 | \r | |
81 | VOID\r | |
82 | EFIAPI\r | |
83 | USBMouseRecoveryHandler (\r | |
84 | IN EFI_EVENT Event,\r | |
85 | IN VOID *Context\r | |
86 | );\r | |
87 | \r | |
88 | //\r | |
89 | // Global Variables\r | |
90 | //\r | |
62b9bb55 | 91 | extern EFI_DRIVER_BINDING_PROTOCOL gUsbMouseDriverBinding;\r |
92 | extern EFI_COMPONENT_NAME_PROTOCOL gUsbMouseComponentName;\r | |
93 | extern EFI_COMPONENT_NAME2_PROTOCOL gUsbMouseComponentName2;\r | |
94 | extern EFI_GUID gEfiUsbMouseDriverGuid;\r | |
ed838d0c | 95 | \r |
96 | VOID\r | |
97 | MouseReportStatusCode (\r | |
98 | IN EFI_DEVICE_PATH_PROTOCOL *DevicePath,\r | |
99 | IN EFI_STATUS_CODE_TYPE CodeType,\r | |
100 | IN EFI_STATUS_CODE_VALUE Value\r | |
101 | );\r | |
102 | \r | |
103 | #endif\r |