Lines Matching defs:pIf
412 * @param pIf The interface to allocated it from.
414 static int usbProxyDarwinUrbAllocIsocBuf(PUSBPROXYURBOSX pUrbOsX, PUSBPROXYIFOSX pIf)
423 for (PUSBPROXYISOCBUFCOL pCur = pIf->pIsocBufCols; pCur; pCur = pCur->pNext)
443 IOReturn irc = (*pIf->ppIfI)->LowLatencyCreateBuffer(pIf->ppIfI, &pNew->pvBuffer, 8192 * RT_ELEMENTS(pNew->aBuffers), enmLLType);
451 irc = (*pIf->ppIfI)->LowLatencyCreateBuffer(pIf->ppIfI, &pNew->pvFrames, PAGE_SIZE, kUSBLowLatencyFrameListBuffer);
471 pNew->pNext = pIf->pIsocBufCols;
472 pIf->pIsocBufCols = pNew;
479 for (unsigned iPipe = 0; iPipe < pIf->cPipes; iPipe++)
480 if (pIf->aPipes[iPipe].u8TransferType == kUSBIsoc)
482 irc = (*pIf->ppIfI)->SetPipePolicy(pIf->ppIfI, pIf->aPipes[iPipe].u8PipeRef,
483 pIf->aPipes[iPipe].u16MaxPacketSize, pIf->aPipes[iPipe].u8Interval);
492 (*pIf->ppIfI)->LowLatencyDestroyBuffer(pIf->ppIfI, pNew->pvBuffer);
669 PUSBPROXYIFOSX pIf = pDevOsX->pIfHead;
672 while (pIf)
674 PUSBPROXYIFOSX pNext = pIf->pNext;
677 if (pIf->RunLoopSrcRef)
679 int rc = usbProxyDarwinRemoveSourceRefFromAllRunLoops((PRTLISTANCHOR)&pIf->HeadOfRunLoopLst, pIf->RunLoopSrcRef);
682 CFRelease(pIf->RunLoopSrcRef);
683 pIf->RunLoopSrcRef = NULL;
684 RTListInit((PRTLISTNODE)&pIf->HeadOfRunLoopLst);
687 while (pIf->pIsocBufCols)
689 PUSBPROXYISOCBUFCOL pCur = pIf->pIsocBufCols;
690 pIf->pIsocBufCols = pCur->pNext;
693 irc = (*pIf->ppIfI)->LowLatencyDestroyBuffer(pIf->ppIfI, pCur->pvBuffer);
697 irc = (*pIf->ppIfI)->LowLatencyDestroyBuffer(pIf->ppIfI, pCur->pvFrames);
704 irc = (*pIf->ppIfI)->USBInterfaceClose(pIf->ppIfI);
707 (*pIf->ppIfI)->Release(pIf->ppIfI);
708 pIf->ppIfI = NULL;
710 RTMemFree(pIf);
712 pIf = pNext;
725 * @param pIf The interface to get pipe props for.
727 static int usbProxyDarwinGetPipeProperties(PUSBPROXYDEVOSX pDevOsX, PUSBPROXYIFOSX pIf)
734 IOReturn irc = (*pIf->ppIfI)->GetNumEndpoints(pIf->ppIfI, &cPipes);
737 pIf->cPipes = 0;
744 AssertRelease(cPipes < RT_ELEMENTS(pIf->aPipes));
745 pIf->cPipes = cPipes + 1;
750 for (unsigned i = 0; i < pIf->cPipes; i++)
752 pIf->aPipes[i].u8PipeRef = i;
753 pIf->aPipes[i].u64NextFrameNo = 0;
754 irc = (*pIf->ppIfI)->GetPipeProperties(pIf->ppIfI, i,
755 &pIf->aPipes[i].u8Direction,
756 &pIf->aPipes[i].u8Endpoint,
757 &pIf->aPipes[i].u8TransferType,
758 &pIf->aPipes[i].u16MaxPacketSize,
759 &pIf->aPipes[i].u8Interval);
763 i, pIf->u8Interface, pDevOsX->pProxyDev->pUsbIns->pszName, pIf->u8Protocol, pIf->u8Class));
768 pIf->cPipes = i;
772 if (pIf->aPipes[i].u8Direction == kUSBIn)
773 pIf->aPipes[i].u8Endpoint |= 0x80;
775 pIf->u8Interface, pIf->aPipes[i].u8Endpoint, pIf->aPipes[i].u8Direction, pIf->aPipes[i].u8TransferType,
776 pIf->aPipes[i].u8PipeRef, pIf->aPipes[i].u16MaxPacketSize, pIf->aPipes[i].u8Interval));
865 PUSBPROXYIFOSX pIf = (PUSBPROXYIFOSX)RTMemAllocZ(sizeof(*pIf));
866 if (pIf)
873 pIf->u8Interface = u8Interface;
874 pIf->u8AltSetting = u8AltSetting;
875 pIf->u8Class = u8Class;
876 pIf->u8Protocol = u8Protocol;
877 pIf->cPipes = cEndpoints;
878 pIf->ppIfI = ppIfI;
881 rc = usbProxyDarwinGetPipeProperties(pDevOsX, pIf);
889 irc = (*ppIfI)->CreateInterfaceAsyncEventSource(ppIfI, &pIf->RunLoopSrcRef);
892 RTListInit((PRTLISTNODE)&pIf->HeadOfRunLoopLst);
893 usbProxyDarwinAddRunLoopRef(&pIf->HeadOfRunLoopLst,
894 pIf->RunLoopSrcRef);
899 pIf->pNext = NULL;
903 pDevOsX->pIfTail = pDevOsX->pIfTail->pNext = pIf;
905 pDevOsX->pIfTail = pDevOsX->pIfHead = pIf;
912 RTMemFree(pIf);
975 PUSBPROXYIFOSX pIf;
976 for (pIf = pDevOsX->pIfHead; pIf; pIf = pIf->pNext)
977 if (pIf->u8Interface == u8Interface)
978 return pIf;
1000 PUSBPROXYIFOSX pIf;
1001 for (pIf = pDevOsX->pIfHead; pIf; pIf = pIf->pNext)
1003 unsigned i = pIf->cPipes;
1005 if (pIf->aPipes[i].u8Endpoint == u8Endpoint)
1007 *pu8PipeRef = pIf->aPipes[i].u8PipeRef;
1009 *ppPipe = &pIf->aPipes[i];
1010 return pIf;
1517 PUSBPROXYIFOSX pIf = usbProxyDarwinGetInterface(pDevOsX, iIf);
1519 pProxyDev->pUsbIns->pszName, iIf, iAlt, pIf ? pIf->u8AltSetting : 0xbeef));
1520 if (pIf)
1523 if (iAlt != pIf->u8AltSetting)
1525 irc = (*pIf->ppIfI)->SetAlternateInterface(pIf->ppIfI, iAlt);
1528 usbProxyDarwinGetPipeProperties(pDevOsX, pIf);
1551 LogFlow(("usbProxyDarwinSetInterface: pProxyDev=%s eiIf=%#x iAlt=%#x - failure - pIf=%p irc=%#x\n",
1552 pProxyDev->pUsbIns->pszName, iIf, iAlt, pIf, irc));
1579 PUSBPROXYIFOSX pIf = usbProxyDarwinGetInterfaceForEndpoint(pDevOsX, EndPt, &u8PipeRef, NULL);
1580 if (pIf)
1582 irc = (*pIf->ppIfI)->ClearPipeStallBothEnds(pIf->ppIfI, u8PipeRef);
1588 LogFlow(("usbProxyDarwinClearHaltedEp: pProxyDev=%s EndPt=%#x - failure - pIf=%p irc=%#x\n",
1589 pProxyDev->pUsbIns->pszName, EndPt, pIf, irc));
1607 PUSBPROXYIFOSX pIf = NULL;
1613 pIf = usbProxyDarwinGetInterfaceForEndpoint(pDevOsX, EndPt, &u8PipeRef, &pPipe);
1614 if (!pIf)
1621 /* else: pIf == NULL -> default control pipe.*/
1653 if (pIf)
1654 irc = (*pIf->ppIfI)->ControlRequestAsync(pIf->ppIfI, u8PipeRef, &pUrbOsX->u.ControlMsg,
1665 AssertBreak(pIf);
1668 irc = (*pIf->ppIfI)->WritePipeAsync(pIf->ppIfI, u8PipeRef, pUrb->abData, pUrb->cbData,
1671 irc = (*pIf->ppIfI)->ReadPipeAsync(pIf->ppIfI, u8PipeRef, pUrb->abData, pUrb->cbData,
1679 AssertBreak(pIf);
1685 int rc = usbProxyDarwinUrbAllocIsocBuf(pUrbOsX, pIf);
1698 irc = (*pIf->ppIfI)->GetBusFrameNumber(pIf->ppIfI, &FrameNo, &FrameTime);
1730 irc = (*pIf->ppIfI)->LowLatencyWriteIsochPipeAsync(pIf->ppIfI, u8PipeRef,
1734 irc = (*pIf->ppIfI)->LowLatencyReadIsochPipeAsync(pIf->ppIfI, u8PipeRef,
1739 irc = (*pIf->ppIfI)->WriteIsochPipeAsync(pIf->ppIfI, u8PipeRef,
1743 irc = (*pIf->ppIfI)->ReadIsochPipeAsync(pIf->ppIfI, u8PipeRef,
1758 irc = (*pIf->ppIfI)->GetBusFrameNumber(pIf->ppIfI, &FrameNo, &FrameTime);
1826 PUSBPROXYIFOSX pIf;
1827 for (pIf = pDevOsX->pIfHead; pIf; pIf = pIf->pNext)
1829 if (!CFRunLoopContainsSource(hRunLoopRef, pIf->RunLoopSrcRef, g_pRunLoopMode))
1830 usbProxyDarwinAddRunLoopRef(&pIf->HeadOfRunLoopLst, pIf->RunLoopSrcRef);
1936 PUSBPROXYIFOSX pIf = usbProxyDarwinGetInterfaceForEndpoint(pDevOsX, EndPt, &u8PipeRef, NULL);
1937 if (pIf)
1938 irc = (*pIf->ppIfI)->AbortPipe(pIf->ppIfI, u8PipeRef);