mirror of
https://github.com/ipxe/ipxe
synced 2025-12-25 09:01:24 +03:00
[efi] Make EFI_HII_DATABASE_PROTOCOL optional
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>
This commit is contained in:
@@ -75,7 +75,7 @@ static EFI_GUID efi_hii_ibm_ucm_compliant_formset_guid
|
|||||||
|
|
||||||
/** EFI HII database protocol */
|
/** EFI HII database protocol */
|
||||||
static EFI_HII_DATABASE_PROTOCOL *efihii;
|
static EFI_HII_DATABASE_PROTOCOL *efihii;
|
||||||
EFI_REQUIRE_PROTOCOL ( EFI_HII_DATABASE_PROTOCOL, &efihii );
|
EFI_REQUEST_PROTOCOL ( EFI_HII_DATABASE_PROTOCOL, &efihii );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Identify settings to be exposed via HII
|
* Identify settings to be exposed via HII
|
||||||
@@ -649,6 +649,10 @@ int efi_snp_hii_install ( struct efi_snp_device *snpdev ) {
|
|||||||
int efirc;
|
int efirc;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
|
/* Do nothing if HII database protocol is not supported */
|
||||||
|
if ( ! efihii )
|
||||||
|
return 0;
|
||||||
|
|
||||||
/* Initialise HII protocol */
|
/* Initialise HII protocol */
|
||||||
memcpy ( &snpdev->hii, &efi_snp_device_hii, sizeof ( snpdev->hii ) );
|
memcpy ( &snpdev->hii, &efi_snp_device_hii, sizeof ( snpdev->hii ) );
|
||||||
|
|
||||||
@@ -705,6 +709,11 @@ int efi_snp_hii_install ( struct efi_snp_device *snpdev ) {
|
|||||||
void efi_snp_hii_uninstall ( struct efi_snp_device *snpdev ) {
|
void efi_snp_hii_uninstall ( struct efi_snp_device *snpdev ) {
|
||||||
EFI_BOOT_SERVICES *bs = efi_systab->BootServices;
|
EFI_BOOT_SERVICES *bs = efi_systab->BootServices;
|
||||||
|
|
||||||
|
/* Do nothing if HII database protocol is not supported */
|
||||||
|
if ( ! efihii )
|
||||||
|
return;
|
||||||
|
|
||||||
|
/* Uninstall protocols and remove package list */
|
||||||
bs->UninstallMultipleProtocolInterfaces (
|
bs->UninstallMultipleProtocolInterfaces (
|
||||||
snpdev->handle,
|
snpdev->handle,
|
||||||
&efi_hii_config_access_protocol_guid, &snpdev->hii,
|
&efi_hii_config_access_protocol_guid, &snpdev->hii,
|
||||||
|
|||||||
Reference in New Issue
Block a user