Revision: 14367
          http://edk2.svn.sourceforge.net/edk2/?rev=14367&view=rev
Author:   jljusten
Date:     2013-05-15 18:21:08 +0000 (Wed, 15 May 2013)
Log Message:
-----------
OvmfPkg: QemuBootOrder: recognize Ethernet OFW device paths

Tested with the e1000, ne2k_pci, pcnet, rtl8139, and virtio iPXE UEFI
oprom drivers distributed with qemu-1.5.0-rc1. Also tested with Intel's
e1000 driver.

Contributed-under: TianoCore Contribution Agreement 1.0

Signed-off-by: Laszlo Ersek <[email protected]>
Reviewed-by: Jordan Justen <[email protected]>

Modified Paths:
--------------
    trunk/edk2/OvmfPkg/Library/PlatformBdsLib/QemuBootOrder.c

Modified: trunk/edk2/OvmfPkg/Library/PlatformBdsLib/QemuBootOrder.c
===================================================================
--- trunk/edk2/OvmfPkg/Library/PlatformBdsLib/QemuBootOrder.c   2013-05-15 
18:20:39 UTC (rev 14366)
+++ trunk/edk2/OvmfPkg/Library/PlatformBdsLib/QemuBootOrder.c   2013-05-15 
18:21:08 UTC (rev 14367)
@@ -677,6 +677,35 @@
       TargetLun[0],
       TargetLun[1]
       );
+  } else if (NumNodes >= 3 &&
+             SubstringEq (OfwNode[1].DriverName, "ethernet") &&
+             SubstringEq (OfwNode[2].DriverName, "ethernet-phy")
+             ) {
+    //
+    // OpenFirmware device path (Ethernet NIC):
+    //
+    //   /pci@i0cf8/ethernet@3[,2]/ethernet-phy@0
+    //        ^              ^                  ^
+    //        |              |                  fixed
+    //        |              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.)
+    //
+    Written = UnicodeSPrintAsciiFormat (
+      Translated,
+      *TranslatedSize * sizeof (*Translated), // BufferSize in bytes
+      "PciRoot(0x0)/Pci(0x%x,0x%x)/MAC",
+      PciDevFun[0],
+      PciDevFun[1]
+      );
   } else {
     return RETURN_UNSUPPORTED;
   }

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
AlienVault Unified Security Management (USM) platform delivers complete
security visibility with the essential security capabilities. Easily and
efficiently configure, manage, and operate all of your security controls
from a single console and one unified framework. Download a free trial.
http://p.sf.net/sfu/alienvault_d2d
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to