TianoCore EDK2 master
Loading...
Searching...
No Matches
UsbMouseAbsolutePointer.h
Go to the documentation of this file.
1
9#ifndef _USB_MOUSE_ABSOLUTE_POINTER_H_
10#define _USB_MOUSE_ABSOLUTE_POINTER_H_
11
12#include <Uefi.h>
13
15#include <Protocol/UsbIo.h>
16#include <Protocol/DevicePath.h>
17
22#include <Library/UefiLib.h>
24#include <Library/UefiUsbLib.h>
25#include <Library/DebugLib.h>
26
28
29#define CLASS_HID 3
30#define SUBCLASS_BOOT 1
31#define PROTOCOL_MOUSE 2
32
33#define BOOT_PROTOCOL 0
34#define REPORT_PROTOCOL 1
35
36#define USB_MOUSE_ABSOLUTE_POINTER_DEV_SIGNATURE SIGNATURE_32 ('u', 'm', 's', 't')
37
38//
39// A common header for usb standard descriptor.
40// Each stand descriptor has a length and type.
41//
42#pragma pack(1)
43typedef struct {
44 UINT8 Len;
45 UINT8 Type;
47#pragma pack()
48
52typedef struct {
53 BOOLEAN ButtonDetected;
54 UINT8 ButtonMinIndex;
55 UINT8 ButtonMaxIndex;
56 UINT8 Reserved;
58
62typedef struct {
63 UINTN Signature;
64 EFI_DEVICE_PATH_PROTOCOL *DevicePath;
65 EFI_EVENT DelayedRecoveryEvent;
67 EFI_USB_INTERFACE_DESCRIPTOR InterfaceDescriptor;
68 EFI_USB_ENDPOINT_DESCRIPTOR IntEndpointDescriptor;
69 UINT8 NumberOfButtons;
70 INT32 XLogicMax;
71 INT32 XLogicMin;
72 INT32 YLogicMax;
73 INT32 YLogicMin;
74 EFI_ABSOLUTE_POINTER_PROTOCOL AbsolutePointerProtocol;
77 BOOLEAN StateChanged;
78 USB_MOUSE_BUTTON_DATA PrivateData;
79 EFI_UNICODE_STRING_TABLE *ControllerNameTable;
81
85
86typedef union {
87 UINT8 Uint8;
88 UINT16 Uint16;
89 UINT32 Uint32;
90 INT8 Int8;
91 INT16 Int16;
92 INT32 Int32;
93 UINT8 *LongData;
94} HID_DATA;
95
96typedef struct {
97 UINT16 Format;
98 UINT8 Size;
99 UINT8 Type;
100 UINT8 Tag;
101 HID_DATA Data;
102} HID_ITEM;
103
104#define USB_MOUSE_ABSOLUTE_POINTER_DEV_FROM_MOUSE_PROTOCOL(a) \
105 CR(a, USB_MOUSE_ABSOLUTE_POINTER_DEV, AbsolutePointerProtocol, USB_MOUSE_ABSOLUTE_POINTER_DEV_SIGNATURE)
106
107//
108// Global Variables
109//
110extern EFI_DRIVER_BINDING_PROTOCOL gUsbMouseAbsolutePointerDriverBinding;
111extern EFI_COMPONENT_NAME_PROTOCOL gUsbMouseAbsolutePointerComponentName;
112extern EFI_COMPONENT_NAME2_PROTOCOL gUsbMouseAbsolutePointerComponentName2;
113
114//
115// Functions of Driver Binding Protocol
116//
117
130EFIAPI
133 IN EFI_HANDLE Controller,
134 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
135 );
136
157EFIAPI
160 IN EFI_HANDLE Controller,
161 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
162 );
163
178EFIAPI
181 IN EFI_HANDLE Controller,
182 IN UINTN NumberOfChildren,
183 IN EFI_HANDLE *ChildHandleBuffer
184 );
185
186//
187// EFI Component Name Functions
188//
189
225EFIAPI
228 IN CHAR8 *Language,
229 OUT CHAR16 **DriverName
230 );
231
291EFIAPI
294 IN EFI_HANDLE ControllerHandle,
295 IN EFI_HANDLE ChildHandle OPTIONAL,
296 IN CHAR8 *Language,
297 OUT CHAR16 **ControllerName
298 );
299
300//
301// Functions of EFI_ABSOLUTE_POINTER_PROTOCOL
302//
303
319EFIAPI
323 );
324
337EFIAPI
340 IN BOOLEAN ExtendedVerification
341 );
342
350VOID
351EFIAPI
353 IN EFI_EVENT Event,
354 IN VOID *Context
355 );
356
357//
358// Internal worker functions
359//
360
370BOOLEAN
373 );
374
392 IN USB_MOUSE_ABSOLUTE_POINTER_DEV *UsbMouseAbsolutePointerDev
393 );
394
413EFIAPI
415 IN VOID *Data,
416 IN UINTN DataLength,
417 IN VOID *Context,
418 IN UINT32 Result
419 );
420
434VOID
435EFIAPI
437 IN EFI_EVENT Event,
438 IN VOID *Context
439 );
440
459 OUT USB_MOUSE_ABSOLUTE_POINTER_DEV *UsbMouseAbsolutePointer,
460 IN UINT8 *ReportDescriptor,
461 IN UINTN ReportSize
462 );
463
464#endif
UINT64 UINTN
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
VOID * EFI_EVENT
Definition: UefiBaseType.h:37
VOID * EFI_HANDLE
Definition: UefiBaseType.h:33
EFI_STATUS EFIAPI UsbMouseAbsolutePointerComponentNameGetControllerName(IN EFI_COMPONENT_NAME_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN EFI_HANDLE ChildHandle OPTIONAL, IN CHAR8 *Language, OUT CHAR16 **ControllerName)
EFI_STATUS EFIAPI UsbMouseAbsolutePointerComponentNameGetDriverName(IN EFI_COMPONENT_NAME_PROTOCOL *This, IN CHAR8 *Language, OUT CHAR16 **DriverName)
Definition: ComponentName.c:70
VOID EFIAPI UsbMouseAbsolutePointerWaitForInput(IN EFI_EVENT Event, IN VOID *Context)
EFI_STATUS EFIAPI USBMouseAbsolutePointerDriverBindingStart(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
BOOLEAN IsUsbMouse(IN EFI_USB_IO_PROTOCOL *UsbIo)
EFI_STATUS EFIAPI OnMouseInterruptComplete(IN VOID *Data, IN UINTN DataLength, IN VOID *Context, IN UINT32 Result)
VOID EFIAPI USBMouseRecoveryHandler(IN EFI_EVENT Event, IN VOID *Context)
EFI_STATUS EFIAPI USBMouseAbsolutePointerDriverBindingStop(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN UINTN NumberOfChildren, IN EFI_HANDLE *ChildHandleBuffer)
EFI_STATUS EFIAPI USBMouseAbsolutePointerDriverBindingSupported(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
EFI_STATUS ParseMouseReportDescriptor(OUT USB_MOUSE_ABSOLUTE_POINTER_DEV *UsbMouseAbsolutePointer, IN UINT8 *ReportDescriptor, IN UINTN ReportSize)
Definition: MouseHid.c:242
EFI_STATUS InitializeUsbMouseDevice(IN USB_MOUSE_ABSOLUTE_POINTER_DEV *UsbMouseAbsolutePointerDev)
EFI_STATUS EFIAPI UsbMouseAbsolutePointerReset(IN EFI_ABSOLUTE_POINTER_PROTOCOL *This, IN BOOLEAN ExtendedVerification)
EFI_STATUS EFIAPI GetMouseAbsolutePointerState(IN EFI_ABSOLUTE_POINTER_PROTOCOL *This, OUT EFI_ABSOLUTE_POINTER_STATE *State)