#include <ipxe/efi/Protocol/DriverBinding.h>
#include <ipxe/efi/Protocol/LoadedImage.h>
#include <ipxe/efi/Protocol/ComponentName.h>
+#include <ipxe/efi/Protocol/ComponentName2.h>
#include <ipxe/efi/efi_veto.h>
/** @file
*
* @v binding Driver binding protocol
* @v loaded Loaded image protocol
- * @v wtf Component name protocol, if present
* @v manufacturer Manufacturer name, if present
- * @v name Driver name (in "eng" language), if present
+ * @v name Driver name, if present
* @ret vetoed Driver is to be vetoed
*/
int ( * veto ) ( EFI_DRIVER_BINDING_PROTOCOL *binding,
EFI_LOADED_IMAGE_PROTOCOL *loaded,
- EFI_COMPONENT_NAME_PROTOCOL *wtf,
const char *manufacturer, const CHAR16 *name );
};
*
* @v binding Driver binding protocol
* @v loaded Loaded image protocol
- * @v wtf Component name protocol, if present
* @v manufacturer Manufacturer name, if present
* @v name Driver name, if present
* @ret vetoed Driver is to be vetoed
static int
efi_veto_ip4config ( EFI_DRIVER_BINDING_PROTOCOL *binding __unused,
EFI_LOADED_IMAGE_PROTOCOL *loaded __unused,
- EFI_COMPONENT_NAME_PROTOCOL *wtf __unused,
const char *manufacturer, const CHAR16 *name ) {
static const CHAR16 ip4cfg[] = L"IP4 CONFIG Network Service Driver";
static const char *dell = "Dell Inc.";
*
* @v binding Driver binding protocol
* @v loaded Loaded image protocol
- * @v wtf Component name protocol, if present
* @v manufacturer Manufacturer name, if present
* @v name Driver name, if present
* @ret vetoed Driver is to be vetoed
static int
efi_veto_hp_xhci ( EFI_DRIVER_BINDING_PROTOCOL *binding __unused,
EFI_LOADED_IMAGE_PROTOCOL *loaded __unused,
- EFI_COMPONENT_NAME_PROTOCOL *wtf __unused,
const char *manufacturer, const CHAR16 *name ) {
static const CHAR16 xhci[] = L"Usb Xhci Driver";
static const char *hp = "HP";
*
* @v binding Driver binding protocol
* @v loaded Loaded image protocol
- * @v wtf Component name protocol, if present
* @v manufacturer Manufacturer name, if present
* @v name Driver name, if present
* @ret vetoed Driver is to be vetoed
static int
efi_veto_vmware_uefipxebc ( EFI_DRIVER_BINDING_PROTOCOL *binding __unused,
EFI_LOADED_IMAGE_PROTOCOL *loaded __unused,
- EFI_COMPONENT_NAME_PROTOCOL *wtf __unused,
const char *manufacturer, const CHAR16 *name ) {
static const CHAR16 uefipxebc[] = L"UEFI PXE Base Code Driver";
static const char *vmware = "VMware, Inc.";
*
* @v binding Driver binding protocol
* @v loaded Loaded image protocol
- * @v wtf Component name protocol, if present
* @v manufacturer Manufacturer name, if present
* @v name Driver name, if present
* @ret vetoed Driver is to be vetoed
*/
static int efi_veto_dhcp6 ( EFI_DRIVER_BINDING_PROTOCOL *binding __unused,
EFI_LOADED_IMAGE_PROTOCOL *loaded __unused,
- EFI_COMPONENT_NAME_PROTOCOL *wtf __unused,
const char *manufacturer __unused,
const CHAR16 *name ) {
static const CHAR16 dhcp6[] = L"DHCP6 Protocol Driver";
EFI_LOADED_IMAGE_PROTOCOL *loaded;
void *interface;
} loaded;
+ union {
+ EFI_COMPONENT_NAME2_PROTOCOL *wtf2;
+ void *interface;
+ } wtf2;
union {
EFI_COMPONENT_NAME_PROTOCOL *wtf;
void *interface;
}
/* Open component name protocol, if present */
+ if ( ( efirc = bs->OpenProtocol (
+ image, &efi_component_name2_protocol_guid,
+ &wtf2.interface, efi_image_handle, image,
+ EFI_OPEN_PROTOCOL_GET_PROTOCOL ) ) != 0 ) {
+ /* Ignore failure; is not required to be present */
+ wtf2.interface = NULL;
+ }
+
+ /* Open obsolete component name protocol, if present */
if ( ( efirc = bs->OpenProtocol (
image, &efi_component_name_protocol_guid,
&wtf.interface, efi_image_handle, image,
}
/* Get driver name, if available */
- if ( wtf.wtf &&
- ( ( efirc = wtf.wtf->GetDriverName ( wtf.wtf, "eng",
- &name ) == 0 ) ) ) {
+ if ( ( wtf2.wtf2 &&
+ ( ( efirc = wtf2.wtf2->GetDriverName ( wtf2.wtf2, "en",
+ &name ) == 0 ) ) ) ||
+ ( wtf.wtf &&
+ ( ( efirc = wtf.wtf->GetDriverName ( wtf.wtf, "eng",
+ &name ) == 0 ) ) ) ) {
/* Driver has a name */
} else {
/* Ignore failure; name is not required to be present */
for ( i = 0 ; i < ( sizeof ( efi_vetoes ) /
sizeof ( efi_vetoes[0] ) ) ; i++ ) {
if ( efi_vetoes[i].veto ( binding.binding, loaded.loaded,
- wtf.wtf, manufacturer, name ) ) {
+ manufacturer, name ) ) {
DBGC ( driver, "EFIVETO %s is vetoed (%s)\n",
efi_handle_name ( driver ),
efi_vetoes[i].name );
bs->CloseProtocol ( image, &efi_component_name_protocol_guid,
efi_image_handle, image );
}
+ if ( wtf2.wtf2 ) {
+ bs->CloseProtocol ( image, &efi_component_name2_protocol_guid,
+ efi_image_handle, image );
+ }
bs->CloseProtocol ( image, &efi_loaded_image_protocol_guid,
efi_image_handle, image );
err_loaded: