Hi Laszlo,
The ethernet device has a pci-pci bridge between itself and the root bridge.
Hence the weird looking device path.
I poked around some more and saw that MNP DXE driver could not open SNP
protocol on any of the handles passed to it and hence it does not bind. It
seems odd that "dh" command sees the SNP but MNP does not.
How does UEFI handle the dependency between drivers ?
What if MNP driver binding protocol runs first and does not find SNP because
the SNP driver binding protocol has no run yet ?
Somewhere in UEFI DWG, there is a statement that drivers should call
RegisterProtocolNotify() to get notified of protocol being registered at a
later time. I did not see MNP driver calling to register for SNP protocol
notification.
Thanx.
> Date: Wed, 6 Aug 2014 22:40:30 +0200
> From: ler...@redhat.com
> To: edk2-devel@lists.sourceforge.net
> Subject: Re: [edk2] UEFI Shell Command "ifconfig" Error
>
> On 08/06/14 21:34, Chris Cuthbert wrote:
> > Hi Laszlo,
> >
> > Thanx for the comprehensive explanation of the "dh" command. You
> > diagnosed my problem correctly and also gave me a pointer to an example
> > SNP implementation. I have looked at this driver and tried to make
> > changes to mine. Looks like the binding is still not happening. Here is
> > the 'dh' dump.
> > Does it provide any more clues as to what I am missing ?
> > Thanx again for all your help.
> >
> >
> > dh -v -d -p SimpleNetwork
> > 7A: DevicePath
> > PciRoot(0x2)/Pci(0x2,0x0)/Pci(0x0,0x0)/MAC(121212121212,0x1) SimpleNetwork
> > Controller Name :
> > PciRoot(0x2)/Pci(0x2,0x0)/Pci(0x0,0x0)/MAC(121212121212,0x1)
> > Device Path :
> > PciRoot(0x2)/Pci(0x2,0x0)/Pci(0x0,0x0)/MAC(121212121212,0x1)
> > Controller Type : DEVICE
> > Configuration : NO
> > Diagnostics : NO
> > Managed by : <None>
> > Parent Controllers :
> > Parent[79] : PciRoot(0x2)/Pci(0x2,0x0)/Pci(0x0,0x0)
> > Child Controllers : <None>
>
> Yes, I think I can see two issues with the above (perhaps originating
> from a common root).
>
> First, the device path is really strange: Pci(0x2,0x0)/Pci(0x0,0x0) is
> confusing. I think even with PCI bridges you wouldn't get a device path
> fragment like this (but I might be wrong).
>
> Second, it says Controller Type: DEVICE. You need a bus driver for this.
>
> Basically, you do produce a SimpleNetworkProtocol instance on some
> handle, but the higher level UEFI Driver Model drivers (eg. MNP), in
> their DriverBindingSupported() functions, look at the handle and the
> installed protocols on it, and find them unsupportable. I'm not sure
> what exactly they don't like, but something's fishy.
>
> I'd recommend to look very closely at
> "OvmfPkg/VirtioNetDxe/DriverBinding.c", and follow precisely what
> happens there. The full logic should apply to your case as well, only
> the hardware dependent bits should be replaced (eg.
> gVirtioDeviceProtocolGuid --> gPciIoProtocolGuid, and so on).
>
> I'd also suggest reading through TechNotes.txt in the same directory, if
> you haven't yet. I wrote that for you. (You don't need the Virtio
> internals.)
>
> Ah, apologies, of course first I should recommend the Driver Writers'
> Guide. :)
>
> >> Shell> dh -d -v -p SimpleNetwork
> >> 9B: UnknownDevice LoadFile PXEBaseCode MTFTPv4ServiceBinding
> >> DHCPv4ServiceBinding UDPv4ServiceBinding TCPv4ServiceBinding
> >> IPv4ServiceBinding IPv4Config ARPServiceBinding UnknownDevice
> >> ManagedNetworkServiceBinding EfiVlanConfigProtocolGuid DevicePath
> >> PciRoot(0x0)/Pci(0x3,0x0)/MAC(52540069721E,0x1) SimpleNetwork
> >> Controller Name : Virtio Network Device
> >> Device Path : PciRoot(0x0)/Pci(0x3,0x0)/MAC(52540069721E,0x1)
> >> Controller Type : BUS
> >> Configuration : NO
> >> Diagnostics : NO
> >> Managed by :
> >> Drv[6B] : MNP Network Service Driver
> >> Drv[6C] : VLAN Configuration Driver
> >> Drv[6F] : IP4 CONFIG Network Service Driver
> >> Parent Controllers :
> >> Parent[88] : Virtio Network Device
> >> Child Controllers :
> >> Child[9D] : MNP (MAC=52-54-00-69-72-1E, ProtocolType=0x806, VlanId=0)
> >> Child[9E] : MNP (Not started)
> >> Child[A0] : MNP (MAC=52-54-00-69-72-1E, ProtocolType=0x800, VlanId=0)
> >> Child[9C] :
> > PciRoot(0x0)/Pci(0x3,0x0)/MAC(52540069721E,0x1)/VenHw(D79DF6B0-EF44-43BD-9797-43E93BCF5FA8)
> >> Child[9F] :
> > PciRoot(0x0)/Pci(0x3,0x0)/MAC(52540069721E,0x1)/VenHw(D8944553-C4DD-41F4-9B30-E1397CFB267B)
>
> Thanks
> Laszlo
>
>
> ------------------------------------------------------------------------------
> Infragistics Professional
> Build stunning WinForms apps today!
> Reboot your WinForms applications with our WinForms controls.
> Build a bridge from your legacy apps to the future.
> http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/edk2-devel
------------------------------------------------------------------------------
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls.
Build a bridge from your legacy apps to the future.
http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel