From 5df081d6c039924506c07c0c7a2cf7e2c699709f Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Thu, 10 Sep 2015 17:22:03 +0100 Subject: [efi] Expose unused USB devices via EFI_USB_IO_PROTOCOL Allow the UEFI platform firmware to provide drivers for unrecognised devices, by exposing our own implementation of EFI_USB_IO_PROTOCOL. Signed-off-by: Michael Brown --- src/include/ipxe/efi/efi_usb.h | 80 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 src/include/ipxe/efi/efi_usb.h (limited to 'src/include/ipxe/efi') diff --git a/src/include/ipxe/efi/efi_usb.h b/src/include/ipxe/efi/efi_usb.h new file mode 100644 index 000000000..05b4fad00 --- /dev/null +++ b/src/include/ipxe/efi/efi_usb.h @@ -0,0 +1,80 @@ +#ifndef _IPXE_EFI_USB_H +#define _IPXE_EFI_USB_H + +/** @file + * + * USB I/O protocol + * + */ + +#include +#include +#include +#include +#include + +/** An EFI USB device */ +struct efi_usb_device { + /** Name */ + const char *name; + /** The underlying USB device */ + struct usb_device *usb; + /** The underlying EFI device */ + struct efi_device *efidev; + /** Configuration descriptor */ + struct usb_configuration_descriptor *config; + /** Supported languages */ + struct usb_descriptor_header *languages; + /** List of interfaces */ + struct list_head interfaces; +}; + +/** An EFI USB device interface */ +struct efi_usb_interface { + /** Name */ + char name[32]; + /** Containing USB device */ + struct efi_usb_device *usbdev; + /** List of interfaces */ + struct list_head list; + + /** Interface number */ + unsigned int interface; + /** Alternate setting */ + unsigned int alternate; + /** EFI handle */ + EFI_HANDLE handle; + /** USB I/O protocol */ + EFI_USB_IO_PROTOCOL usbio; + /** Device path */ + EFI_DEVICE_PATH_PROTOCOL *path; + + /** Opened endpoints */ + struct efi_usb_endpoint *endpoint[32]; +}; + +/** An EFI USB device endpoint */ +struct efi_usb_endpoint { + /** EFI USB device interface */ + struct efi_usb_interface *usbintf; + /** USB endpoint */ + struct usb_endpoint ep; + + /** Most recent synchronous completion status */ + int rc; + + /** Asynchronous timer event */ + EFI_EVENT event; + /** Asynchronous callback handler */ + EFI_ASYNC_USB_TRANSFER_CALLBACK callback; + /** Asynchronous callback context */ + void *context; +}; + +/** Asynchronous transfer fill level + * + * This is a policy decision. + */ +#define EFI_USB_ASYNC_FILL 2 + +#endif /* _IPXE_EFI_USB_H */ -- cgit v1.2.3-55-g7522