]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatform.h
MdeModulePkg: Apply uncrustify changes
[mirror_edk2.git] / MdeModulePkg / Universal / Console / ConPlatformDxe / ConPlatform.h
index 7f8cad2304d0042d76cadf88a73881fcfaddfb3e..f63b25c465f85cffe366d96ad1b57071dfa1eb4c 100644 (file)
@@ -1,14 +1,8 @@
 /** @file\r
   Header file for Console Platfrom DXE Driver.\r
 \r
-Copyright (c) 2006 - 2008, Intel Corporation. <BR>\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
-http://opensource.org/licenses/bsd-license.php\r
-\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
 \r
@@ -20,12 +14,14 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Protocol/SimpleTextOut.h>\r
 #include <Protocol/DevicePath.h>\r
 #include <Protocol/SimpleTextIn.h>\r
+#include <Protocol/PciIo.h>\r
+#include <Protocol/UsbIo.h>\r
+#include <Protocol/GraphicsOutput.h>\r
 \r
 #include <Guid/GlobalVariable.h>\r
 #include <Guid/ConsoleInDevice.h>\r
 #include <Guid/StandardErrorDevice.h>\r
 #include <Guid/ConsoleOutDevice.h>\r
-#include <Guid/HotPlugDevice.h>\r
 \r
 #include <Library/DebugLib.h>\r
 #include <Library/UefiDriverEntryPoint.h>\r
@@ -35,26 +31,26 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Library/UefiRuntimeServicesTableLib.h>\r
 #include <Library/DevicePathLib.h>\r
 #include <Library/MemoryAllocationLib.h>\r
+#include <Library/UefiBootManagerLib.h>\r
 \r
 //\r
 // Driver Binding Externs\r
 //\r
-extern EFI_DRIVER_BINDING_PROTOCOL  gConPlatformTextInDriverBinding;\r
-extern EFI_COMPONENT_NAME_PROTOCOL  gConPlatformComponentName;\r
-extern EFI_COMPONENT_NAME2_PROTOCOL gConPlatformComponentName2;\r
-extern EFI_DRIVER_BINDING_PROTOCOL  gConPlatformTextOutDriverBinding;\r
-extern EFI_COMPONENT_NAME_PROTOCOL  gConPlatformComponentName;\r
-extern EFI_COMPONENT_NAME2_PROTOCOL gConPlatformComponentName2;\r
-\r
+extern EFI_DRIVER_BINDING_PROTOCOL   gConPlatformTextInDriverBinding;\r
+extern EFI_COMPONENT_NAME_PROTOCOL   gConPlatformComponentName;\r
+extern EFI_COMPONENT_NAME2_PROTOCOL  gConPlatformComponentName2;\r
+extern EFI_DRIVER_BINDING_PROTOCOL   gConPlatformTextOutDriverBinding;\r
+extern EFI_COMPONENT_NAME_PROTOCOL   gConPlatformComponentName;\r
+extern EFI_COMPONENT_NAME2_PROTOCOL  gConPlatformComponentName2;\r
 \r
 typedef enum {\r
-  CHECK,\r
-  APPEND,\r
-  DELETE\r
+  Check,\r
+  Append,\r
+  Delete\r
 } CONPLATFORM_VAR_OPERATION;\r
 \r
 /**\r
-  Test to see if specific protocol could be supported on the ControllerHandle. \r
+  Test to see if specific protocol could be supported on the ControllerHandle.\r
 \r
   @param  This                Protocol instance pointer.\r
   @param  ControllerHandle    Handle of device to test.\r
@@ -72,7 +68,7 @@ ConPlatformDriverBindingSupported (
   );\r
 \r
 /**\r
-  Test to see if EFI_SIMPLE_TEXT_INPUT_PROTOCOL is supported on ControllerHandle. \r
+  Test to see if EFI_SIMPLE_TEXT_INPUT_PROTOCOL is supported on ControllerHandle.\r
 \r
   @param  This                Protocol instance pointer.\r
   @param  ControllerHandle    Handle of device to test.\r
@@ -92,7 +88,7 @@ ConPlatformTextInDriverBindingSupported (
   );\r
 \r
 /**\r
-  Test to see if EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL is supported on ControllerHandle. \r
+  Test to see if EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL is supported on ControllerHandle.\r
 \r
   @param  This                Protocol instance pointer.\r
   @param  ControllerHandle    Handle of device to test.\r
@@ -117,9 +113,8 @@ ConPlatformTextOutDriverBindingSupported (
   Start this driver on ControllerHandle by opening Simple Text Input Protocol,\r
   reading Device Path, and installing Console In Devcice GUID on ControllerHandle.\r
 \r
-  If this devcie is not one hot-plug devce, append its device path into the \r
-  console environment variables ConInDev.\r
-  \r
+  Append its device path into the console environment variables ConInDev.\r
+\r
   @param  This                 Protocol instance pointer.\r
   @param  ControllerHandle     Handle of device to bind driver to\r
   @param  RemainingDevicePath  Optional parameter use to pick a specific child\r
@@ -133,21 +128,20 @@ ConPlatformTextOutDriverBindingSupported (
 EFI_STATUS\r
 EFIAPI\r
 ConPlatformTextInDriverBindingStart (\r
-  IN  EFI_DRIVER_BINDING_PROTOCOL   *This,\r
-  IN  EFI_HANDLE                    Handle,\r
-  IN  EFI_DEVICE_PATH_PROTOCOL      *RemainingDevicePath\r
+  IN  EFI_DRIVER_BINDING_PROTOCOL  *This,\r
+  IN  EFI_HANDLE                   Handle,\r
+  IN  EFI_DEVICE_PATH_PROTOCOL     *RemainingDevicePath\r
   );\r
 \r
 /**\r
-  Start this driver on the device for console output and stardard error output.\r
+  Start this driver on the device for console output and standard error output.\r
 \r
   Start this driver on ControllerHandle by opening Simple Text Output Protocol,\r
   reading Device Path, and installing Console Out Devcic GUID, Standard Error\r
   Device GUID on ControllerHandle.\r
 \r
-  If this devcie is not one hot-plug devce, append its device path into the \r
-  console environment variables ConOutDev, StdErrDev.\r
-  \r
+  Append its device path into the console environment variables ConOutDev, ErrOutDev.\r
+\r
   @param  This                 Protocol instance pointer.\r
   @param  ControllerHandle     Handle of device to bind driver to\r
   @param  RemainingDevicePath  Optional parameter use to pick a specific child\r
@@ -161,13 +155,13 @@ ConPlatformTextInDriverBindingStart (
 EFI_STATUS\r
 EFIAPI\r
 ConPlatformTextOutDriverBindingStart (\r
-  IN  EFI_DRIVER_BINDING_PROTOCOL   *This,\r
-  IN  EFI_HANDLE                    Handle,\r
-  IN  EFI_DEVICE_PATH_PROTOCOL      *RemainingDevicePath\r
+  IN  EFI_DRIVER_BINDING_PROTOCOL  *This,\r
+  IN  EFI_HANDLE                   Handle,\r
+  IN  EFI_DEVICE_PATH_PROTOCOL     *RemainingDevicePath\r
   );\r
 \r
 /**\r
-  Stop this driver on ControllerHandle by removing Console In Devcice GUID \r
+  Stop this driver on ControllerHandle by removing Console In Devcice GUID\r
   and closing the Simple Text Input protocol on ControllerHandle.\r
 \r
   @param  This              Protocol instance pointer.\r
@@ -190,7 +184,7 @@ ConPlatformTextInDriverBindingStop (
   );\r
 \r
 /**\r
-  Stop this driver on ControllerHandle by removing Console Out Devcice GUID \r
+  Stop this driver on ControllerHandle by removing Console Out Devcice GUID\r
   and closing the Simple Text Output protocol on ControllerHandle.\r
 \r
   @param  This              Protocol instance pointer.\r
@@ -234,13 +228,13 @@ ConPlatformUnInstallProtocol (
   @param  Name             String part of EFI variable name\r
 \r
   @return Dynamically allocated memory that contains a copy of the EFI variable.\r
-          Caller is repsoncible freeing the buffer. Return NULL means Variable \r
+          Caller is repsoncible freeing the buffer. Return NULL means Variable\r
           was not read.\r
 \r
 **/\r
 VOID *\r
 ConPlatformGetVariable (\r
-  IN  CHAR16              *Name\r
+  IN  CHAR16  *Name\r
   );\r
 \r
 /**\r
@@ -287,30 +281,15 @@ ConPlatformMatchDevicePaths (
 **/\r
 EFI_STATUS\r
 ConPlatformUpdateDeviceVariable (\r
-  IN  CHAR16                    *VariableName,\r
-  IN  EFI_DEVICE_PATH_PROTOCOL  *DevicePath,\r
-  IN  CONPLATFORM_VAR_OPERATION Operation\r
-  );\r
-\r
-/**\r
-  Check if the device supports hot-plug.\r
-\r
-  @param  DriverBindingHandle   Protocol instance pointer.\r
-  @param  ControllerHandle      Handle of device to check.\r
-\r
-  @retval TRUE                  The devcie is a hot-plug device\r
-  @retval FALSE                 The devcie is not a hot-plug device.\r
-\r
-**/\r
-BOOLEAN\r
-IsHotPlugDevice (\r
-  EFI_HANDLE    DriverBindingHandle,\r
-  EFI_HANDLE    ControllerHandle\r
+  IN  CHAR16                     *VariableName,\r
+  IN  EFI_DEVICE_PATH_PROTOCOL   *DevicePath,\r
+  IN  CONPLATFORM_VAR_OPERATION  Operation\r
   );\r
 \r
 //\r
 // EFI Component Name Functions\r
 //\r
+\r
 /**\r
   Retrieves a Unicode string that is the user readable name of the driver.\r
 \r
@@ -330,7 +309,7 @@ IsHotPlugDevice (
                                 languages specified in SupportedLanguages. The\r
                                 number of languages supported by a driver is up\r
                                 to the driver writer. Language is specified\r
-                                in RFC 3066 or ISO 639-2 language code format.\r
+                                in RFC 4646 or ISO 639-2 language code format.\r
   @param  DriverName[out]       A pointer to the Unicode string to return.\r
                                 This Unicode string is the name of the\r
                                 driver specified by This in the language\r
@@ -353,7 +332,6 @@ ConPlatformComponentNameGetDriverName (
   OUT CHAR16                       **DriverName\r
   );\r
 \r
-\r
 /**\r
   Retrieves a Unicode string that is the user readable name of the controller\r
   that is being managed by a driver.\r
@@ -388,7 +366,7 @@ ConPlatformComponentNameGetDriverName (
                                 languages specified in SupportedLanguages. The\r
                                 number of languages supported by a driver is up\r
                                 to the driver writer. Language is specified in\r
-                                RFC 3066 or ISO 639-2 language code format.\r
+                                RFC 4646 or ISO 639-2 language code format.\r
   @param  ControllerName[out]   A pointer to the Unicode string to return.\r
                                 This Unicode string is the name of the\r
                                 controller specified by ControllerHandle and\r
@@ -400,7 +378,7 @@ ConPlatformComponentNameGetDriverName (
                                 the language specified by Language for the\r
                                 driver specified by This was returned in\r
                                 DriverName.\r
-  @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r
+  @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.\r
   @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid\r
                                 EFI_HANDLE.\r
   @retval EFI_INVALID_PARAMETER Language is NULL.\r
@@ -415,12 +393,26 @@ ConPlatformComponentNameGetDriverName (
 EFI_STATUS\r
 EFIAPI\r
 ConPlatformComponentNameGetControllerName (\r
-  IN  EFI_COMPONENT_NAME_PROTOCOL                     *This,\r
-  IN  EFI_HANDLE                                      ControllerHandle,\r
-  IN  EFI_HANDLE                                      ChildHandle        OPTIONAL,\r
-  IN  CHAR8                                           *Language,\r
-  OUT CHAR16                                          **ControllerName\r
+  IN  EFI_COMPONENT_NAME_PROTOCOL  *This,\r
+  IN  EFI_HANDLE                   ControllerHandle,\r
+  IN  EFI_HANDLE                   ChildHandle        OPTIONAL,\r
+  IN  CHAR8                        *Language,\r
+  OUT CHAR16                       **ControllerName\r
   );\r
 \r
+/**\r
+  Update ConOutDev and ErrOutDev variables to add the device path of\r
+  GOP controller itself and the sibling controllers.\r
+\r
+  @param  DevicePath            Pointer to device's device path.\r
+\r
+  @retval TRUE                  The devcie is a GOP device.\r
+  @retval FALSE                 The devcie is not a GOP device.\r
+\r
+**/\r
+BOOLEAN\r
+ConPlatformUpdateGopCandidate (\r
+  IN  EFI_DEVICE_PATH_PROTOCOL  *DevicePath\r
+  );\r
 \r
 #endif\r