uhci: Drop unnecessary forward declaration of some static functions
Signed-off-by: Hans de Goede <hdegoede@redhat.com>Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
uhci: Move emptying of the queue's asyncs' queue to uhci_queue_free
Cleanup: all callers of uhci_queue_free first unconditionally cancelall remaining asyncs in the queue, so lets move this to uhci_queue_free().
Signed-off-by: Hans de Goede <hdegoede@redhat.com>...
uhci: Rename UHCIAsync->td to UHCIAsync->td_addr
We use the name td both to refer to a UHCI_TD read from guest memory aswell as to refer to the guest address where a td is stored, switch overto always use td_addr in the second case for consistency.
uhci: Add uhci_read_td() helper function
uhci: Make uhci_fill_queue() actually operate on an UHCIQueue
And move its calling point to handle_td, this removes the ep_ret ugliness,and prepates the way for further cleanups in the follow-up patches in thispatch-set.
uhci: Store ep in UHCIQueue
This avoids the need to repeatedly lookup the device, and ep.
uhci: Immediately free queues on device disconnect
There is no need to just cancel any in-flight packets, and then waitfor validate-end to clean things up, we can simply clean things upimmediately on device removal.
uhci: Verify queue has not been changed by guest
According to the spec a guest can unlink a qh, and then as soon as frindexhas changed by 1 since the unlink, assume it is idle and re-use it. Howeverfor various reasons, we cannot simply consider a qh as unlinked if we've not...
uhci: cleanup: Add an unlink call to uhci_async_cancel()
All callers of uhci_async_cancel() call uhci_async_unlink() first, solets move the unlink call to uhci_async_cancel()
uhci: Don't retry on error
Since we are either dealing with emulated devices, where retrying isnot going to help, or with redirected devices where the host OS willhave already retried, don't bother retrying on failed transfers.
Also move some common/indentical code out of all the error cases...
View revisions
Also available in: Atom