Changeset 52526 in vbox
- Timestamp:
- Aug 29, 2014 9:51:53 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/USB/VUSBDevice.cpp
r52525 r52526 217 217 } 218 218 219 220 /** 221 * Worker that resets the pipe data on select config and detach. 222 * 223 * This leaves the critical section unmolested 224 * 225 * @param pPipe The pipe which data should be reset. 226 */ 227 static void vusbDevResetPipeData(PVUSBPIPE pPipe) 228 { 229 vusbMsgFreeExtraData(pPipe->pCtrl); 230 pPipe->pCtrl = NULL; 231 232 if (pPipe->hReadAhead) 233 { 234 vusbReadAheadStop(pPipe->hReadAhead); 235 pPipe->hReadAhead = NULL; 236 } 237 238 RT_ZERO(pPipe->in); 239 RT_ZERO(pPipe->out); 240 pPipe->async = 0; 241 } 242 243 219 244 bool vusbDevDoSelectConfig(PVUSBDEV pDev, PCVUSBDESCCONFIGEX pCfgDesc) 220 245 { … … 227 252 unsigned i; 228 253 for (i = 0; i < VUSB_PIPE_MAX; i++) 229 {230 254 if (i != VUSB_PIPE_DEFAULT) 231 { 232 vusbMsgFreeExtraData(pDev->aPipes[i].pCtrl); 233 memset(&pDev->aPipes[i], 0, sizeof(pDev->aPipes[i])); 234 } 235 } 255 vusbDevResetPipeData(&pDev->aPipes[i]); 236 256 memset(pDev->paIfStates, 0, pCfgDesc->Core.bNumInterfaces * sizeof(pDev->paIfStates[0])); 237 257 … … 1225 1245 pDev->pCurCfgDesc = NULL; 1226 1246 for (unsigned i = 0; i < RT_ELEMENTS(pDev->aPipes); i++) 1227 { 1228 vusbMsgFreeExtraData(pDev->aPipes[i].pCtrl); 1229 pDev->aPipes[i].pCtrl = NULL; 1230 1231 if (pDev->aPipes[i].hReadAhead) 1232 { 1233 vusbReadAheadStop(pDev->aPipes[i].hReadAhead); 1234 pDev->aPipes[i].hReadAhead = NULL; 1235 } 1236 1237 RT_ZERO(pDev->aPipes[i].in); 1238 RT_ZERO(pDev->aPipes[i].out); 1239 pDev->aPipes[i].async = 0; 1240 } 1247 vusbDevResetPipeData(&pDev->aPipes[i]); 1241 1248 return VINF_SUCCESS; 1242 1249 } … … 1268 1275 pDev->pResetTimer = NULL; 1269 1276 for (unsigned i = 0; i < RT_ELEMENTS(pDev->aPipes); i++) 1277 { 1278 Assert(pDev->aPipes[i].pCtrl == NULL); 1270 1279 RTCritSectDelete(&pDev->aPipes[i].CritSectCtrl); 1280 } 1271 1281 1272 1282 /*
Note:
See TracChangeset
for help on using the changeset viewer.