- Timestamp:
- Feb 16, 2016 2:13:25 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vusb.h
r59700 r59704 684 684 * @param pInterface Pointer to this struct. 685 685 * @param DstAddress The destination address of the URB. 686 * @param pDev Optional device pointer the URB is for. 686 687 * @param enmType Type of the URB. 687 688 * @param enmDir Data transfer direction. … … 690 691 * @param pszTag Custom URB tag assigned by the caller, only for 691 692 * logged builds and optional. 692 */ 693 DECLR3CALLBACKMEMBER(PVUSBURB, pfnNewUrb,(PVUSBIROOTHUBCONNECTOR pInterface, uint8_t DstAddress, VUSBXFERTYPE enmType, 694 VUSBDIRECTION enmDir, uint32_t cbData, uint32_t cTds, const char *pszTag)); 693 * 694 * @note pDev should be NULL in most cases. The only useful case is for USB3 where 695 * it is required for the SET_ADDRESS request because USB3 uses unicast traffic. 696 */ 697 DECLR3CALLBACKMEMBER(PVUSBURB, pfnNewUrb,(PVUSBIROOTHUBCONNECTOR pInterface, uint8_t DstAddress, PVUSBIDEVICE pDev, 698 VUSBXFERTYPE enmType, VUSBDIRECTION enmDir, uint32_t cbData, uint32_t cTds, const char *pszTag)); 699 700 /** 701 * Free an URB not submitted yet. 702 * 703 * @returns VBox status code. 704 * @param pInterface Pointer to this struct. 705 * @param pUrb Pointer to the URB to free returned by VUSBIROOTHUBCONNECTOR::pfnNewUrb. 706 */ 707 DECLR3CALLBACKMEMBER(int, pfnFreeUrb, (PVUSBIROOTHUBCONNECTOR pInterface, PVUSBURB pUrb)); 695 708 696 709 /** … … 778 791 } VUSBIROOTHUBCONNECTOR; 779 792 /** VUSBIROOTHUBCONNECTOR interface ID. */ 780 #define VUSBIROOTHUBCONNECTOR_IID " 481d7f23-f180-4fde-b636-094253eaf537"793 #define VUSBIROOTHUBCONNECTOR_IID "a593cc64-a821-4e57-af2d-f86b2a052ea4" 781 794 782 795 … … 789 802 790 803 /** @copydoc VUSBIROOTHUBCONNECTOR::pfnNewUrb */ 791 DECLINLINE(PVUSBURB) VUSBIRhNewUrb(PVUSBIROOTHUBCONNECTOR pInterface, uint32_t DstAddress, VUSBXFERTYPE enmType, 792 VUSBDIRECTION enmDir, uint32_t cbData, uint32_t cTds, const char *pszTag) 793 { 794 return pInterface->pfnNewUrb(pInterface, DstAddress, enmType, enmDir, cbData, cTds, pszTag); 804 DECLINLINE(PVUSBURB) VUSBIRhNewUrb(PVUSBIROOTHUBCONNECTOR pInterface, uint32_t DstAddress, PVUSBIDEVICE pDev, 805 VUSBXFERTYPE enmType, VUSBDIRECTION enmDir, uint32_t cbData, uint32_t cTds, const char *pszTag) 806 { 807 return pInterface->pfnNewUrb(pInterface, DstAddress, pDev, enmType, enmDir, cbData, cTds, pszTag); 808 } 809 810 /** @copydoc VUSBIROOTHUBCONNECTOR::pfnSubmitUrb */ 811 DECLINLINE(int) VUSBIRhFreeUrb(PVUSBIROOTHUBCONNECTOR pInterface, PVUSBURB pUrb) 812 { 813 return pInterface->pfnFreeUrb(pInterface, pUrb); 795 814 } 796 815 … … 948 967 } VUSBIDEVICE; 949 968 /** VUSBIDEVICE interface ID. */ 950 #define VUSBIDEVICE_IID " 79a31188-043d-432c-82ac-9485c9ab9a49"969 #define VUSBIDEVICE_IID "af576b38-e8ca-4db7-810a-2596d8d57ca0" 951 970 952 971 … … 1115 1134 /** Private controller emulation specific TD data. */ 1116 1135 typedef struct VUSBURBHCITDINT *PVUSBURBHCITD; 1136 /** Private VUSB/roothub related state for the associated URB. */ 1137 typedef struct VUSBURBVUSBINT *PVUSBURBVUSB; 1117 1138 1118 1139 /** … … 1143 1164 #endif 1144 1165 1145 /** The VUSB data. */ 1146 struct VUSBURBVUSB 1147 { 1148 /** URB chain pointer. */ 1149 PVUSBURB pNext; 1150 /** URB chain pointer. */ 1151 PVUSBURB *ppPrev; 1152 /** Pointer to the original for control messages. */ 1153 PVUSBURB pCtrlUrb; 1154 /** Pointer to the VUSB device. 1155 * This may be NULL if the destination address is invalid. */ 1156 struct VUSBDEV *pDev; 1157 /** Specific to the pfnFree function. */ 1158 void *pvFreeCtx; 1159 /** 1160 * Callback which will free the URB once it's reaped and completed. 1161 * @param pUrb The URB. 1162 */ 1163 DECLCALLBACKMEMBER(void, pfnFree)(PVUSBURB pUrb); 1164 /** Submit timestamp. (logging only) */ 1165 uint64_t u64SubmitTS; 1166 /** The allocated data length. */ 1167 uint32_t cbDataAllocated; 1168 /** Opaque data holder when this is a read-ahead URB. */ 1169 void *pvReadAhead; 1170 } VUsb; 1171 1166 /** The VUSB stack private data. */ 1167 PVUSBURBVUSB pVUsb; 1172 1168 /** Private host controller data associated with this URB. */ 1173 1169 PVUSBURBHCI pHci; -
trunk/src/VBox/Devices/USB/DevOHCI.cpp
r59700 r59704 2761 2761 * Allocate and initialize a new URB. 2762 2762 */ 2763 PVUSBURB pUrb = VUSBIRhNewUrb(pThis->RootHub.pIRhConn, pEd->hwinfo & ED_HWINFO_FUNCTION, enmType,2764 enm Dir, Buf.cbTotal, 1, NULL);2763 PVUSBURB pUrb = VUSBIRhNewUrb(pThis->RootHub.pIRhConn, pEd->hwinfo & ED_HWINFO_FUNCTION, NULL, 2764 enmType, enmDir, Buf.cbTotal, 1, NULL); 2765 2765 if (!pUrb) 2766 2766 return false; /* retry later... */ … … 2913 2913 * Allocate and initialize a new URB. 2914 2914 */ 2915 PVUSBURB pUrb = VUSBIRhNewUrb(pThis->RootHub.pIRhConn, pEd->hwinfo & ED_HWINFO_FUNCTION, enmType,2916 enm Dir, cbTotal, cTds, "ohciServiceTdMultiple");2915 PVUSBURB pUrb = VUSBIRhNewUrb(pThis->RootHub.pIRhConn, pEd->hwinfo & ED_HWINFO_FUNCTION, NULL, 2916 enmType, enmDir, cbTotal, cTds, "ohciServiceTdMultiple"); 2917 2917 if (!pUrb) 2918 2918 /* retry later... */ … … 3121 3121 * Allocate and initialize a new URB. 3122 3122 */ 3123 PVUSBURB pUrb = VUSBIRhNewUrb(pThis->RootHub.pIRhConn, pEd->hwinfo & ED_HWINFO_FUNCTION, VUSBXFERTYPE_ISOC,3124 enmDir, cbTotal, 1, NULL);3123 PVUSBURB pUrb = VUSBIRhNewUrb(pThis->RootHub.pIRhConn, pEd->hwinfo & ED_HWINFO_FUNCTION, NULL, 3124 VUSBXFERTYPE_ISOC, enmDir, cbTotal, 1, NULL); 3125 3125 if (!pUrb) 3126 3126 /* retry later... */ -
trunk/src/VBox/Devices/USB/DrvVUSBRootHub.cpp
r59700 r59704 338 338 */ 339 339 vusbUrbAssert(pUrb); 340 PVUSBROOTHUB pRh = (PVUSBROOTHUB)pUrb-> VUsb.pvFreeCtx;340 PVUSBROOTHUB pRh = (PVUSBROOTHUB)pUrb->pVUsb->pvFreeCtx; 341 341 Assert(pRh); 342 342 … … 356 356 RTCritSectEnter(&pRh->CritSectFreeUrbs); 357 357 pUrb->enmState = VUSBURBSTATE_FREE; 358 pUrb-> VUsb.ppPrev = NULL;359 pUrb-> VUsb.pNext = pRh->pFreeUrbs;358 pUrb->pVUsb->ppPrev = NULL; 359 pUrb->pVUsb->pNext = pRh->pFreeUrbs; 360 360 pRh->pFreeUrbs = pUrb; 361 361 Assert(pRh->pFreeUrbs->enmState == VUSBURBSTATE_FREE); … … 367 367 * Worker routine for vusbRhConnNewUrb() and vusbDevNewIsocUrb(). 368 368 */ 369 PVUSBURB vusbRhNewUrb(PVUSBROOTHUB pRh, uint8_t DstAddress, VUSBXFERTYPE enmType,369 PVUSBURB vusbRhNewUrb(PVUSBROOTHUB pRh, uint8_t DstAddress, PVUSBDEV pDev, VUSBXFERTYPE enmType, 370 370 VUSBDIRECTION enmDir, uint32_t cbData, uint32_t cTds, const char *pszTag) 371 371 { … … 374 374 */ 375 375 /* Get the required amount of additional memory to allocate the whole state. */ 376 size_t cbMem = RT_ALIGN_32(cbData, 16) + pRh->cbHci + cTds * pRh->cbHciTd; 376 size_t cbMem = cbData + sizeof(VUSBURBVUSBINT) + pRh->cbHci + cTds * pRh->cbHciTd; 377 uint32_t cbDataAllocated = 0; 377 378 378 379 /** @todo try find a best fit, MSD which submits rather big URBs intermixed with small control … … 386 387 while (pUrb) 387 388 { 388 if (pUrb-> VUsb.cbDataAllocated >= cbData)389 if (pUrb->pVUsb->cbDataAllocated >= cbData) 389 390 { 390 391 /* Unlink and verify part of the state. */ 391 392 if (pUrbPrev) 392 pUrbPrev-> VUsb.pNext = pUrb->VUsb.pNext;393 pUrbPrev->pVUsb->pNext = pUrb->pVUsb->pNext; 393 394 else 394 pRh->pFreeUrbs = pUrb-> VUsb.pNext;395 pRh->pFreeUrbs = pUrb->pVUsb->pNext; 395 396 Assert(pUrb->u32Magic == VUSBURB_MAGIC); 396 Assert(pUrb-> VUsb.pvFreeCtx == pRh);397 Assert(pUrb-> VUsb.pfnFree == vusbRhFreeUrb);397 Assert(pUrb->pVUsb->pvFreeCtx == pRh); 398 Assert(pUrb->pVUsb->pfnFree == vusbRhFreeUrb); 398 399 Assert(pUrb->enmState == VUSBURBSTATE_FREE); 399 Assert(!pUrb->VUsb.pNext || pUrb->VUsb.pNext->enmState == VUSBURBSTATE_FREE); 400 Assert(!pUrb->pVUsb->pNext || pUrb->pVUsb->pNext->enmState == VUSBURBSTATE_FREE); 401 cbDataAllocated = pUrb->pVUsb->cbDataAllocated; 400 402 break; 401 403 } 402 404 pUrbPrev = pUrb; 403 pUrb = pUrb-> VUsb.pNext;405 pUrb = pUrb->pVUsb->pNext; 404 406 } 405 407 … … 407 409 { 408 410 /* allocate a new one. */ 409 uint32_tcbDataAllocated = cbMem <= _4K ? RT_ALIGN_32(cbMem, _1K)410 411 412 413 pUrb = (PVUSBURB)RTMemAlloc (RT_OFFSETOF(VUSBURB, abData[cbDataAllocated]));411 cbDataAllocated = cbMem <= _4K ? RT_ALIGN_32(cbMem, _1K) 412 : cbMem <= _32K ? RT_ALIGN_32(cbMem, _4K) 413 : RT_ALIGN_32(cbMem, 16*_1K); 414 415 pUrb = (PVUSBURB)RTMemAllocZ(RT_OFFSETOF(VUSBURB, abData[cbDataAllocated])); 414 416 if (RT_UNLIKELY(!pUrb)) 415 417 { … … 419 421 420 422 pRh->cUrbsInPool++; 421 pUrb->u32Magic = VUSBURB_MAGIC; 422 pUrb->VUsb.pvFreeCtx = pRh; 423 pUrb->VUsb.pfnFree = vusbRhFreeUrb; 424 pUrb->VUsb.cbDataAllocated = cbDataAllocated; 423 pUrb->u32Magic = VUSBURB_MAGIC; 424 425 425 } 426 426 RTCritSectLeave(&pRh->CritSectFreeUrbs); … … 429 429 * (Re)init the URB 430 430 */ 431 pUrb->enmState = VUSBURBSTATE_ALLOCATED; 432 pUrb->fCompleting = false; 433 pUrb->pszDesc = NULL; 434 pUrb->VUsb.pNext = NULL; 435 pUrb->VUsb.ppPrev = NULL; 436 pUrb->VUsb.pCtrlUrb = NULL; 437 pUrb->VUsb.u64SubmitTS = 0; 438 pUrb->VUsb.pvReadAhead = NULL; 439 pUrb->VUsb.pDev = vusbRhFindDevByAddress(pRh, DstAddress); 440 pUrb->Dev.pvPrivate = NULL; 441 pUrb->Dev.pNext = NULL; 442 pUrb->DstAddress = DstAddress; 443 pUrb->EndPt = ~0; 444 pUrb->enmType = enmType; 445 pUrb->enmDir = enmDir; 446 pUrb->fShortNotOk = false; 447 pUrb->enmStatus = VUSBSTATUS_INVALID; 448 pUrb->cbData = cbData; 449 pUrb->pHci = pRh->cbHci ? (PVUSBURBHCI)&pUrb->abData[cbData] : NULL; 450 pUrb->paTds = (pRh->cbHciTd && cTds) ? (PVUSBURBHCITD)&pUrb->abData[cbData + pRh->cbHci] : NULL; 431 uint32_t offAlloc = cbData; 432 pUrb->enmState = VUSBURBSTATE_ALLOCATED; 433 pUrb->fCompleting = false; 434 pUrb->pszDesc = NULL; 435 pUrb->pVUsb = (PVUSBURBVUSB)&pUrb->abData[offAlloc]; 436 offAlloc += sizeof(VUSBURBVUSBINT); 437 pUrb->pVUsb->pvFreeCtx = pRh; 438 pUrb->pVUsb->pfnFree = vusbRhFreeUrb; 439 pUrb->pVUsb->cbDataAllocated = cbDataAllocated; 440 pUrb->pVUsb->pNext = NULL; 441 pUrb->pVUsb->ppPrev = NULL; 442 pUrb->pVUsb->pCtrlUrb = NULL; 443 pUrb->pVUsb->u64SubmitTS = 0; 444 pUrb->pVUsb->pvReadAhead = NULL; 445 pUrb->pVUsb->pDev = pDev ? pDev : vusbRhFindDevByAddress(pRh, DstAddress); 446 pUrb->Dev.pvPrivate = NULL; 447 pUrb->Dev.pNext = NULL; 448 pUrb->DstAddress = DstAddress; 449 pUrb->EndPt = ~0; 450 pUrb->enmType = enmType; 451 pUrb->enmDir = enmDir; 452 pUrb->fShortNotOk = false; 453 pUrb->enmStatus = VUSBSTATUS_INVALID; 454 pUrb->cbData = cbData; 455 pUrb->pHci = pRh->cbHci ? (PVUSBURBHCI)&pUrb->abData[offAlloc] : NULL; 456 offAlloc += pRh->cbHci; 457 pUrb->paTds = (pRh->cbHciTd && cTds) ? (PVUSBURBHCITD)&pUrb->abData[offAlloc] : NULL; 451 458 452 459 #ifdef LOG_ENABLED … … 495 502 496 503 /** @copydoc VUSBIROOTHUBCONNECTOR::pfnNewUrb */ 497 static DECLCALLBACK(PVUSBURB) vusbRhConnNewUrb(PVUSBIROOTHUBCONNECTOR pInterface, uint8_t DstAddress, VUSBXFERTYPE enmType,504 static DECLCALLBACK(PVUSBURB) vusbRhConnNewUrb(PVUSBIROOTHUBCONNECTOR pInterface, uint8_t DstAddress, PVUSBIDEVICE pDev, VUSBXFERTYPE enmType, 498 505 VUSBDIRECTION enmDir, uint32_t cbData, uint32_t cTds, const char *pszTag) 499 506 { 500 507 PVUSBROOTHUB pRh = VUSBIROOTHUBCONNECTOR_2_VUSBROOTHUB(pInterface); 501 return vusbRhNewUrb(pRh, DstAddress, enmType, enmDir, cbData, cTds, pszTag); 508 return vusbRhNewUrb(pRh, DstAddress, (PVUSBDEV)pDev, enmType, enmDir, cbData, cTds, pszTag); 509 } 510 511 512 /** @copydoc VUSBIROOTHUBCONNECTOR::pfnFreeUrb */ 513 static DECLCALLBACK(int) vusbRhFreeUrb(PVUSBIROOTHUBCONNECTOR pInterface, PVUSBURB pUrb) 514 { 515 PVUSBROOTHUB pRh = VUSBIROOTHUBCONNECTOR_2_VUSBROOTHUB(pInterface); 516 517 pUrb->pVUsb->pfnFree(pUrb); 518 return VINF_SUCCESS; 502 519 } 503 520 … … 553 570 */ 554 571 int rc; 555 if ( pUrb-> VUsb.pDev556 && pUrb-> VUsb.pDev->pUsbIns)572 if ( pUrb->pVUsb->pDev 573 && pUrb->pVUsb->pDev->pUsbIns) 557 574 { 558 575 switch (pUrb->enmDir) … … 576 593 { 577 594 LogFlow(("vusbRhSubmitUrb: freeing pUrb=%p\n", pUrb)); 578 pUrb-> VUsb.pfnFree(pUrb);595 pUrb->pVUsb->pfnFree(pUrb); 579 596 } 580 597 } 581 598 else 582 599 { 583 pUrb-> VUsb.pDev = &pRh->Hub.Dev;600 pUrb->pVUsb->pDev = &pRh->Hub.Dev; 584 601 Log(("vusb: pRh=%p: SUBMIT: Address %i not found!!!\n", pRh, pUrb->DstAddress)); 585 602 … … 667 684 while (pUrb) 668 685 { 669 PVUSBURB pNext = pUrb-> VUsb.pNext;686 PVUSBURB pNext = pUrb->pVUsb->pNext; 670 687 /* Call the worker directly. */ 671 688 vusbUrbCancelWorker(pUrb, CANCELMODE_FAIL); … … 708 725 while (pUrb) 709 726 { 710 PVUSBURB pNext = pUrb-> VUsb.pNext;711 712 Assert(pUrb-> VUsb.pDev == pDev);727 PVUSBURB pNext = pUrb->pVUsb->pNext; 728 729 Assert(pUrb->pVUsb->pDev == pDev); 713 730 714 731 if (pUrb->EndPt == EndPt && pUrb->enmDir == enmDir) … … 976 993 { 977 994 PVUSBURB pUrb = pRh->pFreeUrbs; 978 pRh->pFreeUrbs = pUrb-> VUsb.pNext;995 pRh->pFreeUrbs = pUrb->pVUsb->pNext; 979 996 980 997 pUrb->u32Magic = 0; 981 998 pUrb->enmState = VUSBURBSTATE_INVALID; 982 pUrb-> VUsb.pNext = NULL;999 pUrb->pVUsb->pNext = NULL; 983 1000 RTMemFree(pUrb); 984 1001 } -
trunk/src/VBox/Devices/USB/USBProxyDevice.cpp
r59700 r59704 79 79 Urb.enmDir = VUSBDIRECTION_IN; 80 80 Urb.fShortNotOk = false; 81 Urb.VUsb.pCtrlUrb = NULL;82 81 Urb.enmStatus = VUSBSTATUS_INVALID; 82 Urb.pVUsb = NULL; 83 83 cbHint = RT_MIN(cbHint, sizeof(Urb.abData) - sizeof(VUSBSETUP)); 84 84 Urb.cbData = cbHint + sizeof(VUSBSETUP); -
trunk/src/VBox/Devices/USB/VUSBDevice.cpp
r59615 r59704 1052 1052 while (pUrb) 1053 1053 { 1054 PVUSBURB pNext = pUrb-> VUsb.pNext;1055 1056 Assert(pUrb-> VUsb.pDev == pDev);1054 PVUSBURB pNext = pUrb->pVUsb->pNext; 1055 1056 Assert(pUrb->pVUsb->pDev == pDev); 1057 1057 1058 1058 LogFlow(("%s: vusbDevCancelAllUrbs: CANCELING URB\n", pUrb->pszDesc)); … … 1073 1073 while (pUrb) 1074 1074 { 1075 PVUSBURB pNext = pUrb-> VUsb.pNext;1076 Assert(pUrb-> VUsb.pDev == pDev);1075 PVUSBURB pNext = pUrb->pVUsb->pNext; 1076 Assert(pUrb->pVUsb->pDev == pDev); 1077 1077 1078 1078 PVUSBURB pRipe = NULL; … … 1091 1091 { 1092 1092 if (pRipe == pNext) 1093 pNext = pNext-> VUsb.pNext;1093 pNext = pNext->pVUsb->pNext; 1094 1094 vusbUrbRipe(pRipe); 1095 1095 cReaped++; … … 1108 1108 while (pUrb) 1109 1109 { 1110 PVUSBURB pNext = pUrb-> VUsb.pNext;1111 Assert(pUrb-> VUsb.pDev == pDev);1110 PVUSBURB pNext = pUrb->pVUsb->pNext; 1111 Assert(pUrb->pVUsb->pDev == pDev); 1112 1112 1113 1113 AssertMsgFailed(("%s: Leaking left over URB! state=%d pDev=%p[%s]\n", … … 1118 1118 * it breaks anything, please add comment here, why we should unlink only. 1119 1119 */ 1120 pUrb-> VUsb.pfnFree(pUrb);1120 pUrb->pVUsb->pfnFree(pUrb); 1121 1121 pUrb = pNext; 1122 1122 } -
trunk/src/VBox/Devices/USB/VUSBInternal.h
r59701 r59704 66 66 /** Maximum number of endpoint addresses */ 67 67 #define VUSB_PIPE_MAX 16 68 69 /** 70 * The VUSB URB data. 71 */ 72 typedef struct VUSBURBVUSBINT 73 { 74 /** URB chain pointer. */ 75 PVUSBURB pNext; 76 /** URB chain pointer. */ 77 PVUSBURB *ppPrev; 78 /** Pointer to the original for control messages. */ 79 PVUSBURB pCtrlUrb; 80 /** Pointer to the VUSB device. 81 * This may be NULL if the destination address is invalid. */ 82 PVUSBDEV pDev; 83 /** Specific to the pfnFree function. */ 84 void *pvFreeCtx; 85 /** 86 * Callback which will free the URB once it's reaped and completed. 87 * @param pUrb The URB. 88 */ 89 DECLCALLBACKMEMBER(void, pfnFree)(PVUSBURB pUrb); 90 /** Submit timestamp. (logging only) */ 91 uint64_t u64SubmitTS; 92 /** The allocated data length. */ 93 uint32_t cbDataAllocated; 94 /** Opaque data holder when this is a read-ahead URB. */ 95 void *pvReadAhead; 96 } VUSBURBVUSBINT; 68 97 69 98 /** … … 449 478 int vusbUrbQueueAsyncRh(PVUSBURB pUrb); 450 479 int vusbUrbSubmitBufferedRead(PVUSBURB pUrb, VUSBREADAHEAD hReadAhead); 451 PVUSBURB vusbRhNewUrb(PVUSBROOTHUB pRh, uint8_t DstAddress, VUSBXFERTYPE enmType, VUSBDIRECTION enmDir,452 uint32_t cbData, uint32_t cTds, const char *pszTag);480 PVUSBURB vusbRhNewUrb(PVUSBROOTHUB pRh, uint8_t DstAddress, PVUSBDEV pDev, VUSBXFERTYPE enmType, 481 VUSBDIRECTION enmDir, uint32_t cbData, uint32_t cTds, const char *pszTag); 453 482 454 483 455 484 DECLINLINE(void) vusbUrbUnlink(PVUSBURB pUrb) 456 485 { 457 PVUSBDEV pDev = pUrb-> VUsb.pDev;486 PVUSBDEV pDev = pUrb->pVUsb->pDev; 458 487 459 488 RTCritSectEnter(&pDev->CritSectAsyncUrbs); 460 *pUrb-> VUsb.ppPrev = pUrb->VUsb.pNext;461 if (pUrb-> VUsb.pNext)462 pUrb-> VUsb.pNext->VUsb.ppPrev = pUrb->VUsb.ppPrev;463 pUrb-> VUsb.pNext = NULL;464 pUrb-> VUsb.ppPrev = NULL;489 *pUrb->pVUsb->ppPrev = pUrb->pVUsb->pNext; 490 if (pUrb->pVUsb->pNext) 491 pUrb->pVUsb->pNext->pVUsb->ppPrev = pUrb->pVUsb->ppPrev; 492 pUrb->pVUsb->pNext = NULL; 493 pUrb->pVUsb->ppPrev = NULL; 465 494 RTCritSectLeave(&pDev->CritSectAsyncUrbs); 466 495 } -
trunk/src/VBox/Devices/USB/VUSBReadAhead.cpp
r59700 r59704 110 110 return NULL; 111 111 112 pUrb = vusbRhNewUrb(pRh, pDev->u8Address, VUSBXFERTYPE_ISOC, VUSBDIRECTION_IN, cbTotal, 1, "prab");112 pUrb = vusbRhNewUrb(pRh, pDev->u8Address, NULL, VUSBXFERTYPE_ISOC, VUSBDIRECTION_IN, cbTotal, 1, "prab"); 113 113 if (!pUrb) 114 114 /* not much we can do here... */ … … 216 216 Assert(pUrb->enmState == VUSBURBSTATE_ALLOCATED); 217 217 218 pUrb-> VUsb.pvReadAhead = pvUser;218 pUrb->pVUsb->pvReadAhead = pvUser; 219 219 pUrb->enmState = VUSBURBSTATE_IN_FLIGHT; 220 220 rc = vusbUrbQueueAsyncRh(pUrb); … … 224 224 Log(("vusb: read-ahead thread failed to queue URB with %Rrc; exiting\n", rc)); 225 225 pThis->cUrbsMax = pThis->cSubmitted; 226 pUrb-> VUsb.pfnFree(pUrb);226 pUrb->pVUsb->pfnFree(pUrb); 227 227 break; 228 228 } … … 250 250 PVUSBURB pBufferedUrb = pThis->pBuffUrbHead; 251 251 252 pThis->pBuffUrbHead = (PVUSBURB)pBufferedUrb-> VUsb.pvReadAhead;253 pBufferedUrb-> VUsb.pfnFree(pBufferedUrb);252 pThis->pBuffUrbHead = (PVUSBURB)pBufferedUrb->pVUsb->pvReadAhead; 253 pBufferedUrb->pVUsb->pfnFree(pBufferedUrb); 254 254 } 255 255 … … 269 269 { 270 270 Assert(pUrb); 271 Assert(pUrb-> VUsb.pvReadAhead);272 PVUSBREADAHEADINT pThis = (PVUSBREADAHEADINT)pUrb-> VUsb.pvReadAhead;271 Assert(pUrb->pVUsb->pvReadAhead); 272 PVUSBREADAHEADINT pThis = (PVUSBREADAHEADINT)pUrb->pVUsb->pvReadAhead; 273 273 PVUSBPIPE pPipe = pThis->pPipe; 274 274 Assert(pPipe); 275 275 276 276 RTCritSectEnter(&pThis->CritSectBuffUrbList); 277 pUrb-> VUsb.pvReadAhead = NULL;277 pUrb->pVUsb->pvReadAhead = NULL; 278 278 if (pThis->pBuffUrbHead == NULL) 279 279 { … … 286 286 // Some URBs are queued already 287 287 Assert(pThis->pBuffUrbTail); 288 Assert(!pThis->pBuffUrbTail-> VUsb.pvReadAhead);289 pThis->pBuffUrbTail-> VUsb.pvReadAhead = pUrb;288 Assert(!pThis->pBuffUrbTail->pVUsb->pvReadAhead); 289 pThis->pBuffUrbTail->pVUsb->pvReadAhead = pUrb; 290 290 pThis->pBuffUrbTail = pUrb; 291 291 } … … 318 318 319 319 // There's a URB available in the read-ahead buffer; use it 320 pThis->pBuffUrbHead = (PVUSBURB)pBufferedUrb-> VUsb.pvReadAhead;320 pThis->pBuffUrbHead = (PVUSBURB)pBufferedUrb->pVUsb->pvReadAhead; 321 321 if (pThis->pBuffUrbHead == NULL) 322 322 pThis->pBuffUrbTail = NULL; … … 344 344 pUrb->aIsocPkts[i].enmStatus = pBufferedUrb->aIsocPkts[i].enmStatus; 345 345 cbTotal += len; 346 Assert(pUrb-> VUsb.cbDataAllocated >= cbTotal);346 Assert(pUrb->pVUsb->cbDataAllocated >= cbTotal); 347 347 memcpy(&pUrb->abData[off], &pBufferedUrb->abData[off], len); 348 348 } … … 353 353 Assert(pBufferedUrb->enmState == VUSBURBSTATE_REAPED); 354 354 LogFlow(("%s: vusbUrbSubmitBufferedRead: Freeing buffered URB\n", pBufferedUrb->pszDesc)); 355 pBufferedUrb-> VUsb.pfnFree(pBufferedUrb);355 pBufferedUrb->pVUsb->pfnFree(pBufferedUrb); 356 356 // This assertion is wrong as the URB could be re-allocated in the meantime by the EMT (race) 357 357 // Assert(pBufferedUrb->enmState == VUSBURBSTATE_FREE); -
trunk/src/VBox/Devices/USB/VUSBUrb.cpp
r59700 r59704 162 162 * Logs an URB. 163 163 * 164 * Note that pUrb-> VUsb.pDev and pUrb->VUsb.pDev->pUsbIns can all be NULL.164 * Note that pUrb->pVUsb->pDev and pUrb->pVUsb->pDev->pUsbIns can all be NULL. 165 165 */ 166 166 void vusbUrbTrace(PVUSBURB pUrb, const char *pszMsg, bool fComplete) 167 167 { 168 PVUSBDEV pDev = pUrb-> VUsb.pDev; /* Can be NULL when called from usbProxyConstruct and friends. */168 PVUSBDEV pDev = pUrb->pVUsb ? pUrb->pVUsb->pDev : NULL; /* Can be NULL when called from usbProxyConstruct and friends. */ 169 169 PVUSBPIPE pPipe = &pDev->aPipes[pUrb->EndPt]; 170 170 const uint8_t *pbData = pUrb->abData; … … 180 180 pUrb->pszDesc, s_cchMaxMsg, pszMsg, 181 181 pDev, 182 pUrb-> VUsb.pDev ? pUrb->VUsb.pDev->pUsbIns->pszName : "",182 pUrb->pVUsb && pUrb->pVUsb->pDev ? pUrb->pVUsb->pDev->pUsbIns->pszName : "", 183 183 vusbUrbStatusName(pUrb->enmStatus), 184 184 pDev ? pDev->u8Address : -1, … … 188 188 pUrb->cbData, 189 189 pUrb->cbData, 190 pUrb-> VUsb.u64SubmitTS,191 RTTimeNanoTS() - pUrb->VUsb.u64SubmitTS,190 pUrb->pVUsb ? pUrb->pVUsb->u64SubmitTS : 0, 191 pUrb->pVUsb ? RTTimeNanoTS() - pUrb->pVUsb->u64SubmitTS : 0, 192 192 pUrb->fShortNotOk ? "ShortNotOk" : "ShortOk")); 193 193 … … 823 823 Log3(("%16.*Rhxd\n", cbData, pbData)); 824 824 #endif 825 if (pUrb->enmType == VUSBXFERTYPE_MSG && pUrb-> VUsb.pCtrlUrb)826 vusbUrbTrace(pUrb-> VUsb.pCtrlUrb, "NESTED MSG", fComplete);825 if (pUrb->enmType == VUSBXFERTYPE_MSG && pUrb->pVUsb && pUrb->pVUsb->pCtrlUrb) 826 vusbUrbTrace(pUrb->pVUsb->pCtrlUrb, "NESTED MSG", fComplete); 827 827 } 828 828 #endif /* LOG_ENABLED */ … … 837 837 static void vusbMsgSetupCompletion(PVUSBURB pUrb) 838 838 { 839 PVUSBDEV pDev = pUrb-> VUsb.pDev;839 PVUSBDEV pDev = pUrb->pVUsb->pDev; 840 840 PVUSBPIPE pPipe = &pDev->aPipes[pUrb->EndPt]; 841 841 PVUSBCTRLEXTRA pExtra = pPipe->pCtrl; … … 856 856 static void vusbMsgDataCompletion(PVUSBURB pUrb) 857 857 { 858 PVUSBDEV pDev = pUrb-> VUsb.pDev;858 PVUSBDEV pDev = pUrb->pVUsb->pDev; 859 859 PVUSBPIPE pPipe = &pDev->aPipes[pUrb->EndPt]; 860 860 PVUSBCTRLEXTRA pExtra = pPipe->pCtrl; … … 875 875 static void vusbMsgStatusCompletion(PVUSBURB pUrb) 876 876 { 877 PVUSBDEV pDev = pUrb-> VUsb.pDev;877 PVUSBDEV pDev = pUrb->pVUsb->pDev; 878 878 PVUSBPIPE pPipe = &pDev->aPipes[pUrb->EndPt]; 879 879 PVUSBCTRLEXTRA pExtra = pPipe->pCtrl; … … 916 916 static void vusbCtrlCompletion(PVUSBURB pUrb) 917 917 { 918 PVUSBDEV pDev = pUrb-> VUsb.pDev;918 PVUSBDEV pDev = pUrb->pVUsb->pDev; 919 919 PVUSBPIPE pPipe = &pDev->aPipes[pUrb->EndPt]; 920 920 PVUSBCTRLEXTRA pExtra = pPipe->pCtrl; … … 943 943 static void vusbMsgCompletion(PVUSBURB pUrb) 944 944 { 945 PVUSBDEV pDev = pUrb-> VUsb.pDev;945 PVUSBDEV pDev = pUrb->pVUsb->pDev; 946 946 PVUSBPIPE pPipe = &pDev->aPipes[pUrb->EndPt]; 947 947 … … 965 965 * Complete the original URB. 966 966 */ 967 PVUSBURB pCtrlUrb = pUrb-> VUsb.pCtrlUrb;967 PVUSBURB pCtrlUrb = pUrb->pVUsb->pCtrlUrb; 968 968 pCtrlUrb->enmState = VUSBURBSTATE_REAPED; 969 969 vusbCtrlCompletion(pCtrlUrb); … … 994 994 int vusbUrbErrorRh(PVUSBURB pUrb) 995 995 { 996 PVUSBDEV pDev = pUrb-> VUsb.pDev;996 PVUSBDEV pDev = pUrb->pVUsb->pDev; 997 997 PVUSBROOTHUB pRh = vusbDevGetRh(pDev); 998 998 AssertPtrReturn(pRh, VERR_VUSB_DEVICE_NOT_ATTACHED); … … 1013 1013 || pUrb->enmState == VUSBURBSTATE_CANCELLED, ("%d\n", pUrb->enmState)); 1014 1014 1015 if ( pUrb-> VUsb.pDev1016 && pUrb-> VUsb.pDev->hSniffer)1017 { 1018 int rc = VUSBSnifferRecordEvent(pUrb-> VUsb.pDev->hSniffer, pUrb,1015 if ( pUrb->pVUsb->pDev 1016 && pUrb->pVUsb->pDev->hSniffer) 1017 { 1018 int rc = VUSBSnifferRecordEvent(pUrb->pVUsb->pDev->hSniffer, pUrb, 1019 1019 pUrb->enmStatus == VUSBSTATUS_OK 1020 1020 ? VUSBSNIFFEREVENT_COMPLETE … … 1024 1024 } 1025 1025 1026 PVUSBROOTHUB pRh = vusbDevGetRh(pUrb-> VUsb.pDev);1026 PVUSBROOTHUB pRh = vusbDevGetRh(pUrb->pVUsb->pDev); 1027 1027 AssertPtrReturnVoid(pRh); 1028 1028 … … 1148 1148 { 1149 1149 LogFlow(("%s: vusbUrbCompletionRh: Freeing URB\n", pUrb->pszDesc)); 1150 pUrb-> VUsb.pfnFree(pUrb);1150 pUrb->pVUsb->pfnFree(pUrb); 1151 1151 } 1152 1152 } … … 1168 1168 return pUrb->EndPt != 0 /* not default control pipe */ 1169 1169 || pSetup->wValue != 0 /* not ENDPOINT_HALT */ 1170 || !pUrb-> VUsb.pDev->pUsbIns->pReg->pfnUsbClearHaltedEndpoint; /* not special need for backend */1170 || !pUrb->pVUsb->pDev->pUsbIns->pReg->pfnUsbClearHaltedEndpoint; /* not special need for backend */ 1171 1171 case VUSB_REQ_SET_ADDRESS: 1172 1172 case VUSB_REQ_SET_CONFIGURATION: … … 1182 1182 */ 1183 1183 case VUSB_REQ_GET_DESCRIPTOR: 1184 if ( !pUrb-> VUsb.pDev->pDescCache->fUseCachedDescriptors1184 if ( !pUrb->pVUsb->pDev->pDescCache->fUseCachedDescriptors 1185 1185 || (pSetup->bmRequestType & VUSB_RECIP_MASK) != VUSB_TO_DEVICE) 1186 1186 return true; … … 1191 1191 return false; 1192 1192 case VUSB_DT_STRING: 1193 return !pUrb-> VUsb.pDev->pDescCache->fUseCachedStringsDescriptors;1193 return !pUrb->pVUsb->pDev->pDescCache->fUseCachedStringsDescriptors; 1194 1194 default: 1195 1195 return true; … … 1217 1217 /* Immediately return in case of error. 1218 1218 * XXX There is still a race: The Rh might vanish after this point! */ 1219 PVUSBDEV pDev = pUrb-> VUsb.pDev;1219 PVUSBDEV pDev = pUrb->pVUsb->pDev; 1220 1220 PVUSBROOTHUB pRh = vusbDevGetRh(pDev); 1221 1221 if (!pRh) … … 1237 1237 1238 1238 /* Queue the pUrb on the roothub */ 1239 pUrb-> VUsb.pNext = pDev->pAsyncUrbHead;1239 pUrb->pVUsb->pNext = pDev->pAsyncUrbHead; 1240 1240 if (pDev->pAsyncUrbHead) 1241 pDev->pAsyncUrbHead-> VUsb.ppPrev = &pUrb->VUsb.pNext;1241 pDev->pAsyncUrbHead->pVUsb->ppPrev = &pUrb->pVUsb->pNext; 1242 1242 pDev->pAsyncUrbHead = pUrb; 1243 pUrb-> VUsb.ppPrev = &pDev->pAsyncUrbHead;1243 pUrb->pVUsb->ppPrev = &pDev->pAsyncUrbHead; 1244 1244 RTCritSectLeave(&pDev->CritSectAsyncUrbs); 1245 1245 … … 1254 1254 static void vusbMsgSubmitSynchronously(PVUSBURB pUrb, bool fSafeRequest) 1255 1255 { 1256 PVUSBDEV pDev = pUrb-> VUsb.pDev;1256 PVUSBDEV pDev = pUrb->pVUsb->pDev; 1257 1257 Assert(pDev); 1258 1258 PVUSBPIPE pPipe = &pDev->aPipes[pUrb->EndPt]; … … 1329 1329 * If a new message urb comes up while it's in the CANCELLED state, we will 1330 1330 * orphan it and it will be freed here in vusbMsgFreeUrb. We indicate this 1331 * by setting VUsb.pvFreeCtx to NULL.1331 * by setting pVUsb->pvFreeCtx to NULL. 1332 1332 * 1333 1333 * If we have to free the message state structure because of device destruction, 1334 1334 * configuration changes, or similar, we will orphan the message pipe state in 1335 * the same way by setting VUsb.pvFreeCtx to NULL and let this function free it.1335 * the same way by setting pVUsb->pvFreeCtx to NULL and let this function free it. 1336 1336 * 1337 1337 * @param pUrb … … 1342 1342 PVUSBCTRLEXTRA pExtra = (PVUSBCTRLEXTRA)((uint8_t *)pUrb - RT_OFFSETOF(VUSBCTRLEXTRA, Urb)); 1343 1343 if ( pUrb->enmState == VUSBURBSTATE_CANCELLED 1344 && !pUrb-> VUsb.pvFreeCtx)1344 && !pUrb->pVUsb->pvFreeCtx) 1345 1345 { 1346 1346 LogFlow(("vusbMsgFreeUrb: Freeing orphan: %p (pUrb=%p)\n", pExtra, pUrb)); … … 1349 1349 else 1350 1350 { 1351 Assert(pUrb-> VUsb.pvFreeCtx == &pExtra->Urb);1351 Assert(pUrb->pVUsb->pvFreeCtx == &pExtra->Urb); 1352 1352 pUrb->enmState = VUSBURBSTATE_ALLOCATED; 1353 1353 pUrb->fCompleting = false; … … 1373 1373 } 1374 1374 else 1375 pExtra->Urb. VUsb.pvFreeCtx = NULL; /* see vusbMsgFreeUrb */1375 pExtra->Urb.pVUsb->pvFreeCtx = NULL; /* see vusbMsgFreeUrb */ 1376 1376 } 1377 1377 … … 1387 1387 /** @todo reuse these? */ 1388 1388 PVUSBCTRLEXTRA pExtra; 1389 const size_t cbMax = sizeof( pExtra->Urb.abData) + sizeof(VUSBSETUP);1389 const size_t cbMax = sizeof(VUSBURBVUSBINT) + sizeof(pExtra->Urb.abData) + sizeof(VUSBSETUP); 1390 1390 pExtra = (PVUSBCTRLEXTRA)RTMemAllocZ(RT_OFFSETOF(VUSBCTRLEXTRA, Urb.abData[cbMax])); 1391 1391 if (pExtra) … … 1405 1405 RTStrAPrintf(&pExtra->Urb.pszDesc, "URB %p msg->%p", &pExtra->Urb, pUrb); 1406 1406 #endif 1407 //pExtra->Urb.VUsb.pCtrlUrb = NULL; 1408 //pExtra->Urb.VUsb.pNext = NULL; 1409 //pExtra->Urb.VUsb.ppPrev = NULL; 1410 pExtra->Urb.VUsb.pDev = pUrb->VUsb.pDev; 1411 pExtra->Urb.VUsb.pfnFree = vusbMsgFreeUrb; 1412 pExtra->Urb.VUsb.pvFreeCtx = &pExtra->Urb; 1407 pExtra->Urb.pVUsb = (PVUSBURBVUSB)&pExtra->Urb.abData[sizeof(pExtra->Urb.abData) + sizeof(VUSBSETUP)]; 1408 //pExtra->Urb.pVUsb->pCtrlUrb = NULL; 1409 //pExtra->Urb.pVUsb->pNext = NULL; 1410 //pExtra->Urb.pVUsb->ppPrev = NULL; 1411 pExtra->Urb.pVUsb->pDev = pUrb->pVUsb->pDev; 1412 pExtra->Urb.pVUsb->pfnFree = vusbMsgFreeUrb; 1413 pExtra->Urb.pVUsb->pvFreeCtx = &pExtra->Urb; 1413 1414 //pExtra->Urb.Hci = {0}; 1414 1415 //pExtra->Urb.Dev.pvProxyUrb = NULL; … … 1462 1463 return false; 1463 1464 } 1464 pExtra->Urb. VUsb.pvFreeCtx = NULL;1465 pExtra->Urb.pVUsb->pvFreeCtx = NULL; 1465 1466 LogFlow(("vusbMsgSetup: Replacing canceled pExtra=%p with %p.\n", pExtra, pvNew)); 1466 1467 pPipe->pCtrl = pExtra = (PVUSBCTRLEXTRA)pvNew; … … 1543 1544 pExtra->Urb.enmDir = (pSetup->bmRequestType & VUSB_DIR_TO_HOST) ? VUSBDIRECTION_IN : VUSBDIRECTION_OUT; 1544 1545 pExtra->Urb.cbData = pSetup->wLength + sizeof(*pSetup); 1545 pExtra->Urb. VUsb.pCtrlUrb = pUrb;1546 pExtra->Urb.pVUsb->pCtrlUrb = pUrb; 1546 1547 int rc = vusbUrbQueueAsyncRh(&pExtra->Urb); 1547 1548 if (RT_FAILURE(rc)) … … 1570 1571 static int vusbMsgStall(PVUSBURB pUrb) 1571 1572 { 1572 PVUSBPIPE pPipe = &pUrb-> VUsb.pDev->aPipes[pUrb->EndPt];1573 PVUSBPIPE pPipe = &pUrb->pVUsb->pDev->aPipes[pUrb->EndPt]; 1573 1574 PVUSBCTRLEXTRA pExtra = pPipe->pCtrl; 1574 1575 LogFlow(("%s: vusbMsgStall: pPipe=%p err=STALL stage %s->SETUP\n", … … 1601 1602 vusbUrbTrace(pUrb, "vusbUrbSubmitCtrl", false); 1602 1603 #endif 1603 PVUSBDEV pDev = pUrb-> VUsb.pDev;1604 PVUSBDEV pDev = pUrb->pVUsb->pDev; 1604 1605 PVUSBPIPE pPipe = &pDev->aPipes[pUrb->EndPt]; 1605 1606 … … 1857 1858 vusbUrbAssert(pUrb); 1858 1859 Assert(pUrb->enmState == VUSBURBSTATE_ALLOCATED); 1859 PVUSBDEV pDev = pUrb-> VUsb.pDev;1860 PVUSBDEV pDev = pUrb->pVUsb->pDev; 1860 1861 PVUSBPIPE pPipe = NULL; 1861 1862 Assert(pDev); … … 1875 1876 #ifdef LOG_ENABLED 1876 1877 /* stamp it */ 1877 pUrb-> VUsb.u64SubmitTS = RTTimeNanoTS();1878 pUrb->pVUsb->u64SubmitTS = RTTimeNanoTS(); 1878 1879 #endif 1879 1880 … … 2003 2004 { 2004 2005 vusbUrbAssert(pUrb); 2005 PVUSBURB pUrbNext = pUrb-> VUsb.pNext;2006 PVUSBDEV pDev = pUrb-> VUsb.pDev;2006 PVUSBURB pUrbNext = pUrb->pVUsb->pNext; 2007 PVUSBDEV pDev = pUrb->pVUsb->pDev; 2007 2008 2008 2009 /* Don't touch resetting devices - paranoid safety precaution. */ … … 2024 2025 vusbUrbAssert(pRipe); 2025 2026 if (pRipe == pUrbNext) 2026 pUrbNext = pUrbNext-> VUsb.pNext;2027 pUrbNext = pUrbNext->pVUsb->pNext; 2027 2028 vusbUrbRipe(pRipe); 2028 2029 } … … 2075 2076 static void vusbUrbCompletion(PVUSBURB pUrb) 2076 2077 { 2077 Assert(pUrb-> VUsb.pDev->aPipes);2078 ASMAtomicDecU32(&pUrb-> VUsb.pDev->aPipes[pUrb->EndPt].async);2078 Assert(pUrb->pVUsb->pDev->aPipes); 2079 ASMAtomicDecU32(&pUrb->pVUsb->pDev->aPipes[pUrb->EndPt].async); 2079 2080 2080 2081 if (pUrb->enmState == VUSBURBSTATE_REAPED) … … 2082 2083 #ifdef VBOX_WITH_USB 2083 2084 // Read-ahead URBs are handled differently 2084 if (pUrb-> VUsb.pvReadAhead)2085 if (pUrb->pVUsb->pvReadAhead) 2085 2086 vusbUrbCompletionReadAhead(pUrb); 2086 2087 else … … 2100 2101 vusbUrbAssert(pUrb); 2101 2102 #ifdef VBOX_WITH_STATISTICS 2102 PVUSBROOTHUB pRh = vusbDevGetRh(pUrb-> VUsb.pDev);2103 PVUSBROOTHUB pRh = vusbDevGetRh(pUrb->pVUsb->pDev); 2103 2104 #endif 2104 2105 if (pUrb->enmState == VUSBURBSTATE_IN_FLIGHT) … … 2113 2114 2114 2115 pUrb->enmState = VUSBURBSTATE_CANCELLED; 2115 PPDMUSBINS pUsbIns = pUrb-> VUsb.pDev->pUsbIns;2116 PPDMUSBINS pUsbIns = pUrb->pVUsb->pDev->pUsbIns; 2116 2117 pUsbIns->pReg->pfnUrbCancel(pUsbIns, pUrb); 2117 2118 Assert(pUrb->enmState == VUSBURBSTATE_CANCELLED || pUrb->enmState == VUSBURBSTATE_REAPED); … … 2178 2179 void vusbUrbCancel(PVUSBURB pUrb, CANCELMODE mode) 2179 2180 { 2180 int rc = vusbDevIoThreadExecSync(pUrb-> VUsb.pDev, (PFNRT)vusbUrbCancelWorker, 2, pUrb, mode);2181 int rc = vusbDevIoThreadExecSync(pUrb->pVUsb->pDev, (PFNRT)vusbUrbCancelWorker, 2, pUrb, mode); 2181 2182 AssertRC(rc); 2182 2183 } … … 2191 2192 if (!ASMAtomicXchgBool(&pUrb->fCompleting, true)) 2192 2193 { 2193 int rc = vusbDevIoThreadExec(pUrb-> VUsb.pDev, 0 /* fFlags */, (PFNRT)vusbUrbCancelWorker, 2, pUrb, mode);2194 int rc = vusbDevIoThreadExec(pUrb->pVUsb->pDev, 0 /* fFlags */, (PFNRT)vusbUrbCancelWorker, 2, pUrb, mode); 2194 2195 AssertRC(rc); 2195 2196 } … … 2219 2220 vusbUrbUnlink(pUrb); 2220 2221 LogFlow(("%s: vusbUrbRipe: Freeing cancelled URB\n", pUrb->pszDesc)); 2221 pUrb-> VUsb.pfnFree(pUrb);2222 pUrb->pVUsb->pfnFree(pUrb); 2222 2223 } 2223 2224 else
Note:
See TracChangeset
for help on using the changeset viewer.