EDK2 doxygen online documents - Firmware Encoding Index 1
EDK2 doxygen online documents - Firmware Encoding Index
Functions | Variables

IntelFrameworkModulePkg/Bus/Isa/Ps2MouseAbsolutePointerDxe/CommPs2.c File Reference

#include "Ps2MouseAbsolutePointer.h"
#include "CommPs2.h"

Go to the source code of this file.

Functions

EFI_STATUS KbcSelfTest (IN EFI_ISA_IO_PROTOCOL *IsaIo)
EFI_STATUS KbcEnableAux (IN EFI_ISA_IO_PROTOCOL *IsaIo)
EFI_STATUS KbcDisableAux (IN EFI_ISA_IO_PROTOCOL *IsaIo)
EFI_STATUS KbcEnableKb (IN EFI_ISA_IO_PROTOCOL *IsaIo)
EFI_STATUS KbcDisableKb (IN EFI_ISA_IO_PROTOCOL *IsaIo)
EFI_STATUS CheckKbStatus (IN EFI_ISA_IO_PROTOCOL *IsaIo, OUT BOOLEAN *KeyboardEnable)
EFI_STATUS PS2MouseReset (IN EFI_ISA_IO_PROTOCOL *IsaIo)
EFI_STATUS PS2MouseSetSampleRate (IN EFI_ISA_IO_PROTOCOL *IsaIo, IN MOUSE_SR SampleRate)
EFI_STATUS PS2MouseSetResolution (IN EFI_ISA_IO_PROTOCOL *IsaIo, IN MOUSE_RE Resolution)
EFI_STATUS PS2MouseSetScaling (IN EFI_ISA_IO_PROTOCOL *IsaIo, IN MOUSE_SF Scaling)
EFI_STATUS PS2MouseEnable (IN EFI_ISA_IO_PROTOCOL *IsaIo)
EFI_STATUS PS2MouseGetPacket (PS2_MOUSE_ABSOLUTE_POINTER_DEV *MouseAbsolutePointerDev)
EFI_STATUS PS2MouseRead (IN EFI_ISA_IO_PROTOCOL *IsaIo, OUT VOID *Buffer, IN OUT UINTN *BufSize, IN UINTN State)
EFI_STATUS Out8042Command (IN EFI_ISA_IO_PROTOCOL *IsaIo, IN UINT8 Command)
EFI_STATUS Out8042Data (IN EFI_ISA_IO_PROTOCOL *IsaIo, IN UINT8 Data)
EFI_STATUS In8042Data (IN EFI_ISA_IO_PROTOCOL *IsaIo, IN OUT UINT8 *Data)
EFI_STATUS Out8042AuxCommand (IN EFI_ISA_IO_PROTOCOL *IsaIo, IN UINT8 Command, IN BOOLEAN Resend)
EFI_STATUS Out8042AuxData (IN EFI_ISA_IO_PROTOCOL *IsaIo, IN UINT8 Data)
EFI_STATUS In8042AuxData (IN EFI_ISA_IO_PROTOCOL *IsaIo, IN OUT UINT8 *Data)
EFI_STATUS CheckForInput (IN EFI_ISA_IO_PROTOCOL *IsaIo)
EFI_STATUS WaitInputEmpty (IN EFI_ISA_IO_PROTOCOL *IsaIo, IN UINTN Timeout)
EFI_STATUS WaitOutputFull (IN EFI_ISA_IO_PROTOCOL *IsaIo, 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 - 2007, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php

THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.

Definition in file CommPs2.c.


Function Documentation

EFI_STATUS CheckForInput ( IN EFI_ISA_IO_PROTOCOL IsaIo)

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

Parameters:
IsaIoPointer to instance of EFI_ISA_IO_PROTOCOL
Return values:
EFI_SUCCESSKeyboard controller is ready
EFI_NOT_READYKeyboard controller is not ready

Definition at line 823 of file CommPs2.c.

EFI_STATUS CheckKbStatus ( IN EFI_ISA_IO_PROTOCOL IsaIo,
OUT BOOLEAN KeyboardEnable 
)

Issue command to check keyboard status.

Parameters:
IsaIoPointer to instance of EFI_ISA_IO_PROTOCOL
KeyboardEnablereturn whether keyboard is enable.
Returns:
Status of command issuing.

Definition at line 164 of file CommPs2.c.

EFI_STATUS In8042AuxData ( IN EFI_ISA_IO_PROTOCOL IsaIo,
IN OUT UINT8 Data 
)

I/O work flow of in 8042 Aux data.

Parameters:
IsaIoPointer to instance of EFI_ISA_IO_PROTOCOL
DataBuffer holding return value.
Return values:
EFI_SUCCESSSuccess to excute I/O work flow
EFI_TIMEOUTKeyboard controller time out.

Definition at line 793 of file CommPs2.c.

EFI_STATUS In8042Data ( IN EFI_ISA_IO_PROTOCOL IsaIo,
IN OUT UINT8 Data 
)

I/O work flow of in 8042 data.

Parameters:
IsaIoPointer to instance of EFI_ISA_IO_PROTOCOL
DataData value
Return values:
EFI_SUCCESSSuccess to excute I/O work flow
EFI_TIMEOUTKeyboard controller time out.

Definition at line 622 of file CommPs2.c.

EFI_STATUS KbcDisableAux ( IN EFI_ISA_IO_PROTOCOL IsaIo)

Issue command to disable keyboard AUX functionality.

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

Definition at line 109 of file CommPs2.c.

EFI_STATUS KbcDisableKb ( IN EFI_ISA_IO_PROTOCOL IsaIo)

Issue command to disable keyboard.

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

Definition at line 145 of file CommPs2.c.

EFI_STATUS KbcEnableAux ( IN EFI_ISA_IO_PROTOCOL IsaIo)

Issue command to enable keyboard AUX functionality.

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

Definition at line 91 of file CommPs2.c.

EFI_STATUS KbcEnableKb ( IN EFI_ISA_IO_PROTOCOL IsaIo)

Issue command to enable keyboard.

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

Definition at line 127 of file CommPs2.c.

EFI_STATUS KbcSelfTest ( IN EFI_ISA_IO_PROTOCOL IsaIo)

Issue self test command via IsaIo interface.

Parameters:
IsaIoPointer to instance of EFI_ISA_IO_PROTOCOL
Returns:
EFI_SUCCESS Success to do keyboard self testing.
others Fail to do keyboard self testing.

Definition at line 31 of file CommPs2.c.

EFI_STATUS Out8042AuxCommand ( IN EFI_ISA_IO_PROTOCOL IsaIo,
IN UINT8  Command,
IN BOOLEAN  Resend 
)

I/O work flow of outing 8042 Aux command.

Parameters:
IsaIoPointer to instance of EFI_ISA_IO_PROTOCOL
CommandAux I/O command
ResendWhether need resend the Aux command.
Return values:
EFI_SUCCESSSuccess to excute I/O work flow
EFI_TIMEOUTKeyboard controller time out.

Definition at line 666 of file CommPs2.c.

EFI_STATUS Out8042AuxData ( IN EFI_ISA_IO_PROTOCOL IsaIo,
IN UINT8  Data 
)

I/O work flow of outing 8042 Aux data.

Parameters:
IsaIoPointer to instance of EFI_ISA_IO_PROTOCOL
DataBuffer holding return value
Return values:
EFI_SUCCESSSuccess to excute I/O work flow.
EFI_TIMEOUTKeyboard controller time out.

Definition at line 747 of file CommPs2.c.

EFI_STATUS Out8042Command ( IN EFI_ISA_IO_PROTOCOL IsaIo,
IN UINT8  Command 
)

I/O work flow of outing 8042 command.

Parameters:
IsaIoPointer to instance of EFI_ISA_IO_PROTOCOL
CommandI/O command.
Return values:
EFI_SUCCESSSuccess to excute I/O work flow
EFI_TIMEOUTKeyboard controller time out.

Definition at line 547 of file CommPs2.c.

EFI_STATUS Out8042Data ( IN EFI_ISA_IO_PROTOCOL IsaIo,
IN UINT8  Data 
)

I/O work flow of outing 8042 data.

Parameters:
IsaIoPointer to instance of EFI_ISA_IO_PROTOCOL
DataData value
Return values:
EFI_SUCCESSSuccess to excute I/O work flow
EFI_TIMEOUTKeyboard controller time out.

Definition at line 586 of file CommPs2.c.

EFI_STATUS PS2MouseEnable ( IN EFI_ISA_IO_PROTOCOL IsaIo)

Issue command to enable Ps2 mouse.

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

Definition at line 331 of file CommPs2.c.

EFI_STATUS PS2MouseGetPacket ( PS2_MOUSE_ABSOLUTE_POINTER_DEV MouseAbsolutePointerDev)

Get mouse packet . Only care first 3 bytes

Parameters:
MouseAbsolutePointerDevPointer to PS2 Absolute Pointer Simulation Device 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 351 of file CommPs2.c.

EFI_STATUS PS2MouseRead ( IN EFI_ISA_IO_PROTOCOL IsaIo,
OUT VOID *  Buffer,
IN OUT UINTN BufSize,
IN UINTN  State 
)

Read data via IsaIo protocol with given number.

Parameters:
IsaIoPointer to instance of EFI_ISA_IO_PROTOCOL
BufferBuffer receive data of mouse
BufSizeThe size of buffer
StateCheck input or read data
Returns:
status of reading mouse data.

Definition at line 487 of file CommPs2.c.

EFI_STATUS PS2MouseReset ( IN EFI_ISA_IO_PROTOCOL IsaIo)

Issue command to reset keyboard.

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

Definition at line 204 of file CommPs2.c.

EFI_STATUS PS2MouseSetResolution ( IN EFI_ISA_IO_PROTOCOL IsaIo,
IN MOUSE_RE  Resolution 
)

Issue command to set mouse's resolution.

Parameters:
IsaIoPointer to instance of EFI_ISA_IO_PROTOCOL
Resolutionvalue of resolution
Returns:
Status of command issuing.

Definition at line 279 of file CommPs2.c.

EFI_STATUS PS2MouseSetSampleRate ( IN EFI_ISA_IO_PROTOCOL IsaIo,
IN MOUSE_SR  SampleRate 
)

Issue command to set mouse's sample rate

Parameters:
IsaIoPointer to instance of EFI_ISA_IO_PROTOCOL
SampleRatevalue of sample rate
Returns:
Status of command issuing.

Definition at line 250 of file CommPs2.c.

EFI_STATUS PS2MouseSetScaling ( IN EFI_ISA_IO_PROTOCOL IsaIo,
IN MOUSE_SF  Scaling 
)

Issue command to set mouse's scaling.

Parameters:
IsaIoPointer to instance of EFI_ISA_IO_PROTOCOL
Scalingvalue of scaling
Returns:
Status of command issuing.

Definition at line 308 of file CommPs2.c.

EFI_STATUS WaitInputEmpty ( IN EFI_ISA_IO_PROTOCOL IsaIo,
IN UINTN  Timeout 
)

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

Parameters:
IsaIoPointer to instance of EFI_ISA_IO_PROTOCOL
TimeoutWating time.
Return values:
EFI_TIMEOUTif input is still not empty in given time.
EFI_SUCCESSinput is empty.

Definition at line 851 of file CommPs2.c.

EFI_STATUS WaitOutputFull ( IN EFI_ISA_IO_PROTOCOL IsaIo,
IN UINTN  Timeout 
)

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

Parameters:
IsaIoPointer to instance of EFI_ISA_IO_PROTOCOL
Timeoutgiven time
Return values:
EFI_TIMEOUToutput is not full in given time
EFI_SUCCESSoutput is full in given time.

Definition at line 892 of file CommPs2.c.


Variable Documentation

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

Definition at line 20 of file CommPs2.c.

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

Definition at line 18 of file CommPs2.c.

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Defines