Lines Matching defs:pUrbInfo
1033 PUSBSUP_URB pUrbInfo = (PUSBSUP_URB)pContext->pOut;
1036 if (!pUrb || !pMdlBuf || !pUrbInfo | !pDevExt)
1051 pUrbInfo->error = USBSUP_XFER_CRC;
1054 pUrbInfo->error = USBSUP_XFER_OK;
1057 pUrbInfo->error = USBSUP_XFER_STALL;
1064 pUrbInfo->error = USBSUP_XFER_DNR;
1072 pUrbInfo->len = pUrb->UrbControlTransfer.TransferBufferLength;
1079 pUrbInfo->len += sizeof (pUrb->UrbControlTransfer.SetupPacket);
1083 pUrbInfo->len = pUrb->UrbIsochronousTransfer.TransferBufferLength;
1087 if (pUrbInfo->dir == USBSUP_DIRECTION_IN && pUrbInfo->error == USBSUP_XFER_OK
1088 && !(pUrbInfo->flags & USBSUP_FLAG_SHORT_OK)
1089 && pUrbInfo->len > pUrb->UrbBulkOrInterruptTransfer.TransferBufferLength
1096 pUrbInfo->error = USBSUP_XFER_UNDERRUN;
1098 pUrbInfo->len = pUrb->UrbBulkOrInterruptTransfer.TransferBufferLength;
1106 pUrbInfo->len = 0;
1128 pUrbInfo->error = USBSUP_XFER_CRC;
1132 pUrbInfo->error = USBSUP_XFER_STALL;
1137 pUrbInfo->error = USBSUP_XFER_DNR;
1142 pUrbInfo->error = USBSUP_XFER_STALL;
1147 pUrbInfo->error = USBSUP_XFER_NAC;
1152 pUrbInfo->error = USBSUP_XFER_DNR;
1160 Assert(pUrbInfo->numIsoPkts == pUrb->UrbIsochronousTransfer.NumberOfPackets);
1161 for (ULONG i = 0; i < pUrbInfo->numIsoPkts; ++i)
1163 Assert(pUrbInfo->aIsoPkts[i].off == pUrb->UrbIsochronousTransfer.IsoPacket[i].Offset);
1164 pUrbInfo->aIsoPkts[i].cb = (uint16_t)pUrb->UrbIsochronousTransfer.IsoPacket[i].Length;
1168 pUrbInfo->aIsoPkts[i].stat = USBSUP_XFER_OK;
1171 pUrbInfo->aIsoPkts[i].stat = USBSUP_XFER_NAC;
1174 pUrbInfo->aIsoPkts[i].stat = USBSUP_XFER_STALL;
1188 pIrp->IoStatus.Information = sizeof(*pUrbInfo);
1193 static NTSTATUS vboxUsbRtUrbSend(PVBOXUSBDEV_EXT pDevExt, PIRP pIrp, PUSBSUP_URB pUrbInfo)
1200 Assert(pUrbInfo);
1201 if (pUrbInfo->type == USBSUP_TRANSFER_TYPE_ISOC)
1203 Assert(pUrbInfo->numIsoPkts <= 8);
1204 cbUrb = GET_ISO_URB_SIZE(pUrbInfo->numIsoPkts);
1221 if (pUrbInfo->ep)
1223 hPipe = vboxUsbRtGetPipeHandle(pDevExt, pUrbInfo->ep | ((pUrbInfo->dir == USBSUP_DIRECTION_IN) ? 0x80 : 0x00));
1226 AssertMsgFailed((__FUNCTION__": vboxUsbRtGetPipeHandle failed for endpoint (0x%x)\n", pUrbInfo->ep));
1232 pMdlBuf = IoAllocateMdl(pUrbInfo->buf, (ULONG)pUrbInfo->len, FALSE, FALSE, NULL);
1235 AssertMsgFailed((__FUNCTION__": IoAllocateMdl failed for buffer (0x%p) length (%d)\n", pUrbInfo->buf, pUrbInfo->len));
1264 switch (pUrbInfo->type)
1272 pUrb->UrbControlTransfer.TransferBufferLength = (ULONG)pUrbInfo->len;
1273 pUrb->UrbControlTransfer.TransferFlags = ((pUrbInfo->dir == USBSUP_DIRECTION_IN) ? USBD_TRANSFER_DIRECTION_IN : USBD_TRANSFER_DIRECTION_OUT);
1279 if (pUrbInfo->type == USBSUP_TRANSFER_TYPE_MSG)
1286 memcpy(pUrb->UrbControlTransfer.SetupPacket, pBuffer, min(sizeof (pUrb->UrbControlTransfer.SetupPacket), pUrbInfo->len));
1306 Assert(pUrbInfo->dir == USBSUP_DIRECTION_IN || pUrbInfo->type == USBSUP_TRANSFER_TYPE_BULK);
1308 VBOXUSB_PIPE_INFO *pPipeInfo = vboxUsbRtGetPipeInfo(pDevExt, pUrbInfo->ep | ((pUrbInfo->dir == USBSUP_DIRECTION_IN) ? 0x80 : 0x00));
1320 pUrb->UrbIsochronousTransfer.TransferBufferLength = (ULONG)pUrbInfo->len;
1323 pUrb->UrbIsochronousTransfer.TransferFlags = ((pUrbInfo->dir == USBSUP_DIRECTION_IN) ? USBD_TRANSFER_DIRECTION_IN : USBD_TRANSFER_DIRECTION_OUT);
1325 pUrb->UrbIsochronousTransfer.NumberOfPackets = pUrbInfo->numIsoPkts;
1329 Assert(pUrbInfo->numIsoPkts == pUrb->UrbIsochronousTransfer.NumberOfPackets);
1330 for (ULONG i = 0; i < pUrbInfo->numIsoPkts; ++i)
1332 pUrb->UrbIsochronousTransfer.IsoPacket[i].Offset = pUrbInfo->aIsoPkts[i].off;
1333 pUrb->UrbIsochronousTransfer.IsoPacket[i].Length = pUrbInfo->aIsoPkts[i].cb;
1346 pPipeInfo->NextScheduledFrame = iFrame + pUrbInfo->numIsoPkts;
1353 Assert(pUrbInfo->dir != USBSUP_DIRECTION_SETUP);
1354 Assert(pUrbInfo->dir == USBSUP_DIRECTION_IN || pUrbInfo->type == USBSUP_TRANSFER_TYPE_BULK);
1360 pUrb->UrbBulkOrInterruptTransfer.TransferBufferLength = (ULONG)pUrbInfo->len;
1363 pUrb->UrbBulkOrInterruptTransfer.TransferFlags = ((pUrbInfo->dir == USBSUP_DIRECTION_IN) ? USBD_TRANSFER_DIRECTION_IN : USBD_TRANSFER_DIRECTION_OUT);
1387 pContext->pOut = pUrbInfo;
1388 pContext->ulTransferType = pUrbInfo->type;
1424 PUSBSUP_URB pUrbInfo = (PUSBSUP_URB)pIrp->AssociatedIrp.SystemBuffer;
1443 if ( !pUrbInfo
1444 || pSl->Parameters.DeviceIoControl.InputBufferLength != sizeof (*pUrbInfo)
1445 || pSl->Parameters.DeviceIoControl.OutputBufferLength != sizeof (*pUrbInfo))
1451 return vboxUsbRtUrbSend(pDevExt, pIrp, pUrbInfo);