Commit Graph

20540 Commits

Author SHA1 Message Date
Gerd Hoffmann 863b474163 ehci: remove unused attach_poll_counter
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-06-07 10:02:23 +02:00
Gerd Hoffmann daf25307b4 ehci: fix halt status handling
When the enable bits for controller / async schedule / periodic schedule
change just make sure we kick the frame timer and let
ehci_advance_periodic_state and ehci_advance_async_state handle the
controller state changes.

This will make ehci set USBSTS_HALT when the controller shutdown is
actually done, once both schedules are in inactive state and the
USBSTS_PSS and USBSTS_ASS bits are clear.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-06-07 10:02:23 +02:00
Gerd Hoffmann b53f685d63 ehci: update status bits in ehci_set_state
Update the status register in the ehci_set_state function, to make sure
the guest-visible register is in sync with our internal schedule state.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-06-07 10:02:23 +02:00
Gerd Hoffmann ec807d12bd ehci: add ehci_*_enabled() helpers
Add helper functions to query whenever the async / periodic schedule
is enabled or not.  Put them into use too.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-06-07 10:02:23 +02:00
Gerd Hoffmann 7046530c36 ehci: fix reset
Check for the reset bit first when processing USBCMD register writes.
Also break out of the switch, there is no need to check the other bits.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-06-07 10:02:22 +02:00
Gerd Hoffmann 0f588df8b3 ehci: kick async schedule on wakeup
Kick async schedule when we get a wakeup
notification from a usb device.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-06-07 10:02:22 +02:00
Gerd Hoffmann ae710b9905 ehci: schedule async bh on async packet completion
When a packet completes which happens to be part of the async schedule
kick the async bottom half for processing,

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-06-07 10:02:22 +02:00
Gerd Hoffmann 0fb3e299bd ehci: move async schedule to bottom half
This way we can kick the async schedule independant from the
periodic frame timer.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-06-07 10:02:22 +02:00
Gerd Hoffmann ae0138a8ea ehci: add async field to EHCIQueue
Keep track whenever a EHCIQueue is part of the async or periodic
schedule.  This way we don't have to pass around the async flag
everywhere but can look it up from the EHCIQueue struct when needed.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-06-07 10:02:22 +02:00
Gerd Hoffmann 8f6d5e26b1 ehci: tweak queue initialization
Little tweak for the queue initialization, set the QH address in the
allocation function.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-06-07 10:02:22 +02:00
Gerd Hoffmann 773dc9cdfd ehci: add queuing support
Add packet queuing.  Follow the qTD chain to see if there are more
packets we can submit.  Improves performance on larger transfers,
especially with usb-host, as we don't have to wait for a packet to
finish before sending the next one to the host for processing.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-06-07 10:02:22 +02:00
Gerd Hoffmann cd6657156e ehci: move ehci_flush_qh
Move ehci_flush_qh() function up in the source code.
No code change.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-06-07 10:02:22 +02:00
Gerd Hoffmann e59928b3d1 ehci: cache USBDevice in EHCIQueue
Keep a USBDevice pointer in EHCIQueue so we don't have to lookup the
device on each usb packet submission.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-06-07 10:02:22 +02:00
Gerd Hoffmann 4224558f87 ehci: make ehci_execute work on EHCIPacket instead of EHCIQueue
This way it is possible to use ehci_execute to submit others than the
first EHCIPacket of the EHCIQueue.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-06-07 10:02:22 +02:00
Gerd Hoffmann eb36a88e6b ehci: add EHCIPacket
Add a separate EHCIPacket struct and move fields over from EHCIQueue.
Preparing for supporting multiple packets per queue being in flight at
the same time.  No functional changes yet.

Fix some codestyle issues along the way.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-06-07 10:02:22 +02:00
Gerd Hoffmann 348f10374a xhci: trace: slots
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-06-07 10:02:22 +02:00
Gerd Hoffmann 97df650bb9 xhci: trace: transfers
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-06-07 10:02:22 +02:00
Gerd Hoffmann c1f6b49326 xhci: trace: endpoints
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-06-07 10:02:22 +02:00
Gerd Hoffmann 0703a4a7a6 xhci: trace: ring fetch
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-06-07 10:02:22 +02:00
Gerd Hoffmann 7acd279f83 xhci: trace: irq + events
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-06-07 10:02:21 +02:00
Gerd Hoffmann fc0ddaca33 xhci: trace: run+stop
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-06-07 10:02:21 +02:00
Gerd Hoffmann 2d754a10e4 xhci: trace: mmio reads+writes
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-06-07 10:02:21 +02:00
Jan Kiszka 64619739c4 xhci: Clean up reset function
Properly register reset function via the device class.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-06-07 10:02:21 +02:00
Gerd Hoffmann 5de88b1d46 usb-storage: migration support
With all scsi migration support bits in place the
final step is pretty simple ;)

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-06-07 10:02:21 +02:00
Gerd Hoffmann 1dc903673a usb-storage: add scsi_off, remove scsi_buf
Repace the running buffer pointer (scsi_buf) with a buffer offset
field (scsi_off).  The later is alot easier to live-migrate.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-06-07 10:02:21 +02:00
Gerd Hoffmann 1e6ed80b90 usb-storage: add usb_msd_packet_complete()
Factor out packet completion to a separate function which
cares to get the MSDState->packet update right.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-06-07 10:02:21 +02:00
Gerd Hoffmann 0659879e6e usb-storage: remove MSDState->residue
We have the field twice, once in MSDState directly and one in the status
word struct.  Drop one.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-06-07 10:02:21 +02:00
Gerd Hoffmann 18eef3bc4e scsi: prepare migration code for usb-storage support
usb-storage can't handle requests in one go as the data transfer can be
splitted into lots of usb packets.  Because of that there can be
normal in-flight requests at savevm time and we need to handle that.
With other scsi hba's this happens only in case i/o is stopped due to
errors and there are pending requests which need to be restarted
(req->retry = true).

So, first we need to save req->retry and then handle the req->retry =
false case.  Write requests are handled fine already.  For read requests
we have to save the buffer as we will not restart the request (and thus
not refill the buffer) on the target host.

Cc: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-06-07 10:02:21 +02:00
Gerd Hoffmann 973002c114 uhci: fix irq routing
The multifunction ich9 ehci controller with uhci companions uses a
different interrupt pin for each function.  The three uhci devices
get pins A, B and C, whereas ehci uses pin D.  This way the guest
can assign different IRQ lines to each controller.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-06-07 10:02:20 +02:00
Gerd Hoffmann 5852d3bfe1 uhci: zap uhci_pre_save
Cancel transactions before saving vmstate is pretty pointless and just
causes disruptions.  We need to cancel them before *loading* vmstate,
but in that case uhci_reset() handles it already and no special action
is needed.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-06-07 10:02:20 +02:00
Gerd Hoffmann 7dd0dfd7f7 uhci: fix trace format strings
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-06-07 10:02:20 +02:00
Gerd Hoffmann 40141d12de uhci: make bandwidth tunable
Add a property for the uhci bandwidth.  Can be used to make uhci
emulation run faster than real hardware.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-06-07 10:02:20 +02:00
Gerd Hoffmann 9a16c5950d uhci: use bottom half
Schedule bottom half on completion of async packets instead of calling
uhci_process_frame directly.  This way we run uhci_process_frame only
once in case multiple packets finish in a row.  Also check whenever
there is bandwidth left before scheduling uhci_process_frame.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-06-07 10:02:20 +02:00
Gerd Hoffmann 4aed20e2d7 uhci: fix bandwidth management
uhci_process_frame() can be invoked multiple times per frame, so
accounting usb bandwith in a local variable doesn't fly, use a variable
in UHCIState instead.  Also check the limit more frequently.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-06-07 10:02:20 +02:00
Paolo Bonzini 2dee8d54c6 build: do not create directories at configure time
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-06-07 09:21:20 +02:00
Anthony Liguori ec5b06d717 configure: ensure directory exists when creating symlink
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-06-07 09:21:19 +02:00
Paolo Bonzini 25f27a4f71 build: compile oslib-obj-y once
There is no difference in oslib-obj-y between user-mode and system
targets.  There used to be when user-mode could optionally be
compiled with PIE.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-06-07 09:21:19 +02:00
Paolo Bonzini fec90ff0bd build: limit usage of vpath
All paths are now explicitly given, and the object tree mimics
the source tree, so there is no need to apply special vpaths.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-06-07 09:21:18 +02:00
Paolo Bonzini 00c705fb92 build: libcacard Makefile cleanups
Build vscclient from toplevel Makefile, limit usage of vpath.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-06-07 09:21:18 +02:00
Paolo Bonzini 49ac9e0a8c build: move device tree to per-target Makefile.objs
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-06-07 09:21:18 +02:00
Paolo Bonzini c353f26194 build: move per-target hw/ objects to nested Makefile.objs
This completes the move to nested Makefiles for virtio and a few
other files that were not part of obj-TARGET-y, but still were
compiled separately for each target.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-06-07 09:21:17 +02:00
Paolo Bonzini be1029ec30 build: convert libhw to nested Makefile.objs
After this patch, the libhw* directories will have a hierarchy
that mimics the source tree.  This is useful because we do have
a couple of files there that are in the top source directory.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-06-07 09:21:17 +02:00
Paolo Bonzini 3d5a3f9a7f build: move target-independent hw/ objects to nested Makefile.objs
This patch starts converting the hw/ directory.  Some files in hw/
are compiled once, some twice (32-/64-bit), some once per target.
Each category is moved in a separate patch.

After this patch, the files that are compiled once will show the
same hierarchy in the build tree as they do in the source tree,
for example hw/qdev.o instead of just qdev.o.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-06-07 09:21:16 +02:00
Paolo Bonzini 4eb7ba8aff build: move qga/ objects to nested Makefile.objs
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-06-07 09:21:16 +02:00
Paolo Bonzini dd5614d6f1 build: move qapi/ objects to nested Makefile.objs
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-06-07 09:21:15 +02:00
Paolo Bonzini 4c69605472 build: move slirp/ objects to nested Makefile.objs
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-06-07 09:21:15 +02:00
Paolo Bonzini b0b68fc671 build: move audio/ objects to nested Makefile.objs
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-06-07 09:21:14 +02:00
Paolo Bonzini 8867aef02e build: move ui/ objects to nested Makefile.objs
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-06-07 09:21:14 +02:00
Paolo Bonzini ee20477d24 build: move fsdev/ objects to nested Makefile.objs
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-06-07 09:21:13 +02:00
Paolo Bonzini d8469de6c1 build: move net/ objects to nested Makefile.objs
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-06-07 09:21:13 +02:00