TianoCore EDK2 master
Loading...
Searching...
No Matches
UsbIo.h
Go to the documentation of this file.
1
13#ifndef __USB_IO_H__
14#define __USB_IO_H__
15
17
18//
19// Global ID for the USB I/O Protocol
20//
21#define EFI_USB_IO_PROTOCOL_GUID \
22 { \
23 0x2B2F68D6, 0x0CD2, 0x44cf, {0x8E, 0x8B, 0xBB, 0xA2, 0x0B, 0x1B, 0x5B, 0x75 } \
24 }
25
27
28//
29// Related Definition for EFI USB I/O protocol
30//
31
32//
33// USB standard descriptors and reqeust
34//
40
44typedef enum {
45 EfiUsbDataIn,
46 EfiUsbDataOut,
47 EfiUsbNoData
49
50//
51// USB Transfer Results
52//
53#define EFI_USB_NOERROR 0x00
54#define EFI_USB_ERR_NOTEXECUTE 0x01
55#define EFI_USB_ERR_STALL 0x02
56#define EFI_USB_ERR_BUFFER 0x04
57#define EFI_USB_ERR_BABBLE 0x08
58#define EFI_USB_ERR_NAK 0x10
59#define EFI_USB_ERR_CRC 0x20
60#define EFI_USB_ERR_TIMEOUT 0x40
61#define EFI_USB_ERR_BITSTUFF 0x80
62#define EFI_USB_ERR_SYSTEM 0x100
63
78typedef
81 IN VOID *Data,
82 IN UINTN DataLength,
83 IN VOID *Context,
84 IN UINT32 Status
85 );
86
87//
88// Prototype for EFI USB I/O protocol
89//
90
113typedef
117 IN EFI_USB_DEVICE_REQUEST *Request,
118 IN EFI_USB_DATA_DIRECTION Direction,
119 IN UINT32 Timeout,
120 IN OUT VOID *Data OPTIONAL,
121 IN UINTN DataLength OPTIONAL,
122 OUT UINT32 *Status
123 );
124
156typedef
160 IN UINT8 DeviceEndpoint,
161 IN OUT VOID *Data,
162 IN OUT UINTN *DataLength,
163 IN UINTN Timeout,
164 OUT UINT32 *Status
165 );
166
201typedef
205 IN UINT8 DeviceEndpoint,
206 IN BOOLEAN IsNewTransfer,
207 IN UINTN PollingInterval OPTIONAL,
208 IN UINTN DataLength OPTIONAL,
210 IN VOID *Context OPTIONAL
211 );
212
241typedef
245 IN UINT8 DeviceEndpoint,
246 IN OUT VOID *Data,
247 IN OUT UINTN *DataLength,
248 IN UINTN Timeout,
249 OUT UINT32 *Status
250 );
251
277typedef
281 IN UINT8 DeviceEndpoint,
282 IN OUT VOID *Data,
283 IN UINTN DataLength,
284 OUT UINT32 *Status
285 );
286
314typedef
318 IN UINT8 DeviceEndpoint,
319 IN OUT VOID *Data,
320 IN UINTN DataLength,
321 IN EFI_ASYNC_USB_TRANSFER_CALLBACK IsochronousCallBack,
322 IN VOID *Context OPTIONAL
323 );
324
336typedef
338(EFIAPI *EFI_USB_IO_PORT_RESET)(
340 );
341
353typedef
357 OUT EFI_USB_DEVICE_DESCRIPTOR *DeviceDescriptor
358 );
359
372typedef
376 OUT EFI_USB_CONFIG_DESCRIPTOR *ConfigurationDescriptor
377 );
378
392typedef
396 OUT EFI_USB_INTERFACE_DESCRIPTOR *InterfaceDescriptor
397 );
398
413typedef
417 IN UINT8 EndpointIndex,
418 OUT EFI_USB_ENDPOINT_DESCRIPTOR *EndpointDescriptor
419 );
420
438typedef
442 IN UINT16 LangID,
443 IN UINT8 StringID,
444 OUT CHAR16 **String
445 );
446
461typedef
465 OUT UINT16 **LangIDTable,
466 OUT UINT16 *TableSize
467 );
468
477 //
478 // IO transfer
479 //
480 EFI_USB_IO_CONTROL_TRANSFER UsbControlTransfer;
481 EFI_USB_IO_BULK_TRANSFER UsbBulkTransfer;
482 EFI_USB_IO_ASYNC_INTERRUPT_TRANSFER UsbAsyncInterruptTransfer;
483 EFI_USB_IO_SYNC_INTERRUPT_TRANSFER UsbSyncInterruptTransfer;
484 EFI_USB_IO_ISOCHRONOUS_TRANSFER UsbIsochronousTransfer;
485 EFI_USB_IO_ASYNC_ISOCHRONOUS_TRANSFER UsbAsyncIsochronousTransfer;
486
487 //
488 // Common device request
489 //
490 EFI_USB_IO_GET_DEVICE_DESCRIPTOR UsbGetDeviceDescriptor;
491 EFI_USB_IO_GET_CONFIG_DESCRIPTOR UsbGetConfigDescriptor;
492 EFI_USB_IO_GET_INTERFACE_DESCRIPTOR UsbGetInterfaceDescriptor;
493 EFI_USB_IO_GET_ENDPOINT_DESCRIPTOR UsbGetEndpointDescriptor;
494 EFI_USB_IO_GET_STRING_DESCRIPTOR UsbGetStringDescriptor;
495 EFI_USB_IO_GET_SUPPORTED_LANGUAGE UsbGetSupportedLanguages;
496
497 //
498 // Reset controller's parent port
499 //
500 EFI_USB_IO_PORT_RESET UsbPortReset;
501};
502
503extern EFI_GUID gEfiUsbIoProtocolGuid;
504
505#endif
UINT64 UINTN
#define OPTIONAL
Definition: Base.h:290
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
EFI_STATUS(EFIAPI * EFI_USB_IO_SYNC_INTERRUPT_TRANSFER)(IN EFI_USB_IO_PROTOCOL *This, IN UINT8 DeviceEndpoint, IN OUT VOID *Data, IN OUT UINTN *DataLength, IN UINTN Timeout, OUT UINT32 *Status)
Definition: UsbIo.h:243
EFI_STATUS(EFIAPI * EFI_USB_IO_ASYNC_ISOCHRONOUS_TRANSFER)(IN EFI_USB_IO_PROTOCOL *This, IN UINT8 DeviceEndpoint, IN OUT VOID *Data, IN UINTN DataLength, IN EFI_ASYNC_USB_TRANSFER_CALLBACK IsochronousCallBack, IN VOID *Context OPTIONAL)
Definition: UsbIo.h:316
EFI_STATUS(EFIAPI * EFI_USB_IO_ASYNC_INTERRUPT_TRANSFER)(IN EFI_USB_IO_PROTOCOL *This, IN UINT8 DeviceEndpoint, IN BOOLEAN IsNewTransfer, IN UINTN PollingInterval OPTIONAL, IN UINTN DataLength OPTIONAL, IN EFI_ASYNC_USB_TRANSFER_CALLBACK InterruptCallBack OPTIONAL, IN VOID *Context OPTIONAL)
Definition: UsbIo.h:203
EFI_STATUS(EFIAPI * EFI_USB_IO_BULK_TRANSFER)(IN EFI_USB_IO_PROTOCOL *This, IN UINT8 DeviceEndpoint, IN OUT VOID *Data, IN OUT UINTN *DataLength, IN UINTN Timeout, OUT UINT32 *Status)
Definition: UsbIo.h:158
EFI_USB_DATA_DIRECTION
Definition: UsbIo.h:44
EFI_STATUS(EFIAPI * EFI_USB_IO_CONTROL_TRANSFER)(IN EFI_USB_IO_PROTOCOL *This, IN EFI_USB_DEVICE_REQUEST *Request, IN EFI_USB_DATA_DIRECTION Direction, IN UINT32 Timeout, IN OUT VOID *Data OPTIONAL, IN UINTN DataLength OPTIONAL, OUT UINT32 *Status)
Definition: UsbIo.h:115
EFI_STATUS(EFIAPI * EFI_USB_IO_PORT_RESET)(IN EFI_USB_IO_PROTOCOL *This)
Definition: UsbIo.h:338
EFI_STATUS(EFIAPI * EFI_USB_IO_GET_ENDPOINT_DESCRIPTOR)(IN EFI_USB_IO_PROTOCOL *This, IN UINT8 EndpointIndex, OUT EFI_USB_ENDPOINT_DESCRIPTOR *EndpointDescriptor)
Definition: UsbIo.h:415
EFI_STATUS(EFIAPI * EFI_USB_IO_GET_DEVICE_DESCRIPTOR)(IN EFI_USB_IO_PROTOCOL *This, OUT EFI_USB_DEVICE_DESCRIPTOR *DeviceDescriptor)
Definition: UsbIo.h:355
EFI_STATUS(EFIAPI * EFI_USB_IO_GET_SUPPORTED_LANGUAGE)(IN EFI_USB_IO_PROTOCOL *This, OUT UINT16 **LangIDTable, OUT UINT16 *TableSize)
Definition: UsbIo.h:463
EFI_STATUS(EFIAPI * EFI_USB_IO_ISOCHRONOUS_TRANSFER)(IN EFI_USB_IO_PROTOCOL *This, IN UINT8 DeviceEndpoint, IN OUT VOID *Data, IN UINTN DataLength, OUT UINT32 *Status)
Definition: UsbIo.h:279
EFI_STATUS(EFIAPI * EFI_ASYNC_USB_TRANSFER_CALLBACK)(IN VOID *Data, IN UINTN DataLength, IN VOID *Context, IN UINT32 Status)
Definition: UsbIo.h:80
EFI_STATUS(EFIAPI * EFI_USB_IO_GET_INTERFACE_DESCRIPTOR)(IN EFI_USB_IO_PROTOCOL *This, OUT EFI_USB_INTERFACE_DESCRIPTOR *InterfaceDescriptor)
Definition: UsbIo.h:394
EFI_STATUS(EFIAPI * EFI_USB_IO_GET_CONFIG_DESCRIPTOR)(IN EFI_USB_IO_PROTOCOL *This, OUT EFI_USB_CONFIG_DESCRIPTOR *ConfigurationDescriptor)
Definition: UsbIo.h:374
EFI_STATUS(EFIAPI * EFI_USB_IO_GET_STRING_DESCRIPTOR)(IN EFI_USB_IO_PROTOCOL *This, IN UINT16 LangID, IN UINT8 StringID, OUT CHAR16 **String)
Definition: UsbIo.h:440
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
Definition: Base.h:213