Changeset 32010 in vbox for trunk/src/VBox
- Timestamp:
- Aug 26, 2010 4:51:26 PM (14 years ago)
- Location:
- trunk/src/VBox/Devices/USB
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/USB/DevOHCI.cpp
r31249 r32010 2416 2416 */ 2417 2417 int cFmAge = ohci_in_flight_remove_urb(pOhci, pUrb); 2418 if (pUrb->enmStatus == VUSBSTATUS_UNDO) 2419 { 2420 /* Leave the TD alone - the HCD doesn't want us talking to the device. */ 2421 Log(("%s: ohciRhXferCompletion: CANCELED {ED=%#010x cTds=%d TD0=%#010x age %d}\n", 2422 pUrb->pszDesc, pUrb->Hci.EdAddr, pUrb->Hci.cTds, pUrb->Hci.paTds[0].TdAddr, cFmAge)); 2423 STAM_COUNTER_INC(&pOhci->StatDroppedUrbs); 2424 return; 2425 } 2418 2426 bool fHasBeenCanceled = false; 2419 2427 if ( (Ed.HeadP & ED_HEAD_HALTED) … … 2438 2446 /* 2439 2447 * Complete the TD updating and write the back. 2440 * When approp irate also copy data back to the guest memory.2448 * When appropriate also copy data back to the guest memory. 2441 2449 */ 2442 2450 if (pUrb->enmType == VUSBXFERTYPE_ISOC) -
trunk/src/VBox/Devices/USB/DrvVUSBRootHub.cpp
r31230 r32010 585 585 */ 586 586 LogFlow(("vusbRhCancelUrbsEp: pRh=%p pUrb=%p\n", pRh)); 587 vusbUrbCancel(pUrb );587 vusbUrbCancel(pUrb, CANCELMODE_UNDO); 588 588 589 589 PVUSBURB pRipe; … … 613 613 { 614 614 PVUSBURB pNext = pUrb->VUsb.pNext; 615 vusbUrbCancel(pUrb );615 vusbUrbCancel(pUrb, CANCELMODE_FAIL); 616 616 pUrb = pNext; 617 617 } -
trunk/src/VBox/Devices/USB/VUSBDevice.cpp
r28800 r32010 1046 1046 { 1047 1047 LogFlow(("%s: vusbDevCancelAllUrbs: CANCELING URB\n", pUrb->pszDesc)); 1048 vusbUrbCancel(pUrb );1048 vusbUrbCancel(pUrb, CANCELMODE_FAIL); 1049 1049 } 1050 1050 pUrb = pNext; -
trunk/src/VBox/Devices/USB/VUSBInternal.h
r31230 r32010 407 407 #define VUSBIROOTHUBCONNECTOR_2_VUSBROOTHUB(pInterface) (PVUSBROOTHUB)( (uintptr_t)(pInterface) - RT_OFFSETOF(VUSBROOTHUB, IRhConnector) ) 408 408 409 /** 410 * URB cancellation modes 411 */ 412 typedef enum CANCELMODE 413 { 414 /** complete the URB with an error (CRC). */ 415 CANCELMODE_FAIL = 0, 416 /** do not change the URB contents. */ 417 CANCELMODE_UNDO 418 } CANCELMODE; 409 419 410 420 /* @} */ … … 417 427 void vusbUrbTrace(PVUSBURB pUrb, const char *pszMsg, bool fComplete); 418 428 void vusbUrbDoReapAsync(PVUSBURB pHead, RTMSINTERVAL cMillies); 419 void vusbUrbCancel(PVUSBURB pUrb );429 void vusbUrbCancel(PVUSBURB pUrb, CANCELMODE mode); 420 430 void vusbUrbRipe(PVUSBURB pUrb); 421 431 void vusbUrbCompletionRh(PVUSBURB pUrb); -
trunk/src/VBox/Devices/USB/VUSBUrb.cpp
r30526 r32010 2011 2011 * state and in the async list until its reaped. When it's finally reaped 2012 2012 * it will be unlinked and freed without doing any completion. 2013 * 2014 * There are different modes of canceling an URB. When devices are being 2015 * disconnected etc., they will be completed with an error (CRC). However, 2016 * when the HC needs to temporarily halt communication with a device, the 2017 * URB/TD must be left alone if possible. 2013 2018 * 2014 2019 * @param pUrb The URB to cancel. 2015 */ 2016 void vusbUrbCancel(PVUSBURB pUrb) 2020 * @param mode The way the URB should be canceled. 2021 */ 2022 void vusbUrbCancel(PVUSBURB pUrb, CANCELMODE mode) 2017 2023 { 2018 2024 vusbUrbAssert(pUrb); … … 2054 2060 { 2055 2061 AssertMsg(pUrb->enmState == VUSBURBSTATE_CANCELLED, ("Invalid state %d, pUrb=%p\n", pUrb->enmState, pUrb)); 2056 pUrb->enmStatus = VUSBSTATUS_CRC; 2062 switch (mode) 2063 { 2064 default: 2065 AssertMsgFailed(("Invalid cancel mode\n")); 2066 case CANCELMODE_FAIL: 2067 pUrb->enmStatus = VUSBSTATUS_CRC; 2068 break; 2069 case CANCELMODE_UNDO: 2070 pUrb->enmStatus = VUSBSTATUS_UNDO; 2071 break; 2072 2073 } 2057 2074 } 2058 2075 }
Note:
See TracChangeset
for help on using the changeset viewer.