TianoCore EDK2 master
Loading...
Searching...
No Matches
Ps2Mouse.c File Reference
#include "Ps2Mouse.h"
#include "CommPs2.h"

Go to the source code of this file.

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 MouseReset (IN EFI_SIMPLE_POINTER_PROTOCOL *This, IN BOOLEAN ExtendedVerification)
 
BOOLEAN CheckMouseConnect (IN PS2_MOUSE_DEV *MouseDev)
 
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 EFIAPI InitializePs2Mouse (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
 

Variables

EFI_DRIVER_BINDING_PROTOCOL gPS2MouseDriver
 

Detailed Description

PS/2 Mouse driver. Routines that interacts with callers, conforming to EFI driver model.

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

Definition in file Ps2Mouse.c.

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.

◆ InitializePs2Mouse()

EFI_STATUS EFIAPI InitializePs2Mouse ( IN EFI_HANDLE  ImageHandle,
IN EFI_SYSTEM_TABLE SystemTable 
)

The user Entry Point for module Ps2Mouse. The user code starts with this function.

Parameters
[in]ImageHandleThe firmware allocated handle for the EFI image.
[in]SystemTableA pointer to the EFI System Table.
Return values
EFI_SUCCESSThe entry point is executed successfully.
otherSome error occurs when executing this entry point.

Definition at line 781 of file Ps2Mouse.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.

◆ 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 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

◆ gPS2MouseDriver

EFI_DRIVER_BINDING_PROTOCOL gPS2MouseDriver
Initial value:
= {
0xa,
}
#define NULL
Definition: Base.h:319
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_STATUS EFIAPI PS2MouseDriverStart(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
Definition: Ps2Mouse.c:146

DriverBinding Protocol Instance

Definition at line 16 of file Ps2Mouse.c.