]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Library/UsbLib.h
Correct parameter UINTN to UINT32
[mirror_edk2.git] / MdePkg / Include / Library / UsbLib.h
1 /** @file
2 Common Dxe Libarary for USB
3
4 Copyright (c) 2006, Intel Corporation<BR>
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13 **/
14
15
16 #ifndef __USB_DXE_LIB_H__
17 #define __USB_DXE_LIB_H__
18
19 #include <Protocol/UsbIo.h>
20
21 //
22 // define the timeout time as 3ms
23 //
24 #define TIMEOUT_VALUE 3 * 1000
25
26 EFI_STATUS
27 EFIAPI
28 UsbGetHidDescriptor (
29 IN EFI_USB_IO_PROTOCOL *UsbIo,
30 IN UINT8 InterfaceNum,
31 OUT EFI_USB_HID_DESCRIPTOR *HidDescriptor
32 );
33
34 EFI_STATUS
35 EFIAPI
36 UsbGetReportDescriptor (
37 IN EFI_USB_IO_PROTOCOL *UsbIo,
38 IN UINT8 InterfaceNum,
39 IN UINT16 DescriptorSize,
40 OUT UINT8 *DescriptorBuffer
41 );
42
43 EFI_STATUS
44 EFIAPI
45 UsbGetProtocolRequest (
46 IN EFI_USB_IO_PROTOCOL *UsbIo,
47 IN UINT8 Interface,
48 IN UINT8 *Protocol
49 );
50
51 EFI_STATUS
52 EFIAPI
53 UsbSetProtocolRequest (
54 IN EFI_USB_IO_PROTOCOL *UsbIo,
55 IN UINT8 Interface,
56 IN UINT8 Protocol
57 );
58
59 EFI_STATUS
60 EFIAPI
61 UsbSetIdleRequest (
62 IN EFI_USB_IO_PROTOCOL *UsbIo,
63 IN UINT8 Interface,
64 IN UINT8 ReportId,
65 IN UINT8 Duration
66 );
67
68 EFI_STATUS
69 EFIAPI
70 UsbGetIdleRequest (
71 IN EFI_USB_IO_PROTOCOL *UsbIo,
72 IN UINT8 Interface,
73 IN UINT8 ReportId,
74 OUT UINT8 *Duration
75 );
76
77 EFI_STATUS
78 EFIAPI
79 UsbSetReportRequest (
80 IN EFI_USB_IO_PROTOCOL *UsbIo,
81 IN UINT8 Interface,
82 IN UINT8 ReportId,
83 IN UINT8 ReportType,
84 IN UINT16 ReportLen,
85 IN UINT8 *Report
86 );
87
88 EFI_STATUS
89 EFIAPI
90 UsbGetReportRequest (
91 IN EFI_USB_IO_PROTOCOL *UsbIo,
92 IN UINT8 Interface,
93 IN UINT8 ReportId,
94 IN UINT8 ReportType,
95 IN UINT16 ReportLen,
96 IN UINT8 *Report
97 );
98
99 typedef enum {
100 EfiUsbEndpointHalt,
101 EfiUsbDeviceRemoteWakeup
102 } EFI_USB_STANDARD_FEATURE_SELECTOR;
103
104 EFI_STATUS
105 UsbGetDescriptor (
106 IN EFI_USB_IO_PROTOCOL *UsbIo,
107 IN UINT16 Value,
108 IN UINT16 Index,
109 IN UINT16 DescriptorLength,
110 OUT VOID *Descriptor,
111 OUT UINT32 *Status
112 );
113
114 EFI_STATUS
115 EFIAPI
116 UsbSetDescriptor (
117 IN EFI_USB_IO_PROTOCOL *UsbIo,
118 IN UINT16 Value,
119 IN UINT16 Index,
120 IN UINT16 DescriptorLength,
121 IN VOID *Descriptor,
122 OUT UINT32 *Status
123 );
124
125 EFI_STATUS
126 EFIAPI
127 UsbGetInterface (
128 IN EFI_USB_IO_PROTOCOL *UsbIo,
129 IN UINT16 Index,
130 OUT UINT8 *AltSetting,
131 OUT UINT32 *Status
132 );
133
134 EFI_STATUS
135 EFIAPI
136 UsbSetInterface (
137 IN EFI_USB_IO_PROTOCOL *UsbIo,
138 IN UINT16 InterfaceNo,
139 IN UINT16 AltSetting,
140 OUT UINT32 *Status
141 );
142
143 EFI_STATUS
144 EFIAPI
145 UsbGetConfiguration (
146 IN EFI_USB_IO_PROTOCOL *UsbIo,
147 OUT UINT8 *ConfigValue,
148 OUT UINT32 *Status
149 );
150
151 EFI_STATUS
152 EFIAPI
153 UsbSetConfiguration (
154 IN EFI_USB_IO_PROTOCOL *UsbIo,
155 IN UINT16 Value,
156 OUT UINT32 *Status
157 );
158
159 EFI_STATUS
160 EFIAPI
161 UsbSetFeature (
162 IN EFI_USB_IO_PROTOCOL *UsbIo,
163 IN UINTN Recipient,
164 IN UINT16 Value,
165 IN UINT16 Target,
166 OUT UINT32 *Status
167 );
168
169 EFI_STATUS
170 EFIAPI
171 UsbClearFeature (
172 IN EFI_USB_IO_PROTOCOL *UsbIo,
173 IN UINTN Recipient,
174 IN UINT16 Value,
175 IN UINT16 Target,
176 OUT UINT32 *Status
177 );
178
179 EFI_STATUS
180 EFIAPI
181 UsbGetStatus (
182 IN EFI_USB_IO_PROTOCOL *UsbIo,
183 IN UINTN Recipient,
184 IN UINT16 Target,
185 OUT UINT16 *DevStatus,
186 OUT UINT32 *Status
187 );
188
189 EFI_STATUS
190 EFIAPI
191 UsbGetHubDescriptor (
192 IN EFI_USB_IO_PROTOCOL *UsbIo,
193 IN UINT16 Value,
194 IN UINT16 Index,
195 IN UINT16 DescriptorLength,
196 OUT VOID *Descriptor,
197 OUT UINT32 *Status
198 );
199
200 //
201 // Clear endpoint stall
202 //
203 EFI_STATUS
204 EFIAPI
205 UsbClearEndpointHalt (
206 IN EFI_USB_IO_PROTOCOL *UsbIo,
207 IN UINT8 EndpointNo,
208 OUT UINT32 *Status
209 );
210
211 #endif