summaryrefslogtreecommitdiff
path: root/hw/usb/hcd-ehci.c
AgeCommit message (Collapse)AuthorFilesLines
2013-07-27misc: Use g_assert_not_reached for code which is expected to be unreachableStefan Weil1-4/+4
The macro g_assert_not_reached is a better self documenting replacement for assert(0) or assert(false). Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2013-07-04hw/[u-x]*: pass owner to memory_region_init* functionsPaolo Bonzini1-4/+4
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-07-04memory: add owner argument to initialization functionsPaolo Bonzini1-4/+4
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-07-04dma: keep a device alive while it has SGListsPaolo Bonzini1-2/+4
Reviewed-by: Anthony Liguori <aliguori@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-06-24usb/hcd-ehci: Replace PORTSC macros with variablesKuo-Jung Su1-8/+14
Replace PORTSC macros with variables which could then be configured in ehci_xxxx_class_init(...) Signed-off-by: Kuo-Jung Su <dantesu@faraday-tech.com> Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-06-24usb/hcd-ehci: Split off instance_init from realizeAndreas Färber1-12/+16
This makes the mem MemoryRegion available to derived instance_inits. Keep the bus in realize for now since naming breaks in instance_init. Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-06-24usb/hcd-ehci-sysbus: Convert to QOM realizeAndreas Färber1-1/+1
The SysBus qdev initfn merely calls SysBusDeviceClass::init, so we can replace it with a realizefn already. This avoids getting into any initfn ambiguity with the upcoming Faraday EHCI implementation. Rename internal usb_ehci_initfn() to usb_ehci_realize() to allow to return Errors from common initialization code as well. Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-06-20dma: eliminate DMAContextPaolo Bonzini1-6/+6
The DMAContext is a simple pointer to an AddressSpace that is now always already available. Make everyone hold the address space directly, and clean up the DMA API to use the AddressSpace directly. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-04-23ehci_free_packet: Discard finished packets when the queue is haltedHans de Goede1-5/+11
With pipelining it is possible to encounter a finished packet when cleaning the queue due to a halt. This happens when a non stall error happens while talking to a real device. In this case the queue on the usb-host side will continue processing packets, and we can have completed packets waiting in the queue after an error condition packet causing a halt. There are 2 reasons to discard the completed packets at this point, rather then trying to writing them back to the guest: 1) The guest expect to be able to cancel and/or change packets after the packet with the error without doing an unlink, so writing them back may confuse the guest. 2) Since the queue does not advance when halted, the writing back of these packets will fail anyways since p->qtdaddr != q->qtdaddr, so the ehci_verify_qtd call in ehci_writeback_async_complete_packet will fail. Note that 2) means that then only functional change this patch introduces is the printing of a warning when this scenario happens. Note that discarding these packets means that the guest driver and the device will get out of sync! This is unfortunate, but should not be a problem since with a non stall error (iow an io-error) the 2 are out of sync already anyways. Still this patch adds a warning to signal this happening. Note that sofar this has only been seen with a DVB-T receiver, which gives of a MPEG-2 stream, which allows for recovering from lost packets, see: https://bugzilla.redhat.com/show_bug.cgi?id=890320 Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-02-19usb-core: usb3 streamsGerd Hoffmann1-3/+4
This patch adds support for usb3 streams to the usb subsystem core. This is just adding a streams field / parameter in a number of places. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-01-14ehci: Assert state machine is sane w.r.t. EHCIQueueMarkus Armbruster1-0/+4
Coverity worries the EHCIQueue pointer could be null when we pass it to functions that reference it. The state machine ensures it can't be null then. Assert that, to hush the checker. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-01-07usb: Add an usb_device_ep_stopped USBDevice methodHans de Goede1-1/+18
Some usb devices (host or network redirection) can benefit from knowing when the guest stops using an endpoint. Redirection may involve submitting packets independently from the guest (in combination with a fifo buffer between the redirection code and the guest), to ensure that buffers of the real usb device are timely emptied. This is done for example for isoc traffic and for interrupt input endpoints. But when the (re)submission of packets is done by the device code, then how does it know when to stop this? For isoc endpoints this is handled by detecting a set interface (change alt setting) command, which works well for isoc endpoints. But for interrupt endpoints currently the redirection code never stops receiving data from the device, which is less then ideal. However the controller emulation is aware when a guest looses interest, as then the qh for the endpoint gets unlinked (ehci, ohci, uhci) or the endpoint is explicitly stopped (xhci). This patch adds a new ep_stopped USBDevice method and modifies the hcd code to call this on queue unlink / ep stop. This makes it possible for the redirection code to properly stop receiving interrupt input (*) data when the guest no longer has interest in it. *) And in the future also buffered bulk input. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-01-07ehci: Don't call commit_irq after raising PCDHans de Goede1-2/+0
ehci_raise_irq(s, USBSTS_PCD), gets applied immediately so there is no need to call commit_irq after it. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-01-07ehci: Further speedup rescanning if async schedule after raising an interruptHans de Goede1-1/+4
I tried lowering the time between raising an interrupt and rescanning the async schedule to see if the guest has queued a new transfer before, but that did not have any positive effect. I now believe the cause for this is that lowering this time made it more likely to hit the 1 ms interrupt threshold penalty for the next packet, as described in my "ehci: Use uframe precision for interrupt threshold checking" commit. Now that we do interrupt threshold handling with uframe precision, futher lowering this time from .5 to .25 ms gives an extra 15% improvement in speed (MB/s) reading from a simple USB-2.0 thumb-drive. While at it also properly set the int_req_by_async flag for short packet completions. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-01-07ehci: Use uframe precision for interrupt threshold checking (v2)Hans de Goede1-23/+47
Before this patch, the following could happen: 1) Transfer completes, raises interrupt 2) .5 ms later we check if the guest has queued up any new transfers 3) We find and execute a new transfer 4) .2 ms later the new transfer completes 5) We re-run our frame_timer to write back the completion, but less then 1 ms has passed since our last run, so frindex is not changed, so the interrupt threshold code delays the interrupt 6) 1 ms from the re-run our frame-timer runs again and finally delivers the interrupt This leads to unnecessary large delays of interrupts, this code fixes this by changing frindex to uframe precision and using that for interrupt threshold control, making the interrupt fire at step 5 for guest which have low interrupt threshold settings (like Linux). Note that the guest still sees the frindex move in steps of 8 for migration compatibility. This boosts Linux read speed of a simple cheap USB thumb drive by 6 %. Changes in v2: -Make the guest see frindex move in steps of 8 by modifying ehci_opreg_read, rather then using a shadow variable Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-01-07ehci: Verify a queue's ep direction does not changeHans de Goede1-0/+19
ehci_fill_queue assumes that there is a one on one relationship between an ep and a qh, this patch adds a check to ensure this. Note I don't expect this to ever trigger, this is just something I noticed the guest might do while working on other stuff. The only way this check can trigger is if a guest mixes in and out qtd-s in a single qh for a non control ep. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-01-07ehci: Add an ehci_get_pid helper functionHans de Goede1-16/+16
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-01-07ehci: Verify qtd for async completed packetsHans de Goede1-14/+1
Remove the short-circuiting of fetchqtd in fetchqh, so that the qtd gets properly verified before completing the transaction. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-01-07ehci: writeback_async_complete_packet: verify qh and qtdHans de Goede1-0/+14
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-01-07ehci: Move get / put_dwords upwardsHans de Goede1-42/+42
No other changes. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-01-07ehci: Verify guest does not change the token of inflight qtd-sHans de Goede1-6/+4
This is not allowed, except for clearing active on cancellation, so don't warn when the new token does not have its active bit set. This unifies the cancellation path for modified qtd-s, and prepares ehci_verify_qtd to be used ad an extra check inside ehci_writeback_async_complete_packet(). Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-01-07ehci: Add ehci_verify_qh and ehci_verify_qtd helper functionsHans de Goede1-16/+35
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-01-07ehci: Add a ehci_writeback_async_complete_packet helper functionHans de Goede1-11/+17
Also drop the warning printf, which was there mainly because this was an untested code path (as the previous bug fixes to it show), but that no longer is the case now :) Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-12-04ehci: Lower timer freq when the periodic schedule is idleHans de Goede1-6/+33
Lower the timer freq if no iso schedule packets complete for 64 frames in a row. We can safely do this, without adding latency, because: 1) If there is isoc traffic this will never trigger 2) For async handled interrupt packets (only usb-host), the completion handler will immediately schedule the frame_timer from a bh 3) All devices using NAK to signal no data for interrupt endpoints now use wakeup, which will immediately schedule the frame_timer from a bh The advantage of this is that when we only have interrupt packets in the periodic schedule, async_stepdown can do its work and significantly lower the frequency at which the frame_timer runs. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-11-16ehci: handle dma errorsGerd Hoffmann1-19/+44
Starting with commit 1c380f9460522f32c8dd2577b2a53d518ec91c6d dma transfers can actually fail. This patch makes ehci keep track of the busmaster bit in pci config space, by setting/clearing the dma_context pointer. Attempts to dma without context will result in raising HSE (Host System Error) interrupt and stopping the host controller. This patch fixes WinXP not booting with a usb stick attached to ehci. Root cause is seabios activating ehci so you can boot from the stick, and WinXP clearing the busmaster bit before resetting the host controller, leading to ehci actually trying dma while it is disabled. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-11-16ehci: keep the frame timer running in case the guest asked for frame list ↵Gerd Hoffmann1-0/+7
rollover interrupts Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-11-16ehci: Don't verify the next pointer for periodic qh-s and qtd-sHans de Goede1-3/+6
While testing the move to async packet handling for interrupt endpoints I noticed that Windows-XP likes to play tricks with the next pointer for periodic qh-s, so we should not fail qh / qtd verification when it changes. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-11-16ehci: Better detection for qtd-s linked in circlesHans de Goede1-3/+6
Windows links interrupt qtd-s in circles, which means that when interrupt endpoints return USB_RET_ASYNC, combined with the recent "ehci: Retry to fill the queue while waiting for td completion" patch, we keep adding the tds to the queue over and over again, as we detect the circle from fill_queue, but we call it over and over again ... This patch fixes this by changing the circle detection to also detect circling into tds already queued up previously. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-11-16ehci: Fixup q->qtdaddr after cancelling an already completed packetHans de Goede1-0/+4
This avoids the q->qtdaddr == p->qtdaddr asserts we have triggering, when a queue contains multiple completed packages when we cancel the queue. I triggered this with windows7 + async interrupt endpoint handling (*) + not detecting circles in ehci_fill_queue() properly, which makes the qtd validation in ehci_fill_queue fail, causing cancellation of the queue on every mouse event ... *) Which is not going upstream as it will cause loss of interrupt events on migration. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-11-16ehci: Don't access packet after freeing itHans de Goede1-4/+5
ehci_state_writeback() will free the packet, so we should not access the packet after calling ehci_state_writeback(). Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-11-08ehci: Add support for packets with both data and an error statusHans de Goede1-84/+77
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-11-08ehci: Get rid of the magical PROC_ERR statusHans de Goede1-31/+24
Instead make ehci_execute and ehci_fill_queue return the again value. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-11-08usb: split packet result into actual_length + statusHans de Goede1-10/+16
Since with the ehci and xhci controllers a single packet can be larger then maxpacketsize, it is possible for the result of a single packet to be both having transferred some data as well as the transfer to have an error. An example would be an input transfer from a bulk endpoint successfully receiving 1 or more maxpacketsize packets from the device, followed by a packet signalling halt. While already touching all the devices and controllers handle_packet / handle_data / handle_control code, also change the return type of these functions to void, solely storing the status in the packet. To make the code paths for regular versus async packet handling more uniform. This patch unfortunately is somewhat invasive, since makeing the qemu usb core deal with this requires changes everywhere. This patch only prepares the usb core for this, all the hcd / device changes are done in such a way that there are no functional changes. This patch has been tested with uhci and ehci hcds, together with usb-audio, usb-hid and usb-storage devices, as well as with usb-redir redirection with a wide variety of real devices. Note that there is usually no need to directly set packet->actual_length form devices handle_data callback, as that is done by usb_packet_copy() Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-11-01usb/ehci: split into multiple source filesGerd Hoffmann1-423/+3
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-11-01usb/ehci: Guard definition of EHCI_DEBUGPeter Crosthwaite1-0/+2
Guard against re-definition of EHCI_DEBUG. Allows for turning on of debug info from configure (using --qemu-extra-cflags="-DEHCI_DEBUG=1") rather than source code hacking. Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-11-01usb/ehci: seperate out PCIismsPeter Crosthwaite1-52/+72
Seperate the PCI stuff from the EHCI components. Extracted the PCIDevice out into a new wrapper struct to make EHCIState non-PCI-specific. Seperated tho non PCI init component out into a seperate "common" init function. Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-11-01usb/ehci: Abstract away PCI DMA APIPeter Crosthwaite1-5/+8
Pull the DMAContext for the PCI DMA out at device init time and put it into the device state. Use dma_memory_read/write() instead of pci specific versions. Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-11-01usb/ehci: parameterise the register region offsetsPeter Crosthwaite1-32/+36
The capabilities register and operational register offsets can vary from one EHCI implementation to the next. Parameterise accordingly. Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-10-25usb: Enforce iso endpoints never returing USB_RET_ASYNCHans de Goede1-1/+0
ehci was already testing for this, and we depend in various places on no devices doing this, so lets move the check for this to the usb core. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-10-25usb: Add an int_req flag to USBPacketHans de Goede1-2/+4
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-10-25usb: Move short-not-ok handling to the coreHans de Goede1-5/+4
After a short-not-ok packet ending short, we should not advance the queue. Move enforcing this to the core, rather then handling it in the hcd code. This may result in the queue now actually containing multiple input packets (which would not happen before), and this requires special handling in combination with pipelining, so disable pipleining for input endpoints (for now). Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-10-25usb: Move clearing of queue on halt to the coreHans de Goede1-14/+8
hcds which queue up more then one packet at once (uhci, ehci and xhci), must clear the queue after an error which has caused the queue to halt. Currently this is handled as a special case inside the hcd code, this patch instead adds an USB_RET_REMOVE_FROM_QUEUE packet result code, teaches the 3 hcds about this and moves the clearing of the queue on a halt into the USB core. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-10-25usb: Add USB_RET_ADD_TO_QUEUE packet result codeHans de Goede1-0/+4
This can be used by usb-device code which wishes to process an entire endpoint queue at once, to do this the usb-device code returns USB_RET_ADD_TO_QUEUE from its handle_data class method and defines a flush_ep_queue class method to call when the hcd is done queuing up packets. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-10-25ehci: Retry to fill the queue while waiting for td completionHans de Goede1-5/+6
If the guest is using multiple transfers to try and keep the usb bus busy / used at maximum efficiency, currently we would see / do the following: 1) submit transfer 1 to the device 2) submit transfer 2 to the device 3) report transfer 1 completion to guest 4) report transfer 2 completion to guest 5) submit transfer 1 to the device 6) report transfer 1 completion to guest 7) submit transfer 2 to the device 8) report transfer 2 completion to guest etc. So after the initial submission we would effectively only have 1 transfer in flight, rather then 2. This is caused by us not checking the queue for addition of new transfers by the guest (ie the resubmission of a recently finished transfer), while waiting for a pending transfer to complete. This patch does add a check for this, changing the sequence to: 1) submit transfer 1 to the device 2) submit transfer 2 to the device 3) report transfer 1 completion to guest 4) submit transfer 1 to the device 5) report transfer 2 completion to guest 6) submit transfer 2 to the device etc. Thus keeping 2 transfers in flight (most of the time, and always 1), as intended by the guest. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-10-25ehci: Detect going in circles when filling the queueHans de Goede1-1/+8
For ctrl endpoints Windows (atleast Win7) creates circular td lists, so far these were not a problem because we would stop filling the queue if altnext was set. Since further patches in this patchset remove the altnext check this does become a problem and we need detection for going in circles. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-10-25ehci: Speed up the timer of raising int from the async scheduleHans de Goede1-1/+12
Often the guest will queue up new packets in response to a packet, in the async schedule with its IOC flag set, completing. By speeding up the frame-timer, we notice these new packets earlier. This increases the speed (MB/s) of a Linux guest reading from a USB mass storage device by a factor of 1.15 on top of the "Improve latency of interrupt delivery" speed-ups, both with and without input pipelining enabled. I've not tested the speed-up of this patch without the "Improve latency of interrupt delivery" patch. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-10-25ehci: Improve latency of interrupt delivery and async schedule scanningHans de Goede1-8/+2
While doing various performance tests of reading from USB mass storage devices I noticed the following:: 1) When an async handled packet completes, we don't immediately report an interrupt to the guest, instead we wait for the frame-timer to run and report it from there 2) If 1) has been fixed and an async handled packet takes a while to complete, then async_stepdown will become a high value, which means that there will be a large latency before any new packets queued by the guest in response to the interrupt get seen 1) was done deliberately as part of commit f0ad01f92: http://www.kraxel.org/cgit/qemu/commit/?h=usb.57&id=f0ad01f92ca02eee7cadbfd225c5de753ebd5fce Since setting the interrupt immediately on async packet completion was causing issues with Linux guests, I believe this recently fixed Linux bug explains why this is happening: http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commitdiff;h=361aabf395e4a23cf554cf4ec0c0c6963b8beb01 Note that we can *not* count on this fix being present in all Linux guests! I was hoping that the recently added support for Interrupt Threshold Control would fix the issues with Linux guests, but adding a simple ehci_commit_irq() call to ehci_async_bh() still caused problems with Linux guests. The problem is, that when doing ehci_commit_irq() from ehci_async_bh(), the "old" frindex value is used to calculate usbsts_frindex, and when the frame-timer then runs possibly very shortly after ehci_async_bh(), it increases the frame-timer, and thus any interrupts raised from that frame-timer run, will also get reported to the guest immediately, rather then being delayed to the next frame-timer run. Luckily the solution for this is simple, this means that we need to increase frindex before calling ehci_commit_irq() from ehci_async_bh(), which in the end boils down to simple calling ehci_frame_timer() instead of ehci_async_bh() from the bh. This may seem like it causes a lot of extra work to be done, but this is not true. Any work done from the frame-timer processing the periodic schedule is work which then does not need to be done the next time the frame timer runs, also the frame-timer will re-arm itself at (possibly) a later time then it was armed for saving a vmexit at that time. As an additional advantage moving to simply calling the frame-timer also fixes 2) as the packet completion will set async_stepdown to 0, and the re-arming of the timer with an async_stepdown of 0 ensures that any newly queued up packets get seen in a reasonable amount of time. This improves the speed (MB/s) of a Linux guest reading from a USB mass storage device by a factor of 1.5 - 1.7 with input pipelining disabled, and by a factor of 1.8 with input pipelining enabled. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-10-25ehci: Set int flag on a short input packetHans de Goede1-0/+4
According to 4.15.1.2 an interrupt must be raised when a short packet is received. If we don't do this it may take a significant time for the guest to notice a short trasnfer has completed, since only the last td will have its IOC flag set, and a short transfer may complete in an earlier packet. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-10-25ehci: Get rid of packet tbytes fieldHans de Goede1-11/+9
This field is used in some places to track the tbytes field of the token, but in other places the field is used directly, use it directly everywhere for consistency. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-10-23Rename target_phys_addr_t to hwaddrAvi Kivity1-10/+10
target_phys_addr_t is unwieldly, violates the C standard (_t suffixes are reserved) and its purpose doesn't match the name (most target_phys_addr_t addresses are not target specific). Replace it with a finger-friendly, standards conformant hwaddr. Outstanding patchsets can be fixed up with the command git rebase -i --exec 'find -name "*.[ch]" | xargs s/target_phys_addr_t/hwaddr/g' origin Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>