- Timestamp:
- Feb 27, 2015 3:42:57 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/USB/DrvVUSBRootHub.cpp
r53163 r54556 648 648 } 649 649 RTCritSectLeave(&pRh->CritSectDevices); 650 } 651 652 /** 653 * Worker doing the actual cancelling of all outstanding per-EP URBs on the 654 * device I/O thread. 655 * 656 * @returns VBox status code. 657 * @param pDev USB device instance data. 658 * @param EndPt Endpoint number. 659 * @param enmDir Endpoint direction. 660 */ 661 static DECLCALLBACK(int) vusbRhAbortEpWorker(PVUSBDEV pDev, int EndPt, VUSBDIRECTION enmDir) 662 { 663 /* 664 * Iterate the URBs, find ones corresponding to given EP, and cancel them. 665 */ 666 PVUSBURB pUrb = pDev->pAsyncUrbHead; 667 while (pUrb) 668 { 669 PVUSBURB pNext = pUrb->VUsb.pNext; 670 671 Assert(pUrb->VUsb.pDev == pDev); 672 673 if (pUrb->EndPt == EndPt && pUrb->enmDir == enmDir) 674 { 675 LogFlow(("%s: vusbRhAbortEpWorker: CANCELING URB\n", pUrb->pszDesc)); 676 int rc = vusbUrbCancelWorker(pUrb, CANCELMODE_UNDO); 677 AssertRC(rc); 678 } 679 pUrb = pNext; 680 } 681 682 return VINF_SUCCESS; 683 } 684 685 686 /** @copydoc VUSBIROOTHUBCONNECTOR::pfnAbortEp */ 687 static DECLCALLBACK(int) vusbRhAbortEp(PVUSBIROOTHUBCONNECTOR pInterface, PVUSBIDEVICE pDevice, int EndPt, VUSBDIRECTION enmDir) 688 { 689 PVUSBROOTHUB pRh = VUSBIROOTHUBCONNECTOR_2_VUSBROOTHUB(pInterface); 690 if (&pRh->Hub != ((PVUSBDEV)pDevice)->pHub) 691 AssertFailedReturn(VERR_INVALID_PARAMETER); 692 693 RTCritSectEnter(&pRh->CritSectDevices); 694 PVUSBDEV pDev = (PVUSBDEV)pDevice; 695 vusbDevIoThreadExecSync(pDev, (PFNRT)vusbRhAbortEpWorker, 3, pDev, EndPt, enmDir); 696 RTCritSectLeave(&pRh->CritSectDevices); 697 698 /* The reaper thread will take care of completing the URB. */ 699 700 return VINF_SUCCESS; 650 701 } 651 702 … … 973 1024 pThis->IRhConnector.pfnCancelUrbsEp = vusbRhCancelUrbsEp; 974 1025 pThis->IRhConnector.pfnCancelAllUrbs= vusbRhCancelAllUrbs; 1026 pThis->IRhConnector.pfnAbortEp = vusbRhAbortEp; 975 1027 pThis->IRhConnector.pfnAttachDevice = vusbRhAttachDevice; 976 1028 pThis->IRhConnector.pfnDetachDevice = vusbRhDetachDevice;
Note:
See TracChangeset
for help on using the changeset viewer.