]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Library/UsbLib.h
f3b56fbb80f4ebf551abb44281dbda27028458cc
[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 EFI_STATUS
100 UsbGetDescriptor (
101 IN EFI_USB_IO_PROTOCOL *UsbIo,
102 IN UINT16 Value,
103 IN UINT16 Index,
104 IN UINT16 DescriptorLength,
105 OUT VOID *Descriptor,
106 OUT UINT32 *Status
107 );
108
109 EFI_STATUS
110 EFIAPI
111 UsbSetDescriptor (
112 IN EFI_USB_IO_PROTOCOL *UsbIo,
113 IN UINT16 Value,
114 IN UINT16 Index,
115 IN UINT16 DescriptorLength,
116 IN VOID *Descriptor,
117 OUT UINT32 *Status
118 );
119
120 EFI_STATUS
121 EFIAPI
122 UsbGetInterface (
123 IN EFI_USB_IO_PROTOCOL *UsbIo,
124 IN UINT16 Index,
125 OUT UINT8 *AltSetting,
126 OUT UINT32 *Status
127 );
128
129 EFI_STATUS
130 EFIAPI
131 UsbSetInterface (
132 IN EFI_USB_IO_PROTOCOL *UsbIo,
133 IN UINT16 InterfaceNo,
134 IN UINT16 AltSetting,
135 OUT UINT32 *Status
136 );
137
138 EFI_STATUS
139 EFIAPI
140 UsbGetConfiguration (
141 IN EFI_USB_IO_PROTOCOL *UsbIo,
142 OUT UINT8 *ConfigValue,
143 OUT UINT32 *Status
144 );
145
146 EFI_STATUS
147 EFIAPI
148 UsbSetConfiguration (
149 IN EFI_USB_IO_PROTOCOL *UsbIo,
150 IN UINT16 Value,
151 OUT UINT32 *Status
152 );
153
154 EFI_STATUS
155 EFIAPI
156 UsbSetFeature (
157 IN EFI_USB_IO_PROTOCOL *UsbIo,
158 IN UINTN Recipient,
159 IN UINT16 Value,
160 IN UINT16 Target,
161 OUT UINT32 *Status
162 );
163
164 EFI_STATUS
165 EFIAPI
166 UsbClearFeature (
167 IN EFI_USB_IO_PROTOCOL *UsbIo,
168 IN UINTN Recipient,
169 IN UINT16 Value,
170 IN UINT16 Target,
171 OUT UINT32 *Status
172 );
173
174 EFI_STATUS
175 EFIAPI
176 UsbGetStatus (
177 IN EFI_USB_IO_PROTOCOL *UsbIo,
178 IN UINTN Recipient,
179 IN UINT16 Target,
180 OUT UINT16 *DevStatus,
181 OUT UINT32 *Status
182 );
183
184 //
185 // Clear endpoint stall
186 //
187 EFI_STATUS
188 EFIAPI
189 UsbClearEndpointHalt (
190 IN EFI_USB_IO_PROTOCOL *UsbIo,
191 IN UINT8 EndpointNo,
192 OUT UINT32 *Status
193 );
194
195 #endif