iPXE
efi_usb.h
Go to the documentation of this file.
00001 #ifndef _IPXE_EFI_USB_H
00002 #define _IPXE_EFI_USB_H
00003 
00004 /** @file
00005  *
00006  * USB I/O protocol
00007  *
00008  */
00009 
00010 #include <ipxe/list.h>
00011 #include <ipxe/efi/efi.h>
00012 #include <ipxe/efi/efi_driver.h>
00013 #include <ipxe/efi/Protocol/UsbIo.h>
00014 #include <ipxe/usb.h>
00015 
00016 /** An EFI USB device */
00017 struct efi_usb_device {
00018         /** Name */
00019         const char *name;
00020         /** The underlying USB device */
00021         struct usb_device *usb;
00022         /** The underlying EFI device */
00023         struct efi_device *efidev;
00024         /** Configuration descriptor */
00025         struct usb_configuration_descriptor *config;
00026         /** Supported languages */
00027         struct usb_descriptor_header *languages;
00028         /** List of interfaces */
00029         struct list_head interfaces;
00030 };
00031 
00032 /** An EFI USB device interface */
00033 struct efi_usb_interface {
00034         /** Name */
00035         char name[32];
00036         /** Containing USB device */
00037         struct efi_usb_device *usbdev;
00038         /** List of interfaces */
00039         struct list_head list;
00040 
00041         /** Interface number */
00042         unsigned int interface;
00043         /** Alternate setting */
00044         unsigned int alternate;
00045         /** EFI handle */
00046         EFI_HANDLE handle;
00047         /** USB I/O protocol */
00048         EFI_USB_IO_PROTOCOL usbio;
00049         /** Device path */
00050         EFI_DEVICE_PATH_PROTOCOL *path;
00051 
00052         /** Opened endpoints */
00053         struct efi_usb_endpoint *endpoint[32];
00054 };
00055 
00056 /** An EFI USB device endpoint */
00057 struct efi_usb_endpoint {
00058         /** EFI USB device interface */
00059         struct efi_usb_interface *usbintf;
00060         /** USB endpoint */
00061         struct usb_endpoint ep;
00062 
00063         /** Most recent synchronous completion status */
00064         int rc;
00065 
00066         /** Asynchronous timer event */
00067         EFI_EVENT event;
00068         /** Asynchronous callback handler */
00069         EFI_ASYNC_USB_TRANSFER_CALLBACK callback;
00070         /** Asynchronous callback context */
00071         void *context;
00072 };
00073 
00074 /** Asynchronous transfer fill level
00075  *
00076  * This is a policy decision.
00077  */
00078 #define EFI_USB_ASYNC_FILL 2
00079 
00080 #endif /* _IPXE_EFI_USB_H */