]> git.proxmox.com Git - mirror_edk2.git/blobdiff - DuetPkg/PciBusNoEnumerationDxe/PciCommand.c
Update the copyright notice format
[mirror_edk2.git] / DuetPkg / PciBusNoEnumerationDxe / PciCommand.c
index 8614ee212e21e52ada3cad07ccba89d0c0836200..203bed3e59f9c429db6a90ce045cd8e426a15dd8 100644 (file)
@@ -1,7 +1,7 @@
 /*++\r
 \r
-Copyright (c) 2005 - 2006, Intel Corporation                                                         \r
-All rights reserved. This program and the accompanying materials                          \r
+Copyright (c) 2005 - 2006, 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
 http://opensource.org/licenses/bsd-license.php                                            \r
@@ -21,7 +21,7 @@ Revision History
 \r
 --*/\r
 \r
-#include "Pcibus.h"\r
+#include "PciBus.h"\r
 \r
 \r
 EFI_STATUS \r
@@ -121,7 +121,7 @@ Returns:
           &OldCommand\r
           );\r
 \r
-  OldCommand |= Command;\r
+  OldCommand = (UINT16) (OldCommand | Command);\r
 \r
   return PciIo->Pci.Write (\r
               PciIo, \r
@@ -165,7 +165,7 @@ Returns:
           &OldCommand\r
           );\r
 \r
-  OldCommand &= ~(Command);\r
+  OldCommand = (UINT16) (OldCommand & ~(Command));\r
 \r
   return PciIo->Pci.Write (\r
             PciIo, \r
@@ -244,7 +244,7 @@ Returns:
           &OldCommand\r
           );\r
 \r
-  OldCommand |= Command;\r
+  OldCommand = (UINT16) (OldCommand | Command);\r
 \r
   return PciIo->Pci.Write (\r
               PciIo, \r
@@ -287,7 +287,7 @@ Returns:
           &OldCommand\r
           );\r
 \r
-  OldCommand &= ~(Command);\r
+  OldCommand = (UINT16) (OldCommand & ~(Command));\r
 \r
   return PciIo->Pci.Write (\r
               PciIo, \r
@@ -392,7 +392,6 @@ Returns:
   UINT8   CapabilityPtr;\r
   UINT16  CapabilityEntry;\r
   UINT8   CapabilityID;\r
-  UINT32  Temp;\r
 \r
   //\r
   // To check the capability of this device supports\r
@@ -419,25 +418,15 @@ Returns:
 \r
       PciIoDevice->PciIo.Pci.Read (\r
                                &PciIoDevice->PciIo,\r
-                               EfiPciIoWidthUint32,\r
-                               EFI_PCI_CAPABILITY_PTR,\r
+                               EfiPciIoWidthUint8,\r
+                               PCI_CAPBILITY_POINTER_OFFSET,\r
                                1,\r
-                               &Temp\r
+                               &CapabilityPtr\r
                                );\r
-      //\r
-      // Do not get byte read directly, because some PCI card will return 0xFF\r
-      // when perform PCI-Express byte read, while return correct 0x00 \r
-      // when perform PCI-Express dword read, or PCI dword read.\r
-      //\r
-      CapabilityPtr = (UINT8)Temp;\r
     }\r
   }\r
 \r
-  while (CapabilityPtr > 0x3F) {\r
-    //\r
-    // Mask it to DWORD alignment per PCI spec\r
-    //\r
-    CapabilityPtr &= 0xFC;\r
+  while ((CapabilityPtr >= 0x40) && ((CapabilityPtr & 0x03) == 0x00)) {\r
     PciIoDevice->PciIo.Pci.Read (\r
                              &PciIoDevice->PciIo,\r
                              EfiPciIoWidthUint16,\r