[ipxe-devel] Using iPXE with UNDI driver

weiwei wang veivei.vang at gmail.com
Tue Dec 20 11:52:55 UTC 2011

On 07/07/2011 09:19 AM, Lantz, Philip wrote:
>> On Friday 01 Jul 2011 19:23:29 Lantz, Philip wrote:
>>>> Under EFI, iPXE can either use a built-in iPXE driver (i.e. something
>>>> under drivers/net), or use an existing EFI network device via an EFI SNP
>>>> interface. Your driver needs to provide an EFI SNP interface, or rely
>>>> upon components that consume an EFI UNDI interface and provide an EFI SNP
>>>> interface.
>>> I suspected this -- thanks for confirming it -- and I have tried loading an
>>> SNP interface on top of my UNDI driver before running iPXE, but iPXE still
>>> doesn't find it. Do you have any more suggestions for why this might
>>> happen? Can you point me toward the code in iPXE that is supposed to
>>> locate the SNP interface and connect to it?
>> It's in drivers/net/efi/snponly.c.  From a quick look at the code, it seems as
>> though it will only attach to the SNP from which the iPXE binary was loaded
>> (i.e. it's the functional equivalent of arch/i386/drivers/net/undionly.c).
>> It should be possible to create an iPXE EFI driver that will attach to any SNP
>> device within the system and call snpnet_probe().  You could model this on the
>> code in interface/efi/efi_pci.c, which attaches to any PCI device within the
>> system and calls pci_probe().
> Thanks! This is what I did. I changed snpbus_probe to call LocateHandle to find a handle that supports SNP and it now connects to my driver.

Hi Philip,

Can you give me a hint how you modify snpbus_probe to call LocateHandle, 
I have got a similar situation in my side, and your approach seems 

Thanks in advance

>>> After I got some debugging output enabled, iPXE prints
>>>       EFIPCI DRIVER_SUPPORTED 0x3de92f90 (0x0)
>>>       EFIPCI device 0x3de92f90 is not a PCI device
>>> In fact, 0x3de92f90 isn't even a valid handle; as far as I know, EFI
>>> handles are small integers, not memory addresses.
>> UefiBaseType.h:  typedef VOID * EFI_HANDLE;
>> (Type checking?  Who needs type checking?  Let's make one of the most
>> frequently used EFI data types transparently cast to or from any pointer
>> type!)
> I'm with you there. (Though with the frequency of casts in the EDK code, it hardly matters.)
> I still don't understand why the 'dh' command only lists handles with small integer values. But it doesn't matter to me now--that code isn't part of snponly.
> I appreciate the assistance.
> Philip

More information about the ipxe-devel mailing list