TianoCore EDK2 master
|
#include "Uhci.h"
Go to the source code of this file.
The EHCI register operation routines.
Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file UhciSched.c.
BOOLEAN UhciCheckTdStatus | ( | IN USB_HC_DEV * | Uhc, |
IN UHCI_TD_SW * | Td, | ||
IN BOOLEAN | IsLow, | ||
OUT UHCI_QH_RESULT * | QhResult | ||
) |
Check TDs Results.
Uhc | This UHCI device. |
Td | UHCI_TD_SW to check. |
IsLow | Is Low Speed Device. |
QhResult | Return the result of this TD list. |
Definition at line 417 of file UhciSched.c.
Convert the poll rate to the maximum 2^n that is smaller than Interval.
Interval | The poll rate to convert. |
Definition at line 209 of file UhciSched.c.
EFI_STATUS UhciCreateAsyncReq | ( | IN USB_HC_DEV * | Uhc, |
IN UHCI_QH_SW * | Qh, | ||
IN UHCI_TD_SW * | FirstTd, | ||
IN UINT8 | DevAddr, | ||
IN UINT8 | EndPoint, | ||
IN UINTN | DataLen, | ||
IN UINTN | Interval, | ||
IN UINT8 * | Data, | ||
IN EFI_ASYNC_USB_TRANSFER_CALLBACK | Callback, | ||
IN VOID * | Context, | ||
IN BOOLEAN | IsLow | ||
) |
Create Async Request node, and Link to List.
Uhc | The UHCI device. |
Qh | The queue head of the transfer. |
FirstTd | First TD of the transfer. |
DevAddr | Device Address. |
EndPoint | EndPoint Address. |
DataLen | Data length. |
Interval | Polling Interval when inserted to frame list. |
Data | Data buffer, unmapped. |
Callback | Callback after interrupt transfeer. |
Context | Callback Context passed as function parameter. |
IsLow | Is Low Speed. |
EFI_SUCCESS | An asynchronous transfer is created. |
EFI_INVALID_PARAMETER | Paremeter is error. |
EFI_OUT_OF_RESOURCES | Failed because of resource shortage. |
Definition at line 683 of file UhciSched.c.
VOID UhciDestoryFrameList | ( | IN USB_HC_DEV * | Uhc | ) |
Destory FrameList buffer.
Uhc | The UHCI device. |
Definition at line 159 of file UhciSched.c.
EFI_STATUS UhciExecuteTransfer | ( | IN USB_HC_DEV * | Uhc, |
IN UHCI_QH_SW * | Qh, | ||
IN UHCI_TD_SW * | Td, | ||
IN UINTN | TimeOut, | ||
IN BOOLEAN | IsLow, | ||
OUT UHCI_QH_RESULT * | QhResult | ||
) |
Check the result of the transfer.
Uhc | The UHCI device. |
Qh | The queue head of the transfer. |
Td | The first TDs of the transfer. |
TimeOut | TimeOut value in milliseconds. |
IsLow | Is Low Speed Device. |
QhResult | The variable to return result. |
EFI_SUCCESS | The transfer finished with success. |
EFI_DEVICE_ERROR | Transfer failed. |
Definition at line 558 of file UhciSched.c.
VOID UhciFreeAllAsyncReq | ( | IN USB_HC_DEV * | Uhc | ) |
Release all the asynchronous transfers on the lsit.
Uhc | The UHCI device. |
Definition at line 907 of file UhciSched.c.
VOID UhciFreeAsyncReq | ( | IN USB_HC_DEV * | Uhc, |
IN UHCI_ASYNC_REQUEST * | AsyncReq | ||
) |
Free an asynchronous request's resource such as memory.
Uhc | The UHCI device. |
AsyncReq | The asynchronous request to free. |
Definition at line 739 of file UhciSched.c.
EFI_STATUS UhciInitFrameList | ( | IN USB_HC_DEV * | Uhc | ) |
Create Frame List Structure.
Uhc | UHCI device. |
EFI_OUT_OF_RESOURCES | Can't allocate memory resources. |
EFI_UNSUPPORTED | Map memory fail. |
EFI_SUCCESS | Success. |
Definition at line 23 of file UhciSched.c.
VOID UhciLinkQhToFrameList | ( | USB_HC_DEV * | Uhc, |
UHCI_QH_SW * | Qh | ||
) |
Link a queue head (for asynchronous interrupt transfer) to the frame list.
Uhc | The UHCI device. |
Qh | The queue head to link into. |
Definition at line 247 of file UhciSched.c.
Interrupt transfer periodic check handler.
Event | The event of the time. |
Context | Context of the event, pointer to USB_HC_DEV. |
Definition at line 943 of file UhciSched.c.
VOID UhciRecycleAsyncReq | ( | IN USB_HC_DEV * | Uhc | ) |
Recycle the asynchronouse request. When a queue head is unlinked from frame list, host controller hardware may still hold a cached pointer to it. To synchronize with hardware, the request is released in two steps: first it is linked to the UHC's RecycleWait list. At the next time UhciMonitorAsyncReqList is fired, it is moved to UHC's Recylelist. Then, at another timer activation, all the requests on Recycle list is freed. This guarrantes that each unlink queue head keeps existing for at least 50ms, far enough for the hardware to clear its cache.
Uhc | The UHCI device. |
Definition at line 881 of file UhciSched.c.
EFI_STATUS UhciRemoveAsyncReq | ( | IN USB_HC_DEV * | Uhc, |
IN UINT8 | DevAddr, | ||
IN UINT8 | EndPoint, | ||
OUT UINT8 * | Toggle | ||
) |
Delete Async Interrupt QH and TDs.
Uhc | The UHCI device. |
DevAddr | Device Address. |
EndPoint | EndPoint Address. |
Toggle | The next data toggle to use. |
EFI_SUCCESS | The request is deleted. |
EFI_INVALID_PARAMETER | Paremeter is error. |
EFI_NOT_FOUND | The asynchronous isn't found. |
Definition at line 808 of file UhciSched.c.
VOID UhciUnlinkAsyncReq | ( | IN USB_HC_DEV * | Uhc, |
IN UHCI_ASYNC_REQUEST * | AsyncReq, | ||
IN BOOLEAN | FreeNow | ||
) |
Unlink an asynchronous request's from UHC's asynchronus list. also remove the queue head from the frame list. If FreeNow, release its resource also. Otherwise, add the request to the UHC's recycle list to wait for a while before release the memory. Until then, hardware won't hold point to the request.
Uhc | The UHCI device. |
AsyncReq | The asynchronous request to free. |
FreeNow | If TRUE, free the resource immediately, otherwise add the request to recycle wait list. |
Definition at line 770 of file UhciSched.c.
VOID UhciUnlinkQhFromFrameList | ( | USB_HC_DEV * | Uhc, |
UHCI_QH_SW * | Qh | ||
) |
Unlink QH from the frame list is easier: find all the precedence node, and pointer there next to QhSw's next.
Uhc | The UHCI device. |
Qh | The queue head to unlink. |
Definition at line 355 of file UhciSched.c.
VOID UhciUpdateAsyncReq | ( | IN USB_HC_DEV * | Uhc, |
IN UHCI_ASYNC_REQUEST * | AsyncReq, | ||
IN UINT32 | Result, | ||
IN UINT32 | NextToggle | ||
) |
Update Async Request, QH and TDs.
Uhc | The UHCI device. |
AsyncReq | The UHCI asynchronous transfer to update. |
Result | Transfer reslut. |
NextToggle | The toggle of next data. |
Definition at line 627 of file UhciSched.c.