summaryrefslogtreecommitdiff
path: root/IntelFrameworkModulePkg/Bus/Isa/Ps2MouseDxe
diff options
context:
space:
mode:
authoreric_tian <eric_tian@6f19259b-4bc3-4df7-8a09-765794883524>2009-06-10 03:09:31 +0000
committereric_tian <eric_tian@6f19259b-4bc3-4df7-8a09-765794883524>2009-06-10 03:09:31 +0000
commit172870eff578c1434b3a4d4667f3eece237ae878 (patch)
tree94f09cb4896a9e076bb0d2daa628996387d6341e /IntelFrameworkModulePkg/Bus/Isa/Ps2MouseDxe
parentc72216a6274deaaee46ebf58e3ae84f119a94b7f (diff)
downloadedk2-platforms-172870eff578c1434b3a4d4667f3eece237ae878.tar.xz
fix the ecc issue.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8502 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'IntelFrameworkModulePkg/Bus/Isa/Ps2MouseDxe')
-rw-r--r--IntelFrameworkModulePkg/Bus/Isa/Ps2MouseDxe/CommPs2.c26
-rw-r--r--IntelFrameworkModulePkg/Bus/Isa/Ps2MouseDxe/CommPs2.h7
-rw-r--r--IntelFrameworkModulePkg/Bus/Isa/Ps2MouseDxe/ComponentName.c5
-rw-r--r--IntelFrameworkModulePkg/Bus/Isa/Ps2MouseDxe/Ps2Mouse.c15
-rw-r--r--IntelFrameworkModulePkg/Bus/Isa/Ps2MouseDxe/Ps2Mouse.h107
5 files changed, 128 insertions, 32 deletions
diff --git a/IntelFrameworkModulePkg/Bus/Isa/Ps2MouseDxe/CommPs2.c b/IntelFrameworkModulePkg/Bus/Isa/Ps2MouseDxe/CommPs2.c
index ede1d5664c..c396ab5813 100644
--- a/IntelFrameworkModulePkg/Bus/Isa/Ps2MouseDxe/CommPs2.c
+++ b/IntelFrameworkModulePkg/Bus/Isa/Ps2MouseDxe/CommPs2.c
@@ -1,5 +1,5 @@
-/**@file
- PS2 Mouse Communication Interface
+/** @file
+ PS2 Mouse Communication Interface.
Copyright (c) 2006 - 2007, Intel Corporation
All rights reserved. This program and the accompanying materials
@@ -588,7 +588,7 @@ Out8042Data (
)
{
EFI_STATUS Status;
- UINT8 temp;
+ UINT8 Temp;
//
// Wait keyboard controller input buffer empty
//
@@ -597,8 +597,8 @@ Out8042Data (
return Status;
}
- temp = Data;
- IsaIo->Io.Write (IsaIo, EfiIsaIoWidthUint8, KBC_DATA_PORT, 1, &temp);
+ Temp = Data;
+ IsaIo->Io.Write (IsaIo, EfiIsaIoWidthUint8, KBC_DATA_PORT, 1, &Temp);
Status = WaitInputEmpty (IsaIo, TIMEOUT);
if (EFI_ERROR (Status)) {
@@ -624,23 +624,23 @@ In8042Data (
)
{
UINTN Delay;
- UINT8 temp;
+ UINT8 Temp;
Delay = TIMEOUT / 50;
do {
- IsaIo->Io.Read (IsaIo, EfiIsaIoWidthUint8, KBC_CMD_STS_PORT, 1, &temp);
+ IsaIo->Io.Read (IsaIo, EfiIsaIoWidthUint8, KBC_CMD_STS_PORT, 1, &Temp);
//
// Check keyboard controller status bit 0(output buffer status)
//
- if ((temp & KBC_OUTB) == KBC_OUTB) {
+ if ((Temp & KBC_OUTB) == KBC_OUTB) {
break;
}
gBS->Stall (50);
Delay--;
- } while (Delay);
+ } while (Delay != 0);
if (Delay == 0) {
return EFI_TIMEOUT;
@@ -737,7 +737,7 @@ Out8042AuxCommand (
I/O work flow of outing 8042 Aux data.
@param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL
- @param Command Aux I/O command
+ @param Data Buffer holding return value
@retval EFI_SUCCESS Success to excute I/O work flow
@retval EFI_TIMEOUT Keyboard controller time out.
@@ -811,7 +811,7 @@ In8042AuxData (
/**
- Check keyboard controller status, if it is output buffer full and for auxiliary device
+ Check keyboard controller status, if it is output buffer full and for auxiliary device.
@param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL
@@ -869,7 +869,7 @@ WaitInputEmpty (
gBS->Stall (50);
Delay--;
- } while (Delay);
+ } while (Delay != 0);
if (Delay == 0) {
return EFI_TIMEOUT;
@@ -928,7 +928,7 @@ Returns:
gBS->Stall (50);
Delay--;
- } while (Delay);
+ } while (Delay != 0);
if (Delay == 0) {
return EFI_TIMEOUT;
diff --git a/IntelFrameworkModulePkg/Bus/Isa/Ps2MouseDxe/CommPs2.h b/IntelFrameworkModulePkg/Bus/Isa/Ps2MouseDxe/CommPs2.h
index c92a1c57ed..8e2b58d440 100644
--- a/IntelFrameworkModulePkg/Bus/Isa/Ps2MouseDxe/CommPs2.h
+++ b/IntelFrameworkModulePkg/Bus/Isa/Ps2MouseDxe/CommPs2.h
@@ -1,7 +1,6 @@
-/**@file
+/** @file
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
@@ -360,7 +359,7 @@ In8042AuxData (
I/O work flow of outing 8042 Aux data.
@param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL
- @param Command Aux I/O command
+ @param Data Buffer holding return value
@retval EFI_SUCCESS Success to excute I/O work flow
@retval EFI_TIMEOUT Keyboard controller time out.
@@ -372,7 +371,7 @@ Out8042AuxData (
);
/**
- Check keyboard controller status, if it is output buffer full and for auxiliary device
+ Check keyboard controller status, if it is output buffer full and for auxiliary device.
@param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL
diff --git a/IntelFrameworkModulePkg/Bus/Isa/Ps2MouseDxe/ComponentName.c b/IntelFrameworkModulePkg/Bus/Isa/Ps2MouseDxe/ComponentName.c
index 9adf41fb24..e14e2ba434 100644
--- a/IntelFrameworkModulePkg/Bus/Isa/Ps2MouseDxe/ComponentName.c
+++ b/IntelFrameworkModulePkg/Bus/Isa/Ps2MouseDxe/ComponentName.c
@@ -1,6 +1,7 @@
-/**@file
+/** @file
+ UEFI Component Name(2) protocol implementation for Ps2MouseDxe driver.
-Copyright (c) 2006 - 2007, Intel Corporation
+Copyright (c) 2006 - 2009, 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
diff --git a/IntelFrameworkModulePkg/Bus/Isa/Ps2MouseDxe/Ps2Mouse.c b/IntelFrameworkModulePkg/Bus/Isa/Ps2MouseDxe/Ps2Mouse.c
index 084c3244ae..b0dc3098bd 100644
--- a/IntelFrameworkModulePkg/Bus/Isa/Ps2MouseDxe/Ps2Mouse.c
+++ b/IntelFrameworkModulePkg/Bus/Isa/Ps2MouseDxe/Ps2Mouse.c
@@ -1,4 +1,4 @@
-/**@file
+/** @file
PS/2 Mouse driver. Routines that interacts with callers,
conforming to EFI driver model
@@ -618,10 +618,10 @@ Exit:
/**
Check whether there is Ps/2 mouse device in system
- @param PS2_MOUSE_DEV - Mouse Private Data Structure
+ @param MouseDev - Mouse Private Data Structure
- @retval TRUE - Keyboard in System.
- @retval FALSE - Keyboard not in System.
+ @retval TRUE - Keyboard in System.
+ @retval FALSE - Keyboard not in System.
**/
BOOLEAN
@@ -687,22 +687,19 @@ MouseGetState (
/**
- Event notification function for SIMPLE_POINTER.WaitForInput event
- Signal the event if there is input from mouse
+ Event notification function for SIMPLE_POINTER.WaitForInput event.
+ Signal the event if there is input from mouse.
@param Event event object
@param Context event context
**/
-
VOID
EFIAPI
MouseWaitForInput (
IN EFI_EVENT Event,
IN VOID *Context
)
-// GC_TODO: Event - add argument and description to function comment
-// GC_TODO: Context - add argument and description to function comment
{
PS2_MOUSE_DEV *MouseDev;
diff --git a/IntelFrameworkModulePkg/Bus/Isa/Ps2MouseDxe/Ps2Mouse.h b/IntelFrameworkModulePkg/Bus/Isa/Ps2MouseDxe/Ps2Mouse.h
index 3ed2581888..ae6720a5c9 100644
--- a/IntelFrameworkModulePkg/Bus/Isa/Ps2MouseDxe/Ps2Mouse.h
+++ b/IntelFrameworkModulePkg/Bus/Isa/Ps2MouseDxe/Ps2Mouse.h
@@ -1,5 +1,5 @@
-/**@file
- PS/2 Mouse driver header file
+/** @file
+ PS/2 Mouse driver header file.
Copyright (c) 2006 - 2007, Intel Corporation
All rights reserved. This program and the accompanying materials
@@ -12,8 +12,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
-#ifndef _PS2MOUSE_H
-#define _PS2MOUSE_H
+#ifndef _PS2MOUSE_H_
+#define _PS2MOUSE_H_
#include <PiDxe.h>
#include <Framework/StatusCode.h>
@@ -105,6 +105,20 @@ typedef struct {
//
// Function prototypes
//
+/**
+ Test to see if this driver supports ControllerHandle. Any ControllerHandle
+ than contains a IsaIo protocol can be supported.
+
+ @param This Protocol instance pointer.
+ @param ControllerHandle Handle of device to test
+ @param RemainingDevicePath Optional parameter use to pick a specific child
+ device to start.
+
+ @retval EFI_SUCCESS This driver supports this device
+ @retval EFI_ALREADY_STARTED This driver is already running on this device
+ @retval other This driver does not support this device
+
+**/
EFI_STATUS
EFIAPI
PS2MouseDriverSupported (
@@ -113,6 +127,21 @@ PS2MouseDriverSupported (
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
+ finnally.
+
+ @param This Protocol instance pointer.
+ @param ControllerHandle Handle of device to bind driver to
+ @param RemainingDevicePath Optional parameter use to pick a specific child
+ device to start.
+
+ @retval EFI_SUCCESS This driver is added to ControllerHandle
+ @retval EFI_ALREADY_STARTED This driver is already running on ControllerHandle
+ @retval other This driver does not support this device
+
+**/
EFI_STATUS
EFIAPI
PS2MouseDriverStart (
@@ -121,6 +150,20 @@ PS2MouseDriverStart (
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
);
+/**
+ Stop this driver on ControllerHandle. Support stoping any child handles
+ created by this driver.
+
+ @param This Protocol instance pointer.
+ @param ControllerHandle Handle of device to stop driver on
+ @param NumberOfChildren Number of Handles in ChildHandleBuffer. If number of
+ children is zero stop the entire bus driver.
+ @param ChildHandleBuffer List of Child Handles to Stop.
+
+ @retval EFI_SUCCESS This driver is removed ControllerHandle
+ @retval other This driver was not removed from this device
+
+**/
EFI_STATUS
EFIAPI
PS2MouseDriverStop (
@@ -259,7 +302,17 @@ Ps2MouseComponentNameGetControllerName (
OUT CHAR16 **ControllerName
);
+/**
+ Reset the Mouse and do BAT test for it, if ExtendedVerification isTRUE and there is a mouse device connectted to system
+
+ @param This - Pointer of simple pointer Protocol.
+ @param ExtendedVerification - Whether configure mouse parameters. True: do; FALSE: skip.
+
+ @retval EFI_SUCCESS - The command byte is written successfully.
+ @retval EFI_DEVICE_ERROR - Errors occurred during reseting keyboard.
+
+**/
EFI_STATUS
EFIAPI
MouseReset (
@@ -267,6 +320,16 @@ MouseReset (
IN BOOLEAN ExtendedVerification
);
+/**
+ Get and Clear mouse status.
+
+ @param This - Pointer of simple pointer Protocol.
+ @param State - Output buffer holding status.
+
+ @retval EFI_INVALID_PARAMETER Output buffer is invalid.
+ @retval EFI_NOT_READY Mouse is not changed status yet.
+ @retval EFI_SUCCESS Mouse status is changed and get successful.
+**/
EFI_STATUS
EFIAPI
MouseGetState (
@@ -274,6 +337,15 @@ MouseGetState (
IN OUT EFI_SIMPLE_POINTER_STATE *State
);
+/**
+
+ Event notification function for SIMPLE_POINTER.WaitForInput event.
+ Signal the event if there is input from mouse.
+
+ @param Event event object
+ @param Context event context
+
+**/
VOID
EFIAPI
MouseWaitForInput (
@@ -281,6 +353,14 @@ MouseWaitForInput (
IN VOID *Context
);
+/**
+ Event notification function for TimerEvent event
+ If mouse device is connected to system, try to get the mouse packet data
+
+ @param Event - TimerEvent in PS2_MOUSE_DEV
+ @param Context - Pointer to PS2_MOUSE_DEV structure
+
+**/
VOID
EFIAPI
PollMouse (
@@ -288,11 +368,30 @@ PollMouse (
IN VOID *Context
);
+/**
+ I/O work flow of in 8042 data.
+
+ @param IsaIo Pointer to instance of EFI_ISA_IO_PROTOCOL
+ @param Data Data value
+
+ @retval EFI_SUCCESS Success to excute I/O work flow
+ @retval EFI_TIMEOUT Keyboard controller time out.
+**/
EFI_STATUS
In8042Data (
IN EFI_ISA_IO_PROTOCOL *IsaIo,
IN OUT UINT8 *Data
);
+
+/**
+ Check whether there is Ps/2 mouse device in system
+
+ @param MouseDev - Mouse Private Data Structure
+
+ @retval TRUE - Keyboard in System.
+ @retval FALSE - Keyboard not in System.
+
+**/
BOOLEAN
CheckMouseConnect (
IN PS2_MOUSE_DEV *MouseDev