Refine the comments.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8605 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
klu2 2009-06-19 06:52:51 +00:00
parent b6763e03bd
commit f713c4feab
6 changed files with 96 additions and 48 deletions

View File

@ -1,6 +1,7 @@
/**@file
Copyright (c) 2006 - 2007, Intel Corporation
/** @file
Routines related Component Name protocol.
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

View File

@ -1,4 +1,4 @@
/**@file
/** @file
Routines that access 8042 keyboard controller
Copyright (c) 2006 - 2007, Intel Corporation
@ -567,7 +567,7 @@ UINTN mWaitForValueTimeOut = KEYBOARD_WAITFORVALUE_TIMEOUT;
BOOLEAN mEnableMouseInterface;
/**
Read data register
Read data register .
@param ConsoleIn Pointer to instance of KEYBOARD_CONSOLE_IN_DEV
@ -600,7 +600,7 @@ KeyReadDataRegister (
}
/**
Write data register
Write data register.
@param ConsoleIn Pointer to instance of KEYBOARD_CONSOLE_IN_DEV
@param Data value wanted to be written
@ -631,7 +631,7 @@ KeyWriteDataRegister (
}
/**
Read status register
Read status register.
@param ConsoleIn Pointer to instance of KEYBOARD_CONSOLE_IN_DEV
@ -664,13 +664,12 @@ KeyReadStatusRegister (
}
/**
Write command register
Write command register .
@param ConsoleIn Pointer to instance of KEYBOARD_CONSOLE_IN_DEV
@param Data The value wanted to be written
**/
VOID
KeyWriteCommandRegister (
IN KEYBOARD_CONSOLE_IN_DEV *ConsoleIn,
@ -695,7 +694,7 @@ KeyWriteCommandRegister (
}
/**
Display error message
Display error message.
@param ConsoleIn Pointer to instance of KEYBOARD_CONSOLE_IN_DEV
@param ErrMsg Unicode string of error message
@ -826,8 +825,9 @@ KeyboardTimerHandler (
This function is called to see if there are enough bytes of scancode
representing a single key.
@param Count - Number of bytes to be read
@param Buf - Store the results
@param ConsoleIn Pointer to instance of KEYBOARD_CONSOLE_IN_DEV
@param Count Number of bytes to be read
@param Buf Store the results
@retval EFI_SUCCESS success to scan the keyboard code
@retval EFI_NOT_READY invalid parameter
@ -878,8 +878,9 @@ GetScancodeBufHead (
Read & remove several bytes from the scancode buffer.
This function is usually called after GetScancodeBufHead()
@param Count - Number of bytes to be read
@param Buf - Store the results
@param ConsoleIn Pointer to instance of KEYBOARD_CONSOLE_IN_DEV
@param Count Number of bytes to be read
@param Buf Store the results
@retval EFI_SUCCESS success to scan the keyboard code
@retval EFI_NOT_READY invalid parameter
@ -927,7 +928,7 @@ PopScancodeBufHead (
}
/**
Read key value
Read key value .
@param ConsoleIn - Pointer to instance of KEYBOARD_CONSOLE_IN_DEV
@param Data - Pointer to outof buffer for keeping key value
@ -962,7 +963,7 @@ KeyboardRead (
MicroSecondDelay (30);
}
if (!RegFilled) {
if (RegFilled == 0) {
return EFI_TIMEOUT;
}
@ -995,7 +996,7 @@ KeyboardWrite (
// wait for input buffer empty
//
for (TimeOut = 0; TimeOut < KEYBOARD_TIMEOUT; TimeOut += 30) {
if (!(KeyReadStatusRegister (ConsoleIn) & 0x02)) {
if ((KeyReadStatusRegister (ConsoleIn) & 0x02) == 0) {
RegEmptied = 1;
break;
}
@ -1003,7 +1004,7 @@ KeyboardWrite (
MicroSecondDelay (30);
}
if (!RegEmptied) {
if (RegEmptied == 0) {
return EFI_TIMEOUT;
}
//
@ -1015,7 +1016,7 @@ KeyboardWrite (
}
/**
Issue keyboard command
Issue keyboard command.
@param ConsoleIn Pointer to instance of KEYBOARD_CONSOLE_IN_DEV
@param Data The buff holding the command
@ -1040,7 +1041,7 @@ KeyboardCommand (
// Wait For Input Buffer Empty
//
for (TimeOut = 0; TimeOut < KEYBOARD_TIMEOUT; TimeOut += 30) {
if (!(KeyReadStatusRegister (ConsoleIn) & 0x02)) {
if ((KeyReadStatusRegister (ConsoleIn) & 0x02) == 0) {
RegEmptied = 1;
break;
}
@ -1048,7 +1049,7 @@ KeyboardCommand (
MicroSecondDelay (30);
}
if (!RegEmptied) {
if (RegEmptied == 0) {
return EFI_TIMEOUT;
}
//
@ -1061,7 +1062,7 @@ KeyboardCommand (
//
RegEmptied = 0;
for (TimeOut = 0; TimeOut < KEYBOARD_TIMEOUT; TimeOut += 30) {
if (!(KeyReadStatusRegister (ConsoleIn) & 0x02)) {
if ((KeyReadStatusRegister (ConsoleIn) & 0x02) == 0) {
RegEmptied = 1;
break;
}
@ -1069,7 +1070,7 @@ KeyboardCommand (
MicroSecondDelay (30);
}
if (!RegEmptied) {
if (RegEmptied == 0) {
return EFI_TIMEOUT;
}
@ -1519,10 +1520,10 @@ KeyGetchar (
// Save the Shift/Toggle state
//
if (ConsoleIn->Ctrl) {
ConsoleIn->KeyState.KeyShiftState |= (Extended == TRUE) ? EFI_RIGHT_CONTROL_PRESSED : EFI_LEFT_CONTROL_PRESSED;
ConsoleIn->KeyState.KeyShiftState |= (Extended) ? EFI_RIGHT_CONTROL_PRESSED : EFI_LEFT_CONTROL_PRESSED;
}
if (ConsoleIn->Alt) {
ConsoleIn->KeyState.KeyShiftState |= (Extended == TRUE) ? EFI_RIGHT_ALT_PRESSED : EFI_LEFT_ALT_PRESSED;
ConsoleIn->KeyState.KeyShiftState |= (Extended) ? EFI_RIGHT_ALT_PRESSED : EFI_LEFT_ALT_PRESSED;
}
if (ConsoleIn->LeftShift) {
ConsoleIn->KeyState.KeyShiftState |= EFI_LEFT_SHIFT_PRESSED;
@ -1556,7 +1557,7 @@ KeyGetchar (
}
/**
Perform 8042 controller and keyboard Initialization
Perform 8042 controller and keyboard Initialization.
If ExtendedVerification is TRUE, do additional test for
the keyboard interface
@ -1624,7 +1625,7 @@ InitKeyboard (
// Test the system flag in to determine whether this is the first
// time initialization
//
if ((KeyReadStatusRegister (ConsoleIn) & KEYBOARD_STATUS_REGISTER_SYSTEM_FLAG)) {
if ((KeyReadStatusRegister (ConsoleIn) & KEYBOARD_STATUS_REGISTER_SYSTEM_FLAG) != 0) {
//
// 8042 controller is already setup (by myself or by mouse driver):
// See whether mouse interface is already enabled
@ -1647,7 +1648,7 @@ InitKeyboard (
//
// Test the mouse enabling bit
//
if (CommandByte & 0x20) {
if ((CommandByte & 0x20) != 0) {
mEnableMouseInterface = FALSE;
} else {
mEnableMouseInterface = TRUE;
@ -1901,9 +1902,9 @@ Done:
}
/**
Disable the keyboard interface of the 8042 controller
Disable the keyboard interface of the 8042 controller.
@param ConsoleIn - the device instance
@param ConsoleIn The device instance
@return status of issuing disable command

View File

@ -1,8 +1,8 @@
/**@file
/** @file
Routines implements SIMPLE_TEXT_IN protocol's interfaces based on 8042 interfaces
provided by Ps2KbdCtrller.c.
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
@ -17,7 +17,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include "Ps2Keyboard.h"
/**
Check keyboard for given key value
Check keyboard for given key value.
@param This Point to instance of EFI_SIMPLE_TEXT_INPUT_PROTOCOL
@ -248,7 +248,7 @@ KeyboardEfiReset (
//
// Report the status If keyboard is locked
//
if (!(KeyReadStatusRegister (ConsoleIn) & 0x10)) {
if ((KeyReadStatusRegister (ConsoleIn) & 0x10) == 0) {
REPORT_STATUS_CODE_WITH_DEVICE_PATH (
EFI_ERROR_CODE | EFI_ERROR_MINOR,
EFI_PERIPHERAL_KEYBOARD | EFI_P_KEYBOARD_EC_LOCKED,

View File

@ -1,9 +1,9 @@
/**@file
/** @file
PS/2 Keyboard driver. Routines that interacts with callers,
conforming to EFI driver model
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
@ -19,6 +19,16 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
//
// Function prototypes
//
/**
Test controller is a keyboard Controller.
@param This Pointer of EFI_DRIVER_BINDING_PROTOCOL
@param Controller driver's controller
@param RemainingDevicePath children device path
@retval EFI_UNSUPPORTED controller is not floppy disk
@retval EFI_SUCCESS controller is floppy disk
**/
EFI_STATUS
EFIAPI
KbdControllerDriverSupported (
@ -27,6 +37,15 @@ KbdControllerDriverSupported (
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
);
/**
Create KEYBOARD_CONSOLE_IN_DEV instance on controller.
@param This Pointer of EFI_DRIVER_BINDING_PROTOCOL
@param Controller driver controller handle
@param RemainingDevicePath Children's device path
@retval whether success to create floppy control instance.
**/
EFI_STATUS
EFIAPI
KbdControllerDriverStart (
@ -35,6 +54,20 @@ KbdControllerDriverStart (
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
KbdControllerDriverStop (
@ -44,6 +77,14 @@ KbdControllerDriverStop (
IN EFI_HANDLE *ChildHandleBuffer
);
/**
Free the waiting key notify list.
@param ListHead Pointer to list head
@retval EFI_INVALID_PARAMETER ListHead is NULL
@retval EFI_SUCCESS Sucess to free NotifyList
**/
EFI_STATUS
KbdFreeNotifyList (
IN OUT LIST_ENTRY *ListHead
@ -62,7 +103,7 @@ EFI_DRIVER_BINDING_PROTOCOL gKeyboardControllerDriver = {
};
/**
Test controller is a keyboard Controller
Test controller is a keyboard Controller.
@param This Pointer of EFI_DRIVER_BINDING_PROTOCOL
@param Controller driver's controller
@ -461,7 +502,7 @@ KbdControllerDriverStop (
ConsoleIn->DevicePath
);
if (ConsoleIn->TimerEvent) {
if (ConsoleIn->TimerEvent != NULL) {
gBS->CloseEvent (ConsoleIn->TimerEvent);
ConsoleIn->TimerEvent = NULL;
}
@ -529,6 +570,9 @@ KbdControllerDriverStop (
Free the waiting key notify list.
@param ListHead Pointer to list head
@retval EFI_INVALID_PARAMETER ListHead is NULL
@retval EFI_SUCCESS Sucess to free NotifyList
**/
EFI_STATUS
KbdFreeNotifyList (

View File

@ -1,7 +1,7 @@
/**@file
/** @file
PS/2 keyboard driver header file
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
@ -12,8 +12,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#ifndef _PS2KEYBOARD_H
#define _PS2KEYBOARD_H
#ifndef _PS2KEYBOARD_H_
#define _PS2KEYBOARD_H_
#include <PiDxe.h>
#include <Framework/StatusCode.h>
@ -231,7 +231,7 @@ UpdateStatusLights (
);
/**
write key to keyboard
write key to keyboard.
@param ConsoleIn Pointer to instance of KEYBOARD_CONSOLE_IN_DEV
@param Data value wanted to be written
@ -263,7 +263,7 @@ KeyGetchar (
);
/**
Perform 8042 controller and keyboard Initialization
Perform 8042 controller and keyboard Initialization.
If ExtendedVerification is TRUE, do additional test for
the keyboard interface
@ -280,7 +280,7 @@ InitKeyboard (
);
/**
Disable the keyboard interface of the 8042 controller
Disable the keyboard interface of the 8042 controller.
@param ConsoleIn - the device instance
@ -360,7 +360,7 @@ KeyboardWaitForKey (
);
/**
Read status register
Read status register.
@param ConsoleIn Pointer to instance of KEYBOARD_CONSOLE_IN_DEV
@ -377,7 +377,7 @@ KeyReadStatusRegister (
If Keyboard receives 0xF4, it will respond with 'ACK'. If it doesn't respond, the device
should not be in system.
@param[in] BiosKeyboardPrivate Keyboard Private Data Structure
@param[in] ConsoleIn Pointer to instance of KEYBOARD_CONSOLE_IN_DEV
@retval TRUE Keyboard in System.
@retval FALSE Keyboard not in System.

View File

@ -1,5 +1,7 @@
#/** @file
# Ps2 Keyboard Driver
# Ps2 Keyboard UEFI Driver which produce gEfiSimpleTextInProtocolGuid and gEfiSimpleTextInputExProtocolGuid
# protocol.
# The keyboard type implemented follows IBM compatible PS2 protocol, with Scan Codes Set 1.
#
# This dirver directly uses IsaIo protocol service to support KeyBoard work.
# Copyright (c) 2006 - 2009, Intel Corporation.