]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Disk/PartitionDxe/Partition.h
MdeModulePkg: Clean up source files
[mirror_edk2.git] / MdeModulePkg / Universal / Disk / PartitionDxe / Partition.h
index 06470f689f11f23db894cfd38d8ed5dff0ed9dd8..cd16f494f61ba5d57c8768ca14b1e365a2fb839e 100644 (file)
@@ -1,10 +1,11 @@
 /** @file\r
-  Partition driver that produces logical BlockIo devices from a physical \r
+  Partition driver that produces logical BlockIo devices from a physical\r
   BlockIo device. The logical BlockIo devices are based on the format\r
-  of the raw block devices media. Currently "El Torito CD-ROM", Legacy \r
+  of the raw block devices media. Currently "El Torito CD-ROM", UDF, Legacy\r
   MBR, and GPT partition schemes are supported.\r
 \r
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2018 Qualcomm Datacenter Technologies, Inc.\r
+Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
 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
@@ -15,8 +16,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 **/\r
 \r
-#ifndef _PARTITION_H_ \r
-#define _PARTITION_H_ \r
+#ifndef _PARTITION_H_\r
+#define _PARTITION_H_\r
 \r
 #include <Uefi.h>\r
 #include <Protocol/BlockIo.h>\r
@@ -27,6 +28,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Protocol/DriverBinding.h>\r
 #include <Protocol/DiskIo.h>\r
 #include <Protocol/DiskIo2.h>\r
+#include <Protocol/PartitionInfo.h>\r
 #include <Library/DebugLib.h>\r
 #include <Library/UefiDriverEntryPoint.h>\r
 #include <Library/BaseLib.h>\r
@@ -38,31 +40,33 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 #include <IndustryStandard/Mbr.h>\r
 #include <IndustryStandard/ElTorito.h>\r
-\r
+#include <IndustryStandard/Udf.h>\r
 \r
 //\r
 // Partition private data\r
 //\r
 #define PARTITION_PRIVATE_DATA_SIGNATURE  SIGNATURE_32 ('P', 'a', 'r', 't')\r
 typedef struct {\r
-  UINT64                    Signature;\r
-\r
-  EFI_HANDLE                Handle;\r
-  EFI_DEVICE_PATH_PROTOCOL  *DevicePath;\r
-  EFI_BLOCK_IO_PROTOCOL     BlockIo;\r
-  EFI_BLOCK_IO2_PROTOCOL    BlockIo2;\r
-  EFI_BLOCK_IO_MEDIA        Media;\r
-  EFI_BLOCK_IO_MEDIA        Media2;//For BlockIO2\r
-\r
-  EFI_DISK_IO_PROTOCOL      *DiskIo;\r
-  EFI_DISK_IO2_PROTOCOL     *DiskIo2;\r
-  EFI_BLOCK_IO_PROTOCOL     *ParentBlockIo;\r
-  EFI_BLOCK_IO2_PROTOCOL    *ParentBlockIo2;\r
-  UINT64                    Start;\r
-  UINT64                    End;\r
-  UINT32                    BlockSize;\r
-\r
-  EFI_GUID                  *EspGuid;\r
+  UINT64                       Signature;\r
+\r
+  EFI_HANDLE                   Handle;\r
+  EFI_DEVICE_PATH_PROTOCOL     *DevicePath;\r
+  EFI_BLOCK_IO_PROTOCOL        BlockIo;\r
+  EFI_BLOCK_IO2_PROTOCOL       BlockIo2;\r
+  EFI_BLOCK_IO_MEDIA           Media;\r
+  EFI_BLOCK_IO_MEDIA           Media2;//For BlockIO2\r
+  EFI_PARTITION_INFO_PROTOCOL  PartitionInfo;\r
+\r
+  EFI_DISK_IO_PROTOCOL         *DiskIo;\r
+  EFI_DISK_IO2_PROTOCOL        *DiskIo2;\r
+  EFI_BLOCK_IO_PROTOCOL        *ParentBlockIo;\r
+  EFI_BLOCK_IO2_PROTOCOL       *ParentBlockIo2;\r
+  UINT64                       Start;\r
+  UINT64                       End;\r
+  UINT32                       BlockSize;\r
+  BOOLEAN                      InStop;\r
+\r
+  EFI_GUID                     TypeGuid;\r
 \r
 } PARTITION_PRIVATE_DATA;\r
 \r
@@ -320,10 +324,11 @@ PartitionComponentNameGetControllerName (
   @param[in]  ParentBlockIo2    Parent BlockIo2 interface.\r
   @param[in]  ParentDevicePath  Parent Device Path.\r
   @param[in]  DevicePathNode    Child Device Path node.\r
+  @param[in]  PartitionInfo     Child Partition Information interface.\r
   @param[in]  Start             Start Block.\r
   @param[in]  End               End Block.\r
   @param[in]  BlockSize         Child block size.\r
-  @param[in]  InstallEspGuid    Flag to install EFI System Partition GUID on handle.\r
+  @param[in]  TypeGuid          Parition Type Guid.\r
 \r
   @retval EFI_SUCCESS       A child handle was added.\r
   @retval other             A child handle was not added.\r
@@ -339,10 +344,25 @@ PartitionInstallChildHandle (
   IN  EFI_BLOCK_IO2_PROTOCOL       *ParentBlockIo2,\r
   IN  EFI_DEVICE_PATH_PROTOCOL     *ParentDevicePath,\r
   IN  EFI_DEVICE_PATH_PROTOCOL     *DevicePathNode,\r
+  IN  EFI_PARTITION_INFO_PROTOCOL  *PartitionInfo,\r
   IN  EFI_LBA                      Start,\r
   IN  EFI_LBA                      End,\r
   IN  UINT32                       BlockSize,\r
-  IN  BOOLEAN                      InstallEspGuid\r
+  IN  EFI_GUID                     *TypeGuid\r
+  );\r
+\r
+/**\r
+  Test to see if there is any child on ControllerHandle.\r
+\r
+  @param[in]  ControllerHandle    Handle of device to test.\r
+\r
+  @retval TRUE                    There are children on the ControllerHandle.\r
+  @retval FALSE                   No child is on the ControllerHandle.\r
+\r
+**/\r
+BOOLEAN\r
+HasChildren (\r
+  IN EFI_HANDLE           ControllerHandle\r
   );\r
 \r
 /**\r
@@ -411,7 +431,7 @@ PartitionInstallElToritoChildHandles (
   @param[in]  BlockIo           Parent BlockIo interface.\r
   @param[in]  BlockIo2          Parent BlockIo2 interface.\r
   @param[in]  DevicePath        Parent Device Path.\r
-   \r
+\r
   @retval EFI_SUCCESS       A child handle was added.\r
   @retval EFI_MEDIA_CHANGED Media change was detected.\r
   @retval Others            MBR partition was not found.\r
@@ -428,6 +448,34 @@ PartitionInstallMbrChildHandles (
   IN  EFI_DEVICE_PATH_PROTOCOL     *DevicePath\r
   );\r
 \r
+/**\r
+  Install child handles if the Handle supports UDF/ECMA-167 volume format.\r
+\r
+  @param[in]  This        Calling context.\r
+  @param[in]  Handle      Parent Handle.\r
+  @param[in]  DiskIo      Parent DiskIo interface.\r
+  @param[in]  DiskIo2     Parent DiskIo2 interface.\r
+  @param[in]  BlockIo     Parent BlockIo interface.\r
+  @param[in]  BlockIo2    Parent BlockIo2 interface.\r
+  @param[in]  DevicePath  Parent Device Path\r
+\r
+\r
+  @retval EFI_SUCCESS         Child handle(s) was added.\r
+  @retval EFI_MEDIA_CHANGED   Media changed Detected.\r
+  @retval other               no child handle was added.\r
+\r
+**/\r
+EFI_STATUS\r
+PartitionInstallUdfChildHandles (\r
+  IN  EFI_DRIVER_BINDING_PROTOCOL  *This,\r
+  IN  EFI_HANDLE                   Handle,\r
+  IN  EFI_DISK_IO_PROTOCOL         *DiskIo,\r
+  IN  EFI_DISK_IO2_PROTOCOL        *DiskIo2,\r
+  IN  EFI_BLOCK_IO_PROTOCOL        *BlockIo,\r
+  IN  EFI_BLOCK_IO2_PROTOCOL       *BlockIo2,\r
+  IN  EFI_DEVICE_PATH_PROTOCOL     *DevicePath\r
+  );\r
+\r
 typedef\r
 EFI_STATUS\r
 (*PARTITION_DETECT_ROUTINE) (\r