- Timestamp:
- Mar 30, 2024 11:14:59 AM (10 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/USB/DevOHCI.cpp
r99739 r104124 72 72 * the host memory. 73 73 * 74 * The guest can set the SKIP bit in an endpoint to pause USB traffic on 75 * that endpoint. If we see the bit set, we need to cancel any URBs that might 76 * be queued on that particular endpoint. 77 * 78 * In some situations, we might miss seeing the SKIP bit. Additionally, the 79 * guest is not forced to set the SKIP bit and might rearrange the transfer 80 * descriptors at any time, or remove EDs from the list entirely. We must 81 * therefore keep track of which endpoints have URBs already in flight, and 82 * cancel any and all such URBs if we detect that the guest is no longer 83 * attempting to perform any transfers on them. 84 * 85 * When we submit a URB, we note the corresponding endpoint and transfer 86 * descriptor information. URB completion checks if the descriptors in 87 * guest memory are still the same; if not, the URB is effectively thrown 88 * away (and nothing is placed on the corresponding done queue). 89 * 90 * For control and interrupt endpoints, we convert each TD into a URB. No 91 * attempt is made to pipeline the traffic and submit multiple URBs for an 92 * endpoint. 93 * 94 * For bulk endpoints, we use heuristics to decide when multiple TDs should 95 * be coalesced into a single URB. This logic helps among others with MSDs 96 * which tend to transfer data in larger chunks, such as 32 or 64 KB. 97 * 74 98 * As for error handling OHCI allows for 3 retries before failing a transfer, 75 99 * an error count is stored in each transfer descriptor. A halt flag is also 76 100 * stored in the transfer descriptor. That allows for ED's to be disabled 77 * without stopping the bus and de-queuing them.101 * by the HC without stopping the bus and de-queuing them. 78 102 * 79 103 * When the bus is started and stopped we call VUSBIDevPowerOn/Off() on our … … 146 170 /* Macro to query the number of currently configured ports. */ 147 171 #define OHCI_NDP_CFG(pohci) ((pohci)->RootHub.desc_a & OHCI_RHA_NDP) 148 /** Macro to convert a EHCI port index (zero based) to a VUSB roothub port ID (one based). */172 /** Macro to convert an OHCI port index (zero based) to a VUSB roothub port ID (one based). */ 149 173 #define OHCI_PORT_2_VUSB_PORT(a_uPort) ((a_uPort) + 1) 150 174 … … 165 189 RTGCPHYS32 TdAddr; 166 190 /** A copy of the TD. */ 167 uint32_t TdCopy[ 16];191 uint32_t TdCopy[8]; 168 192 } VUSBURBHCITDINT; 169 193 … … 3453 3477 { 3454 3478 Log(("ITdAddr=%RX32 PSW%d.CC=%#x < 'Not Accessed'!\n", ITdAddr, R, pITd->aPSW[R] >> ITD_PSW_CC_SHIFT)); /* => Unrecoverable Error*/ 3455 pThis->intr_status |= OHCI_INTR_UNRECOVERABLE_ERROR;3479 ohciR3RaiseUnrecoverableError(pDevIns, pThis, 9); 3456 3480 return false; 3457 3481 } … … 3579 3603 * hierarchy described in the documenation. This means that for an isochronous endpoint 3580 3604 * with a 1 ms interval we expect to find in-flight TDs at the head of the list. We will 3581 * skip over all in-flight TDs wh ich timeframe has been exceed. Those which aren't in3605 * skip over all in-flight TDs whose timeframe has been exceeded. Those which aren't in 3582 3606 * flight but which are too late will be retired (possibly out of order, but, we don't 3583 3607 * care right now). … … 3760 3784 # if 1 3761 3785 /* 3762 3763 3786 * After we figured out that all the TDs submitted for dealing with MSD 3764 3787 * read/write data really makes up on single URB, and that we must … … 4181 4204 pThisCC->aInFlight[j].fInactive = false; 4182 4205 TdAddr = Td.NextTD & ED_PTR_MASK; 4183 /* See #8125.4206 /* See @bugref{8125}. 4184 4207 * Sometimes the ED is changed by the guest between ohciR3ReadEd above and here. 4185 4208 * Then the code reads TD pointed by the new TailP, which is not allowed.
Note:
See TracChangeset
for help on using the changeset viewer.