diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2014-03-31 20:36:23 +0000 |
---|---|---|
committer | jljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524> | 2014-03-31 20:36:23 +0000 |
commit | 3f4b148993b1099de49cf736356f628c3c1201da (patch) | |
tree | 298af0f290001d47dbaa1703549cb41ecb7fd9f9 /OvmfPkg | |
parent | e04cca1d05e2329a5beee18a302467ba7ae482ed (diff) | |
download | edk2-3f4b148993b1099de49cf736356f628c3c1201da.tar.gz edk2-3f4b148993b1099de49cf736356f628c3c1201da.tar.bz2 edk2-3f4b148993b1099de49cf736356f628c3c1201da.zip |
OvmfPkg: add a catch-all match for PCI devices in the OpenFirmware path
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
Diffstat (limited to 'OvmfPkg')
-rw-r--r-- | OvmfPkg/Library/PlatformBdsLib/QemuBootOrder.c | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/OvmfPkg/Library/PlatformBdsLib/QemuBootOrder.c b/OvmfPkg/Library/PlatformBdsLib/QemuBootOrder.c index 7f81fc35a0..bd0fb76877 100644 --- a/OvmfPkg/Library/PlatformBdsLib/QemuBootOrder.c +++ b/OvmfPkg/Library/PlatformBdsLib/QemuBootOrder.c @@ -763,37 +763,27 @@ TranslateOfwNodes ( TargetLun[0],
TargetLun[1]
);
- } else if (NumNodes >= 3 &&
- SubstringEq (OfwNode[1].DriverName, "ethernet") &&
- SubstringEq (OfwNode[2].DriverName, "ethernet-phy")
- ) {
+ } else {
//
- // OpenFirmware device path (Ethernet NIC):
+ // Generic OpenFirmware device path for PCI devices:
//
- // /pci@i0cf8/ethernet@3[,2]/ethernet-phy@0
- // ^ ^ ^
- // | | fixed
+ // /pci@i0cf8/ethernet@3[,2]
+ // ^ ^
// | PCI slot[, function] holding Ethernet card
// PCI root at system bus port, PIO
//
// UEFI device path prefix (dependent on presence of nonzero PCI function):
//
- // PciRoot(0x0)/Pci(0x3,0x0)/MAC(525400E15EEF,0x1)
- // PciRoot(0x0)/Pci(0x3,0x2)/MAC(525400E15EEF,0x1)
- // ^ ^
- // MAC address IfType (1 == Ethernet)
- //
- // (Some UEFI NIC drivers don't set 0x1 for IfType.)
+ // PciRoot(0x0)/Pci(0x3,0x0)
+ // PciRoot(0x0)/Pci(0x3,0x2)
//
Written = UnicodeSPrintAsciiFormat (
Translated,
*TranslatedSize * sizeof (*Translated), // BufferSize in bytes
- "PciRoot(0x0)/Pci(0x%x,0x%x)/MAC",
+ "PciRoot(0x0)/Pci(0x%x,0x%x)",
PciDevFun[0],
PciDevFun[1]
);
- } else {
- return RETURN_UNSUPPORTED;
}
//
|