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

Go to the source code of this file.

Functions

EFI_STATUS KbcSelfTest (VOID)
 
EFI_STATUS KbcEnableAux (VOID)
 
EFI_STATUS KbcDisableAux (VOID)
 
EFI_STATUS KbcEnableKb (VOID)
 
EFI_STATUS KbcDisableKb (VOID)
 
EFI_STATUS CheckKbStatus (OUT BOOLEAN *KeyboardEnable)
 
EFI_STATUS PS2MouseReset (VOID)
 
EFI_STATUS PS2MouseSetSampleRate (IN MOUSE_SR SampleRate)
 
EFI_STATUS PS2MouseSetResolution (IN MOUSE_RE Resolution)
 
EFI_STATUS PS2MouseSetScaling (IN MOUSE_SF Scaling)
 
EFI_STATUS PS2MouseEnable (VOID)
 
EFI_STATUS PS2MouseGetPacket (PS2_MOUSE_DEV *MouseDev)
 
EFI_STATUS PS2MouseRead (OUT UINT8 *Buffer, IN OUT UINTN *BufSize, IN UINTN State)
 
EFI_STATUS Out8042Command (IN UINT8 Command)
 
EFI_STATUS Out8042Data (IN UINT8 Data)
 
EFI_STATUS In8042Data (IN OUT UINT8 *Data)
 
EFI_STATUS Out8042AuxCommand (IN UINT8 Command, IN BOOLEAN Resend)
 
EFI_STATUS Out8042AuxData (IN UINT8 Data)
 
EFI_STATUS In8042AuxData (IN OUT UINT8 *Data)
 
EFI_STATUS CheckForInput (VOID)
 
EFI_STATUS WaitInputEmpty (IN UINTN Timeout)
 
EFI_STATUS WaitOutputFull (IN UINTN Timeout)
 

Variables

UINT8 SampleRateTbl [MaxSampleRate] = { 0xa, 0x14, 0x28, 0x3c, 0x50, 0x64, 0xc8 }
 
UINT8 ResolutionTbl [MaxResolution] = { 0, 1, 2, 3 }
 

Detailed Description

PS2 Mouse Communication Interface.

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

Definition in file CommPs2.c.

Function Documentation

◆ CheckForInput()

EFI_STATUS CheckForInput ( VOID  )

Check keyboard controller status, if it is output buffer full and for auxiliary device.

Return values
EFI_SUCCESSKeyboard controller is ready
EFI_NOT_READYKeyboard controller is not ready

Definition at line 766 of file CommPs2.c.

◆ CheckKbStatus()

EFI_STATUS CheckKbStatus ( OUT BOOLEAN *  KeyboardEnable)

Issue command to check keyboard status.

Parameters
KeyboardEnablereturn whether keyboard is enable.
Returns
Status of command issuing.

Definition at line 153 of file CommPs2.c.

◆ In8042AuxData()

EFI_STATUS In8042AuxData ( IN OUT UINT8 *  Data)

I/O work flow of in 8042 Aux data.

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

Definition at line 740 of file CommPs2.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.

◆ KbcDisableAux()

EFI_STATUS KbcDisableAux ( VOID  )

Issue command to disable keyboard AUX functionality.

Parameters
IsaIoPointer to instance of EFI_ISA_IO_PROTOCOL
Returns
Status of command issuing.

Definition at line 101 of file CommPs2.c.

◆ KbcDisableKb()

EFI_STATUS KbcDisableKb ( VOID  )

Issue command to disable keyboard.

Returns
Status of command issuing.

Definition at line 135 of file CommPs2.c.

◆ KbcEnableAux()

EFI_STATUS KbcEnableAux ( VOID  )

Issue command to enable keyboard AUX functionality.

Returns
Status of command issuing.

Definition at line 83 of file CommPs2.c.

◆ KbcEnableKb()

EFI_STATUS KbcEnableKb ( VOID  )

Issue command to enable keyboard.

Parameters
IsaIoPointer to instance of EFI_ISA_IO_PROTOCOL
Returns
Status of command issuing.

Definition at line 119 of file CommPs2.c.

◆ KbcSelfTest()

EFI_STATUS KbcSelfTest ( VOID  )

Issue self test command via IsaIo interface.

Returns
EFI_SUCCESS Success to do keyboard self testing.
others Fail to do keyboard self testing.

Definition at line 23 of file CommPs2.c.

◆ Out8042AuxCommand()

EFI_STATUS Out8042AuxCommand ( IN UINT8  Command,
IN BOOLEAN  Resend 
)

I/O work flow of outing 8042 Aux command.

Parameters
CommandAux I/O command
ResendWhether need resend the Aux command.
Return values
EFI_SUCCESSSuccess to execute I/O work flow
EFI_TIMEOUTKeyboard controller time out.

Definition at line 621 of file CommPs2.c.

◆ Out8042AuxData()

EFI_STATUS Out8042AuxData ( IN UINT8  Data)

I/O work flow of outing 8042 Aux data.

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

Definition at line 697 of file CommPs2.c.

◆ Out8042Command()

EFI_STATUS Out8042Command ( IN UINT8  Command)

I/O work flow of outing 8042 command.

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

Definition at line 519 of file CommPs2.c.

◆ Out8042Data()

EFI_STATUS Out8042Data ( IN UINT8  Data)

I/O work flow of outing 8042 data.

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

Definition at line 555 of file CommPs2.c.

◆ PS2MouseEnable()

EFI_STATUS PS2MouseEnable ( VOID  )

Issue command to enable Ps2 mouse.

Returns
Status of command issuing.

Definition at line 308 of file CommPs2.c.

◆ PS2MouseGetPacket()

EFI_STATUS PS2MouseGetPacket ( PS2_MOUSE_DEV MouseDev)

Get mouse packet . Only care first 3 bytes

Parameters
MouseDevPointer of PS2 Mouse Private Data Structure
Return values
EFI_NOT_READYMouse Device not ready to input data packet, or some error happened during getting the packet
EFI_SUCCESSThe data packet is gotten successfully.

Definition at line 328 of file CommPs2.c.

◆ PS2MouseRead()

EFI_STATUS PS2MouseRead ( OUT UINT8 *  Buffer,
IN OUT UINTN BufSize,
IN UINTN  State 
)

Read data via IsaIo protocol with given number.

Parameters
BufferBuffer receive data of mouse
BufSizeThe size of buffer
StateCheck input or read data
Returns
status of reading mouse data.

Definition at line 464 of file CommPs2.c.

◆ PS2MouseReset()

EFI_STATUS PS2MouseReset ( VOID  )

Issue command to reset keyboard.

Returns
Status of command issuing.

Definition at line 191 of file CommPs2.c.

◆ PS2MouseSetResolution()

EFI_STATUS PS2MouseSetResolution ( IN MOUSE_RE  Resolution)

Issue command to set mouse's resolution.

Parameters
Resolutionvalue of resolution
Returns
Status of command issuing.

Definition at line 265 of file CommPs2.c.

◆ PS2MouseSetSampleRate()

EFI_STATUS PS2MouseSetSampleRate ( IN MOUSE_SR  SampleRate)

Issue command to set mouse's sample rate

Parameters
SampleRatevalue of sample rate
Returns
Status of command issuing.

Definition at line 238 of file CommPs2.c.

◆ PS2MouseSetScaling()

EFI_STATUS PS2MouseSetScaling ( IN MOUSE_SF  Scaling)

Issue command to set mouse's scaling.

Parameters
Scalingvalue of scaling
Returns
Status of command issuing.

Definition at line 292 of file CommPs2.c.

◆ WaitInputEmpty()

EFI_STATUS WaitInputEmpty ( IN UINTN  Timeout)

I/O work flow to wait input buffer empty in given time.

Parameters
TimeoutWaiting time.
Return values
EFI_TIMEOUTif input is still not empty in given time.
EFI_SUCCESSinput is empty.

Definition at line 793 of file CommPs2.c.

◆ WaitOutputFull()

EFI_STATUS WaitOutputFull ( IN UINTN  Timeout)

I/O work flow to wait output buffer full in given time.

Parameters
Timeoutgiven time
Return values
EFI_TIMEOUToutput is not full in given time
EFI_SUCCESSoutput is full in given time.

Definition at line 832 of file CommPs2.c.

Variable Documentation

◆ ResolutionTbl

UINT8 ResolutionTbl[MaxResolution] = { 0, 1, 2, 3 }

Definition at line 14 of file CommPs2.c.

◆ SampleRateTbl

UINT8 SampleRateTbl[MaxSampleRate] = { 0xa, 0x14, 0x28, 0x3c, 0x50, 0x64, 0xc8 }

Definition at line 12 of file CommPs2.c.