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