Changeset 60486 in vbox
- Timestamp:
- Apr 14, 2016 9:57:02 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/VBoxUSB/win/dev/VBoxUsbRt.cpp
r60273 r60486 1076 1076 switch(pContext->ulTransferType) 1077 1077 { 1078 case USBSUP_TRANSFER_TYPE_CTRL:1079 1078 case USBSUP_TRANSFER_TYPE_MSG: 1080 1079 pUrbInfo->len = pUrb->UrbControlTransfer.TransferBufferLength; … … 1118 1117 switch(pContext->ulTransferType) 1119 1118 { 1120 case USBSUP_TRANSFER_TYPE_CTRL:1121 1119 case USBSUP_TRANSFER_TYPE_MSG: 1122 LogRel((" Ctrl/Msglength=%d\n", pUrb->UrbControlTransfer.TransferBufferLength));1120 LogRel(("Msg (CTRL) length=%d\n", pUrb->UrbControlTransfer.TransferBufferLength)); 1123 1121 break; 1124 1122 case USBSUP_TRANSFER_TYPE_ISOC: … … 1272 1270 switch (pUrbInfo->type) 1273 1271 { 1274 case USBSUP_TRANSFER_TYPE_CTRL:1275 1272 case USBSUP_TRANSFER_TYPE_MSG: 1276 1273 { … … 1285 1282 pUrb->UrbControlTransfer.TransferFlags |= USBD_DEFAULT_PIPE_TRANSFER; 1286 1283 1287 if (pUrbInfo->type == USBSUP_TRANSFER_TYPE_MSG) 1288 { 1289 /* QUSB_TRANSFER_TYPE_MSG is a control transfer, but it is special 1290 * the first 8 bytes of the buffer is the setup packet so the real 1291 * data length is therefore pUrb->len - 8 1292 */ 1293 PVBOXUSB_SETUP pSetup = (PVBOXUSB_SETUP)pUrb->UrbControlTransfer.SetupPacket; 1294 memcpy(pUrb->UrbControlTransfer.SetupPacket, pBuffer, min(sizeof (pUrb->UrbControlTransfer.SetupPacket), pUrbInfo->len)); 1295 1296 if (pUrb->UrbControlTransfer.TransferBufferLength <= sizeof (pUrb->UrbControlTransfer.SetupPacket)) 1297 pUrb->UrbControlTransfer.TransferBufferLength = 0; 1298 else 1299 pUrb->UrbControlTransfer.TransferBufferLength -= sizeof (pUrb->UrbControlTransfer.SetupPacket); 1300 1301 pUrb->UrbControlTransfer.TransferBuffer = (uint8_t *)pBuffer + sizeof(pUrb->UrbControlTransfer.SetupPacket); 1302 pUrb->UrbControlTransfer.TransferBufferMDL = 0; 1303 pUrb->UrbControlTransfer.TransferFlags |= USBD_SHORT_TRANSFER_OK; 1304 } 1284 /* QUSB_TRANSFER_TYPE_MSG is a control transfer, but it is special 1285 * the first 8 bytes of the buffer is the setup packet so the real 1286 * data length is therefore pUrb->len - 8 1287 */ 1288 PVBOXUSB_SETUP pSetup = (PVBOXUSB_SETUP)pUrb->UrbControlTransfer.SetupPacket; 1289 memcpy(pUrb->UrbControlTransfer.SetupPacket, pBuffer, min(sizeof (pUrb->UrbControlTransfer.SetupPacket), pUrbInfo->len)); 1290 1291 if (pUrb->UrbControlTransfer.TransferBufferLength <= sizeof (pUrb->UrbControlTransfer.SetupPacket)) 1292 pUrb->UrbControlTransfer.TransferBufferLength = 0; 1305 1293 else 1306 { 1307 pUrb->UrbControlTransfer.TransferBuffer = 0; 1308 pUrb->UrbControlTransfer.TransferBufferMDL = pMdlBuf; 1309 } 1294 pUrb->UrbControlTransfer.TransferBufferLength -= sizeof (pUrb->UrbControlTransfer.SetupPacket); 1295 1296 pUrb->UrbControlTransfer.TransferBuffer = (uint8_t *)pBuffer + sizeof(pUrb->UrbControlTransfer.SetupPacket); 1297 pUrb->UrbControlTransfer.TransferBufferMDL = 0; 1298 pUrb->UrbControlTransfer.TransferFlags |= USBD_SHORT_TRANSFER_OK; 1310 1299 break; 1311 1300 }
Note:
See TracChangeset
for help on using the changeset viewer.