]> git.proxmox.com Git - mirror_edk2.git/blame - QuarkSocPkg/QuarkSouthCluster/Usb/Ohci/Dxe/Ohci.h
QuarkSocPkg: Fix typos in comments
[mirror_edk2.git] / QuarkSocPkg / QuarkSouthCluster / Usb / Ohci / Dxe / Ohci.h
CommitLineData
9b6bbcdb
MK
1/** @file\r
2Provides the definition of Usb Hc Protocol and OHCI controller\r
3private data structure.\r
4\r
74c6a103 5Copyright (c) 2013-2016 Intel Corporation.\r
9b6bbcdb
MK
6\r
7This program and the accompanying materials\r
8are licensed and made available under the terms and conditions of the BSD License\r
9which accompanies this distribution. The full text of the license may be found at\r
10http://opensource.org/licenses/bsd-license.php\r
11\r
12THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
13WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
14\r
15**/\r
16\r
17\r
18\r
19#ifndef _OHCI_H\r
20#define _OHCI_H\r
21\r
22\r
23#include <Uefi.h>\r
24\r
25#include <Protocol/UsbHostController.h>\r
26#include <Protocol/PciIo.h>\r
27\r
28#include <Guid/EventGroup.h>\r
29\r
30#include <Library/DebugLib.h>\r
31#include <Library/BaseMemoryLib.h>\r
32#include <Library/UefiBootServicesTableLib.h>\r
33#include <Library/UefiLib.h>\r
34#include <Library/BaseLib.h>\r
35#include <Library/MemoryAllocationLib.h>\r
36\r
37#include <IndustryStandard/Pci.h>\r
38\r
39\r
40typedef struct _USB_OHCI_HC_DEV USB_OHCI_HC_DEV;\r
41\r
42#include "UsbHcMem.h"\r
43#include "OhciReg.h"\r
44#include "OhciSched.h"\r
45#include "OhciUrb.h"\r
46#include "Descriptor.h"\r
47#include "ComponentName.h"\r
48#include "OhciDebug.h"\r
49\r
50extern EFI_DRIVER_BINDING_PROTOCOL gOhciDriverBinding;\r
51extern EFI_COMPONENT_NAME_PROTOCOL gOhciComponentName;\r
52extern EFI_COMPONENT_NAME2_PROTOCOL gOhciComponentName2;\r
53\r
54#define USB_OHCI_HC_DEV_SIGNATURE SIGNATURE_32('o','h','c','i')\r
55\r
56typedef struct _HCCA_MEMORY_BLOCK{\r
57 UINT32 HccaInterruptTable[32]; // 32-bit Physical Address to ED_DESCRIPTOR\r
58 UINT16 HccaFrameNumber;\r
59 UINT16 HccaPad;\r
60 UINT32 HccaDoneHead; // 32-bit Physical Address to TD_DESCRIPTOR\r
61 UINT8 Reserved[116];\r
62} HCCA_MEMORY_BLOCK;\r
63\r
64\r
65struct _USB_OHCI_HC_DEV {\r
66 UINTN Signature;\r
67 EFI_USB_HC_PROTOCOL UsbHc;\r
68 EFI_USB2_HC_PROTOCOL Usb2Hc;\r
69 EFI_PCI_IO_PROTOCOL *PciIo;\r
70 UINT64 OriginalPciAttributes;\r
71\r
72 HCCA_MEMORY_BLOCK *HccaMemoryBlock;\r
73 VOID *HccaMemoryBuf;\r
74 VOID *HccaMemoryMapping;\r
75 UINTN HccaMemoryPages;\r
76\r
77 ED_DESCRIPTOR *IntervalList[6][32];\r
78 INTERRUPT_CONTEXT_ENTRY *InterruptContextList;\r
79 VOID *MemPool;\r
80\r
81 UINT32 ToggleFlag;\r
82\r
83 EFI_EVENT HouseKeeperTimer;\r
84 //\r
85 // ExitBootServicesEvent is used to stop the OHC DMA operation\r
86 // after exit boot service.\r
87 //\r
88 EFI_EVENT ExitBootServiceEvent;\r
89\r
90 EFI_UNICODE_STRING_TABLE *ControllerNameTable;\r
91};\r
92\r
93#define USB_OHCI_HC_DEV_FROM_THIS(a) CR(a, USB_OHCI_HC_DEV, UsbHc, USB_OHCI_HC_DEV_SIGNATURE)\r
94#define USB2_OHCI_HC_DEV_FROM_THIS(a) CR(a, USB_OHCI_HC_DEV, Usb2Hc, USB_OHCI_HC_DEV_SIGNATURE)\r
95\r
96//\r
97// Func List\r
98//\r
99\r
100/**\r
101 Provides software reset for the USB host controller.\r
102\r
103 @param This This EFI_USB_HC_PROTOCOL instance.\r
104 @param Attributes A bit mask of the reset operation to perform.\r
105\r
106 @retval EFI_SUCCESS The reset operation succeeded.\r
107 @retval EFI_INVALID_PARAMETER Attributes is not valid.\r
108 @retval EFI_UNSUPPOURTED The type of reset specified by Attributes is\r
109 not currently supported by the host controller.\r
110 @retval EFI_DEVICE_ERROR Host controller isn't halted to reset.\r
111\r
112**/\r
113EFI_STATUS\r
114EFIAPI\r
115OhciReset (\r
116 IN EFI_USB_HC_PROTOCOL *This,\r
117 IN UINT16 Attributes\r
118 );\r
119/**\r
120 Retrieve the current state of the USB host controller.\r
121\r
122 @param This This EFI_USB_HC_PROTOCOL instance.\r
123 @param State Variable to return the current host controller\r
124 state.\r
125\r
126 @retval EFI_SUCCESS Host controller state was returned in State.\r
127 @retval EFI_INVALID_PARAMETER State is NULL.\r
128 @retval EFI_DEVICE_ERROR An error was encountered while attempting to\r
129 retrieve the host controller's current state.\r
130\r
131**/\r
132\r
133EFI_STATUS\r
134EFIAPI\r
135OhciGetState (\r
136 IN EFI_USB_HC_PROTOCOL *This,\r
137 OUT EFI_USB_HC_STATE *State\r
138 );\r
139/**\r
140 Sets the USB host controller to a specific state.\r
141\r
142 @param This This EFI_USB_HC_PROTOCOL instance.\r
143 @param State The state of the host controller that will be set.\r
144\r
145 @retval EFI_SUCCESS The USB host controller was successfully placed\r
146 in the state specified by State.\r
147 @retval EFI_INVALID_PARAMETER State is invalid.\r
148 @retval EFI_DEVICE_ERROR Failed to set the state due to device error.\r
149\r
150**/\r
151\r
152EFI_STATUS\r
153EFIAPI\r
154OhciSetState(\r
155 IN EFI_USB_HC_PROTOCOL *This,\r
156 IN EFI_USB_HC_STATE State\r
157 );\r
158/**\r
159\r
160 Submits control transfer to a target USB device.\r
161\r
162 @param This A pointer to the EFI_USB_HC_PROTOCOL instance.\r
163 @param DeviceAddress Represents the address of the target device on the USB,\r
164 which is assigned during USB enumeration.\r
165 @param IsSlowDevice Indicates whether the target device is slow device\r
166 or full-speed device.\r
167 @param MaxPaketLength Indicates the maximum packet size that the\r
168 default control transfer endpoint is capable of\r
169 sending or receiving.\r
170 @param Request A pointer to the USB device request that will be sent\r
171 to the USB device.\r
172 @param TransferDirection Specifies the data direction for the transfer.\r
173 There are three values available, DataIn, DataOut\r
174 and NoData.\r
175 @param Data A pointer to the buffer of data that will be transmitted\r
176 to USB device or received from USB device.\r
177 @param DataLength Indicates the size, in bytes, of the data buffer\r
178 specified by Data.\r
179 @param TimeOut Indicates the maximum time, in microseconds,\r
180 which the transfer is allowed to complete.\r
181 @param TransferResult A pointer to the detailed result information generated\r
182 by this control transfer.\r
183\r
184 @retval EFI_SUCCESS The control transfer was completed successfully.\r
185 @retval EFI_OUT_OF_RESOURCES The control transfer could not be completed due to a lack of resources.\r
186 @retval EFI_INVALID_PARAMETER Some parameters are invalid.\r
187 @retval EFI_TIMEOUT The control transfer failed due to timeout.\r
188 @retval EFI_DEVICE_ERROR The control transfer failed due to host controller or device error.\r
189 Caller should check TranferResult for detailed error information.\r
190\r
191--*/\r
192\r
193\r
194EFI_STATUS\r
195EFIAPI\r
196OhciControlTransfer (\r
197 IN EFI_USB_HC_PROTOCOL *This,\r
198 IN UINT8 DeviceAddress,\r
199 IN BOOLEAN IsSlowDevice,\r
200 IN UINT8 MaxPacketLength,\r
201 IN EFI_USB_DEVICE_REQUEST *Request,\r
202 IN EFI_USB_DATA_DIRECTION TransferDirection,\r
203 IN OUT VOID *Data OPTIONAL,\r
204 IN OUT UINTN *DataLength OPTIONAL,\r
205 IN UINTN TimeOut,\r
206 OUT UINT32 *TransferResult\r
207 );\r
208/**\r
209\r
210 Submits bulk transfer to a bulk endpoint of a USB device.\r
211\r
212 @param This A pointer to the EFI_USB_HC_PROTOCOL instance.\r
213 @param DeviceAddress Represents the address of the target device on the USB,\r
214 which is assigned during USB enumeration.\r
215 @param EndPointAddress The combination of an endpoint number and an\r
216 endpoint direction of the target USB device.\r
217 Each endpoint address supports data transfer in\r
218 one direction except the control endpoint\r
219 (whose default endpoint address is 0).\r
220 It is the caller's responsibility to make sure that\r
221 the EndPointAddress represents a bulk endpoint.\r
222 @param MaximumPacketLength Indicates the maximum packet size the target endpoint\r
223 is capable of sending or receiving.\r
224 @param Data A pointer to the buffer of data that will be transmitted\r
225 to USB device or received from USB device.\r
226 @param DataLength When input, indicates the size, in bytes, of the data buffer\r
227 specified by Data. When output, indicates the actually\r
228 transferred data size.\r
229 @param DataToggle A pointer to the data toggle value. On input, it indicates\r
230 the initial data toggle value the bulk transfer should adopt;\r
231 on output, it is updated to indicate the data toggle value\r
232 of the subsequent bulk transfer.\r
233 @param TimeOut Indicates the maximum time, in microseconds, which the\r
234 transfer is allowed to complete.\r
235 TransferResult A pointer to the detailed result information of the\r
236 bulk transfer.\r
237\r
238 @retval EFI_SUCCESS The bulk transfer was completed successfully.\r
239 @retval EFI_OUT_OF_RESOURCES The bulk transfer could not be submitted due to lack of resource.\r
240 @retval EFI_INVALID_PARAMETER Some parameters are invalid.\r
241 @retval EFI_TIMEOUT The bulk transfer failed due to timeout.\r
242 @retval EFI_DEVICE_ERROR The bulk transfer failed due to host controller or device error.\r
243 Caller should check TranferResult for detailed error information.\r
244\r
245**/\r
246\r
247\r
248EFI_STATUS\r
249EFIAPI\r
250OhciBulkTransfer(\r
251 IN EFI_USB_HC_PROTOCOL *This,\r
252 IN UINT8 DeviceAddress,\r
253 IN UINT8 EndPointAddress,\r
254 IN UINT8 MaxPacketLength,\r
255 IN OUT VOID *Data,\r
256 IN OUT UINTN *DataLength,\r
257 IN OUT UINT8 *DataToggle,\r
258 IN UINTN TimeOut,\r
259 OUT UINT32 *TransferResult\r
260 );\r
261/**\r
262\r
263 Submits an interrupt transfer to an interrupt endpoint of a USB device.\r
264\r
265 @param Ohc Device private data\r
266 @param DeviceAddress Represents the address of the target device on the USB,\r
267 which is assigned during USB enumeration.\r
268 @param EndPointAddress The combination of an endpoint number and an endpoint\r
269 direction of the target USB device. Each endpoint address\r
270 supports data transfer in one direction except the\r
271 control endpoint (whose default endpoint address is 0).\r
272 It is the caller's responsibility to make sure that\r
273 the EndPointAddress represents an interrupt endpoint.\r
274 @param IsSlowDevice Indicates whether the target device is slow device\r
275 or full-speed device.\r
276 @param MaxPacketLength Indicates the maximum packet size the target endpoint\r
277 is capable of sending or receiving.\r
278 @param IsNewTransfer If TRUE, an asynchronous interrupt pipe is built between\r
279 the host and the target interrupt endpoint.\r
280 If FALSE, the specified asynchronous interrupt pipe\r
281 is canceled.\r
282 @param DataToggle A pointer to the data toggle value. On input, it is valid\r
283 when IsNewTransfer is TRUE, and it indicates the initial\r
284 data toggle value the asynchronous interrupt transfer\r
285 should adopt.\r
286 On output, it is valid when IsNewTransfer is FALSE,\r
287 and it is updated to indicate the data toggle value of\r
288 the subsequent asynchronous interrupt transfer.\r
289 @param PollingInterval Indicates the interval, in milliseconds, that the\r
290 asynchronous interrupt transfer is polled.\r
291 This parameter is required when IsNewTransfer is TRUE.\r
292 @param UCBuffer Uncacheable buffer\r
293 @param DataLength Indicates the length of data to be received at the\r
294 rate specified by PollingInterval from the target\r
295 asynchronous interrupt endpoint. This parameter\r
296 is only required when IsNewTransfer is TRUE.\r
297 @param CallBackFunction The Callback function.This function is called at the\r
298 rate specified by PollingInterval.This parameter is\r
299 only required when IsNewTransfer is TRUE.\r
300 @param Context The context that is passed to the CallBackFunction.\r
301 This is an optional parameter and may be NULL.\r
302 @param IsPeriodic Periodic interrupt or not\r
303 @param OutputED The correspoding ED carried out\r
304 @param OutputTD The correspoding TD carried out\r
305\r
306\r
307 @retval EFI_SUCCESS The asynchronous interrupt transfer request has been successfully\r
308 submitted or canceled.\r
309 @retval EFI_INVALID_PARAMETER Some parameters are invalid.\r
310 @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.\r
311\r
312**/\r
313\r
314EFI_STATUS\r
315OhciInterruptTransfer (\r
316 IN USB_OHCI_HC_DEV *Ohc,\r
317 IN UINT8 DeviceAddress,\r
318 IN UINT8 EndPointAddress,\r
319 IN BOOLEAN IsSlowDevice,\r
320 IN UINT8 MaxPacketLength,\r
321 IN BOOLEAN IsNewTransfer,\r
322 IN OUT UINT8 *DataToggle OPTIONAL,\r
323 IN UINTN PollingInterval OPTIONAL,\r
324 IN VOID *UCBuffer OPTIONAL,\r
325 IN UINTN DataLength OPTIONAL,\r
326 IN EFI_ASYNC_USB_TRANSFER_CALLBACK CallBackFunction OPTIONAL,\r
327 IN VOID *Context OPTIONAL,\r
328 IN BOOLEAN IsPeriodic OPTIONAL,\r
329 OUT ED_DESCRIPTOR **OutputED OPTIONAL,\r
330 OUT TD_DESCRIPTOR **OutputTD OPTIONAL\r
331 );\r
332/**\r
333\r
334 Submits an asynchronous interrupt transfer to an interrupt endpoint of a USB device.\r
335\r
336 @param This A pointer to the EFI_USB_HC_PROTOCOL instance.\r
337 @param DeviceAddress Represents the address of the target device on the USB,\r
338 which is assigned during USB enumeration.\r
339 @param EndPointAddress The combination of an endpoint number and an endpoint\r
340 direction of the target USB device. Each endpoint address\r
341 supports data transfer in one direction except the\r
342 control endpoint (whose default endpoint address is 0).\r
343 It is the caller's responsibility to make sure that\r
344 the EndPointAddress represents an interrupt endpoint.\r
345 @param IsSlowDevice Indicates whether the target device is slow device\r
346 or full-speed device.\r
347 @param MaxiumPacketLength Indicates the maximum packet size the target endpoint\r
348 is capable of sending or receiving.\r
349 @param IsNewTransfer If TRUE, an asynchronous interrupt pipe is built between\r
350 the host and the target interrupt endpoint.\r
351 If FALSE, the specified asynchronous interrupt pipe\r
352 is canceled.\r
353 @param DataToggle A pointer to the data toggle value. On input, it is valid\r
354 when IsNewTransfer is TRUE, and it indicates the initial\r
355 data toggle value the asynchronous interrupt transfer\r
356 should adopt.\r
357 On output, it is valid when IsNewTransfer is FALSE,\r
358 and it is updated to indicate the data toggle value of\r
359 the subsequent asynchronous interrupt transfer.\r
360 @param PollingInterval Indicates the interval, in milliseconds, that the\r
361 asynchronous interrupt transfer is polled.\r
362 This parameter is required when IsNewTransfer is TRUE.\r
363 @param DataLength Indicates the length of data to be received at the\r
364 rate specified by PollingInterval from the target\r
365 asynchronous interrupt endpoint. This parameter\r
366 is only required when IsNewTransfer is TRUE.\r
367 @param CallBackFunction The Callback function.This function is called at the\r
368 rate specified by PollingInterval.This parameter is\r
369 only required when IsNewTransfer is TRUE.\r
370 @param Context The context that is passed to the CallBackFunction.\r
371 This is an optional parameter and may be NULL.\r
372\r
373 @retval EFI_SUCCESS The asynchronous interrupt transfer request has been successfully\r
374 submitted or canceled.\r
375 @retval EFI_INVALID_PARAMETER Some parameters are invalid.\r
376 @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.\r
377\r
378**/\r
379\r
380\r
381EFI_STATUS\r
382EFIAPI\r
383OhciAsyncInterruptTransfer (\r
384 IN EFI_USB_HC_PROTOCOL *This,\r
385 IN UINT8 DeviceAddress,\r
386 IN UINT8 EndPointAddress,\r
387 IN BOOLEAN IsSlowDevice,\r
388 IN UINT8 MaxPacketLength,\r
389 IN BOOLEAN IsNewTransfer,\r
390 IN OUT UINT8 *DataToggle OPTIONAL,\r
391 IN UINTN PollingInterval OPTIONAL,\r
392 IN UINTN DataLength OPTIONAL,\r
393 IN EFI_ASYNC_USB_TRANSFER_CALLBACK CallBackFunction OPTIONAL,\r
394 IN VOID *Context OPTIONAL\r
395 );\r
396/**\r
397\r
398 Submits synchronous interrupt transfer to an interrupt endpoint\r
399 of a USB device.\r
400\r
401 @param This A pointer to the EFI_USB_HC_PROTOCOL instance.\r
402 @param DeviceAddress Represents the address of the target device on the USB,\r
403 which is assigned during USB enumeration.\r
404 @param EndPointAddress The combination of an endpoint number and an endpoint\r
405 direction of the target USB device. Each endpoint\r
406 address supports data transfer in one direction\r
407 except the control endpoint (whose default\r
408 endpoint address is 0). It is the caller's responsibility\r
409 to make sure that the EndPointAddress represents\r
410 an interrupt endpoint.\r
411 @param IsSlowDevice Indicates whether the target device is slow device\r
412 or full-speed device.\r
413 @param MaxPacketLength Indicates the maximum packet size the target endpoint\r
414 is capable of sending or receiving.\r
415 @param Data A pointer to the buffer of data that will be transmitted\r
416 to USB device or received from USB device.\r
417 @param DataLength On input, the size, in bytes, of the data buffer specified\r
418 by Data. On output, the number of bytes transferred.\r
419 @param DataToggle A pointer to the data toggle value. On input, it indicates\r
420 the initial data toggle value the synchronous interrupt\r
421 transfer should adopt;\r
422 on output, it is updated to indicate the data toggle value\r
423 of the subsequent synchronous interrupt transfer.\r
424 @param TimeOut Indicates the maximum time, in microseconds, which the\r
425 transfer is allowed to complete.\r
426 @param TransferResult A pointer to the detailed result information from\r
427 the synchronous interrupt transfer.\r
428\r
429 @retval EFI_UNSUPPORTED This interface not available.\r
430 @retval EFI_INVALID_PARAMETER Parameters not follow spec\r
431\r
432**/\r
433\r
434\r
435EFI_STATUS\r
436EFIAPI\r
437OhciSyncInterruptTransfer (\r
438 IN EFI_USB_HC_PROTOCOL *This,\r
439 IN UINT8 DeviceAddress,\r
440 IN UINT8 EndPointAddress,\r
441 IN BOOLEAN IsSlowDevice,\r
442 IN UINT8 MaxPacketLength,\r
443 IN OUT VOID *Data,\r
444 IN OUT UINTN *DataLength,\r
445 IN OUT UINT8 *DataToggle,\r
446 IN UINTN TimeOut,\r
447 OUT UINT32 *TransferResult\r
448 );\r
449/**\r
450\r
451 Submits isochronous transfer to a target USB device.\r
452\r
453 @param This A pointer to the EFI_USB_HC_PROTOCOL instance.\r
454 @param DeviceAddress Represents the address of the target device on the USB,\r
455 which is assigned during USB enumeration.\r
456 @param EndPointAddress End point address\r
457 @param MaximumPacketLength Indicates the maximum packet size that the\r
458 default control transfer endpoint is capable of\r
459 sending or receiving.\r
460 @param Data A pointer to the buffer of data that will be transmitted\r
461 to USB device or received from USB device.\r
462 @param DataLength Indicates the size, in bytes, of the data buffer\r
463 specified by Data.\r
464 @param TransferResult A pointer to the detailed result information generated\r
465 by this control transfer.\r
466\r
467 @retval EFI_UNSUPPORTED This interface not available\r
468 @retval EFI_INVALID_PARAMETER Data is NULL or DataLength is 0 or TransferResult is NULL\r
469\r
470**/\r
471\r
472\r
473EFI_STATUS\r
474EFIAPI\r
475OhciIsochronousTransfer (\r
476 IN EFI_USB_HC_PROTOCOL *This,\r
477 IN UINT8 DeviceAddress,\r
478 IN UINT8 EndPointAddress,\r
479 IN UINT8 MaximumPacketLength,\r
480 IN OUT VOID *Data,\r
481 IN OUT UINTN DataLength,\r
482 OUT UINT32 *TransferResult\r
483 );\r
484/**\r
485\r
486 Submits Async isochronous transfer to a target USB device.\r
487\r
488 @param his A pointer to the EFI_USB_HC_PROTOCOL instance.\r
489 @param DeviceAddress Represents the address of the target device on the USB,\r
490 which is assigned during USB enumeration.\r
491 @param EndPointAddress End point address\r
492 @param MaximumPacketLength Indicates the maximum packet size that the\r
493 default control transfer endpoint is capable of\r
494 sending or receiving.\r
495 @param Data A pointer to the buffer of data that will be transmitted\r
496 to USB device or received from USB device.\r
497 @param IsochronousCallBack When the transfer complete, the call back function will be called\r
498 @param Context Pass to the call back function as parameter\r
499\r
500 @retval EFI_UNSUPPORTED This interface not available\r
501 @retval EFI_INVALID_PARAMETER Data is NULL or Datalength is 0\r
502\r
503**/\r
504\r
505EFI_STATUS\r
506EFIAPI\r
507OhciAsyncIsochronousTransfer (\r
508 IN EFI_USB_HC_PROTOCOL *This,\r
509 IN UINT8 DeviceAddress,\r
510 IN UINT8 EndPointAddress,\r
511 IN UINT8 MaximumPacketLength,\r
512 IN OUT VOID *Data,\r
513 IN OUT UINTN DataLength,\r
514 IN EFI_ASYNC_USB_TRANSFER_CALLBACK IsochronousCallBack,\r
515 IN VOID *Context OPTIONAL\r
516 );\r
517\r
518/**\r
519\r
520 Retrieves the number of root hub ports.\r
521\r
522 @param This A pointer to the EFI_USB_HC_PROTOCOL instance.\r
523 @param NumOfPorts A pointer to the number of the root hub ports.\r
524\r
525 @retval EFI_SUCCESS The port number was retrieved successfully.\r
526**/\r
527EFI_STATUS\r
528EFIAPI\r
529OhciGetRootHubNumOfPorts (\r
530 IN EFI_USB_HC_PROTOCOL *This,\r
531 OUT UINT8 *NumOfPorts\r
532 );\r
533/**\r
534\r
535 Retrieves the current status of a USB root hub port.\r
536\r
537 @param This A pointer to the EFI_USB_HC_PROTOCOL.\r
538 @param PortNumber Specifies the root hub port from which the status\r
539 is to be retrieved. This value is zero-based. For example,\r
540 if a root hub has two ports, then the first port is numbered 0,\r
541 and the second port is numbered 1.\r
542 @param PortStatus A pointer to the current port status bits and\r
543 port status change bits.\r
544\r
545 @retval EFI_SUCCESS The status of the USB root hub port specified by PortNumber\r
546 was returned in PortStatus.\r
547 @retval EFI_INVALID_PARAMETER Port number not valid\r
548**/\r
549\r
550\r
551EFI_STATUS\r
552EFIAPI\r
553OhciGetRootHubPortStatus (\r
554 IN EFI_USB_HC_PROTOCOL *This,\r
555 IN UINT8 PortNumber,\r
556 OUT EFI_USB_PORT_STATUS *PortStatus\r
557 );\r
558\r
559/**\r
560\r
561 Sets a feature for the specified root hub port.\r
562\r
563 @param This A pointer to the EFI_USB_HC_PROTOCOL.\r
564 @param PortNumber Specifies the root hub port whose feature\r
565 is requested to be set.\r
566 @param PortFeature Indicates the feature selector associated\r
567 with the feature set request.\r
568\r
569 @retval EFI_SUCCESS The feature specified by PortFeature was set for the\r
570 USB root hub port specified by PortNumber.\r
571 @retval EFI_DEVICE_ERROR Set feature failed because of hardware issue\r
572 @retval EFI_INVALID_PARAMETER PortNumber is invalid or PortFeature is invalid.\r
573**/\r
574EFI_STATUS\r
575EFIAPI\r
576OhciSetRootHubPortFeature (\r
577 IN EFI_USB_HC_PROTOCOL *This,\r
578 IN UINT8 PortNumber,\r
579 IN EFI_USB_PORT_FEATURE PortFeature\r
580 );\r
581/**\r
582\r
583 Clears a feature for the specified root hub port.\r
584\r
585 @param This A pointer to the EFI_USB_HC_PROTOCOL instance.\r
586 @param PortNumber Specifies the root hub port whose feature\r
587 is requested to be cleared.\r
588 @param PortFeature Indicates the feature selector associated with the\r
589 feature clear request.\r
590\r
591 @retval EFI_SUCCESS The feature specified by PortFeature was cleared for the\r
592 USB root hub port specified by PortNumber.\r
593 @retval EFI_INVALID_PARAMETER PortNumber is invalid or PortFeature is invalid.\r
594 @retval EFI_DEVICE_ERROR Some error happened when clearing feature\r
595**/\r
596EFI_STATUS\r
597EFIAPI\r
598OhciClearRootHubPortFeature (\r
599 IN EFI_USB_HC_PROTOCOL *This,\r
600 IN UINT8 PortNumber,\r
601 IN EFI_USB_PORT_FEATURE PortFeature\r
602 );\r
603\r
604\r
605/**\r
606 Test to see if this driver supports ControllerHandle. Any\r
607 ControllerHandle that has UsbHcProtocol installed will be supported.\r
608\r
609 @param This Protocol instance pointer.\r
610 @param Controller Handle of device to test.\r
611 @param RemainingDevicePath Not used.\r
612\r
613 @return EFI_SUCCESS This driver supports this device.\r
614 @return EFI_UNSUPPORTED This driver does not support this device.\r
615\r
616**/\r
617EFI_STATUS\r
618EFIAPI\r
619\r
620OHCIDriverBindingSupported (\r
621 IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
622 IN EFI_HANDLE Controller,\r
623 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath\r
624 );\r
625\r
626/**\r
627 Starting the Usb OHCI Driver.\r
628\r
629 @param This Protocol instance pointer.\r
630 @param Controller Handle of device to test.\r
631 @param RemainingDevicePath Not used.\r
632\r
633 @retval EFI_SUCCESS This driver supports this device.\r
634 @retval EFI_UNSUPPORTED This driver does not support this device.\r
635 @retval EFI_DEVICE_ERROR This driver cannot be started due to device Error.\r
636 EFI_OUT_OF_RESOURCES- Failed due to resource shortage.\r
637\r
638**/\r
639EFI_STATUS\r
640EFIAPI\r
641OHCIDriverBindingStart (\r
642 IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
643 IN EFI_HANDLE Controller,\r
644 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath\r
645 );\r
646\r
647/**\r
74c6a103 648 Stop this driver on ControllerHandle. Support stopping any child handles\r
9b6bbcdb
MK
649 created by this driver.\r
650\r
651 @param This Protocol instance pointer.\r
652 @param Controller Handle of device to stop driver on.\r
653 @param NumberOfChildren Number of Children in the ChildHandleBuffer.\r
654 @param ChildHandleBuffer List of handles for the children we need to stop.\r
655\r
656 @return EFI_SUCCESS\r
657 @return others\r
658\r
659**/\r
660EFI_STATUS\r
661EFIAPI\r
662OHCIDriverBindingStop (\r
663 IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
664 IN EFI_HANDLE Controller,\r
665 IN UINTN NumberOfChildren,\r
666 IN EFI_HANDLE *ChildHandleBuffer\r
667 );\r
668\r
669#endif\r