Lines Matching refs:pipe
28 usb_host_ohci_pipe_struct_t *pipe,
32 usb_host_ohci_pipe_struct_t *pipe,
38 usb_host_ohci_pipe_struct_t *pipe,
43 usb_host_ohci_pipe_struct_t *pipe,
256 …_t USB_HostOhciGetPipe(usb_host_ohci_pipe_struct_t **pipeQueue, usb_host_ohci_pipe_struct_t **pipe) in USB_HostOhciGetPipe() argument
267 *pipe = *pipeQueue; in USB_HostOhciGetPipe()
268 temp = (void *)((*pipe)->pipeCommon.next); in USB_HostOhciGetPipe()
277 … USB_HostOhciRemovePipe(usb_host_ohci_pipe_struct_t **pipeQueue, usb_host_ohci_pipe_struct_t *pipe) in USB_HostOhciRemovePipe() argument
290 if (p != pipe) in USB_HostOhciRemovePipe()
314 … USB_HostOhciInsertPipe(usb_host_ohci_pipe_struct_t **pipeQueue, usb_host_ohci_pipe_struct_t *pipe) in USB_HostOhciInsertPipe() argument
325 if (p != pipe) in USB_HostOhciInsertPipe()
338 pipe->pipeCommon.next = (usb_host_pipe_t *)temp; in USB_HostOhciInsertPipe()
339 *pipeQueue = pipe; in USB_HostOhciInsertPipe()
705 usb_host_ohci_pipe_struct_t *pipe) in USB_HostOhciFindStartFrame() argument
713 pipe->startFrame = 0U; in USB_HostOhciFindStartFrame()
720 for (startFrame = 0U; startFrame < pipe->pipeCommon.interval; startFrame++) in USB_HostOhciFindStartFrame()
742 pipe->startFrame = (uint16_t)startFrame; in USB_HostOhciFindStartFrame()
750 usb_host_ohci_pipe_struct_t *pipe) in USB_HostOhciAddToPeriodicList() argument
757 for (i = pipe->startFrame; i < USB_HOST_OHCI_HCCA_SIZE; i += pipe->pipeCommon.interval) in USB_HostOhciAddToPeriodicList()
765 if (pre == pipe->ed) in USB_HostOhciAddToPeriodicList()
780 if (ed->pipe->pipeCommon.interval <= pipe->pipeCommon.interval) in USB_HostOhciAddToPeriodicList()
782 … if ((USB_ENDPOINT_ISOCHRONOUS == pipe->pipeCommon.pipeType) && (dummy != (uint32_t)ed)) in USB_HostOhciAddToPeriodicList()
793 pipe->ed->NextED = (uint32_t)ed; in USB_HostOhciAddToPeriodicList()
796 pre->NextED = (uint32_t)pipe->ed; in USB_HostOhciAddToPeriodicList()
800 … s_UsbHostOhciHcca[usbHostState->controllerId].HccaInterrruptTable[i] = (uint32_t)pipe->ed; in USB_HostOhciAddToPeriodicList()
807 usb_host_ohci_pipe_struct_t *pipe) in USB_HostOhciOpenControlBulkPipe() argument
821 pipe->ed->TailP = (uint32_t)gtd; in USB_HostOhciOpenControlBulkPipe()
822 pipe->ed->HeadP = (uint32_t)gtd; in USB_HostOhciOpenControlBulkPipe()
823 if (USB_ENDPOINT_CONTROL == pipe->pipeCommon.pipeType) in USB_HostOhciOpenControlBulkPipe()
825 …pipe->ed->NextED = s_UsbHostOhciTd[usbHostState->controllerId].ed[USB_HOST_OHCI_CONTROL_ED_DUMMY].… in USB_HostOhciOpenControlBulkPipe()
826 …tOhciTd[usbHostState->controllerId].ed[USB_HOST_OHCI_CONTROL_ED_DUMMY].NextED = (uint32_t)pipe->ed; in USB_HostOhciOpenControlBulkPipe()
831 …pipe->ed->NextED = s_UsbHostOhciTd[usbHostState->controllerId].ed[USB_HOST_OHCI_BULK_ED_DUMMY].Nex… in USB_HostOhciOpenControlBulkPipe()
832 …HostOhciTd[usbHostState->controllerId].ed[USB_HOST_OHCI_BULK_ED_DUMMY].NextED = (uint32_t)pipe->ed; in USB_HostOhciOpenControlBulkPipe()
841 usb_host_ohci_pipe_struct_t *pipe) in USB_HostOhciOpenIsoPipe() argument
849 pipe->busTime = (uint16_t)USB_HostOhciBusTime( in USB_HostOhciOpenIsoPipe()
850 … ((usb_host_device_instance_t *)pipe->pipeCommon.deviceHandle)->speed, pipe->pipeCommon.pipeType, in USB_HostOhciOpenIsoPipe()
851 pipe->pipeCommon.direction, in USB_HostOhciOpenIsoPipe()
852 ((uint32_t)pipe->pipeCommon.maxPacketSize) * ((uint32_t)pipe->pipeCommon.numberPerUframe)); in USB_HostOhciOpenIsoPipe()
855 error = USB_HostOhciFindStartFrame(usbHostState, pipe); in USB_HostOhciOpenIsoPipe()
871 pipe->ed->TailP = (uint32_t)itd; in USB_HostOhciOpenIsoPipe()
872 pipe->ed->HeadP = (uint32_t)itd; in USB_HostOhciOpenIsoPipe()
874 pipe->ed->TailP = (uint32_t)0; in USB_HostOhciOpenIsoPipe()
875 pipe->ed->HeadP = (uint32_t)0; in USB_HostOhciOpenIsoPipe()
880 (void)USB_HostOhciAddToPeriodicList(usbHostState, pipe); in USB_HostOhciOpenIsoPipe()
890 usb_host_ohci_pipe_struct_t *pipe) in USB_HostOhciOpenInterruptPipe() argument
896 pipe->busTime = (uint16_t)USB_HostOhciBusTime( in USB_HostOhciOpenInterruptPipe()
897 … ((usb_host_device_instance_t *)pipe->pipeCommon.deviceHandle)->speed, pipe->pipeCommon.pipeType, in USB_HostOhciOpenInterruptPipe()
898 pipe->pipeCommon.direction, in USB_HostOhciOpenInterruptPipe()
899 ((uint32_t)pipe->pipeCommon.maxPacketSize) * ((uint32_t)pipe->pipeCommon.numberPerUframe)); in USB_HostOhciOpenInterruptPipe()
902 error = USB_HostOhciFindStartFrame(usbHostState, pipe); in USB_HostOhciOpenInterruptPipe()
918 pipe->ed->TailP = (uint32_t)gtd; in USB_HostOhciOpenInterruptPipe()
919 pipe->ed->HeadP = (uint32_t)gtd; in USB_HostOhciOpenInterruptPipe()
921 (void)USB_HostOhciAddToPeriodicList(usbHostState, pipe); in USB_HostOhciOpenInterruptPipe()
930 usb_host_ohci_pipe_struct_t *pipe, in USB_HostOhciTdDoneHandle() argument
950 pipe->isDone = 0U; in USB_HostOhciTdDoneHandle()
982 if (pipe->pipeCommon.pipeType == USB_ENDPOINT_INTERRUPT) in USB_HostOhciTdDoneHandle()
984 (void)USB_HostHelperGetPeripheralInformation(pipe->pipeCommon.deviceHandle, in USB_HostOhciTdDoneHandle()
989 pipe->deviceNotRespondingCount++; in USB_HostOhciTdDoneHandle()
990 if (pipe->deviceNotRespondingCount < in USB_HostOhciTdDoneHandle()
993 pipe->endpointInterval = (uint16_t)(pipe->pipeCommon.interval + 1U); in USB_HostOhciTdDoneHandle()
999 pipe->deviceNotRespondingCount = 0U; in USB_HostOhciTdDoneHandle()
1000 pipe->endpointInterval = 0U; in USB_HostOhciTdDoneHandle()
1018 pipe->ed->HeadP &= ~USB_HOST_OHCI_ED_HEADP_HALT_MASK; in USB_HostOhciTdDoneHandle()
1092 uint32_t tail = pipe->ed->TailP & USB_HOST_OHCI_ED_TAILP_MASK; in USB_HostOhciTdDoneHandle()
1093 uint32_t head = pipe->ed->HeadP & USB_HOST_OHCI_ED_HEADP_MASK; in USB_HostOhciTdDoneHandle()
1097 pipe->ed->HeadP &= ~USB_HOST_OHCI_ED_HEADP_MASK; in USB_HostOhciTdDoneHandle()
1098 pipe->ed->HeadP |= (uint32_t)gtdP->NextTD; in USB_HostOhciTdDoneHandle()
1123 if ((0U == pipe->isCanceling) && ((uint32_t)kStatus_USB_Success == currentTr->union2.frame)) in USB_HostOhciTdDoneHandle()
1125 if (USB_ENDPOINT_CONTROL == pipe->pipeCommon.pipeType) in USB_HostOhciTdDoneHandle()
1127 if (NULL != pipe->ed->trListHead) in USB_HostOhciTdDoneHandle()
1129 … if (kStatus_USB_Success == USB_HostOhciLinkGtdControlTr(usbHostState, pipe, pipe->ed->trListHead)) in USB_HostOhciTdDoneHandle()
1146 trPos = pipe->ed->trListHead; in USB_HostOhciTdDoneHandle()
1154 pipe->ed->trListHead = trPos->next; in USB_HostOhciTdDoneHandle()
1166 if (NULL == pipe->ed->trListHead) in USB_HostOhciTdDoneHandle()
1168 pipe->ed->trListTail = NULL; in USB_HostOhciTdDoneHandle()
1173 pipe->cutOffTime = USB_HOST_OHCI_TRANSFER_TIMEOUT_GAP; in USB_HostOhciTdDoneHandle()
1176 (USB_ENDPOINT_CONTROL == pipe->pipeCommon.pipeType) && in USB_HostOhciTdDoneHandle()
1189 (p->pipeCommon.deviceHandle == pipe->pipeCommon.deviceHandle)) in USB_HostOhciTdDoneHandle()
1218 (void)USB_HostOhciWritePipe(usbHostState, pipe, currentTr); in USB_HostOhciTdDoneHandle()
1224 pipe->deviceNotRespondingCount = 0U; in USB_HostOhciTdDoneHandle()
1225 pipe->endpointInterval = 0U; in USB_HostOhciTdDoneHandle()
1230 if (USB_ENDPOINT_CONTROL == pipe->pipeCommon.pipeType) in USB_HostOhciTdDoneHandle()
1234 pipe->isBusy = 0U; in USB_HostOhciTdDoneHandle()
1267 if (NULL != pipe->ed->trListHead) in USB_HostOhciTdDoneHandle()
1269 switch (pipe->pipeCommon.pipeType) in USB_HostOhciTdDoneHandle()
1276 … if (kStatus_USB_Success != USB_HostOhciLinkGtdTr(usbHostState, pipe, pipe->ed->trListHead)) in USB_HostOhciTdDoneHandle()
1300 usb_host_ohci_pipe_struct_t *pipe, in USB_HostOhciCancelPipe() argument
1314 pipe->ed->stateUnion.stateBitField.K = 1U; in USB_HostOhciCancelPipe()
1325 pipe->isCanceling = 1U; in USB_HostOhciCancelPipe()
1326 pipe->ed->HeadP &= ~USB_HOST_OHCI_ED_HEADP_MASK; in USB_HostOhciCancelPipe()
1327 pipe->ed->HeadP |= pipe->ed->TailP; in USB_HostOhciCancelPipe()
1338 currentPipe = itd->pipe; in USB_HostOhciCancelPipe()
1344 currentPipe = gtd->pipe; in USB_HostOhciCancelPipe()
1346 if (pipe == currentPipe) in USB_HostOhciCancelPipe()
1351 USB_HostOhciTdDoneHandle(usbHostState, pipe, trCurrent, gtd, itd); in USB_HostOhciCancelPipe()
1369 trCurrent = pipe->ed->trListHead; in USB_HostOhciCancelPipe()
1381 if (USB_ENDPOINT_ISOCHRONOUS == pipe->pipeCommon.pipeType) in USB_HostOhciCancelPipe()
1393 USB_HostOhciTdDoneHandle(usbHostState, pipe, trCurrent, gtd, itd); in USB_HostOhciCancelPipe()
1399 pipe->cutOffTime = USB_HOST_OHCI_TRANSFER_TIMEOUT_GAP; in USB_HostOhciCancelPipe()
1402 pipe->deviceNotRespondingCount = 0U; in USB_HostOhciCancelPipe()
1403 pipe->endpointInterval = 0U; in USB_HostOhciCancelPipe()
1408 pipe->isBusy = 0U; in USB_HostOhciCancelPipe()
1412 pipe->ed->trListHead = trPos; in USB_HostOhciCancelPipe()
1426 if (NULL == pipe->ed->trListHead) in USB_HostOhciCancelPipe()
1428 pipe->ed->trListTail = NULL; in USB_HostOhciCancelPipe()
1430 pipe->isCanceling = 0U; in USB_HostOhciCancelPipe()
1433 pipe->ed->stateUnion.stateBitField.K = 0U; in USB_HostOhciCancelPipe()
1439 usb_host_ohci_pipe_struct_t *pipe) in USB_HostOhciRemoveFromPeriodicList() argument
1445 for (i = pipe->startFrame; i < USB_HOST_OHCI_HCCA_SIZE; i += pipe->pipeCommon.interval) in USB_HostOhciRemoveFromPeriodicList()
1453 if (ed == pipe->ed) in USB_HostOhciRemoveFromPeriodicList()
1473 usb_host_ohci_pipe_struct_t *pipe) in USB_HostOhciCloseControlBulkPipe() argument
1478 (void)USB_HostOhciCancelPipe(usbHostState, pipe, NULL); in USB_HostOhciCloseControlBulkPipe()
1480 pipe->ed->stateUnion.stateBitField.K = 1U; in USB_HostOhciCloseControlBulkPipe()
1482 if (USB_ENDPOINT_CONTROL == pipe->pipeCommon.pipeType) in USB_HostOhciCloseControlBulkPipe()
1493 …(usb_host_ohci_general_transfer_descritpor_struct_t *)(pipe->ed->TailP & USB_HOST_OHCI_ED_HEADP_MA… in USB_HostOhciCloseControlBulkPipe()
1496 while ((NULL != edHead) && (edHead != pipe->ed)) in USB_HostOhciCloseControlBulkPipe()
1511 usb_host_ohci_pipe_struct_t *pipe) in USB_HostOhciCloseIsoInterruptPipe() argument
1513 (void)USB_HostOhciCancelPipe(usbHostState, pipe, NULL); in USB_HostOhciCloseIsoInterruptPipe()
1515 pipe->ed->stateUnion.stateBitField.K = 1U; in USB_HostOhciCloseIsoInterruptPipe()
1516 if (USB_ENDPOINT_ISOCHRONOUS == pipe->pipeCommon.pipeType) in USB_HostOhciCloseIsoInterruptPipe()
1521 …(usb_host_ohci_isochronous_transfer_descritpor_struct_t *)(pipe->ed->TailP & USB_HOST_OHCI_ED_HEAD… in USB_HostOhciCloseIsoInterruptPipe()
1528 …(usb_host_ohci_general_transfer_descritpor_struct_t *)(pipe->ed->TailP & USB_HOST_OHCI_ED_HEADP_MA… in USB_HostOhciCloseIsoInterruptPipe()
1531 (void)USB_HostOhciRemoveFromPeriodicList(usbHostState, pipe); in USB_HostOhciCloseIsoInterruptPipe()
1536 static void USB_HostOhciFillGtd(usb_host_ohci_pipe_struct_t *pipe, in USB_HostOhciFillGtd() argument
1547 gtd->pipe = pipe; in USB_HostOhciFillGtd()
1558 usb_host_ohci_pipe_struct_t *pipe, in USB_HostOhciLinkGtdControlTr() argument
1571 …if ((0U != pipe->isBusy) && (kStatus_UsbHostOhci_Idle == (usb_host_ohci_transfer_status_t)tr->setu… in USB_HostOhciLinkGtdControlTr()
1576 pipe->isBusy = 1; in USB_HostOhciLinkGtdControlTr()
1577 pipe->isDone = 0U; in USB_HostOhciLinkGtdControlTr()
1588 pipe->isBusy = 0; in USB_HostOhciLinkGtdControlTr()
1592 … head = (usb_host_ohci_general_transfer_descritpor_struct_t *)pipe->ed->TailP; in USB_HostOhciLinkGtdControlTr()
1596 …USB_HostOhciFillGtd(pipe, tr, p, (uint8_t *)tr->setupPacket, 8U, USB_HOST_OHCI_GTD_DP_SETUP, 0x02U… in USB_HostOhciLinkGtdControlTr()
1612 pipe->isBusy = 0; in USB_HostOhciLinkGtdControlTr()
1617 … head = (usb_host_ohci_general_transfer_descritpor_struct_t *)pipe->ed->TailP; in USB_HostOhciLinkGtdControlTr()
1622 …USB_HostOhciFillGtd(pipe, tr, p, (uint8_t *)tr->transferBuffer, tr->transferLength, dirPid, 0x03U,… in USB_HostOhciLinkGtdControlTr()
1631 pipe->isBusy = 0; in USB_HostOhciLinkGtdControlTr()
1635 … head = (usb_host_ohci_general_transfer_descritpor_struct_t *)pipe->ed->TailP; in USB_HostOhciLinkGtdControlTr()
1647 USB_HostOhciFillGtd(pipe, tr, p, NULL, 0U, statePid, 0x03, 1U); in USB_HostOhciLinkGtdControlTr()
1657 pipe->isBusy = 0; in USB_HostOhciLinkGtdControlTr()
1664 if (0U == pipe->isBusy) in USB_HostOhciLinkGtdControlTr()
1676 p->pipe = pipe; in USB_HostOhciLinkGtdControlTr()
1677 temp = (void *)pipe; in USB_HostOhciLinkGtdControlTr()
1679 pipe->ed->TailP = (uint32_t)p; in USB_HostOhciLinkGtdControlTr()
1687 usb_host_ohci_pipe_struct_t *pipe, in USB_HostOhciLinkGtdTr() argument
1703 if (0U != pipe->isBusy) in USB_HostOhciLinkGtdTr()
1708 pipe->isBusy = 1U; in USB_HostOhciLinkGtdTr()
1709 pipe->isDone = 0U; in USB_HostOhciLinkGtdTr()
1717 tdLength -= tdLength % pipe->pipeCommon.maxPacketSize; in USB_HostOhciLinkGtdTr()
1737 pipe->isBusy = 0; in USB_HostOhciLinkGtdTr()
1742 head = (usb_host_ohci_general_transfer_descritpor_struct_t *)pipe->ed->TailP; in USB_HostOhciLinkGtdTr()
1756 tdLength -= tdLength % pipe->pipeCommon.maxPacketSize; in USB_HostOhciLinkGtdTr()
1765 USB_HostOhciFillGtd(pipe, tr, p, (uint8_t *)bufferAddress, tdLength, dirPid, 0x00U, 0U); in USB_HostOhciLinkGtdTr()
1771 USB_HostOhciFillGtd(pipe, tr, p, (uint8_t *)bufferAddress, tdLength, dirPid, 0x00U, 1U); in USB_HostOhciLinkGtdTr()
1778 USB_HostOhciFillGtd(pipe, tr, p, NULL, 0U, dirPid, 0x00U, 1U); in USB_HostOhciLinkGtdTr()
1785 p->pipe = pipe; in USB_HostOhciLinkGtdTr()
1786 temp = (void *)pipe; in USB_HostOhciLinkGtdTr()
1788 pipe->ed->TailP = (uint32_t)p; in USB_HostOhciLinkGtdTr()
1790 if (USB_ENDPOINT_BULK == pipe->pipeCommon.pipeType) in USB_HostOhciLinkGtdTr()
1801 static void USB_HostOhciFillItd(usb_host_ohci_pipe_struct_t *pipe, in USB_HostOhciFillItd() argument
1812 itd->stateUnion.stateBitField.FC = (length - 1U) / pipe->pipeCommon.maxPacketSize; in USB_HostOhciFillItd()
1814 itd->pipe = pipe; in USB_HostOhciFillItd()
1818 …itd->OffsetPSW[i] = (uint16_t)((((uint32_t)buffer + (i * pipe->pipeCommon.maxPacketSize)) & 0xFFFU… in USB_HostOhciFillItd()
1820 …if ((((uint32_t)buffer + (i * pipe->pipeCommon.maxPacketSize)) & USB_HOST_OHCI_ITD_BP0_MASK) != it… in USB_HostOhciFillItd()
1829 usb_host_ohci_pipe_struct_t *pipe, in USB_HostOhciLinkItdTr() argument
1849 pipe->isDone = 0U; in USB_HostOhciLinkItdTr()
1851 tdCount = ((remainingLength - 1U) / (pipe->pipeCommon.maxPacketSize)) + 1U; in USB_HostOhciLinkItdTr()
1852 if (1U == pipe->pipeCommon.interval) in USB_HostOhciLinkItdTr()
1868 head = (usb_host_ohci_isochronous_transfer_descritpor_struct_t *)pipe->ed->TailP; in USB_HostOhciLinkItdTr()
1881 tdLength = ((uint32_t)pipe->pipeCommon.maxPacketSize) * ((uint32_t)tansaction); in USB_HostOhciLinkItdTr()
1886 USB_HostOhciFillItd(pipe, tr, p, (uint8_t *)bufferAddress, tdLength, startFrame); in USB_HostOhciLinkItdTr()
1892 startFrame += ((uint32_t)tansaction) * ((uint32_t)pipe->pipeCommon.interval); in USB_HostOhciLinkItdTr()
1899 p->pipe = pipe; in USB_HostOhciLinkItdTr()
1900 temp = (void *)pipe; in USB_HostOhciLinkItdTr()
1902 pipe->ed->HeadP &= ~USB_HOST_OHCI_ED_HEADP_MASK; in USB_HostOhciLinkItdTr()
1903 pipe->ed->HeadP |= (uint32_t)head; in USB_HostOhciLinkItdTr()
1904 pipe->ed->TailP = (uint32_t)p; in USB_HostOhciLinkItdTr()
1916 usb_host_ohci_pipe_struct_t *pipe; in USB_HostOhciTokenDone() local
1932 pipe = itd->pipe; in USB_HostOhciTokenDone()
1938 pipe = gtd->pipe; in USB_HostOhciTokenDone()
1942 USB_HostOhciTdDoneHandle(usbHostState, pipe, trCurrent, gtd, itd); in USB_HostOhciTokenDone()
1959 usb_host_ohci_pipe_struct_t *pipe; in USB_HostOhciSof() local
1972 pipe = usbHostState->pipeListInUsing; in USB_HostOhciSof()
1973 while (NULL != pipe) in USB_HostOhciSof()
1975 …if ((USB_ENDPOINT_CONTROL == pipe->pipeCommon.pipeType) || (USB_ENDPOINT_BULK == pipe->pipeCommon.… in USB_HostOhciSof()
1977 if (NULL != pipe->ed->trListHead) in USB_HostOhciSof()
1979 pipe->cutOffTime--; in USB_HostOhciSof()
1980 if (0U == pipe->cutOffTime) in USB_HostOhciSof()
1982 (void)USB_HostOhciCancelPipe(usbHostState, pipe, pipe->ed->trListHead); in USB_HostOhciSof()
1989 if (USB_ENDPOINT_INTERRUPT == pipe->pipeCommon.pipeType) in USB_HostOhciSof()
1991 if (pipe->endpointInterval != 0U) in USB_HostOhciSof()
1993 pipe->endpointInterval--; in USB_HostOhciSof()
1994 if (pipe->endpointInterval == 0U) in USB_HostOhciSof()
1996 pipe->deviceNotRespondingCount = 0U; in USB_HostOhciSof()
2005 tail = pipe->ed->TailP & USB_HOST_OHCI_ED_TAILP_MASK; in USB_HostOhciSof()
2006 head = pipe->ed->HeadP & USB_HOST_OHCI_ED_HEADP_MASK; in USB_HostOhciSof()
2007 if ((0U != pipe->isBusy) && (head == tail)) in USB_HostOhciSof()
2009 if ((0U != pipe->isDone) && (pipe->currentTr == pipe->ed->trListHead)) in USB_HostOhciSof()
2011 if (pipe->startWriteBackCount != usbHostState->writeBackCount) in USB_HostOhciSof()
2013 pipe->isDone = 0U; in USB_HostOhciSof()
2014 … gtd = (usb_host_ohci_general_transfer_descritpor_struct_t *)pipe->ed->trListHead->union1.unitHead; in USB_HostOhciSof()
2018 if (USB_ENDPOINT_ISOCHRONOUS == pipe->pipeCommon.pipeType) in USB_HostOhciSof()
2028 … USB_HostOhciTdDoneHandle(usbHostState, pipe, pipe->ed->trListHead, gtd, itd); in USB_HostOhciSof()
2035 pipe->isDone = 1; in USB_HostOhciSof()
2036 pipe->currentTr = pipe->ed->trListHead; in USB_HostOhciSof()
2037 pipe->startWriteBackCount = usbHostState->writeBackCount; in USB_HostOhciSof()
2042 pipe->isDone = 0U; in USB_HostOhciSof()
2045 temp = (void *)pipe->pipeCommon.next; in USB_HostOhciSof()
2046 pipe = (usb_host_ohci_pipe_struct_t *)temp; in USB_HostOhciSof()
2067 usb_host_ohci_pipe_struct_t *pipe; in UBS_HostOhciControllerInit() local
2095 pipe = usbHostState->pipeList; in UBS_HostOhciControllerInit()
2096 pipe->ed = &s_UsbHostOhciTd[usbHostState->controllerId].ed[3]; in UBS_HostOhciControllerInit()
2100 pipe->pipeCommon.next = (usb_host_pipe_t *)temp; in UBS_HostOhciControllerInit()
2101 temp = (void *)pipe->pipeCommon.next; in UBS_HostOhciControllerInit()
2102 pipe = (usb_host_ohci_pipe_struct_t *)temp; in UBS_HostOhciControllerInit()
2103 pipe->ed = &s_UsbHostOhciTd[usbHostState->controllerId].ed[3U + i]; in UBS_HostOhciControllerInit()
2105 pipe->pipeCommon.next = NULL; in UBS_HostOhciControllerInit()
2325 usb_host_ohci_pipe_struct_t *pipe = NULL; in USB_HostOhciOpenPipe() local
2329 status = USB_HostOhciGetPipe(&usbHostState->pipeList, &pipe); in USB_HostOhciOpenPipe()
2331 if ((kStatus_USB_Success != status) || (NULL == pipe)) in USB_HostOhciOpenPipe()
2340 pipe->pipeCommon.deviceHandle = pipeInit->devInstance; in USB_HostOhciOpenPipe()
2341 pipe->pipeCommon.endpointAddress = pipeInit->endpointAddress; in USB_HostOhciOpenPipe()
2342 pipe->pipeCommon.direction = pipeInit->direction; in USB_HostOhciOpenPipe()
2343 pipe->pipeCommon.interval = pipeInit->interval; in USB_HostOhciOpenPipe()
2344 pipe->pipeCommon.maxPacketSize = pipeInit->maxPacketSize; in USB_HostOhciOpenPipe()
2345 pipe->pipeCommon.pipeType = pipeInit->pipeType; in USB_HostOhciOpenPipe()
2346 pipe->pipeCommon.numberPerUframe = 1U; in USB_HostOhciOpenPipe()
2347 pipe->pipeCommon.nakCount = pipeInit->nakCount; in USB_HostOhciOpenPipe()
2348 pipe->pipeCommon.nextdata01 = 0U; in USB_HostOhciOpenPipe()
2349 pipe->pipeCommon.currentCount = 0U; in USB_HostOhciOpenPipe()
2350 pipe->pipeCommon.open = 1U; in USB_HostOhciOpenPipe()
2351 pipe->ed->stateUnion.stateBitField.EN = pipeInit->endpointAddress; in USB_HostOhciOpenPipe()
2352 pipe->ed->stateUnion.stateBitField.D = (USB_OUT == pipeInit->direction) ? 1U : 2U; in USB_HostOhciOpenPipe()
2353 …pipe->ed->stateUnion.stateBitField.FA = ((usb_host_device_instance_t *)pipeInit->devInstance)->set… in USB_HostOhciOpenPipe()
2354 pipe->ed->stateUnion.stateBitField.S = in USB_HostOhciOpenPipe()
2356 pipe->ed->stateUnion.stateBitField.F = 0U; in USB_HostOhciOpenPipe()
2357 pipe->ed->stateUnion.stateBitField.MPS = pipeInit->maxPacketSize; in USB_HostOhciOpenPipe()
2358 pipe->ed->stateUnion.stateBitField.K = 0U; in USB_HostOhciOpenPipe()
2359 pipe->ed->TailP = 0U; in USB_HostOhciOpenPipe()
2360 pipe->ed->HeadP = 0U; in USB_HostOhciOpenPipe()
2361 pipe->ed->pipe = pipe; in USB_HostOhciOpenPipe()
2362 pipe->ed->NextED = 0U; in USB_HostOhciOpenPipe()
2363 pipe->ed->trListHead = NULL; in USB_HostOhciOpenPipe()
2364 pipe->ed->trListTail = NULL; in USB_HostOhciOpenPipe()
2365 pipe->ed->dealTr = NULL; in USB_HostOhciOpenPipe()
2366 pipe->cutOffTime = USB_HOST_OHCI_TRANSFER_TIMEOUT_GAP; in USB_HostOhciOpenPipe()
2367 pipe->isCanceling = 0U; in USB_HostOhciOpenPipe()
2369 pipe->deviceNotRespondingCount = 0U; in USB_HostOhciOpenPipe()
2370 pipe->endpointInterval = 0U; in USB_HostOhciOpenPipe()
2373 if (USB_ENDPOINT_ISOCHRONOUS == pipe->pipeCommon.pipeType) in USB_HostOhciOpenPipe()
2375 pipe->ed->stateUnion.stateBitField.F = 1U; in USB_HostOhciOpenPipe()
2378 pipe->pipeCommon.interval = in USB_HostOhciOpenPipe()
2379 (1 << (pipe->pipeCommon.interval - 1)); /* iso interval is the power of 2 */ in USB_HostOhciOpenPipe()
2380 if (pipe->pipeCommon.interval > USB_HOST_OHCI_HCCA_SIZE) in USB_HostOhciOpenPipe()
2382 pipe->pipeCommon.interval = USB_HOST_OHCI_HCCA_SIZE; in USB_HostOhciOpenPipe()
2385 pipe->pipeCommon.interval = 1U; in USB_HostOhciOpenPipe()
2388 else if (USB_ENDPOINT_INTERRUPT == pipe->pipeCommon.pipeType) in USB_HostOhciOpenPipe()
2394 if (0U != (pipe->pipeCommon.interval & ((uint16_t)(1UL << p)))) in USB_HostOhciOpenPipe()
2402 pipe->pipeCommon.interval = (uint16_t)(1UL << interval); in USB_HostOhciOpenPipe()
2403 if (pipe->pipeCommon.interval > USB_HOST_OHCI_HCCA_SIZE) in USB_HostOhciOpenPipe()
2405 pipe->pipeCommon.interval = USB_HOST_OHCI_HCCA_SIZE; in USB_HostOhciOpenPipe()
2413 switch (pipe->pipeCommon.pipeType) in USB_HostOhciOpenPipe()
2416 pipe->ed->stateUnion.stateBitField.D = 0; in USB_HostOhciOpenPipe()
2417 … status = USB_HostOhciOpenControlBulkPipe(usbHostState, pipe); in USB_HostOhciOpenPipe()
2420 status = USB_HostOhciOpenControlBulkPipe(usbHostState, pipe); in USB_HostOhciOpenPipe()
2425 status = USB_HostOhciOpenIsoPipe(usbHostState, pipe); in USB_HostOhciOpenPipe()
2429 status = USB_HostOhciOpenInterruptPipe(usbHostState, pipe); in USB_HostOhciOpenPipe()
2439 pipe->ed->stateUnion.stateBitField.K = 1U; in USB_HostOhciOpenPipe()
2440 pipe->pipeCommon.open = 0U; in USB_HostOhciOpenPipe()
2442 (void)USB_HostOhciInsertPipe(&usbHostState->pipeList, pipe); in USB_HostOhciOpenPipe()
2446 (void)USB_HostOhciInsertPipe(&usbHostState->pipeListInUsing, pipe); in USB_HostOhciOpenPipe()
2448 *pipeHandle = pipe; in USB_HostOhciOpenPipe()
2455 usb_host_ohci_pipe_struct_t *pipe = (usb_host_ohci_pipe_struct_t *)pipeHandle; in USB_HostOhciClosePipe() local
2457 switch (pipe->pipeCommon.pipeType) in USB_HostOhciClosePipe()
2461 (void)USB_HostOhciCloseControlBulkPipe(usbHostState, pipe); in USB_HostOhciClosePipe()
2468 (void)USB_HostOhciCloseIsoInterruptPipe(usbHostState, pipe); in USB_HostOhciClosePipe()
2475 (void)USB_HostOhciRemovePipe(&usbHostState->pipeListInUsing, pipe); in USB_HostOhciClosePipe()
2476 pipe->pipeCommon.open = 0U; in USB_HostOhciClosePipe()
2477 (void)USB_HostOhciInsertPipe(&usbHostState->pipeList, pipe); in USB_HostOhciClosePipe()
2487 usb_host_ohci_pipe_struct_t *pipe = (usb_host_ohci_pipe_struct_t *)pipeHandle; in USB_HostOhciWritePipe() local
2494 if (NULL != pipe->ed->trListHead) in USB_HostOhciWritePipe()
2496 pipe->ed->trListTail->next = transfer; in USB_HostOhciWritePipe()
2500 pipe->ed->trListHead = transfer; in USB_HostOhciWritePipe()
2502 pipe->ed->trListTail = transfer; in USB_HostOhciWritePipe()
2506 switch (pipe->pipeCommon.pipeType) in USB_HostOhciWritePipe()
2515 status = USB_HostOhciLinkGtdControlTr(usbHostState, pipe, transfer); in USB_HostOhciWritePipe()
2526 status = USB_HostOhciLinkGtdTr(usbHostState, pipe, transfer); in USB_HostOhciWritePipe()
2536 if (NULL == pipe->ed->dealTr) in USB_HostOhciWritePipe()
2538 if (NULL != pipe->ed->trListHead) in USB_HostOhciWritePipe()
2540 pipe->ed->dealTr = pipe->ed->trListHead; in USB_HostOhciWritePipe()
2544 pipe->ed->dealTr = transfer; in USB_HostOhciWritePipe()
2562 usb_host_transfer_t *trP = pipe->ed->trListHead; in USB_HostOhciWritePipe()
2572 pipe->ed->trListHead = trP->next; in USB_HostOhciWritePipe()
2578 if (pipe->ed->trListTail == transfer) in USB_HostOhciWritePipe()
2580 pipe->ed->trListTail = trQ; in USB_HostOhciWritePipe()
2602 usb_host_ohci_pipe_struct_t *pipe; in USB_HostOhciIoctl() local
2632 pipe = (usb_host_ohci_pipe_struct_t *)ioctlParam; in USB_HostOhciIoctl()
2633 pipe->ed->stateUnion.stateBitField.K = 1U; in USB_HostOhciIoctl()
2635 (void)USB_HostHelperGetPeripheralInformation(pipe->pipeCommon.deviceHandle, in USB_HostOhciIoctl()
2637 pipe->ed->stateUnion.stateBitField.FA = deviceAddress; in USB_HostOhciIoctl()
2638 pipe->ed->stateUnion.stateBitField.K = 0U; in USB_HostOhciIoctl()
2643 pipe = (usb_host_ohci_pipe_struct_t *)ioctlParam; in USB_HostOhciIoctl()
2644 pipe->ed->stateUnion.stateBitField.K = 1U; in USB_HostOhciIoctl()
2645 pipe->ed->stateUnion.stateBitField.MPS = pipe->pipeCommon.maxPacketSize; in USB_HostOhciIoctl()
2646 pipe->ed->stateUnion.stateBitField.K = 0U; in USB_HostOhciIoctl()
2743 usb_host_ohci_pipe_struct_t *pipe; in USB_HostOhciIsrFunction() local
2748 pipe = (usb_host_ohci_pipe_struct_t *)temp; in USB_HostOhciIsrFunction()
2749 temp = (void *)pipe->pipeCommon.next; in USB_HostOhciIsrFunction()
2750 … if ((USB_ENDPOINT_ISOCHRONOUS == pipe->pipeCommon.pipeType) && (NULL != pipe->ed->trListHead)) in USB_HostOhciIsrFunction()
2752 if ((NULL != pipe->ed->dealTr)) in USB_HostOhciIsrFunction()
2754 uint32_t tail = pipe->ed->TailP & USB_HOST_OHCI_ED_TAILP_MASK; in USB_HostOhciIsrFunction()
2755 uint32_t head = pipe->ed->HeadP & USB_HOST_OHCI_ED_HEADP_MASK; in USB_HostOhciIsrFunction()
2758 … if (kStatus_USB_Success == USB_HostOhciLinkItdTr(usbHostState, pipe, pipe->ed->dealTr)) in USB_HostOhciIsrFunction()
2760 pipe->ed->dealTr = pipe->ed->dealTr->next; in USB_HostOhciIsrFunction()
2768 pipe->isDone = 0U; in USB_HostOhciIsrFunction()