You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

efi_usb.h 1.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. #ifndef _IPXE_EFI_USB_H
  2. #define _IPXE_EFI_USB_H
  3. /** @file
  4. *
  5. * USB I/O protocol
  6. *
  7. */
  8. #include <ipxe/list.h>
  9. #include <ipxe/efi/efi.h>
  10. #include <ipxe/efi/efi_driver.h>
  11. #include <ipxe/efi/Protocol/UsbIo.h>
  12. #include <ipxe/usb.h>
  13. /** An EFI USB device */
  14. struct efi_usb_device {
  15. /** Name */
  16. const char *name;
  17. /** The underlying USB device */
  18. struct usb_device *usb;
  19. /** The underlying EFI device */
  20. struct efi_device *efidev;
  21. /** Configuration descriptor */
  22. struct usb_configuration_descriptor *config;
  23. /** Supported languages */
  24. struct usb_descriptor_header *languages;
  25. /** List of interfaces */
  26. struct list_head interfaces;
  27. };
  28. /** An EFI USB device interface */
  29. struct efi_usb_interface {
  30. /** Name */
  31. char name[32];
  32. /** Containing USB device */
  33. struct efi_usb_device *usbdev;
  34. /** List of interfaces */
  35. struct list_head list;
  36. /** Interface number */
  37. unsigned int interface;
  38. /** Alternate setting */
  39. unsigned int alternate;
  40. /** EFI handle */
  41. EFI_HANDLE handle;
  42. /** USB I/O protocol */
  43. EFI_USB_IO_PROTOCOL usbio;
  44. /** Device path */
  45. EFI_DEVICE_PATH_PROTOCOL *path;
  46. /** Opened endpoints */
  47. struct efi_usb_endpoint *endpoint[32];
  48. };
  49. /** An EFI USB device endpoint */
  50. struct efi_usb_endpoint {
  51. /** EFI USB device interface */
  52. struct efi_usb_interface *usbintf;
  53. /** USB endpoint */
  54. struct usb_endpoint ep;
  55. /** Most recent synchronous completion status */
  56. int rc;
  57. /** Asynchronous timer event */
  58. EFI_EVENT event;
  59. /** Asynchronous callback handler */
  60. EFI_ASYNC_USB_TRANSFER_CALLBACK callback;
  61. /** Asynchronous callback context */
  62. void *context;
  63. };
  64. /** Asynchronous transfer fill level
  65. *
  66. * This is a policy decision.
  67. */
  68. #define EFI_USB_ASYNC_FILL 2
  69. #endif /* _IPXE_EFI_USB_H */