TianoCore EDK2 master
Loading...
Searching...
No Matches
Ps2Mouse.h
Go to the documentation of this file.
1
9#ifndef _PS2MOUSE_H_
10#define _PS2MOUSE_H_
11
12#include <Uefi.h>
13
15#include <Protocol/SuperIo.h>
16#include <Protocol/DevicePath.h>
17
19#include <Library/DebugLib.h>
21#include <Library/UefiLib.h>
26#include <Library/PcdLib.h>
27#include <Library/IoLib.h>
28
29//
30// Global Variables
31//
33extern EFI_COMPONENT_NAME_PROTOCOL gPs2MouseComponentName;
34extern EFI_COMPONENT_NAME2_PROTOCOL gPs2MouseComponentName2;
35
36//
37// PS/2 mouse sample rate
38//
39typedef enum {
40 SampleRate10,
41 SampleRate20,
42 SampleRate40,
43 SampleRate60,
44 SampleRate80,
45 SampleRate100,
46 SampleRate200,
47 MaxSampleRate
48} MOUSE_SR;
49
50//
51// PS/2 mouse resolution
52//
53typedef enum {
54 MouseResolution1,
55 MouseResolution2,
56 MouseResolution4,
57 MouseResolution8,
58 MaxResolution
59} MOUSE_RE;
60
61//
62// PS/2 mouse scaling
63//
64typedef enum {
65 Scaling1,
66 Scaling2
67} MOUSE_SF;
68
69//
70// Driver Private Data
71//
72#define PS2_MOUSE_DEV_SIGNATURE SIGNATURE_32 ('p', 's', '2', 'm')
73
74typedef struct {
75 UINTN Signature;
76
77 EFI_HANDLE Handle;
78 EFI_SIMPLE_POINTER_PROTOCOL SimplePointerProtocol;
81 BOOLEAN StateChanged;
82
83 //
84 // PS2 Mouse device specific information
85 //
86 MOUSE_SR SampleRate;
87 MOUSE_RE Resolution;
88 MOUSE_SF Scaling;
89 UINT8 DataPackageSize;
90
91 EFI_EVENT TimerEvent;
92
93 EFI_UNICODE_STRING_TABLE *ControllerNameTable;
94 EFI_DEVICE_PATH_PROTOCOL *DevicePath;
96
97#define PS2_MOUSE_DEV_FROM_THIS(a) CR (a, PS2_MOUSE_DEV, SimplePointerProtocol, PS2_MOUSE_DEV_SIGNATURE)
98
99//
100// Function prototypes
101//
102
118EFIAPI
121 IN EFI_HANDLE Controller,
122 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
123 );
124
141EFIAPI
144 IN EFI_HANDLE Controller,
145 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
146 );
147
163EFIAPI
166 IN EFI_HANDLE Controller,
167 IN UINTN NumberOfChildren,
168 IN EFI_HANDLE *ChildHandleBuffer
169 );
170
171//
172// EFI Component Name Functions
173//
174
215EFIAPI
218 IN CHAR8 *Language,
219 OUT CHAR16 **DriverName
220 );
221
291EFIAPI
294 IN EFI_HANDLE ControllerHandle,
295 IN EFI_HANDLE ChildHandle OPTIONAL,
296 IN CHAR8 *Language,
297 OUT CHAR16 **ControllerName
298 );
299
313EFIAPI
316 IN BOOLEAN ExtendedVerification
317 );
318
330EFIAPI
334 );
335
345VOID
346EFIAPI
348 IN EFI_EVENT Event,
349 IN VOID *Context
350 );
351
360VOID
361EFIAPI
362PollMouse (
363 IN EFI_EVENT Event,
364 IN VOID *Context
365 );
366
377 IN OUT UINT8 *Data
378 );
379
389BOOLEAN
391 IN PS2_MOUSE_DEV *MouseDev
392 );
393
394#endif
UINT64 UINTN
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
EFI_STATUS EFIAPI MouseGetState(IN EFI_SIMPLE_POINTER_PROTOCOL *This, IN OUT EFI_SIMPLE_POINTER_STATE *State)
Definition: Ps2Mouse.c:681
EFI_STATUS In8042Data(IN OUT UINT8 *Data)
Definition: CommPs2.c:582
EFI_STATUS EFIAPI PS2MouseDriverStop(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN UINTN NumberOfChildren, IN EFI_HANDLE *ChildHandleBuffer)
Definition: Ps2Mouse.c:448
EFI_STATUS EFIAPI PS2MouseDriverSupported(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
Definition: Ps2Mouse.c:41
EFI_DRIVER_BINDING_PROTOCOL gPS2MouseDriver
Definition: Ps2Mouse.c:16
EFI_STATUS EFIAPI MouseReset(IN EFI_SIMPLE_POINTER_PROTOCOL *This, IN BOOLEAN ExtendedVerification)
Definition: Ps2Mouse.c:542
EFI_STATUS EFIAPI Ps2MouseComponentNameGetControllerName(IN EFI_COMPONENT_NAME_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN EFI_HANDLE ChildHandle OPTIONAL, IN CHAR8 *Language, OUT CHAR16 **ControllerName)
EFI_STATUS EFIAPI PS2MouseDriverStart(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
Definition: Ps2Mouse.c:146
VOID EFIAPI MouseWaitForInput(IN EFI_EVENT Event, IN VOID *Context)
Definition: Ps2Mouse.c:725
EFI_STATUS EFIAPI Ps2MouseComponentNameGetDriverName(IN EFI_COMPONENT_NAME_PROTOCOL *This, IN CHAR8 *Language, OUT CHAR16 **DriverName)
Definition: ComponentName.c:81
BOOLEAN CheckMouseConnect(IN PS2_MOUSE_DEV *MouseDev)
Definition: Ps2Mouse.c:654
VOID EFIAPI PollMouse(IN EFI_EVENT Event, IN VOID *Context)
Definition: Ps2Mouse.c:753
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
VOID * EFI_EVENT
Definition: UefiBaseType.h:37
VOID * EFI_HANDLE
Definition: UefiBaseType.h:33