summaryrefslogtreecommitdiffstats
path: root/src/interface/efi/efi_snp_hii.c
Commit message (Collapse)AuthorAgeFilesLines
* [efi] Install the HII config access protocol on a child of the SNP handleLaszlo Ersek2016-07-081-4/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In edk2, there are several drivers that associate HII forms (and corresponding config access protocol instances) with each individual network device. (In this context, "network device" means the EFI handle on which the SNP protocol is installed, and on which the device path ending with the MAC() node is installed also.) Such edk2 drivers are, for example: Ip4Dxe, HttpBootDxe, VlanConfigDxe. In UEFI, any given handle can carry at most one instance of a specific protocol (see e.g. the specification of the InstallProtocolInterface() boot service). This implies that the class of drivers mentioned above can't install their EFI_HII_CONFIG_ACCESS_PROTOCOL instances on the SNP handle directly -- they would conflict with each other. Accordingly, each of those edk2 drivers creates a "private" child handle under the SNP handle, and installs its config access protocol (and corresponding HII package list) on its child handle. The device path for the child handle is traditionally derived by appending a Hardware Vendor Device Path node after the MAC() node. The VenHw() nodes in question consist of a GUID (by definition), and no trailing data (by choice). The purpose of these VenHw() nodes is only that all the child nodes can be uniquely identified by device path. At the moment iPXE does not follow this pattern. It doesn't run into a conflict when it installs its EFI_HII_CONFIG_ACCESS_PROTOCOL directly on the SNP handle, but that's only because iPXE is the sole driver not following the pattern. This behavior seems risky (one might call it a "latent bug"); better align iPXE with the edk2 custom. Cc: Michael Brown <mcb30@ipxe.org> Cc: Gary Lin <glin@suse.com> Cc: Ladi Prosek <lprosek@redhat.com> Ref: http://thread.gmane.org/gmane.comp.bios.edk2.devel/13494/focus=13532 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ladi Prosek <lprosek@redhat.com> Modified-by: Michael Brown <mcb30@ipxe.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Work around broken EFI HII specificationMichael Brown2016-04-121-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The EFI_HII_CONFIG_ACCESS_PROTOCOL's ExtractConfig() method is passed a request string which includes the parameters being queried plus an apparently meaningless blob of information (the ConfigHdr), and is expected to include this same meaningless blob of information in the results string. Neither the specification nor the existing EDK2 code (including the nominal reference implementation in the DriverSampleDxe driver) provide any reason for the existence of this meaningless blob of information. It appears to be consumed in its entirety by the EFI_HII_CONFIG_ROUTING_PROTOCOL, and to contain zero bits of information by the time it reaches an EFI_HII_CONFIG_ACCESS_PROTOCOL instance. It would potentially allow for multiple configuration data sets to be handled by a single EFI_HII_CONFIG_ACCESS_PROTOCOL instance, in a style alien to the rest of the UEFI specification (which implicitly assumes that the instance pointer is always sufficient to uniquely identify the instance). iPXE currently handles this by simply copying the ConfigHdr from the request string to the results string, and otherwise ignoring it. This approach is also used by some code in EDK2, such as OVMF's PlatformDxe driver. As of EDK2 commit 8a45f80 ("MdeModulePkg: Make HII configuration settings available to OS runtime"), this causes an assertion failure inside EDK2. The failure arises when iPXE is handled a NULL request string, and responds (as per the specification) with a results string including all settings. Since there is no meaningless blob to copy from the request string, there is no corresponding meaningless blob in the results string. This now causes an assertion failure in HiiDatabaseDxe's HiiConfigRoutingExportConfig(). The same failure does not affect the OVMF PlatformDxe driver, which simply passes the request string to the HII BlockToConfig() utility function. The BlockToConfig() function returns EFI_INVALID_PARAMETER when passed a null request string, and PlatformDxe propagates this error directly to the caller. Fix by matching the behaviour of OVMF's PlatformDxe driver: explicitly return EFI_INVALID_PARAMETER if the request string is NULL or empty. This violates the specification (insofar as it is feasible to determine what the specification actually requires), but causes correct behaviour with the EDK2 codebase. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [legal] Relicense files under GPL2_OR_LATER_OR_UBDLMichael Brown2015-03-021-1/+5
| | | | | | | Relicense files for which I am the sole author (as identified by util/relicense.pl). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Allow setting help text URI to be customised via config/branding.hMichael Brown2015-02-111-1/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Centralise definitions of more protocol GUIDsMichael Brown2014-09-251-4/+0Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Ignore failures when attempting to install SNP HII protocolMichael Brown2014-07-301-2/+5
| | | | | | | | HII seems to fail on several systems. Since it is non-essential, treat HII problems as non-fatal. Debugged-by: Curtis Larsen <larsen@dixie.edu> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Expose build timestamp, build name, and product namesMichael Brown2014-06-241-7/+6Star
| | | | | | | | Expose the build timestamp (measured in seconds since the Epoch) and the build name (e.g. "rtl8139.rom" or "ipxe.efi"), and provide the product name and product short name in a single centralised location. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Make EFI_HII_DATABASE_PROTOCOL optionalMichael Brown2014-05-201-1/+10
| | | | | | | | | | | | Some UEFI systems (observed with a Mac Pro) do not provide EFI_HII_DATABASE_PROTOCOL. We can continue to function without providing access to network device settings via HII, so make this protocol optional and fall back to simply not providing any HII protocols. Reported-by: Matt Woodward <pxematt@woodwardcc.com> Tested-by: Matt Woodward <pxematt@woodwardcc.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Allow for multiple definitions of each predefined settingMichael Brown2013-12-051-0/+4
| | | | | | | | | | Allow for multiple setting definitions with the same name but different scopes and tags. For example, allow for a "filename" setting with default scope and tag value 67 (for DHCPv4) and a corresponding "filename" setting with IPv6 scope and tag value 59 (for DHCPv6). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Explicitly separate the concept of a completed fetched settingMichael Brown2013-12-051-2/+6
| | | | | | | | | | The fetch_setting() family of functions may currently modify the definition of the specified setting (e.g. to add missing type information). Clean up this interface by requiring callers to provide an explicit buffer to contain the completed definition of the fetched setting, if required. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Perform meaningful error code conversionsMichael Brown2013-04-191-7/+7
| | | | | | | | Exploit the redefinition of iPXE error codes to include a "platform error code" to allow for meaningful conversion of EFI_STATUS values to iPXE errors and vice versa. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Include version number within only a single object fileMichael Brown2012-11-021-1/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Add missing RC_TO_EFIRC() conversionMichael Brown2012-10-221-1/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Expose net device non-volatile settings via HIIMichael Brown2012-10-161-216/+492
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Split SNP HII functionality into a separate fileMichael Brown2012-10-161-0/+430
Signed-off-by: Michael Brown <mcb30@ipxe.org>