]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFrameworkModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2Keyboard.c
Fix the potential issue that using integrate as BOOLEAN value in judgment.
[mirror_edk2.git] / IntelFrameworkModulePkg / Bus / Isa / Ps2KeyboardDxe / Ps2Keyboard.c
index 7c7c0bf27a1bf6c1f38f253fa58167732c8ad814..098d29f6e0597c3fa1995aeab6996e6f2ee2098d 100644 (file)
@@ -1,9 +1,9 @@
-/**@file\r
+/** @file\r
 \r
   PS/2 Keyboard driver. Routines that interacts with callers,\r
   conforming to EFI driver model\r
 \r
-Copyright (c) 2006 - 2007, Intel Corporation\r
+Copyright (c) 2006 - 2009, Intel Corporation\r
 All rights reserved. This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -19,6 +19,16 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 //\r
 // Function prototypes\r
 //\r
+/**\r
+  Test controller is a keyboard Controller.\r
+  \r
+  @param This                 Pointer of EFI_DRIVER_BINDING_PROTOCOL\r
+  @param Controller           driver's controller\r
+  @param RemainingDevicePath  children device path\r
+  \r
+  @retval EFI_UNSUPPORTED controller is not floppy disk\r
+  @retval EFI_SUCCESS     controller is floppy disk\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 KbdControllerDriverSupported (\r
@@ -27,6 +37,15 @@ KbdControllerDriverSupported (
   IN EFI_DEVICE_PATH_PROTOCOL       *RemainingDevicePath\r
   );\r
 \r
+/**\r
+  Create KEYBOARD_CONSOLE_IN_DEV instance on controller.\r
+  \r
+  @param This         Pointer of EFI_DRIVER_BINDING_PROTOCOL\r
+  @param Controller   driver controller handle\r
+  @param RemainingDevicePath Children's device path\r
+  \r
+  @retval whether success to create floppy control instance.\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 KbdControllerDriverStart (\r
@@ -35,6 +54,20 @@ KbdControllerDriverStart (
   IN EFI_DEVICE_PATH_PROTOCOL       *RemainingDevicePath\r
   );\r
 \r
+/**\r
+  Stop this driver on ControllerHandle. Support stoping any child handles\r
+  created by this driver.\r
+\r
+  @param  This              Protocol instance pointer.\r
+  @param  ControllerHandle  Handle of device to stop driver on\r
+  @param  NumberOfChildren  Number of Handles in ChildHandleBuffer. If number of\r
+                            children is zero stop the entire bus driver.\r
+  @param  ChildHandleBuffer List of Child Handles to Stop.\r
+\r
+  @retval EFI_SUCCESS       This driver is removed ControllerHandle\r
+  @retval other             This driver was not removed from this device\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 KbdControllerDriverStop (\r
@@ -44,6 +77,14 @@ KbdControllerDriverStop (
   IN  EFI_HANDLE                     *ChildHandleBuffer\r
   );\r
 \r
+/**\r
+  Free the waiting key notify list.\r
+  \r
+  @param ListHead  Pointer to list head\r
+  \r
+  @retval EFI_INVALID_PARAMETER  ListHead is NULL\r
+  @retval EFI_SUCCESS            Sucess to free NotifyList\r
+**/\r
 EFI_STATUS\r
 KbdFreeNotifyList (\r
   IN OUT LIST_ENTRY           *ListHead\r
@@ -62,7 +103,7 @@ EFI_DRIVER_BINDING_PROTOCOL gKeyboardControllerDriver = {
 };\r
 \r
 /**\r
-  Test controller is a keyboard Controller\r
+  Test controller is a keyboard Controller.\r
   \r
   @param This                 Pointer of EFI_DRIVER_BINDING_PROTOCOL\r
   @param Controller           driver's controller\r
@@ -461,7 +502,7 @@ KbdControllerDriverStop (
     ConsoleIn->DevicePath\r
     );\r
 \r
-  if (ConsoleIn->TimerEvent) {\r
+  if (ConsoleIn->TimerEvent != NULL) {\r
     gBS->CloseEvent (ConsoleIn->TimerEvent);\r
     ConsoleIn->TimerEvent = NULL;\r
   }\r
@@ -510,7 +551,7 @@ KbdControllerDriverStop (
   //\r
   // Free other resources\r
   //\r
-  if ((ConsoleIn->ConIn).WaitForKey) {\r
+  if ((ConsoleIn->ConIn).WaitForKey != NULL) {\r
     gBS->CloseEvent ((ConsoleIn->ConIn).WaitForKey);\r
     (ConsoleIn->ConIn).WaitForKey = NULL;\r
   }\r
@@ -529,6 +570,9 @@ KbdControllerDriverStop (
   Free the waiting key notify list.\r
   \r
   @param ListHead  Pointer to list head\r
+  \r
+  @retval EFI_INVALID_PARAMETER  ListHead is NULL\r
+  @retval EFI_SUCCESS            Sucess to free NotifyList\r
 **/\r
 EFI_STATUS\r
 KbdFreeNotifyList (\r
@@ -555,7 +599,7 @@ KbdFreeNotifyList (
 }\r
 \r
 /**\r
-  The user Entry Point for module Ps2Keyboard. The user code starts with this function.\r
+  The module Entry Point for module Ps2Keyboard. \r
 \r
   @param[in] ImageHandle    The firmware allocated handle for the EFI image.  \r
   @param[in] SystemTable    A pointer to the EFI System Table.\r