]> git.proxmox.com Git - mirror_edk2.git/commitdiff
OvmfPkg: add a catch-all match for PCI devices in the OpenFirmware path
authorPaolo Bonzini <pbonzini@redhat.com>
Mon, 31 Mar 2014 20:36:23 +0000 (20:36 +0000)
committerjljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 31 Mar 2014 20:36:23 +0000 (20:36 +0000)
In many cases, the second node in /pci@i0cf8/XYZ@DD,FF node is enough
to match a UEFI device path; a typical cases is a NIC that is assigned
from the host to the guest.  Add a catch-all case for PCI devices, and
reuse it for NICs since it works well for those too.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15422 6f19259b-4bc3-4df7-8a09-765794883524

OvmfPkg/Library/PlatformBdsLib/QemuBootOrder.c

index 7f81fc35a0923fbae7359b7418166f03618197ba..bd0fb768779bd7c84ad4a299dfbae4bfbfb5b110 100644 (file)
@@ -763,37 +763,27 @@ TranslateOfwNodes (
       TargetLun[0],\r
       TargetLun[1]\r
       );\r
-  } else if (NumNodes >= 3 &&\r
-             SubstringEq (OfwNode[1].DriverName, "ethernet") &&\r
-             SubstringEq (OfwNode[2].DriverName, "ethernet-phy")\r
-             ) {\r
+  } else {\r
     //\r
-    // OpenFirmware device path (Ethernet NIC):\r
+    // Generic OpenFirmware device path for PCI devices:\r
     //\r
-    //   /pci@i0cf8/ethernet@3[,2]/ethernet-phy@0\r
-    //        ^              ^                  ^\r
-    //        |              |                  fixed\r
+    //   /pci@i0cf8/ethernet@3[,2]\r
+    //        ^              ^\r
     //        |              PCI slot[, function] holding Ethernet card\r
     //        PCI root at system bus port, PIO\r
     //\r
     // UEFI device path prefix (dependent on presence of nonzero PCI function):\r
     //\r
-    //   PciRoot(0x0)/Pci(0x3,0x0)/MAC(525400E15EEF,0x1)\r
-    //   PciRoot(0x0)/Pci(0x3,0x2)/MAC(525400E15EEF,0x1)\r
-    //                                 ^            ^\r
-    //                                 MAC address  IfType (1 == Ethernet)\r
-    //\r
-    // (Some UEFI NIC drivers don't set 0x1 for IfType.)\r
+    //   PciRoot(0x0)/Pci(0x3,0x0)\r
+    //   PciRoot(0x0)/Pci(0x3,0x2)\r
     //\r
     Written = UnicodeSPrintAsciiFormat (\r
       Translated,\r
       *TranslatedSize * sizeof (*Translated), // BufferSize in bytes\r
-      "PciRoot(0x0)/Pci(0x%x,0x%x)/MAC",\r
+      "PciRoot(0x0)/Pci(0x%x,0x%x)",\r
       PciDevFun[0],\r
       PciDevFun[1]\r
       );\r
-  } else {\r
-    return RETURN_UNSUPPORTED;\r
   }\r
 \r
   //\r