[efi] Allow for custom methods for disconnecting existing drivers

Allow for greater control over the process used to disconnect existing
drivers from a device handle, by converting the "exclude" field from a
simple protocol GUID to a per-driver method.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2025-04-16 21:26:45 +01:00
parent eeec6442d9
commit c88ebf2ac6
10 changed files with 103 additions and 17 deletions

View File

@@ -33,8 +33,13 @@ struct efi_device {
struct efi_driver {
/** Name */
const char *name;
/** Protocol to which exclusive access is required, if any */
EFI_GUID *exclude;
/**
* Exclude existing drivers
*
* @v device EFI device handle
* @ret rc Return status code
*/
int ( * exclude ) ( EFI_HANDLE device );
/**
* Check if driver supports device
*
@@ -95,6 +100,7 @@ extern void efidev_free ( struct efi_device *efidev );
extern struct efi_device * efidev_parent ( struct device *dev );
extern int efi_driver_install ( void );
extern void efi_driver_uninstall ( void );
extern int efi_driver_exclude ( EFI_HANDLE device, EFI_GUID *protocol );
extern int efi_driver_connect_all ( void );
extern void efi_driver_disconnect_all ( void );
extern void efi_driver_reconnect_all ( void );