]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Bus/Usb/UsbMouseDxe/usbmouse.h
1. Import UsbKbDxe and UsbMouseDxe into MdeModulePkg
[mirror_edk2.git] / MdeModulePkg / Bus / Usb / UsbMouseDxe / usbmouse.h
1 /** @file
2
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
8
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.
11
12 Module Name:
13
14 UsbMouse.h
15
16 Abstract:
17
18
19 **/
20
21 #ifndef _USB_MOUSE_H
22 #define _USB_MOUSE_H
23
24 //
25 // The package level header files this module uses
26 //
27 #include <PiDxe.h>
28 //
29 // The protocols, PPI and GUID defintions for this module
30 //
31 #include <Protocol/SimplePointer.h>
32 #include <Protocol/UsbIo.h>
33 #include <Protocol/DevicePath.h>
34 //
35 // The Library classes this module consumes
36 //
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>
45
46 #include <IndustryStandard/Usb.h>
47
48 #define CLASS_HID 3
49 #define SUBCLASS_BOOT 1
50 #define PROTOCOL_MOUSE 2
51
52 #define BOOT_PROTOCOL 0
53 #define REPORT_PROTOCOL 1
54
55 #define USB_MOUSE_DEV_SIGNATURE EFI_SIGNATURE_32 ('u', 'm', 'o', 'u')
56
57 typedef struct {
58 BOOLEAN ButtonDetected;
59 UINT8 ButtonMinIndex;
60 UINT8 ButtonMaxIndex;
61 UINT8 Reserved;
62 } PRIVATE_DATA;
63
64 typedef struct {
65 UINTN Signature;
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;
72 INT32 XLogicMax;
73 INT32 XLogicMin;
74 INT32 YLogicMax;
75 INT32 YLogicMin;
76 EFI_SIMPLE_POINTER_PROTOCOL SimplePointerProtocol;
77 EFI_SIMPLE_POINTER_STATE State;
78 EFI_SIMPLE_POINTER_MODE Mode;
79 BOOLEAN StateChanged;
80 PRIVATE_DATA PrivateData;
81 EFI_UNICODE_STRING_TABLE *ControllerNameTable;
82 } USB_MOUSE_DEV;
83
84 #define USB_MOUSE_DEV_FROM_MOUSE_PROTOCOL(a) \
85 CR(a, USB_MOUSE_DEV, SimplePointerProtocol, USB_MOUSE_DEV_SIGNATURE)
86
87 VOID
88 EFIAPI
89 USBMouseRecoveryHandler (
90 IN EFI_EVENT Event,
91 IN VOID *Context
92 );
93
94 //
95 // Global Variables
96 //
97 extern EFI_DRIVER_BINDING_PROTOCOL gUsbMouseDriverBinding;
98 extern EFI_COMPONENT_NAME_PROTOCOL gUsbMouseComponentName;
99 extern EFI_GUID gEfiUsbMouseDriverGuid;
100
101 VOID
102 MouseReportStatusCode (
103 IN EFI_DEVICE_PATH_PROTOCOL *DevicePath,
104 IN EFI_STATUS_CODE_TYPE CodeType,
105 IN EFI_STATUS_CODE_VALUE Value
106 );
107
108 #endif