• Robert Sprowson's avatar
    Fix for sending a stale TRB from a pipe that was previously open · 53348b62
    Robert Sprowson authored
    Performing an open/out/close set of operations leaves the TRBs from the output step in the transfer ring for that endpoint. Subsequently re-opening the same endpoint a second time would start appending new TRBs on the end of the ring, but as the hardware's dequeue pointer gets reset to 0 all the old TRBs (with stale pointers to data) would get repeated.
    Now, when an endpoint is configured (and hence the hardware's dequeue pointer set) the shadow copy in RAM is also cleared. Since this procedure is also needed during slot initialisation and stall clear, make it a function too.
    Fixes problem with 1st print job from Printer Manager being good, and the 2nd print job being bad due to bits of the previous page being jumbled up in the data stream. Also fixes problem with TWAIN scanner failing to complete a scan, for the same reason. Endpoints that are only ever opened, such as mass storage devices, were not affected as the hardware's dequeue pointer always matched the software's copy.
    From NetBSD revision 1.56, ref http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=51202.
    Version 0.16. Tagged as 'XHCIDriver-0_16'
xhci 93.7 KB