Browse Source

[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>
tags/v1.20.1
Michael Brown 10 years ago
parent
commit
81df95e8ae
1 changed files with 10 additions and 1 deletions
  1. 10
    1
      src/interface/efi/efi_snp_hii.c

+ 10
- 1
src/interface/efi/efi_snp_hii.c View File

@@ -75,7 +75,7 @@ static EFI_GUID efi_hii_ibm_ucm_compliant_formset_guid
75 75
 
76 76
 /** EFI HII database protocol */
77 77
 static EFI_HII_DATABASE_PROTOCOL *efihii;
78
-EFI_REQUIRE_PROTOCOL ( EFI_HII_DATABASE_PROTOCOL, &efihii );
78
+EFI_REQUEST_PROTOCOL ( EFI_HII_DATABASE_PROTOCOL, &efihii );
79 79
 
80 80
 /**
81 81
  * Identify settings to be exposed via HII
@@ -649,6 +649,10 @@ int efi_snp_hii_install ( struct efi_snp_device *snpdev ) {
649 649
 	int efirc;
650 650
 	int rc;
651 651
 
652
+	/* Do nothing if HII database protocol is not supported */
653
+	if ( ! efihii )
654
+		return 0;
655
+
652 656
 	/* Initialise HII protocol */
653 657
 	memcpy ( &snpdev->hii, &efi_snp_device_hii, sizeof ( snpdev->hii ) );
654 658
 
@@ -705,6 +709,11 @@ int efi_snp_hii_install ( struct efi_snp_device *snpdev ) {
705 709
 void efi_snp_hii_uninstall ( struct efi_snp_device *snpdev ) {
706 710
 	EFI_BOOT_SERVICES *bs = efi_systab->BootServices;
707 711
 
712
+	/* Do nothing if HII database protocol is not supported */
713
+	if ( ! efihii )
714
+		return;
715
+
716
+	/* Uninstall protocols and remove package list */
708 717
 	bs->UninstallMultipleProtocolInterfaces (
709 718
 			snpdev->handle,
710 719
 			&efi_hii_config_access_protocol_guid, &snpdev->hii,

Loading…
Cancel
Save