|
|
|
@@ -340,7 +340,7 @@ Returns:
|
|
|
|
|
//
|
|
|
|
|
// Init fields in Qh
|
|
|
|
|
//
|
|
|
|
|
gBS->SetMem (*QhPtrPtr, sizeof (EHCI_QH_ENTITY), 0);
|
|
|
|
|
ZeroMem (*QhPtrPtr, sizeof (EHCI_QH_ENTITY));
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// Software field
|
|
|
|
@@ -699,7 +699,8 @@ Returns:
|
|
|
|
|
//
|
|
|
|
|
// Init fields in Qtd
|
|
|
|
|
//
|
|
|
|
|
gBS->SetMem (*QtdPtrPtr, sizeof (EHCI_QTD_ENTITY), 0);
|
|
|
|
|
|
|
|
|
|
ZeroMem (*QtdPtrPtr, sizeof (EHCI_QTD_ENTITY));
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// Software field
|
|
|
|
@@ -1386,7 +1387,7 @@ Returns:
|
|
|
|
|
Value = NULL;
|
|
|
|
|
|
|
|
|
|
if (!HwQtdPtr->AltNextQtdTerminate) {
|
|
|
|
|
Value = (EHCI_QTD_HW *) (UINTN) GET_0B_TO_31B (HwQtdPtr->AltNextQtdPointer << 5);
|
|
|
|
|
Value = (EHCI_QTD_HW *) GET_0B_TO_31B (HwQtdPtr->AltNextQtdPointer << 5);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return Value;
|
|
|
|
@@ -1417,7 +1418,7 @@ Returns:
|
|
|
|
|
Value = NULL;
|
|
|
|
|
|
|
|
|
|
if (!HwQtdPtr->NextQtdTerminate) {
|
|
|
|
|
Value = (EHCI_QTD_HW *) (UINTN) GET_0B_TO_31B (HwQtdPtr->NextQtdPointer << 5);
|
|
|
|
|
Value = (EHCI_QTD_HW *) GET_0B_TO_31B (HwQtdPtr->NextQtdPointer << 5);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return Value;
|
|
|
|
@@ -1727,7 +1728,7 @@ Returns:
|
|
|
|
|
if (!FrameEntryPtr->LinkTerminate) {
|
|
|
|
|
//
|
|
|
|
|
// Not Null FrameList
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
FindQhHwPtr = (EHCI_QH_HW *) GET_0B_TO_31B (FrameEntryPtr->LinkPointer << 5);
|
|
|
|
|
FindQhPtr = (EHCI_QH_ENTITY *) GET_QH_ENTITY_ADDR (FindQhHwPtr);
|
|
|
|
|
//
|
|
|
|
@@ -1742,12 +1743,12 @@ Returns:
|
|
|
|
|
// Link Qh after FindQh
|
|
|
|
|
//
|
|
|
|
|
if (NULL != FindQhPtr->Next) {
|
|
|
|
|
FindQhPtr->Next->Prev = QhPtr;
|
|
|
|
|
FindQhPtr->Next->Prev = QhPtr;
|
|
|
|
|
QhPtr->Qh.QhHorizontalPointer = (UINT32) GET_0B_TO_31B (&(FindQhPtr->Next->Qh) >> 5);
|
|
|
|
|
QhPtr->Qh.SelectType = QH_SELECT_TYPE;
|
|
|
|
|
QhPtr->Qh.QhTerminate = FALSE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
FindQhPtr->Qh.QhHorizontalPointer = (UINT32) GET_0B_TO_31B (&(QhPtr->Qh) >> 5);
|
|
|
|
|
FindQhPtr->Qh.SelectType = QH_SELECT_TYPE;
|
|
|
|
|
FindQhPtr->Qh.QhTerminate = FALSE;
|
|
|
|
@@ -1762,7 +1763,7 @@ Returns:
|
|
|
|
|
if (NULL == FindQhPtr->Prev) {
|
|
|
|
|
//
|
|
|
|
|
// Qh is the First one in Frame[0] List
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
FrameEntryPtr->LinkPointer = (UINT32) GET_0B_TO_31B (&(QhPtr->Qh) >> 5);
|
|
|
|
|
FrameEntryPtr->SelectType = QH_SELECT_TYPE;
|
|
|
|
|
FrameEntryPtr->LinkTerminate = FALSE;
|
|
|
|
@@ -1770,12 +1771,12 @@ Returns:
|
|
|
|
|
//
|
|
|
|
|
// Qh is not the First one in Frame[0] List
|
|
|
|
|
//
|
|
|
|
|
FindQhPtr->Prev->Next = QhPtr;
|
|
|
|
|
FindQhPtr->Prev->Next = QhPtr;
|
|
|
|
|
FindQhPtr->Prev->Qh.QhHorizontalPointer = (UINT32) GET_0B_TO_31B (&(QhPtr->Qh) >> 5);
|
|
|
|
|
FindQhPtr->Prev->Qh.SelectType = QH_SELECT_TYPE;
|
|
|
|
|
FindQhPtr->Prev->Qh.QhTerminate = FALSE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QhPtr->Qh.QhHorizontalPointer = (UINT32) GET_0B_TO_31B (&(FindQhPtr->Qh) >> 5);
|
|
|
|
|
QhPtr->Qh.SelectType = QH_SELECT_TYPE;
|
|
|
|
|
QhPtr->Qh.QhTerminate = FALSE;
|
|
|
|
@@ -1786,7 +1787,7 @@ Returns:
|
|
|
|
|
} else {
|
|
|
|
|
//
|
|
|
|
|
// Link Qh after FindQh, Qh is the Last one
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
FindQhPtr->Qh.QhHorizontalPointer = (UINT32) GET_0B_TO_31B (&(QhPtr->Qh) >> 5);
|
|
|
|
|
FindQhPtr->Prev->Qh.SelectType = QH_SELECT_TYPE;
|
|
|
|
|
FindQhPtr->Qh.QhTerminate = FALSE;
|
|
|
|
@@ -1798,7 +1799,7 @@ Returns:
|
|
|
|
|
} else {
|
|
|
|
|
//
|
|
|
|
|
// Null FrameList
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
FrameEntryPtr->LinkPointer = (UINT32) GET_0B_TO_31B (&(QhPtr->Qh) >> 5);
|
|
|
|
|
FrameEntryPtr->SelectType = QH_SELECT_TYPE;
|
|
|
|
|
FrameEntryPtr->LinkTerminate = FALSE;
|
|
|
|
@@ -1812,7 +1813,7 @@ Returns:
|
|
|
|
|
//
|
|
|
|
|
FrameIndex += QhPtr->Interval;
|
|
|
|
|
while (FrameIndex < HcDev->PeriodicFrameListLength) {
|
|
|
|
|
FrameEntryPtr = (FRAME_LIST_ENTRY *) (FrameEntryPtr + QhPtr->Interval);
|
|
|
|
|
FrameEntryPtr = (FRAME_LIST_ENTRY *) (FrameEntryPtr + QhPtr->Interval);
|
|
|
|
|
FrameEntryPtr->LinkPointer = (UINT32) GET_0B_TO_31B (&(QhPtr->Qh) >> 5);
|
|
|
|
|
FrameEntryPtr->SelectType = QH_SELECT_TYPE;
|
|
|
|
|
FrameEntryPtr->LinkTerminate = FALSE;
|
|
|
|
@@ -1825,7 +1826,7 @@ Returns:
|
|
|
|
|
FrameIndex += QhPtr->Interval;
|
|
|
|
|
while (FrameIndex < HcDev->PeriodicFrameListLength) {
|
|
|
|
|
FrameEntryPtr = (FRAME_LIST_ENTRY *) (FrameEntryPtr + QhPtr->Interval);
|
|
|
|
|
if ((FrameIndex % QhPtr->Prev->Interval) != 0) {
|
|
|
|
|
if ((FrameIndex % QhPtr->Prev->Interval) != 0) {
|
|
|
|
|
FrameEntryPtr->LinkPointer = (UINT32) GET_0B_TO_31B (&(QhPtr->Qh) >> 5);
|
|
|
|
|
FrameEntryPtr->SelectType = QH_SELECT_TYPE;
|
|
|
|
|
FrameEntryPtr->LinkTerminate = FALSE;
|
|
|
|
@@ -1843,7 +1844,7 @@ Returns:
|
|
|
|
|
if (!FrameEntryPtr->LinkTerminate) {
|
|
|
|
|
//
|
|
|
|
|
// Not Null FrameList
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
FindQhHwPtr = (EHCI_QH_HW *) GET_0B_TO_31B (FrameEntryPtr->LinkPointer << 5);
|
|
|
|
|
FindQhPtr = (EHCI_QH_ENTITY *) GET_QH_ENTITY_ADDR (FindQhHwPtr);
|
|
|
|
|
//
|
|
|
|
@@ -1852,7 +1853,7 @@ Returns:
|
|
|
|
|
while (NULL != FindQhPtr->Next) {
|
|
|
|
|
FindQhPtr = FindQhPtr->Next;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
FindQhPtr->Qh.QhHorizontalPointer = (UINT32) GET_0B_TO_31B (&(QhPtr->Qh) >> 5);
|
|
|
|
|
FindQhPtr->Qh.SelectType = QH_SELECT_TYPE;
|
|
|
|
|
FindQhPtr->Qh.QhTerminate = FALSE;
|
|
|
|
@@ -1862,7 +1863,7 @@ Returns:
|
|
|
|
|
} else {
|
|
|
|
|
//
|
|
|
|
|
// Null FrameList
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
FrameEntryPtr->LinkPointer = (UINT32) GET_0B_TO_31B (&(QhPtr->Qh) >> 5);
|
|
|
|
|
FrameEntryPtr->SelectType = QH_SELECT_TYPE;
|
|
|
|
|
FrameEntryPtr->LinkTerminate = FALSE;
|
|
|
|
@@ -1929,7 +1930,7 @@ Returns:
|
|
|
|
|
FrameIndex += Interval;
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
while (FrameIndex < HcDev->PeriodicFrameListLength) {
|
|
|
|
|
while (FrameIndex < HcDev->PeriodicFrameListLength) {
|
|
|
|
|
FrameEntryPtr->LinkPointer = (UINT32) GET_0B_TO_31B (&(QhPtr->Next->Qh) >> 5);
|
|
|
|
|
FrameEntryPtr->SelectType = QH_SELECT_TYPE;
|
|
|
|
|
FrameEntryPtr->LinkTerminate = FALSE;
|
|
|
|
@@ -1949,7 +1950,7 @@ Returns:
|
|
|
|
|
QhPtr->Prev->Qh.QhHorizontalPointer = 0;
|
|
|
|
|
QhPtr->Prev->Qh.SelectType = 0;
|
|
|
|
|
QhPtr->Prev->Qh.QhTerminate = TRUE;
|
|
|
|
|
} else {
|
|
|
|
|
} else {
|
|
|
|
|
QhPtr->Prev->Qh.QhHorizontalPointer = (UINT32) GET_0B_TO_31B (&(QhPtr->Next->Qh) >> 5);
|
|
|
|
|
QhPtr->Prev->Qh.SelectType = QH_SELECT_TYPE;
|
|
|
|
|
QhPtr->Prev->Qh.QhTerminate = FALSE;
|
|
|
|
@@ -2109,6 +2110,12 @@ Returns:
|
|
|
|
|
|
|
|
|
|
RemainLen = DataLen;
|
|
|
|
|
ASSERT (QtdHwPtr);
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// Allow buffer address range across 4G.
|
|
|
|
|
// But EFI_USB_MAX_BULK_BUFFER_NUM = 1, so don't allow
|
|
|
|
|
// seperate buffer array.
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// Set BufferPointer0, ExtBufferPointer0 and Offset
|
|
|
|
@@ -2125,7 +2132,7 @@ Returns:
|
|
|
|
|
goto exit;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QtdHwPtr->BufferPointer1 = QtdHwPtr->BufferPointer0 + 1;
|
|
|
|
|
QtdHwPtr->BufferPointer1 = QtdHwPtr->BufferPointer0 + 1;
|
|
|
|
|
QtdHwPtr->ExtBufferPointer1 = (QtdHwPtr->BufferPointer1 == 0) ? (QtdHwPtr->ExtBufferPointer0 + 1) : QtdHwPtr->ExtBufferPointer0;
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
@@ -2136,7 +2143,7 @@ Returns:
|
|
|
|
|
goto exit;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QtdHwPtr->BufferPointer2 = QtdHwPtr->BufferPointer1 + 1;
|
|
|
|
|
QtdHwPtr->BufferPointer2 = QtdHwPtr->BufferPointer1 + 1;
|
|
|
|
|
QtdHwPtr->ExtBufferPointer2 = (QtdHwPtr->BufferPointer2 == 0) ? (QtdHwPtr->ExtBufferPointer1 + 1) : QtdHwPtr->ExtBufferPointer1;
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
@@ -2147,7 +2154,7 @@ Returns:
|
|
|
|
|
goto exit;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QtdHwPtr->BufferPointer3 = QtdHwPtr->BufferPointer2 + 1;
|
|
|
|
|
QtdHwPtr->BufferPointer3 = QtdHwPtr->BufferPointer2 + 1;
|
|
|
|
|
QtdHwPtr->ExtBufferPointer3 = (QtdHwPtr->BufferPointer2 == 0) ? (QtdHwPtr->ExtBufferPointer2 + 1) : QtdHwPtr->ExtBufferPointer2;
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
@@ -2158,7 +2165,7 @@ Returns:
|
|
|
|
|
goto exit;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QtdHwPtr->BufferPointer4 = QtdHwPtr->BufferPointer3 + 1;
|
|
|
|
|
QtdHwPtr->BufferPointer4 = QtdHwPtr->BufferPointer3 + 1;
|
|
|
|
|
QtdHwPtr->ExtBufferPointer4 = (QtdHwPtr->BufferPointer3 == 0) ? (QtdHwPtr->ExtBufferPointer3 + 1) : QtdHwPtr->ExtBufferPointer3;
|
|
|
|
|
|
|
|
|
|
exit:
|
|
|
|
@@ -2865,8 +2872,8 @@ Returns:
|
|
|
|
|
//
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
(*ErrQtdPos)++;
|
|
|
|
|
|
|
|
|
|
(*ErrQtdPos)++;
|
|
|
|
|
QtdPtr = QtdPtr->Next;
|
|
|
|
|
QtdHwPtr = &(QtdPtr->Qtd);
|
|
|
|
|
|
|
|
|
@@ -3026,7 +3033,7 @@ Returns:
|
|
|
|
|
Status = EFI_OUT_OF_RESOURCES;
|
|
|
|
|
goto exit;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QtdHwPtr = &(AsyncRequestPtr->QhPtr->FirstQtdPtr->Qtd);
|
|
|
|
|
ReceiveBuffer = (UINT8 *) GET_0B_TO_31B ((QtdHwPtr->BufferPointer0 << 12) | AsyncRequestPtr->QhPtr->FirstQtdPtr->StaticCurrentOffset);
|
|
|
|
|
CopyMem (
|
|
|
|
|