]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Include/Ppi/UsbIo.h
ShellPkg: Update rm command to properly prepend file system identifiers to filenames.
[mirror_edk2.git] / MdeModulePkg / Include / Ppi / UsbIo.h
CommitLineData
4b1bf81c 1/** @file\r
2 Defines the PEI_USB_IO_PPI that the USB-related PEIM can use for I/O operations \r
3 on the USB BUS. This interface enables recovery from a \r
4 USB-class storage device, such as USB CD/DVD, USB hard drive, or USB FLASH \r
5 drive. These interfaces are modeled on the UEFI 2.3 specification EFI_USB_IO_PROTOCOL.\r
6 Refer to section 16.2.4 of the UEFI 2.3 Specification for more information on \r
7 these interfaces.\r
8\r
9Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
10\r
11This program and the accompanying materials\r
12are licensed and made available under the terms and conditions\r
13of the BSD License which accompanies this distribution. The\r
14full text of the license may be found at\r
15http://opensource.org/licenses/bsd-license.php\r
16\r
17THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
18WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
19\r
20**/\r
21\r
22#ifndef _PEI_USB_IO_PPI_H_\r
23#define _PEI_USB_IO_PPI_H_\r
24\r
25#include <Protocol/Usb2HostController.h>\r
26\r
27///\r
28/// Global ID for the PEI_USB_IO_PPI.\r
29///\r
30#define PEI_USB_IO_PPI_GUID \\r
31 { \\r
32 0x7c29785c, 0x66b9, 0x49fc, { 0xb7, 0x97, 0x1c, 0xa5, 0x55, 0xe, 0xf2, 0x83} \\r
33 }\r
34\r
35///\r
36/// Forward declaration for the PEI_USB_IO_PPI.\r
37///\r
38typedef struct _PEI_USB_IO_PPI PEI_USB_IO_PPI;\r
39\r
40/**\r
41 Submits control transfer to a target USB device.\r
42\r
43 @param[in] PeiServices The pointer to the PEI Services Table.\r
44 @param[in] This The pointer to this instance of the PEI_USB_IO_PPI.\r
45 @param[in] Request A pointer to the USB device request that will be \r
46 sent to the USB device.\r
47 @param[in] Direction Specifies the data direction for the transfer. There \r
48 are three values available: \r
49 EfiUsbDataIn, EfiUsbDataOut and EfiUsbNoData.\r
50 @param[in] TimeOut Indicates the maximum time, in milliseconds, that \r
51 the transfer is allowed to complete.\r
52 @param[in,out] Data A pointer to the buffer of data that will be \r
53 transmitted to or received from the USB device.\r
54 @param[in] DataLength On input, indicates the size, in bytes, of the data \r
55 buffer specified by Data.\r
56 \r
57 @retval EFI_SUCCESS The control transfer was completed successfully.\r
58 @retval EFI_INVALID_PARAMETER Some parameters are invalid.\r
59 @retval EFI_OUT_OF_RESOURCES The control transfer could not be completed due \r
60 to a lack of resources.\r
61 @retval EFI_TIMEOUT The control transfer failed due to timeout.\r
62 @retval EFI_DEVICE_ERROR The control transfer failed due to host controller \r
63 or device error.\r
64 Caller should check TransferResult for detailed \r
65 error information.\r
66\r
67**/\r
68typedef\r
69EFI_STATUS\r
70(EFIAPI *PEI_USB_CONTROL_TRANSFER)(\r
71 IN EFI_PEI_SERVICES **PeiServices,\r
72 IN PEI_USB_IO_PPI *This,\r
73 IN EFI_USB_DEVICE_REQUEST *Request,\r
74 IN EFI_USB_DATA_DIRECTION Direction,\r
75 IN UINT32 Timeout,\r
76 IN OUT VOID *Data OPTIONAL,\r
77 IN UINTN DataLength OPTIONAL\r
78 );\r
79\r
80/**\r
81 Submits bulk transfer to a target USB device.\r
82\r
83 @param[in] PeiServices The pointer to the PEI Services Table.\r
84 @param[in] This The pointer to this instance of the PEI_USB_IO_PPI.\r
85 @param[in] EndPointAddress The endpoint address.\r
86 @param[in] Data The data buffer to be transfered.\r
87 @param[in] DataLength The length of data buffer.\r
88 @param[in] TimeOut The timeout for the transfer, in milliseconds.\r
89\r
90 @retval EFI_SUCCESS The bulk transfer completed successfully.\r
91 @retval EFI_INVALID_PARAMETER Some parameters are invalid.\r
92 @retval EFI_OUT_OF_RESOURCES The bulk transfer could not be completed due to \r
93 a lack of resources.\r
94 @retval EFI_TIMEOUT The bulk transfer failed due to timeout.\r
95 @retval EFI_DEVICE_ERROR The bulk transfer failed due to host controller \r
96 or device error.\r
97 Caller should check TransferResult for detailed \r
98 error information.\r
99\r
100**/\r
101typedef\r
102EFI_STATUS\r
103(EFIAPI *PEI_USB_BULK_TRANSFER)(\r
104 IN EFI_PEI_SERVICES **PeiServices,\r
105 IN PEI_USB_IO_PPI *This,\r
106 IN UINT8 DeviceEndpoint,\r
107 IN OUT VOID *Data,\r
108 IN OUT UINTN *DataLength,\r
109 IN UINTN Timeout\r
110 );\r
111\r
112/**\r
113 Get interface descriptor from a USB device.\r
114\r
115 @param[in] PeiServices The pointer to the PEI Services Table.\r
116 @param[in] This The pointer to this instance of the PEI_USB_IO_PPI.\r
117 @param[in] InterfaceDescriptor The interface descriptor.\r
118\r
119 @retval EFI_SUCCESS The interface descriptor was returned.\r
120 @retval EFI_INVALID_PARAMETER Some parameters are invalid.\r
121 @retval EFI_DEVICE_ERROR A device error occurred, the function failed to \r
122 get the interface descriptor.\r
123\r
124**/\r
125typedef\r
126EFI_STATUS\r
127(EFIAPI *PEI_USB_GET_INTERFACE_DESCRIPTOR)(\r
128 IN EFI_PEI_SERVICES **PeiServices,\r
129 IN PEI_USB_IO_PPI *This,\r
130 IN EFI_USB_INTERFACE_DESCRIPTOR **InterfaceDescriptor\r
131 );\r
132\r
133/**\r
134 Get endpoint descriptor from a USB device.\r
135\r
136 @param[in] PeiServices The pointer to the PEI Services Table.\r
137 @param[in] This The pointer to this instance of the PEI_USB_IO_PPI.\r
138 @param[in] EndPointIndex The index of the end point.\r
139 @param[in] EndpointDescriptor The endpoint descriptor.\r
140\r
141 @retval EFI_SUCCESS The endpoint descriptor was returned.\r
142 @retval EFI_INVALID_PARAMETER Some parameters are invalid.\r
143 @retval EFI_DEVICE_ERROR A device error occurred, the function failed to \r
144 get the endpoint descriptor.\r
145\r
146**/\r
147typedef\r
148EFI_STATUS\r
149(EFIAPI *PEI_USB_GET_ENDPOINT_DESCRIPTOR)(\r
150 IN EFI_PEI_SERVICES **PeiServices,\r
151 IN PEI_USB_IO_PPI *This,\r
152 IN UINT8 EndpointIndex,\r
153 IN EFI_USB_ENDPOINT_DESCRIPTOR **EndpointDescriptor\r
154 );\r
155\r
156/**\r
157 Issue a port reset to the device.\r
158\r
159 @param[in] PeiServices The pointer to the PEI Services Table.\r
160 @param[in] This The pointer to this instance of the PEI_USB_IO_PPI.\r
161\r
162 @retval EFI_SUCCESS The port reset was issued successfully.\r
163 @retval EFI_INVALID_PARAMETER Some parameters are invalid.\r
164 @retval EFI_DEVICE_ERROR Device error occurred.\r
165\r
166**/\r
167typedef\r
168EFI_STATUS\r
169(EFIAPI *PEI_USB_PORT_RESET)(\r
170 IN EFI_PEI_SERVICES **PeiServices,\r
171 IN PEI_USB_IO_PPI *This\r
172 );\r
173\r
174///\r
175/// This PPI contains a set of services to interact with the USB host controller.\r
176/// These interfaces are modeled on the UEFI 2.3 specification EFI_USB_IO_PROTOCOL.\r
177/// Refer to section 16.2.4 of the UEFI 2.3 Specification for more information on \r
178/// these interfaces.\r
179///\r
180struct _PEI_USB_IO_PPI {\r
181 PEI_USB_CONTROL_TRANSFER UsbControlTransfer;\r
182 PEI_USB_BULK_TRANSFER UsbBulkTransfer;\r
183 PEI_USB_GET_INTERFACE_DESCRIPTOR UsbGetInterfaceDescriptor;\r
184 PEI_USB_GET_ENDPOINT_DESCRIPTOR UsbGetEndpointDescriptor;\r
185 PEI_USB_PORT_RESET UsbPortReset;\r
186};\r
187\r
188extern EFI_GUID gPeiUsbIoPpiGuid;\r
189\r
190#endif\r