Changeset 93993 in vbox
- Timestamp:
- Feb 28, 2022 6:28:04 PM (3 years ago)
- Location:
- trunk/src/VBox/Devices/USB
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/USB/DrvVUSBRootHub.cpp
r93989 r93993 411 411 Assert(pDev->i16Port != -1); 412 412 413 /* Cancel all in-flight URBs from this device. */414 vusbDevCancelAllUrbs(pDev, true);415 416 413 /* 417 414 * Detach the device and mark the port as available. … … 434 431 } 435 432 RTCritSectLeave(&pThis->CritSectDevices); 433 434 /* Cancel all in-flight URBs from this device. */ 435 vusbDevCancelAllUrbs(pDev, true); 436 436 437 437 /* Free resources. */ … … 956 956 pUrb->enmState = VUSBURBSTATE_REAPED; 957 957 pUrb->enmStatus = VUSBSTATUS_DNR; 958 vusbUrbCompletionRh (pUrb);958 vusbUrbCompletionRhEx(pRh, pUrb); 959 959 rc = VINF_SUCCESS; 960 960 } -
trunk/src/VBox/Devices/USB/VUSBInternal.h
r93989 r93993 484 484 void vusbUrbCancelAsync(PVUSBURB pUrb, CANCELMODE mode); 485 485 void vusbUrbRipe(PVUSBURB pUrb); 486 void vusbUrbCompletionRh (PVUSBURB pUrb);486 void vusbUrbCompletionRhEx(PVUSBROOTHUB pRh, PVUSBURB pUrb); 487 487 int vusbUrbSubmitHardError(PVUSBURB pUrb); 488 int vusbUrbErrorRh (PVUSBURB pUrb);488 int vusbUrbErrorRhEx(PVUSBROOTHUB pRh, PVUSBURB pUrb); 489 489 int vusbDevUrbIoThreadWakeup(PVUSBDEV pDev); 490 490 int vusbDevUrbIoThreadCreate(PVUSBDEV pDev); … … 578 578 RTCritSectLeave(&pDev->CritSectAsyncUrbs); 579 579 } 580 581 582 DECLINLINE(int) vusbUrbErrorRh(PVUSBURB pUrb) 583 { 584 PVUSBDEV pDev = pUrb->pVUsb->pDev; 585 PVUSBROOTHUB pRh = vusbDevGetRh(pDev); 586 AssertPtrReturn(pRh, VERR_VUSB_DEVICE_NOT_ATTACHED); 587 588 return vusbUrbErrorRhEx(pRh, pUrb); 589 } 590 591 592 DECLINLINE(void) vusbUrbCompletionRh(PVUSBURB pUrb) 593 { 594 PVUSBROOTHUB pRh = vusbDevGetRh(pUrb->pVUsb->pDev); 595 AssertPtrReturnVoid(pRh); 596 597 vusbUrbCompletionRhEx(pRh, pUrb); 598 } 599 580 600 581 601 /** @def vusbUrbAssert -
trunk/src/VBox/Devices/USB/VUSBUrb.cpp
r93115 r93993 216 216 * @returns true if it could be retried. 217 217 * @returns false if it should be completed with failure. 218 * @param pRh The roothub the URB originated from. 218 219 * @param pUrb The URB in question. 219 220 */ 220 int vusbUrbErrorRh (PVUSBURB pUrb)221 int vusbUrbErrorRhEx(PVUSBROOTHUB pRh, PVUSBURB pUrb) 221 222 { 222 223 PVUSBDEV pDev = pUrb->pVUsb->pDev; 223 PVUSBROOTHUB pRh = vusbDevGetRh(pDev);224 AssertPtrReturn(pRh, VERR_VUSB_DEVICE_NOT_ATTACHED);225 224 LogFlow(("%s: vusbUrbErrorRh: pDev=%p[%s] rh=%p\n", pUrb->pszDesc, pDev, pDev->pUsbIns ? pDev->pUsbIns->pszName : "", pRh)); 226 225 return pRh->pIRhPort->pfnXferError(pRh->pIRhPort, pUrb); … … 230 229 * Does URB completion on roothub level. 231 230 * 231 * @param pRh The roothub the URB originated from. 232 232 * @param pUrb The URB to complete. 233 233 */ 234 void vusbUrbCompletionRh (PVUSBURB pUrb)234 void vusbUrbCompletionRhEx(PVUSBROOTHUB pRh, PVUSBURB pUrb) 235 235 { 236 236 LogFlow(("%s: vusbUrbCompletionRh: type=%s status=%s\n", … … 249 249 LogRel(("VUSB: Capturing URB completion event failed with %Rrc\n", rc)); 250 250 } 251 252 PVUSBROOTHUB pRh = vusbDevGetRh(pUrb->pVUsb->pDev);253 AssertPtrReturnVoid(pRh);254 251 255 252 /* If there is a sniffer on the roothub record the completed URB there too. */ … … 365 362 case VUSBXFERTYPE_BULK: 366 363 if (pUrb->enmStatus != VUSBSTATUS_OK) 367 vusbUrbErrorRh (pUrb);364 vusbUrbErrorRhEx(pRh, pUrb); 368 365 break; 369 366 }
Note:
See TracChangeset
for help on using the changeset viewer.