Lines Matching defs:pProxyDevUsbIp
469 * @param pProxyDevUsbIp The USB/IP proxy device data.
471 DECLINLINE(uint32_t) usbProxyUsbIpSeqNumGet(PUSBPROXYDEVUSBIP pProxyDevUsbIp)
473 return ASMAtomicIncU32(&pProxyDevUsbIp->u32SeqNumNext);
480 * @param pProxyDevUsbIp The USB/IP proxy device data.
484 DECLINLINE(void) usbProxyUsbIpLinkUrb(PUSBPROXYDEVUSBIP pProxyDevUsbIp, PRTLISTANCHOR pList, PUSBPROXYURBUSBIP pUrbUsbIp)
486 int rc = RTSemFastMutexRequest(pProxyDevUsbIp->hMtxLists);
489 RTSemFastMutexRelease(pProxyDevUsbIp->hMtxLists);
496 * @param pProxyDevUsbIp The USB/IP proxy device data.
499 DECLINLINE(void) usbProxyUsbIpUnlinkUrb(PUSBPROXYDEVUSBIP pProxyDevUsbIp, PUSBPROXYURBUSBIP pUrbUsbIp)
501 int rc = RTSemFastMutexRequest(pProxyDevUsbIp->hMtxLists);
504 RTSemFastMutexRelease(pProxyDevUsbIp->hMtxLists);
511 * @param pProxyDevUsbIp The USB/IP proxy device data.
513 static PUSBPROXYURBUSBIP usbProxyUsbIpUrbAlloc(PUSBPROXYDEVUSBIP pProxyDevUsbIp)
515 NOREF(pProxyDevUsbIp);
523 * @param pProxyDevUsbIp The USB/IP proxy device data.
526 static void usbProxyUsbIpUrbFree(PUSBPROXYDEVUSBIP pProxyDevUsbIp, PUSBPROXYURBUSBIP pUrbUsbIp)
528 NOREF(pProxyDevUsbIp);
536 * @param pProxyDevUsbIp The USB/IP proxy device data to parse the address for.
539 static int usbProxyUsbIpParseAddress(PUSBPROXYDEVUSBIP pProxyDevUsbIp, const char *pszAddress)
549 rc = RTStrToUInt32Ex(pszPortStart, NULL, 10 /* uBase */, &pProxyDevUsbIp->uPort);
553 rc = RTStrAllocEx(&pProxyDevUsbIp->pszHost, cbHost + 1);
556 rc = RTStrCopyEx(pProxyDevUsbIp->pszHost, cbHost + 1, pszAddress, cbHost);
574 * @param pProxyDevUsbIp The USB/IP proxy device data.
576 static int usbProxyUsbIpConnect(PUSBPROXYDEVUSBIP pProxyDevUsbIp)
579 rc = RTTcpClientConnect(pProxyDevUsbIp->pszHost, pProxyDevUsbIp->uPort, &pProxyDevUsbIp->hSocket);
583 rc = RTTcpSetSendCoalescing(pProxyDevUsbIp->hSocket, false);
592 rc = RTStrCopy(&ReqImport.aszBusId[0], sizeof(ReqImport.aszBusId[0]), pProxyDevUsbIp->pszBusId);
595 rc = RTTcpWrite(pProxyDevUsbIp->hSocket, &ReqImport, sizeof(ReqImport));
600 rc = RTTcpRead(pProxyDevUsbIp->hSocket, &RetImport, sizeof(RetImport), NULL);
612 rc = RTTcpRead(pProxyDevUsbIp->hSocket, &Device, sizeof(Device), NULL);
616 pProxyDevUsbIp->u32DevId = (Device.u32BusNum << 16) | Device.u32DevNum;
618 rc = RTPollSetAddSocket(pProxyDevUsbIp->hPollSet, pProxyDevUsbIp->hSocket,
642 strlen(pProxyDevUsbIp->pszBusId) + 1, sizeof(ReqImport.aszBusId[0])));
647 RTTcpClientCloseEx(pProxyDevUsbIp->hSocket, false /*fGracefulShutdown*/);
650 LogRel(("UsbIp: Connecting to the host %s failed with %Rrc\n", pProxyDevUsbIp->pszHost, rc));
658 * @param pProxyDevUsbIp The USB/IP proxy device data.
660 static int usbProxyUsbIpDisconnect(PUSBPROXYDEVUSBIP pProxyDevUsbIp)
664 rc = RTTcpClientCloseEx(pProxyDevUsbIp->hSocket, false /*fGracefulShutdown*/);
666 pProxyDevUsbIp->hSocket = NIL_RTSOCKET;
674 * @param pProxyDevUsbIp The USB/IP proxy device data.
682 static int usbProxyUsbIpCtrlUrbExchangeSync(PUSBPROXYDEVUSBIP pProxyDevUsbIp, PVUSBSETUP pSetup)
687 uint32_t u32SeqNum = usbProxyUsbIpSeqNumGet(pProxyDevUsbIp);
690 ReqSubmit.Hdr.u32DevId = pProxyDevUsbIp->u32DevId;
702 rc = RTTcpWrite(pProxyDevUsbIp->hSocket, &ReqSubmit, sizeof(ReqSubmit));
708 rc = RTTcpRead(pProxyDevUsbIp->hSocket, &RetSubmit, sizeof(RetSubmit), NULL);
897 PUSBPROXYDEVUSBIP pProxyDevUsbIp = USBPROXYDEV_2_DATA(pProxyDev, PUSBPROXYDEVUSBIP);
900 PUSBPROXYURBUSBIP pUrbUsbIp = usbProxyUsbIpUrbAlloc(pProxyDevUsbIp);
904 pUrbUsbIp->u32SeqNumUrb = usbProxyUsbIpSeqNumGet(pProxyDevUsbIp);
909 ReqSubmit.Hdr.u32DevId = pProxyDevUsbIp->u32DevId;
938 usbProxyUsbIpUrbFree(pProxyDevUsbIp, pUrbUsbIp);
946 usbProxyUsbIpUrbFree(pProxyDevUsbIp, pUrbUsbIp);
960 int rc = RTTcpSgWrite(pProxyDevUsbIp->hSocket, &SgBufReq);
966 usbProxyUsbIpLinkUrb(pProxyDevUsbIp, &pProxyDevUsbIp->ListUrbsInFlight, pUrbUsbIp);
969 usbProxyUsbIpUrbFree(pProxyDevUsbIp, pUrbUsbIp);
1019 PUSBPROXYDEVUSBIP pProxyDevUsbIp = USBPROXYDEV_2_DATA(pProxyDev, PUSBPROXYDEVUSBIP);
1023 uint32_t u32SeqNum = usbProxyUsbIpSeqNumGet(pProxyDevUsbIp);
1026 ReqUnlink.Hdr.u32DevId = pProxyDevUsbIp->u32DevId;
1031 int rc = RTTcpWrite(pProxyDevUsbIp->hSocket, &ReqUnlink, sizeof(ReqUnlink));