On 06/21/16 23:34, Laszlo Ersek wrote:

> I believe that iPXE installs a HII formset that for some reason
> confuses this logic. I'll have to investigate more (e.g., write some
> debug code...) for a better understanding.

Yeah. I added the following DEBUG to the code:

> diff --git a/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.c 
> b/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.c
> index 0de4e3c0c587..1fc2b6f7b182 100644
> --- a/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.c
> +++ b/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.c
> @@ -649,6 +649,9 @@ CreateDeviceManagerForm(
>              // In network device form, only the selected mac address device 
> need to be show.
>              //
>              DevicePathStr = 
> DmExtractDevicePathFromHiiHandle(HiiHandles[Index]);
> +            DEBUG ((EFI_D_VERBOSE, "%a: DevicePathStr=%s FormSetGuid=%g "
> +              "Index=%Lu\n", __FUNCTION__, DevicePathStr, &FormSetGuid,
> +              (UINT64)Index));
>              DevicePathId  = 0;
>              if (DevicePathStr != NULL){
>                DevicePathId =  HiiSetString (HiiHandle, 0, DevicePathStr, 
> NULL);

When the iPXE oprom is disabled, the following is printed:

> CreateDeviceManagerForm: 
> DevicePathStr=PciRoot(0x0)/Pci(0x3,0x0)/MAC(525400DE5E59,0x1)/VenHw(D79DF6B0-EF44-43BD-9797-43E93BCF5FA8)
>  FormSetGuid=D79DF6B0-EF44-43BD-9797-43E93BCF5FA8 Index=9
> CreateDeviceManagerForm: 
> DevicePathStr=PciRoot(0x0)/Pci(0x3,0x0)/MAC(525400DE5E59,0x1)/VenHw(9FB1A1F3-3B71-4324-B39A-745CBB015FFF)
>  FormSetGuid=9B942747-154E-4D29-A436-BF7100C8B53B Index=10
> CreateDeviceManagerForm: 
> DevicePathStr=PciRoot(0x0)/Pci(0x3,0x0)/MAC(525400DE5E59,0x1)/VenHw(ECEBCB00-D9C8-11E4-AF3D-8CDCD426C973)
>  FormSetGuid=4D20583A-7765-4E7A-8A67-DCDE74EE3EC5 Index=11

If I process that log snippet with my sed script that replaces GUIDs with their 
names, I get:

> CreateDeviceManagerForm: 
> DevicePathStr=PciRoot(0x0)/Pci(0x3,0x0)/MAC(525400DE5E59,0x1)/VenHw([VlanConfigFormSet])
>  FormSetGuid=[VlanConfigFormSet] Index=9
> CreateDeviceManagerForm: 
> DevicePathStr=PciRoot(0x0)/Pci(0x3,0x0)/MAC(525400DE5E59,0x1)/VenHw([Ip4Dxe]) 
> FormSetGuid=[Ip4Config2NvData] Index=10
> CreateDeviceManagerForm: 
> DevicePathStr=PciRoot(0x0)/Pci(0x3,0x0)/MAC(525400DE5E59,0x1)/VenHw([HttpBootDxe])
>  FormSetGuid=[HttpBootConfig] Index=11


Now compare it against the case when the iPXE oprom is enabled:

> CreateDeviceManagerForm: 
> DevicePathStr=PciRoot(0x0)/Pci(0x3,0x0)/MAC(525400938342,0x1) 
> FormSetGuid=ACF511E7-6578-C7A8-5C48-2B536DDC8B68 Index=9
> CreateDeviceManagerForm: 
> DevicePathStr=PciRoot(0x0)/Pci(0x3,0x0)/MAC(525400938342,0x1)/VenHw(D79DF6B0-EF44-43BD-9797-43E93BCF5FA8)
>  FormSetGuid=D79DF6B0-EF44-43BD-9797-43E93BCF5FA8 Index=10
> CreateDeviceManagerForm: 
> DevicePathStr=PciRoot(0x0)/Pci(0x3,0x0)/MAC(525400938342,0x1)/VenHw(9FB1A1F3-3B71-4324-B39A-745CBB015FFF)
>  FormSetGuid=9B942747-154E-4D29-A436-BF7100C8B53B Index=11
> CreateDeviceManagerForm: 
> DevicePathStr=PciRoot(0x0)/Pci(0x3,0x0)/MAC(525400938342,0x1)/VenHw(ECEBCB00-D9C8-11E4-AF3D-8CDCD426C973)
>  FormSetGuid=4D20583A-7765-4E7A-8A67-DCDE74EE3EC5 Index=12

Processed with the sed script:

> CreateDeviceManagerForm: 
> DevicePathStr=PciRoot(0x0)/Pci(0x3,0x0)/MAC(525400938342,0x1) 
> FormSetGuid=ACF511E7-6578-C7A8-5C48-2B536DDC8B68 Index=9
> CreateDeviceManagerForm: 
> DevicePathStr=PciRoot(0x0)/Pci(0x3,0x0)/MAC(525400938342,0x1)/VenHw([VlanConfigFormSet])
>  FormSetGuid=[VlanConfigFormSet] Index=10
> CreateDeviceManagerForm: 
> DevicePathStr=PciRoot(0x0)/Pci(0x3,0x0)/MAC(525400938342,0x1)/VenHw([Ip4Dxe]) 
> FormSetGuid=[Ip4Config2NvData] Index=11
> CreateDeviceManagerForm: 
> DevicePathStr=PciRoot(0x0)/Pci(0x3,0x0)/MAC(525400938342,0x1)/VenHw([HttpBootDxe])
>  FormSetGuid=[HttpBootConfig] Index=12

The (structural) difference is that iPXE seems to install its HII form set 
directly on the handle that corresponds to the network device.

Whereas the other drivers install their form sets on new child handles (whose 
device paths are built by appending a VenHw() node).

I have no clue where this is actually enforced by the setup browser, but I 
think this is the reason. See also the big comment on FIXME in 
"OvmfPkg/PlatformDxe/Platform.c", and the documentation of the HiiAddPackages() 
function, in "MdeModulePkg/Library/UefiHiiLib/HiiLib.c".

I might try to come up with an iPXE patch for this.

Thanks
Laszlo
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to