]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Library/DxePlatDriOverLib/PlatDriOver.h
Code Scrub for DxePlatDriOverLib.
[mirror_edk2.git] / MdeModulePkg / Library / DxePlatDriOverLib / PlatDriOver.h
index b63b2c8f1631f6f76aecaf78ff7019a851b86891..db2d6e5dab1eb00930c4c2fc6c58c131598a31af 100644 (file)
@@ -1,20 +1,14 @@
 /** @file\r
+  Internal include file for Platform Driver Override Library implementation.\r
+  \r
+  Copyright (c) 2007 - 2008, 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
+  http://opensource.org/licenses/bsd-license.php\r
 \r
-Copyright (c) 2007, 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
-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
-\r
-Module Name:\r
-\r
-    PlatDriOver.h\r
-\r
-Abstract:\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
 \r
 **/\r
 \r
@@ -46,17 +40,20 @@ Abstract:
 \r
 \r
 #define PLATFORM_OVERRIDE_ITEM_SIGNATURE      EFI_SIGNATURE_32('p','d','o','i')\r
- typedef struct _PLATFORM_OVERRIDE_ITEM{\r
+ typedef struct _PLATFORM_OVERRIDE_ITEM {\r
   UINTN                                 Signature;\r
   LIST_ENTRY                            Link;\r
   UINT32                                DriverInfoNum;\r
   EFI_DEVICE_PATH_PROTOCOL              *ControllerDevicePath;\r
-  LIST_ENTRY                            DriverInfoList;  //DRIVER_IMAGE_INFO List\r
+  ///\r
+  /// List of DRIVER_IMAGE_INFO\r
+  ///\r
+  LIST_ENTRY                            DriverInfoList;\r
   EFI_HANDLE                            LastReturnedImageHandle;\r
 } PLATFORM_OVERRIDE_ITEM;\r
 \r
 #define DRIVER_IMAGE_INFO_SIGNATURE           EFI_SIGNATURE_32('p','d','i','i')\r
-typedef struct _DRIVER_IMAGE_INFO{\r
+typedef struct _DRIVER_IMAGE_INFO {\r
   UINTN                                 Signature;\r
   LIST_ENTRY                            Link;\r
   EFI_HANDLE                            ImageHandle;\r
@@ -72,50 +69,121 @@ typedef struct _DEVICE_PATH_STACK_ITEM{
   EFI_DEVICE_PATH_PROTOCOL              *DevicePath;\r
 } DEVICE_PATH_STACK_ITEM;\r
 \r
+/**\r
+  Push a controller device path into a globle device path list\r
+\r
+  @param  DevicePath     The controller device path to push into stack\r
+\r
+  @retval EFI_SUCCESS    Device path successfully pushed into the stack.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 PushDevPathStack (\r
   IN  EFI_DEVICE_PATH_PROTOCOL    *DevicePath\r
   );\r
 \r
+/**\r
+  Pop a controller device path from a globle device path list\r
+\r
+  @param  DevicePath     The controller device path popped from stack\r
+\r
+  @retval EFI_SUCCESS    Controller device path successfully popped.\r
+  @retval EFI_NOT_FOUND  Stack is empty.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 PopDevPathStack (\r
   OUT  EFI_DEVICE_PATH_PROTOCOL    **DevicePath\r
   );\r
 \r
+/**\r
+  Check whether a controller device path is in a globle device path list\r
+\r
+  @param  DevicePath     The controller device path to check\r
+\r
+  @retval TRUE           DevicePath exists in the stack.\r
+  @retval FALSE          DevicePath does not exist in the stack.\r
+\r
+**/\r
 BOOLEAN\r
 EFIAPI\r
 CheckExistInStack (\r
   IN  EFI_DEVICE_PATH_PROTOCOL    *DevicePath\r
   );\r
 \r
+/**\r
+  According to a file GUID, check a Fv file device path is valid. If it is invalid,\r
+  try to return the valid device path.\r
+  FV address maybe changes for memory layout adjust from time to time, use this funciton\r
+  could promise the Fv file device path is right.\r
+\r
+  @param  DevicePath               On input, the FV file device path to check\r
+                                   On output, the updated valid FV file device path\r
+  @param  FileGuid                 The FV file GUID\r
+  @param  CallerImageHandle        Image handle of the caller\r
+\r
+  @retval EFI_INVALID_PARAMETER    the input DevicePath or FileGuid is invalid\r
+                                   parameter\r
+  @retval EFI_UNSUPPORTED          the input DevicePath does not contain FV file\r
+                                   GUID at all\r
+  @retval EFI_ALREADY_STARTED      the input DevicePath has pointed to FV file, it\r
+                                   is valid\r
+  @retval EFI_SUCCESS              Successfully updated the invalid DevicePath,\r
+                                   and return the updated device path in DevicePath\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 UpdateFvFileDevicePath (\r
-  IN  OUT EFI_DEVICE_PATH_PROTOCOL      ** DevicePath,\r
+  IN  OUT EFI_DEVICE_PATH_PROTOCOL      **DevicePath,\r
   IN  EFI_GUID                          *FileGuid,\r
   IN  EFI_HANDLE                        CallerImageHandle\r
   );\r
 \r
+/**\r
+  Read the EFI variable (VendorGuid/Name) and return a dynamically allocated\r
+  buffer, and the size of the buffer. If failure return NULL.\r
+\r
+  @param  Name                     String part of EFI variable name\r
+  @param  VendorGuid               GUID part of EFI variable name\r
+  @param  VariableSize             Returns the size of the EFI variable that was\r
+                                   read\r
+\r
+  @return Dynamically allocated memory that contains a copy of the EFI variable.\r
+          Caller is responsible freeing the buffer.\r
+  @retval NULL                     Variable was not read\r
+\r
+**/\r
 VOID *\r
+EFIAPI\r
 GetVariableAndSize (\r
   IN  CHAR16              *Name,\r
   IN  EFI_GUID            *VendorGuid,\r
   OUT UINTN               *VariableSize\r
   );\r
 \r
+/**\r
+  This function will create all handles associate with every device\r
+  path node. If the handle associate with one device path node can not\r
+  be created success, then still give one chance to do the dispatch,\r
+  which load the missing drivers if possible.\r
+\r
+  @param  DevicePathToConnect      The device path which will be connected, it can\r
+                                   be a multi-instance device path\r
+\r
+  @retval EFI_SUCCESS              All handles associate with every device path\r
+                                   node have been created\r
+  @retval EFI_OUT_OF_RESOURCES     There is no resource to create new handles\r
+  @retval EFI_NOT_FOUND            Create the handle associate with one device\r
+                                   path node failed\r
+\r
+**/\r
 EFI_STATUS\r
+EFIAPI\r
 ConnectDevicePath (\r
   IN EFI_DEVICE_PATH_PROTOCOL  *DevicePathToConnect\r
   );\r
 \r
-EFI_STATUS\r
-BdsConnectDeviceByPciClassType (\r
-  UINT8     ClassType,\r
-  UINT8     SubClassCode,\r
-  UINT8     PI,\r
-  BOOLEAN   Recursive\r
-  );\r
-\r
 #endif\r