Changeset 93934 in vbox for trunk/src/VBox/Devices/USB/DrvVUSBRootHub.cpp
- Timestamp:
- Feb 24, 2022 4:14:06 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/USB/DrvVUSBRootHub.cpp
r93915 r93934 918 918 static DECLCALLBACK(void) vusbRhCancelAllUrbs(PVUSBIROOTHUBCONNECTOR pInterface) 919 919 { 920 PVUSBROOTHUB p Rh= VUSBIROOTHUBCONNECTOR_2_VUSBROOTHUB(pInterface);921 922 RTCritSectEnter(&p Rh->CritSectDevices);923 PVUSBDEV pDev = pRh->pDevices;924 while (pDev)925 {926 vusbDevIoThreadExecSync(pDev, (PFNRT)vusbRhCancelAllUrbsWorker, 1, pDev);927 pDev = pDev->pNext;928 } 929 RTCritSectLeave(&p Rh->CritSectDevices);920 PVUSBROOTHUB pThis = VUSBIROOTHUBCONNECTOR_2_VUSBROOTHUB(pInterface); 921 922 RTCritSectEnter(&pThis->CritSectDevices); 923 for (unsigned i = 0; i < RT_ELEMENTS(pThis->apDevByPort); i++) 924 { 925 PVUSBDEV pDev = pThis->apDevByPort[i]; 926 if (pDev) 927 vusbDevIoThreadExecSync(pDev, (PFNRT)vusbRhCancelAllUrbsWorker, 1, pDev); 928 } 929 RTCritSectLeave(&pThis->CritSectDevices); 930 930 } 931 931 … … 1419 1419 { 1420 1420 RTCritSectEnter(&pRh->CritSectDevices); 1421 pDev->pNext = pRh->pDevices;1422 pRh->pDevices = pDev;1423 1424 1421 Assert(!pRh->apDevByPort[iPort]); 1425 1422 pRh->apDevByPort[iPort] = pDev; … … 1456 1453 */ 1457 1454 RTCritSectEnter(&pRh->CritSectDevices); 1458 if (pRh->pDevices != pDev) 1459 { 1460 PVUSBDEV pPrev = pRh->pDevices; 1461 while (pPrev && pPrev->pNext != pDev) 1462 pPrev = pPrev->pNext; 1463 Assert(pPrev); 1464 pPrev->pNext = pDev->pNext; 1465 } 1466 else 1467 pRh->pDevices = pDev->pNext; 1468 pDev->pNext = NULL; 1469 1455 Assert(pRh->apDevByPort[pDev->i16Port] == pDev); 1470 1456 pRh->apDevByPort[pDev->i16Port] = NULL; 1471 1457 RTCritSectLeave(&pRh->CritSectDevices);
Note:
See TracChangeset
for help on using the changeset viewer.