TianoCore EDK2 master
Loading...
Searching...
No Matches
Ps2Mouse.h File Reference

Go to the source code of this file.

Data Structures

struct  PS2_MOUSE_DEV
 

Macros

#define PS2_MOUSE_DEV_SIGNATURE   SIGNATURE_32 ('p', 's', '2', 'm')
 
#define PS2_MOUSE_DEV_FROM_THIS(a)   CR (a, PS2_MOUSE_DEV, SimplePointerProtocol, PS2_MOUSE_DEV_SIGNATURE)
 

Enumerations

enum  MOUSE_SR {
  SampleRate10 , SampleRate20 , SampleRate40 , SampleRate60 ,
  SampleRate80 , SampleRate100 , SampleRate200 , MaxSampleRate
}
 
enum  MOUSE_RE {
  MouseResolution1 , MouseResolution2 , MouseResolution4 , MouseResolution8 ,
  MaxResolution
}
 
enum  MOUSE_SF { Scaling1 , Scaling2 }
 

Functions

EFI_STATUS EFIAPI PS2MouseDriverSupported (IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
 
EFI_STATUS EFIAPI PS2MouseDriverStart (IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
 
EFI_STATUS EFIAPI PS2MouseDriverStop (IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN UINTN NumberOfChildren, IN EFI_HANDLE *ChildHandleBuffer)
 
EFI_STATUS EFIAPI Ps2MouseComponentNameGetDriverName (IN EFI_COMPONENT_NAME_PROTOCOL *This, IN CHAR8 *Language, OUT CHAR16 **DriverName)
 
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 MouseReset (IN EFI_SIMPLE_POINTER_PROTOCOL *This, IN BOOLEAN ExtendedVerification)
 
EFI_STATUS EFIAPI MouseGetState (IN EFI_SIMPLE_POINTER_PROTOCOL *This, IN OUT EFI_SIMPLE_POINTER_STATE *State)
 
VOID EFIAPI MouseWaitForInput (IN EFI_EVENT Event, IN VOID *Context)
 
VOID EFIAPI PollMouse (IN EFI_EVENT Event, IN VOID *Context)
 
EFI_STATUS In8042Data (IN OUT UINT8 *Data)
 
BOOLEAN CheckMouseConnect (IN PS2_MOUSE_DEV *MouseDev)
 

Variables

EFI_DRIVER_BINDING_PROTOCOL gPS2MouseDriver
 
EFI_COMPONENT_NAME_PROTOCOL gPs2MouseComponentName
 
EFI_COMPONENT_NAME2_PROTOCOL gPs2MouseComponentName2
 

Detailed Description

PS/2 Mouse driver header file.

Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file Ps2Mouse.h.

Macro Definition Documentation

◆ PS2_MOUSE_DEV_FROM_THIS

#define PS2_MOUSE_DEV_FROM_THIS (   a)    CR (a, PS2_MOUSE_DEV, SimplePointerProtocol, PS2_MOUSE_DEV_SIGNATURE)

Definition at line 97 of file Ps2Mouse.h.

◆ PS2_MOUSE_DEV_SIGNATURE

#define PS2_MOUSE_DEV_SIGNATURE   SIGNATURE_32 ('p', 's', '2', 'm')

Definition at line 72 of file Ps2Mouse.h.

Enumeration Type Documentation

◆ MOUSE_RE

enum MOUSE_RE

Definition at line 53 of file Ps2Mouse.h.

◆ MOUSE_SF

enum MOUSE_SF

Definition at line 64 of file Ps2Mouse.h.

◆ MOUSE_SR

enum MOUSE_SR

Definition at line 39 of file Ps2Mouse.h.

Function Documentation

◆ CheckMouseConnect()

BOOLEAN CheckMouseConnect ( IN PS2_MOUSE_DEV MouseDev)

Check whether there is Ps/2 mouse device in system

Parameters
MouseDev- Mouse Private Data Structure
Return values
TRUE- Keyboard in System.
FALSE- Keyboard not in System.

Definition at line 654 of file Ps2Mouse.c.

◆ In8042Data()

EFI_STATUS In8042Data ( IN OUT UINT8 *  Data)

I/O work flow of in 8042 data.

Parameters
DataData value
Return values
EFI_SUCCESSSuccess to execute I/O work flow
EFI_TIMEOUTKeyboard controller time out.

Definition at line 582 of file CommPs2.c.

◆ MouseGetState()

EFI_STATUS EFIAPI MouseGetState ( IN EFI_SIMPLE_POINTER_PROTOCOL This,
IN OUT EFI_SIMPLE_POINTER_STATE State 
)

Get and Clear mouse status.

Parameters
This- Pointer of simple pointer Protocol.
State- Output buffer holding status.
Return values
EFI_INVALID_PARAMETEROutput buffer is invalid.
EFI_NOT_READYMouse is not changed status yet.
EFI_SUCCESSMouse status is changed and get successful.

Definition at line 681 of file Ps2Mouse.c.

◆ MouseReset()

EFI_STATUS EFIAPI MouseReset ( IN EFI_SIMPLE_POINTER_PROTOCOL This,
IN BOOLEAN  ExtendedVerification 
)

Reset the Mouse and do BAT test for it, if ExtendedVerification is TRUE and there is a mouse device connected to system.

Parameters
This- Pointer of simple pointer Protocol.
ExtendedVerification- Whether configure mouse parameters. True: do; FALSE: skip.
Return values
EFI_SUCCESS- The command byte is written successfully.
EFI_DEVICE_ERROR- Errors occurred during resetting keyboard.

Definition at line 542 of file Ps2Mouse.c.

◆ MouseWaitForInput()

VOID EFIAPI MouseWaitForInput ( IN EFI_EVENT  Event,
IN VOID *  Context 
)

Event notification function for SIMPLE_POINTER.WaitForInput event. Signal the event if there is input from mouse.

Parameters
Eventevent object
Contextevent context

Definition at line 725 of file Ps2Mouse.c.

◆ PollMouse()

VOID EFIAPI PollMouse ( IN EFI_EVENT  Event,
IN VOID *  Context 
)

Event notification function for TimerEvent event. If mouse device is connected to system, try to get the mouse packet data.

Parameters
Event- TimerEvent in PS2_MOUSE_DEV
Context- Pointer to PS2_MOUSE_DEV structure

Definition at line 753 of file Ps2Mouse.c.

◆ Ps2MouseComponentNameGetControllerName()

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 
)

Retrieves a Unicode string that is the user readable name of the controller that is being managed by a driver.

This function retrieves the user readable name of the controller specified by ControllerHandle and ChildHandle in the form of a Unicode string. If the driver specified by This has a user readable name in the language specified by Language, then a pointer to the controller name is returned in ControllerName, and EFI_SUCCESS is returned. If the driver specified by This is not currently managing the controller specified by ControllerHandle and ChildHandle, then EFI_UNSUPPORTED is returned. If the driver specified by This does not support the language specified by Language, then EFI_UNSUPPORTED is returned.

Parameters
This[in]A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or EFI_COMPONENT_NAME_PROTOCOL instance.
ControllerHandle[in]The handle of a controller that the driver specified by This is managing. This handle specifies the controller whose name is to be returned.
ChildHandle[in]The handle of the child controller to retrieve the name of. This is an optional parameter that may be NULL. It will be NULL for device drivers. It will also be NULL for a bus drivers that wish to retrieve the name of the bus controller. It will not be NULL for a bus driver that wishes to retrieve the name of a child controller.
Language[in]A pointer to a Null-terminated ASCII string array indicating the language. This is the language of the driver name that the caller is requesting, and it must match one of the languages specified in SupportedLanguages. The number of languages supported by a driver is up to the driver writer. Language is specified in RFC 4646 or ISO 639-2 language code format.
ControllerName[out]A pointer to the Unicode string to return. This Unicode string is the name of the controller specified by ControllerHandle and ChildHandle in the language specified by Language from the point of view of the driver specified by This.
Return values
EFI_SUCCESSThe Unicode string for the user readable name in the language specified by Language for the driver specified by This was returned in DriverName.
EFI_INVALID_PARAMETERControllerHandle is NULL.
EFI_INVALID_PARAMETERChildHandle is not NULL and it is not a valid EFI_HANDLE.
EFI_INVALID_PARAMETERLanguage is NULL.
EFI_INVALID_PARAMETERControllerName is NULL.
EFI_UNSUPPORTEDThe driver specified by This is not currently managing the controller specified by ControllerHandle and ChildHandle.
EFI_UNSUPPORTEDThe driver specified by This does not support the language specified by Language.

Definition at line 166 of file ComponentName.c.

◆ Ps2MouseComponentNameGetDriverName()

EFI_STATUS EFIAPI Ps2MouseComponentNameGetDriverName ( IN EFI_COMPONENT_NAME_PROTOCOL This,
IN CHAR8 *  Language,
OUT CHAR16 **  DriverName 
)

Retrieves a Unicode string that is the user readable name of the driver.

This function retrieves the user readable name of a driver in the form of a Unicode string. If the driver specified by This has a user readable name in the language specified by Language, then a pointer to the driver name is returned in DriverName, and EFI_SUCCESS is returned. If the driver specified by This does not support the language specified by Language, then EFI_UNSUPPORTED is returned.

Parameters
This[in]A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or EFI_COMPONENT_NAME_PROTOCOL instance.
Language[in]A pointer to a Null-terminated ASCII string array indicating the language. This is the language of the driver name that the caller is requesting, and it must match one of the languages specified in SupportedLanguages. The number of languages supported by a driver is up to the driver writer. Language is specified in RFC 4646 or ISO 639-2 language code format.
DriverName[out]A pointer to the Unicode string to return. This Unicode string is the name of the driver specified by This in the language specified by Language.
Return values
EFI_SUCCESSThe Unicode string for the Driver specified by This and the language specified by Language was returned in DriverName.
EFI_INVALID_PARAMETERLanguage is NULL.
EFI_INVALID_PARAMETERDriverName is NULL.
EFI_UNSUPPORTEDThe driver specified by This does not support the language specified by Language.

Definition at line 81 of file ComponentName.c.

◆ PS2MouseDriverStart()

EFI_STATUS EFIAPI PS2MouseDriverStart ( IN EFI_DRIVER_BINDING_PROTOCOL This,
IN EFI_HANDLE  Controller,
IN EFI_DEVICE_PATH_PROTOCOL RemainingDevicePath 
)

Start this driver on ControllerHandle by opening a IsaIo protocol, creating PS2_MOUSE_ABSOLUTE_POINTER_DEV device and install gEfiAbsolutePointerProtocolGuid finally.

Parameters
ThisProtocol instance pointer.
ControllerHandleHandle of device to bind driver to
RemainingDevicePathOptional parameter use to pick a specific child device to start.
Return values
EFI_SUCCESSThis driver is added to ControllerHandle
EFI_ALREADY_STARTEDThis driver is already running on ControllerHandle
otherThis driver does not support this device

Start this driver on ControllerHandle by opening a Sio protocol, creating PS2_MOUSE_DEV device and install gEfiSimplePointerProtocolGuid finally.

Parameters
ThisProtocol instance pointer.
ControllerHandleHandle of device to bind driver to
RemainingDevicePathOptional parameter use to pick a specific child device to start.
Return values
EFI_SUCCESSThis driver is added to ControllerHandle
EFI_ALREADY_STARTEDThis driver is already running on ControllerHandle
otherThis driver does not support this device

Definition at line 146 of file Ps2Mouse.c.

◆ PS2MouseDriverStop()

EFI_STATUS EFIAPI PS2MouseDriverStop ( IN EFI_DRIVER_BINDING_PROTOCOL This,
IN EFI_HANDLE  Controller,
IN UINTN  NumberOfChildren,
IN EFI_HANDLE ChildHandleBuffer 
)

Stop this driver on ControllerHandle. Support stopping any child handles created by this driver.

Parameters
ThisProtocol instance pointer.
ControllerHandleHandle of device to stop driver on
NumberOfChildrenNumber of Handles in ChildHandleBuffer. If number of children is zero stop the entire bus driver.
ChildHandleBufferList of Child Handles to Stop.
Return values
EFI_SUCCESSThis driver is removed ControllerHandle
otherThis driver was not removed from this device

Definition at line 448 of file Ps2Mouse.c.

◆ PS2MouseDriverSupported()

EFI_STATUS EFIAPI PS2MouseDriverSupported ( IN EFI_DRIVER_BINDING_PROTOCOL This,
IN EFI_HANDLE  Controller,
IN EFI_DEVICE_PATH_PROTOCOL RemainingDevicePath 
)

Test to see if this driver supports ControllerHandle. Any ControllerHandle than contains a IsaIo protocol can be supported.

Parameters
ThisProtocol instance pointer.
ControllerHandleHandle of device to test
RemainingDevicePathOptional parameter use to pick a specific child device to start.
Return values
EFI_SUCCESSThis driver supports this device
EFI_ALREADY_STARTEDThis driver is already running on this device
otherThis driver does not support this device

Definition at line 41 of file Ps2Mouse.c.

Variable Documentation

◆ gPs2MouseComponentName

EFI_COMPONENT_NAME_PROTOCOL gPs2MouseComponentName
extern

Definition at line 14 of file ComponentName.c.

◆ gPs2MouseComponentName2

EFI_COMPONENT_NAME2_PROTOCOL gPs2MouseComponentName2
extern

Definition at line 23 of file ComponentName.c.

◆ gPS2MouseDriver

EFI_DRIVER_BINDING_PROTOCOL gPS2MouseDriver
extern

DriverBinding Protocol Instance

Definition at line 16 of file Ps2Mouse.c.