]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c
MdeModulePkg/PciBus: Correct typos
[mirror_edk2.git] / MdeModulePkg / Bus / Pci / PciBusDxe / PciDeviceSupport.c
index f7039da99210b0252b7b15928b805d3db9e812a3..764845252faa8ec609899a3a86f4df8d88e590eb 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
-  Supporting functions implementaion for PCI devices management.\r
+  Supporting functions implementation for PCI devices management.\r
 \r
-Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>\r
 (C) Copyright 2018 Hewlett Packard Enterprise Development LP<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
@@ -66,7 +66,7 @@ InsertPciDevice (
 }\r
 \r
 /**\r
-  Destroy root bridge and remove it from deivce tree.\r
+  Destroy root bridge and remove it from device tree.\r
 \r
   @param RootBridge     The bridge want to be removed.\r
 \r
@@ -86,7 +86,7 @@ DestroyRootBridge (
 \r
   All direct or indirect allocated resource for this node will be freed.\r
 \r
-  @param PciIoDevice  A pointer to the PCI_IO_DEVICE to be destoried.\r
+  @param PciIoDevice  A pointer to the PCI_IO_DEVICE to be destroyed.\r
 \r
 **/\r
 VOID\r
@@ -155,7 +155,7 @@ DestroyPciDeviceTree (
 \r
   @param  Controller    Root bridge handle.\r
 \r
-  @retval EFI_SUCCESS   Destory all devcie nodes successfully.\r
+  @retval EFI_SUCCESS   Destroy all device nodes successfully.\r
   @retval EFI_NOT_FOUND Cannot find any PCI device under specified\r
                         root bridge.\r
 \r
@@ -259,7 +259,7 @@ RegisterPciDevice (
                                        );\r
       if (!EFI_ERROR (Status)) {\r
         PciIoDevice->EmbeddedRom    = FALSE;\r
-        PciIoDevice->RomSize        = PlatformOpRomSize;\r
+        PciIoDevice->RomSize        = (UINT32) PlatformOpRomSize;\r
         PciIoDevice->PciIo.RomSize  = PlatformOpRomSize;\r
         PciIoDevice->PciIo.RomImage = PlatformOpRomBuffer;\r
         //\r
@@ -285,7 +285,7 @@ RegisterPciDevice (
                                        );\r
       if (!EFI_ERROR (Status)) {\r
         PciIoDevice->EmbeddedRom    = FALSE;\r
-        PciIoDevice->RomSize        = PlatformOpRomSize;\r
+        PciIoDevice->RomSize        = (UINT32) PlatformOpRomSize;\r
         PciIoDevice->PciIo.RomSize  = PlatformOpRomSize;\r
         PciIoDevice->PciIo.RomImage = PlatformOpRomBuffer;\r
         //\r
@@ -824,7 +824,7 @@ StartPciDevices (
 /**\r
   Create root bridge device.\r
 \r
-  @param RootBridgeHandle    Specified root bridge hanle.\r
+  @param RootBridgeHandle    Specified root bridge handle.\r
 \r
   @return The crated root bridge device instance, NULL means no\r
           root bridge device instance created.\r
@@ -937,9 +937,9 @@ GetRootBridgeByHandle (
 }\r
 \r
 /**\r
-  Judege whether Pci device existed.\r
+  Judge whether Pci device existed.\r
 \r
-  @param Bridge       Parent bridege instance.\r
+  @param Bridge       Parent bridge instance.\r
   @param PciIoDevice  Device instance.\r
 \r
   @retval TRUE        Pci device existed.\r
@@ -979,33 +979,33 @@ PciDeviceExisted (
 }\r
 \r
 /**\r
-  Get the active VGA device on the same segment.\r
+  Get the active VGA device on the specified Host Bridge.\r
 \r
-  @param VgaDevice    PCI IO instance for the VGA device.\r
+  @param HostBridgeHandle    Host Bridge handle.\r
 \r
-  @return The active VGA device on the same segment.\r
+  @return The active VGA device on the specified Host Bridge.\r
 \r
 **/\r
 PCI_IO_DEVICE *\r
-ActiveVGADeviceOnTheSameSegment (\r
-  IN PCI_IO_DEVICE        *VgaDevice\r
+LocateVgaDeviceOnHostBridge (\r
+  IN EFI_HANDLE           HostBridgeHandle\r
   )\r
 {\r
   LIST_ENTRY      *CurrentLink;\r
-  PCI_IO_DEVICE   *Temp;\r
+  PCI_IO_DEVICE   *PciIoDevice;\r
 \r
   CurrentLink = mPciDevicePool.ForwardLink;\r
 \r
   while (CurrentLink != NULL && CurrentLink != &mPciDevicePool) {\r
 \r
-    Temp = PCI_IO_DEVICE_FROM_LINK (CurrentLink);\r
+    PciIoDevice = PCI_IO_DEVICE_FROM_LINK (CurrentLink);\r
 \r
-    if (Temp->PciRootBridgeIo->SegmentNumber == VgaDevice->PciRootBridgeIo->SegmentNumber) {\r
+    if (PciIoDevice->PciRootBridgeIo->ParentHandle== HostBridgeHandle) {\r
 \r
-      Temp = ActiveVGADeviceOnTheRootBridge (Temp);\r
+      PciIoDevice = LocateVgaDevice (PciIoDevice);\r
 \r
-      if (Temp != NULL) {\r
-        return Temp;\r
+      if (PciIoDevice != NULL) {\r
+        return PciIoDevice;\r
       }\r
     }\r
 \r
@@ -1016,41 +1016,41 @@ ActiveVGADeviceOnTheSameSegment (
 }\r
 \r
 /**\r
-  Get the active VGA device on the root bridge.\r
+  Locate the active VGA device under the bridge.\r
 \r
-  @param RootBridge  PCI IO instance for the root bridge.\r
+  @param Bridge  PCI IO instance for the bridge.\r
 \r
   @return The active VGA device.\r
 \r
 **/\r
 PCI_IO_DEVICE *\r
-ActiveVGADeviceOnTheRootBridge (\r
-  IN PCI_IO_DEVICE        *RootBridge\r
+LocateVgaDevice (\r
+  IN PCI_IO_DEVICE        *Bridge\r
   )\r
 {\r
   LIST_ENTRY      *CurrentLink;\r
-  PCI_IO_DEVICE   *Temp;\r
+  PCI_IO_DEVICE   *PciIoDevice;\r
 \r
-  CurrentLink = RootBridge->ChildList.ForwardLink;\r
+  CurrentLink = Bridge->ChildList.ForwardLink;\r
 \r
-  while (CurrentLink != NULL && CurrentLink != &RootBridge->ChildList) {\r
+  while (CurrentLink != NULL && CurrentLink != &Bridge->ChildList) {\r
 \r
-    Temp = PCI_IO_DEVICE_FROM_LINK (CurrentLink);\r
+    PciIoDevice = PCI_IO_DEVICE_FROM_LINK (CurrentLink);\r
 \r
-    if (IS_PCI_VGA(&Temp->Pci) &&\r
-        (Temp->Attributes &\r
+    if (IS_PCI_VGA(&PciIoDevice->Pci) &&\r
+        (PciIoDevice->Attributes &\r
          (EFI_PCI_IO_ATTRIBUTE_VGA_MEMORY |\r
           EFI_PCI_IO_ATTRIBUTE_VGA_IO     |\r
           EFI_PCI_IO_ATTRIBUTE_VGA_IO_16)) != 0) {\r
-      return Temp;\r
+      return PciIoDevice;\r
     }\r
 \r
-    if (IS_PCI_BRIDGE (&Temp->Pci)) {\r
+    if (IS_PCI_BRIDGE (&PciIoDevice->Pci)) {\r
 \r
-      Temp = ActiveVGADeviceOnTheRootBridge (Temp);\r
+      PciIoDevice = LocateVgaDevice (PciIoDevice);\r
 \r
-      if (Temp != NULL) {\r
-        return Temp;\r
+      if (PciIoDevice != NULL) {\r
+        return PciIoDevice;\r
       }\r
     }\r
 \r
@@ -1060,6 +1060,3 @@ ActiveVGADeviceOnTheRootBridge (
   return NULL;\r
 }\r
 \r
-\r
-\r
-\r