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