- Timestamp:
- Aug 27, 2010 2:03:57 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/USB/DevOHCI.cpp
r32010 r32052 346 346 /** Idle detection flag; must be cleared at start of frame */ 347 347 bool fIdle; 348 349 uint32_t Alignment3; /**< Align size on a 8 byte boundary. */348 /** A flag indicating that the bulk list may have in-flight URBs. */ 349 bool fBulkNeedsCleaning; 350 350 } OHCI; 351 351 … … 3157 3157 */ 3158 3158 pOhci->status &= ~OHCI_STATUS_BLF; 3159 pOhci->fBulkNeedsCleaning = false; 3159 3160 pOhci->bulk_cur = 0; 3160 3161 … … 3168 3169 { 3169 3170 pOhci->status |= OHCI_STATUS_BLF; 3171 pOhci->fBulkNeedsCleaning = true; 3170 3172 3171 3173 #if 1 … … 3232 3234 } 3233 3235 3236 /** 3237 * Abort outstanding transfers on the bulk list. 3238 * 3239 * If the guest disabled bulk list processing, we must abort any outstanding transfers 3240 * (that is, cancel in-flight URBs associated with the list). This is required because 3241 * there may be outstanding read URBs that will never get a response from the device 3242 * and would block further communication. 3243 */ 3244 static void ohciUndoBulkList(POHCI pOhci) 3245 { 3246 #ifdef LOG_ENABLED 3247 if (g_fLogBulkEPs) 3248 ohciDumpEdList(pOhci, pOhci->bulk_head, "Bulk before", true); 3249 if (pOhci->bulk_cur) 3250 Log(("ohciUndoBulkList: bulk_cur=%#010x before list processing!!! HCD has positioned us!!!\n", pOhci->bulk_cur)); 3251 #endif 3252 3253 /* This flag follows OHCI_STATUS_BLF, but BLF doesn't change when list processing is disabled. */ 3254 pOhci->fBulkNeedsCleaning = false; 3255 3256 uint32_t EdAddr = pOhci->bulk_head; 3257 while (EdAddr) 3258 { 3259 OHCIED Ed; 3260 ohciReadEd(pOhci, EdAddr, &Ed); 3261 Assert(!(Ed.hwinfo & ED_HWINFO_ISO)); /* the guest is screwing us */ 3262 if (ohciIsEdReady(&Ed)) 3263 { 3264 uint32_t TdAddr = Ed.HeadP & ED_PTR_MASK; 3265 if (ohciIsTdInFlight(pOhci, TdAddr)) 3266 { 3267 LogFlow(("ohciUndoBulkList: Ed=%#010RX32 Ed.TailP=%#010RX32 UNDO\n", EdAddr, Ed.TailP)); 3268 PVUSBURB pUrb = ohciTdInFlightUrb(pOhci, TdAddr); 3269 if (pUrb) 3270 pOhci->RootHub.pIRhConn->pfnCancelUrbsEp(pOhci->RootHub.pIRhConn, pUrb); 3271 } 3272 } 3273 /* next endpoint */ 3274 EdAddr = Ed.NextED & ED_PTR_MASK; 3275 } 3276 } 3277 3234 3278 3235 3279 /** … … 3511 3555 && (pOhci->status & OHCI_STATUS_BLF)) 3512 3556 ohciServiceBulkList(pOhci); 3557 else if ((pOhci->status & OHCI_STATUS_BLF) 3558 && pOhci->fBulkNeedsCleaning) 3559 ohciUndoBulkList(pOhci); /* If list disabled but not empty, abort endpoints. */ 3513 3560 3514 3561 #if 1
Note:
See TracChangeset
for help on using the changeset viewer.