mirror of https://github.com/ipxe/ipxe.git
[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 <mcb30@ipxe.org>pull/41/head
parent
668dc73d52
commit
5df081d6c0
|
@ -53,3 +53,10 @@ REQUIRE_OBJECT ( usbio );
|
||||||
#ifdef USB_KEYBOARD
|
#ifdef USB_KEYBOARD
|
||||||
REQUIRE_OBJECT ( usbkbd );
|
REQUIRE_OBJECT ( usbkbd );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Drag in USB external interfaces
|
||||||
|
*/
|
||||||
|
#ifdef USB_EFI
|
||||||
|
REQUIRE_OBJECT ( efi_usb );
|
||||||
|
#endif
|
||||||
|
|
|
@ -26,6 +26,11 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
|
||||||
#define IMAGE_EFI /* EFI image support */
|
#define IMAGE_EFI /* EFI image support */
|
||||||
#define IMAGE_SCRIPT /* iPXE script image support */
|
#define IMAGE_SCRIPT /* iPXE script image support */
|
||||||
|
|
||||||
|
#define USB_HCD_XHCI /* xHCI USB host controller */
|
||||||
|
#define USB_HCD_EHCI /* EHCI USB host controller */
|
||||||
|
#define USB_HCD_UHCI /* UHCI USB host controller */
|
||||||
|
#define USB_EFI /* Provide EFI_USB_IO_PROTOCOL interface */
|
||||||
|
|
||||||
#define REBOOT_CMD /* Reboot command */
|
#define REBOOT_CMD /* Reboot command */
|
||||||
#define CPUID_CMD /* x86 CPU feature detection command */
|
#define CPUID_CMD /* x86 CPU feature detection command */
|
||||||
|
|
||||||
|
|
|
@ -26,6 +26,12 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
|
||||||
*/
|
*/
|
||||||
//#undef USB_KEYBOARD /* USB keyboards */
|
//#undef USB_KEYBOARD /* USB keyboards */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* USB external interfaces
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
//#undef USB_EFI /* Provide EFI_USB_IO_PROTOCOL interface */
|
||||||
|
|
||||||
#include <config/named.h>
|
#include <config/named.h>
|
||||||
#include NAMED_CONFIG(usb.h)
|
#include NAMED_CONFIG(usb.h)
|
||||||
#include <config/local/usb.h>
|
#include <config/local/usb.h>
|
||||||
|
|
|
@ -0,0 +1,80 @@
|
||||||
|
#ifndef _IPXE_EFI_USB_H
|
||||||
|
#define _IPXE_EFI_USB_H
|
||||||
|
|
||||||
|
/** @file
|
||||||
|
*
|
||||||
|
* USB I/O protocol
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <ipxe/list.h>
|
||||||
|
#include <ipxe/efi/efi.h>
|
||||||
|
#include <ipxe/efi/efi_driver.h>
|
||||||
|
#include <ipxe/efi/Protocol/UsbIo.h>
|
||||||
|
#include <ipxe/usb.h>
|
||||||
|
|
||||||
|
/** 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 */
|
|
@ -341,6 +341,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
|
||||||
#define ERRFILE_efi_time ( ERRFILE_OTHER | 0x00480000 )
|
#define ERRFILE_efi_time ( ERRFILE_OTHER | 0x00480000 )
|
||||||
#define ERRFILE_efi_watchdog ( ERRFILE_OTHER | 0x00490000 )
|
#define ERRFILE_efi_watchdog ( ERRFILE_OTHER | 0x00490000 )
|
||||||
#define ERRFILE_efi_pxe ( ERRFILE_OTHER | 0x004a0000 )
|
#define ERRFILE_efi_pxe ( ERRFILE_OTHER | 0x004a0000 )
|
||||||
|
#define ERRFILE_efi_usb ( ERRFILE_OTHER | 0x004b0000 )
|
||||||
|
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue