Changeset 52513 in vbox
- Timestamp:
- Aug 28, 2014 1:14:13 PM (10 years ago)
- Location:
- trunk/src/VBox/Devices/USB
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/USB/VUSBDevice.cpp
r52301 r52513 1225 1225 pDev->pCurCfgDesc = NULL; 1226 1226 for (unsigned i = 0; i < VUSB_PIPE_MAX; i++) 1227 { 1227 1228 vusbMsgFreeExtraData(pDev->aPipes[i].pCtrl); 1229 RTCritSectDelete(&pDev->aPipes[i].CritSectCtrl); 1230 } 1228 1231 memset(pDev->aPipes, 0, sizeof(pDev->aPipes)); 1229 1232 return VINF_SUCCESS; … … 1711 1714 pDev->paIfStates = NULL; 1712 1715 memset(&pDev->aPipes[0], 0, sizeof(pDev->aPipes)); 1716 for (unsigned i = 0; i < RT_ELEMENTS(pDev->aPipes); i++) 1717 { 1718 int rc = RTCritSectInit(&pDev->aPipes[i].CritSectCtrl); 1719 AssertRCReturn(rc, rc); 1720 } 1713 1721 pDev->pResetTimer = NULL; 1714 1722 -
trunk/src/VBox/Devices/USB/VUSBInternal.h
r52307 r52513 125 125 /** Pointer to the extra state data required to run a control pipe. */ 126 126 PVUSBCTRLEXTRA pCtrl; 127 /** Critical section serializing access to the extra state data for a control pipe. */ 128 RTCRITSECT CritSectCtrl; 127 129 /** Count of active async transfers. */ 128 130 volatile uint32_t async; -
trunk/src/VBox/Devices/USB/VUSBUrb.cpp
r52301 r52513 935 935 break; 936 936 } 937 vusbUrbCompletionRh(pUrb);938 937 } 939 938 … … 948 947 PVUSBDEV pDev = pUrb->VUsb.pDev; 949 948 PVUSBPIPE pPipe = &pDev->aPipes[pUrb->EndPt]; 949 950 RTCritSectEnter(&pPipe->CritSectCtrl); 950 951 PVUSBCTRLEXTRA pExtra = pPipe->pCtrl; 951 952 … … 977 978 if (pUrb->enmState != VUSBURBSTATE_CANCELLED) 978 979 pUrb->enmState = VUSBURBSTATE_ALLOCATED; 980 RTCritSectLeave(&pPipe->CritSectCtrl); 981 982 /* Complete the original control URB on the root hub now. */ 983 vusbUrbCompletionRh(pCtrlUrb); 979 984 } 980 985 … … 1260 1265 1261 1266 vusbCtrlCompletion(pUrb); 1267 vusbUrbCompletionRh(pUrb); 1262 1268 1263 1269 /* … … 1572 1578 PVUSBDEV pDev = pUrb->VUsb.pDev; 1573 1579 PVUSBPIPE pPipe = &pDev->aPipes[pUrb->EndPt]; 1580 1581 RTCritSectEnter(&pPipe->CritSectCtrl); 1574 1582 PVUSBCTRLEXTRA pExtra = pPipe->pCtrl; 1583 1575 1584 if (!pExtra && !(pExtra = pPipe->pCtrl = vusbMsgAllocExtraData(pUrb))) 1585 { 1586 RTCritSectLeave(&pPipe->CritSectCtrl); 1576 1587 return VERR_VUSB_NO_URB_MEMORY; 1588 } 1577 1589 PVUSBSETUP pSetup = pExtra->pMsg; 1578 1590 … … 1613 1625 { 1614 1626 Log(("%s: vusbUrbSubmitCtrl: Stall at setup stage (dir=%#x)!!\n", pUrb->pszDesc, pUrb->enmDir)); 1615 return vusbMsgStall(pUrb); 1627 vusbMsgStall(pUrb); 1628 break; 1616 1629 } 1617 1630 … … 1622 1635 pUrb->enmStatus = VUSBSTATUS_DNR; 1623 1636 vusbUrbCompletionRh(pUrb); 1624 return VINF_SUCCESS;1637 break; 1625 1638 } 1626 1639 if (pPipe->pCtrl != pExtra) … … 1680 1693 { 1681 1694 Log(("%s: vusbUrbSubmitCtrl: Stall at data stage!!\n", pUrb->pszDesc)); 1682 return vusbMsgStall(pUrb); 1695 vusbMsgStall(pUrb); 1696 break; 1683 1697 } 1684 1698 } … … 1747 1761 } 1748 1762 1763 RTCritSectLeave(&pPipe->CritSectCtrl); 1749 1764 return VINF_SUCCESS; 1750 1765 }
Note:
See TracChangeset
for help on using the changeset viewer.