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