dma: keep a device alive while it has SGLists
Reviewed-by: Anthony Liguori <aliguori@redhat.com>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
usb: add serial bus property
This patch adds a serial property for all usb devices, which can beused to set the serial number of a usb device (as listed by lsusb -v)to a specific value. Applies to emulated devices only.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
usb-host-libusb: set USB_DEV_FLAG_IS_HOST
... like host-{linux,bsd}.c do.
Cc: qemu-stable@nongnu.orgSigned-off-by: Gerd Hoffmann <kraxel@redhat.com>
usb/hcd-ehci: Replace PORTSC macros with variables
Replace PORTSC macros with variables which could then beconfigured 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>
usb/hcd-ehci: Add Faraday FUSBH200 support
Add Faraday FUSBH200 support, which is slightly different from EHCI spec.(Or maybe simply a bad/wrong implementation...)
Signed-off-by: Kuo-Jung Su <dantesu@faraday-tech.com>Signed-off-by: Andreas Färber <afaerber@suse.de>...
usb/host-libusb: Fix building with libusb git master code
The next libusb release will deprecate libusb_get_port_path, and sincewe compile with -Werror, this breaks the build.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
usb/hcd-ehci-sysbus: Convert to QOM realize
The SysBus qdev initfn merely calls SysBusDeviceClass::init, so we canreplace it with a realizefn already. This avoids getting into any initfnambiguity with the upcoming Faraday EHCI implementation.
Rename internal usb_ehci_initfn() to usb_ehci_realize() to allow to...
usb/hcd-ehci: Split off instance_init from realize
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>
usb/hcd-ehci: Add Tegra2 SysBus EHCI device
This prepares an EHCI device for the Nvidia Tegra2 SoC family.Values based on patch by Vincent Palatin and verified against TRM v01p.
Cc: Vincent Palatin <vpalatin@chromium.org>Signed-off-by: Andreas Färber <andreas.faerber@web.de>...
dma: eliminate DMAContext
The DMAContext is a simple pointer to an AddressSpace that is now alwaysalready 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>...
xhci: add live migration support
With all preparing pieces in place we can finally drop inthe vmstate structs and the postload function.
xhci: add XHCISlot->addressed
Preparing for live-migration support, post_load will need that.
xhci: add xhci_alloc_epctx
Factor out endpoint context allocation to a separate function.xhci live migration will need that too, in post_load.
xhci: add xhci_init_epctx
Factor out endpoint context initialization to a separate function.xhci live migration will need that too, in post_load.
Fix usage of USB_DEV_FLAG_IS_HOST flag.
USB_DEV_FLAG_IS_HOST is the bit number, not value. Booting with a"Fitbit Base Station" USB dongle was triggering this assert.
Signed-off-by: Michael Marineau <mike@marineau.org>Cc: qemu-stable@nongnu.orgSigned-off-by: Gerd Hoffmann <kraxel@redhat.com>
host-libusb: Correct test for USB packet state
USB_RET_ASYNC is -6, so inflight was always false.
Signed-off-by: Ed Maste <emaste@freebsd.org>Cc: qemu-stable@nongnu.orgSigned-off-by: Gerd Hoffmann <kraxel@redhat.com>
remove double semicolons
Signed-off-by: Dong Xu Wang <wdongxu@linux.vnet.ibm.com>Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
uhci: Use an intermediate buffer for usb packet data
Due to various unfortunate reasons we cannot reliable detect a guestcancelling a packet as soon as it happens, instead we detect cancelswith some delay.
When packets are handled async, and we directly pass the guest memory for...
xhci: handle USB_RET_BABBLE
usb-host: add usb_host_full_speed_compat
Alloes to pass through usb2 devices on usb1 host controllers if possible.Brings the libusb implementation to feature-parity with the linux usbfscode, so the usb-host implementation in 1.5 (libusb) doesn't regress...
usb-host: live migration support for the libusb version
scsi: add bus_name parameter to scsi_bus_new.
This adds the possibility to create a scsi-bus with a specified name.
Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>Acked-by: Paolo Bonzini <pbonzini@redhat.com>Tested-by: Cornelia Huck <cornelia.huck@de.ibm.com>...
audio: remove the need for audio card CONFIG_* symbols
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Message-id: 1366303444-24620-3-git-send-email-pbonzini@redhat.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
ccid: Fix crash when backend isn't specified
Reproducer:
./x86_64-softmmu/qemu-system-x86_64 -device usb-ccid,id=ccid0 -usb -device ccid-card-emulated -monitor stdio
Signed-off-by: Cole Robinson <crobinso@redhat.com>Reviewed-by: Alon Levy <alevy@redhat.com>
dev-smartcard-reader: empty implementation for Mechanical (fail correctly)
Signed-off-by: Alon Levy <alevy@redhat.com>Reviewed-by: Marc-André Lureau <mlureau@redhat.com>
dev-smartcard-reader: copy atr protocol to ccid parameters
Adds todos.
dev-smartcard-reader: change default protocol to T=0
We don't support T=1 so we shouldn't advertise it by default.
dev-smartcard-reader: define structs for CCID_Parameter internals
ccid-card-passthru, dev-smartcard-reader: add debug environment variables
Introduces a new utility function: parse_debug_env to avoid codeduplication.
This overrides whatever debug value is set on the corresponding devicesfrom the command line, and is meant to ease the usage with any...
ccid-card-passthru: add atr check
dev-smartcard-reader: reuse usb.h definitions
dev-smartcard-reader: support windows guest
By not advertising USB wakeup support (which we don't).
dev-smartcard-reader: remove aborts (never triggered, but just in case)
dev-smartcard-reader: nicer debug messages
dev-smartcard-reader: white space fixes
ccid: declare DEFAULT_ATR table to be "static const"
Signed-off-by: Jim Meyering <meyering@redhat.com>Reviewed-by: Alon Levy <alevy@redhat.com>Reviewed-by: Marc-André Lureau <mlureau@redhat.com>
ccid: make backend_enum_table "static const" and adjust users
ccid-card-emul: do not crash if backend is not provided
Program received signal SIGSEGV, Segmentation fault.__strcmp_sse42 () at ../sysdeps/x86_64/multiarch/strcmp-sse42.S:164164 movdqu (%rsi), %xmm2(gdb) bt at /home/elmarco/320g/src/qemu/hw/ccid-card-emulated.c:477...
xhci: remove XHCIRing->base (unused)
ehci_free_packet: Discard finished packets when the queue is halted
With pipelining it is possible to encounter a finished packet when cleaningthe queue due to a halt. This happens when a non stall error happens whiletalking to a real device. In this case the queue on the usb-host side will...
usb: better speed mismatch error reporting
Report the supported speeds for device and port in the error message.Also add the speeds to the tracepoint. And while being at it dropthe redundant error message in usb_desc_attach, usb_device_attach willreport the error anyway....
usb-host: raise libusbx minimum version to 1.0.13
Allows to remove one FIXME. Makes LIBUSB_LOG_LEVEL_WARNING build errorsgo away. And starting with that version libusb has a LIBUSBX_API_VERSIONdefine which allows to easily #ifdef version dependencies should that...
xhci: use slotid as device address
Is good enougth for unique device addresses and avoids the need for anystate for device addressing. Makes live migration support easier. Alsomakes device->slot lookups trivial.
xhci: fix address device
Zero-initialize the set-address dummy USBPacket,also add buffer to avoid sanity checks triggering.
https://bugzilla.redhat.com/show_bug.cgi?id=929019
use libusb for usb-host
Reimplement usb-host on top of libusb.Reasons to do this:
(1) Largely rewritten from scratch, nice opportunity to kill historical cruft. (2) Offload usbfs handling to libusb. (3) Have a single portable code base instead of bsd + linux variants....
usb-serial: Remove double call to qemu_chr_add_handlers( NULL )
usb-serial has a qdev chardev property, and hw/qdev-properties-system.calready contains:
static void release_chr(Object *obj, const char *name, void *opaque) { DeviceState *dev = DEVICE;...
xhci: remove leftover debug printf
xhci: add xhci_cap_write
xhci: fix portsc writes
Check for port reset first and skip everything else then.Add sanity checks for PLS updates.Add PLC notification when entering PLS_U0 state.
This gets host-initiated port resume going on win8.
include: avoid useless includes of exec/ headers
Headers in include/exec/ are for the deepest innards of QEMU,they should almost never be included directly.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
sysemu: avoid proliferation of include/ subdirectories
Merge remote-tracking branch 'bonzini/hw-dirs' into staging
hw: move private headers to hw/ subdirectories.
Many headers are used only in a single directory. These can bekept in hw/.
hw: move target-independent files to subdirectories
This patch tackles all files that are compiled once, movingthem to subdirectories of hw/.
hw: make all of hw/usb/ configurable via default-configs/
hw: move headers to include/
Many of these should be cleaned up with proper qdev-/QOM-ification.Right now there are many catch-all headers in include/hw/ARCH dependingon cpu.h, and this makes it necessary to compile these files per-target.However, fixing this does not belong in these patches....
Merge remote-tracking branch 'kraxel/usb.79' into staging
usb-storage: Forward serial number to scsi-disk
usb-storage takes care to fetch the USB serial number from -driveoptions, but it neglected to pass its own 'serial' property to thescsi-disk it creates. With this patch, the 'serial' qdev property andthe 'serial' option in -drive behave the same and correctly apply the...
usb-hub: limit chain length
USB supports up to 5 hubs chained.Catch attempts to chain more.
usb-hub: report status changes only once
usb-tablet: Don't claim wakeup capability for USB-2 version
Our ehci code does not implement wakeup support, so claiming support forit with usb-tablet in USB-2 mode causes all tablet events to get lost.
http://bugzilla.redhat.com/show_bug.cgi?id=929068...
xhci: zap unused name field
xhci: fix numintrs sanity checks
Make sure numintrs is a power of two, msi requires this.
https://bugzilla.redhat.com/show_bug.cgi?id=918035
xhci: remove unimplemented printfs
Replace them with a tracepoint, so they don't spam stderr by default.
usb-redir: Fix crash on migration with no client connected
If no client is connected on the src side, then we won't receive aparser during migrate, in this case usbredir_post_load() should be a nop,rather then to try to derefefence the NULL dev->parser pointer....
usb-redir: Add flow control support
qemu-char: Automatically do fe_open / fe_close on qemu_chr_add_handlers
Most frontends can't really determine if the guest actually has the frontendside open. So lets automatically generate fe_open / fe_close as soon as afrontend becomes ready (as signalled by calling qemu_chr_add_handlers) /...
qemu-char: Rename opened to be_open
Rename the opened variable to be_open to reflect that it contains theopened state of the backend.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>Message-id: 1364292483-16564-2-git-send-email-hdegoede@redhat.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
pcie: Add endpoint capability initialization wrapper
Fix the awkward API of mangling the caller specified PCIe type andjust provide an interface to initialize an endpoint device. Thiswill pick either a regular endpoint or integrated endpoint based onthe bus and return pcie_cap_init to doing exactly what is asked....
hw: move qdev-monitor.o to toplevel directory
qdev-monitor.c is the only "core qdev" file that is not used inuser-mode emulation, and it does not define anything that is usedby hardware models. Remove it from the hw/ directory andremove hw/qdev-monitor.h from hw/qdev.h too; this requires...
xhci: fix bad print specifier
This fixes the following compilation error:hw/usb/hcd-xhci.c:1156:17: error: format ‘%llx’ expects argument of type‘long long unsigned int’, but argument 4 has type ‘unsigned int’
Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>...
unbreak hw/usb/redirect.c build
Commit 8550a02d1239415342959f6a32d178bc05c557cc added a streamsparameter to usb_wakeup and didn't update redirect.c. Fix it.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
uas-uas: usb3 streams
Add usb3 streams support to the uas (usb attached scsi) emulation.
usb-xhci: usb3 streams
Add streams support to the xhci emulation. No secondary streams yet,only linear stream arays are supported for now.
usb-host: move legacy cmd line bits
The code handling the "-usbdevice host:..." legacy command linesyntax is moved to the new hw/usb/host-legacy.c file.
usb-host: remove usb_host_device_close
Nobody implements that anyway.
usb: add usb_ep_set_halted
usb: make usb_packet_copy operate on combined packets
Likewise usb_packet_skip.Also usb_packet_size.
usb-redir: simplify packet copy
usb_packet_copy can handle combined packets now,so it isn't needed to special-case them any more.
Also use the new usb_packet_size() function.
usb: fix endpoint descriptor ordering
Fix the ordering of the endpoint descriptors for superspeed endpoints:The superspeed companion must come first, possible additionaldescriptors for the endpoint after that.
usb-core: usb3 streams
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.
allow disabling usb smartcard support
usb-storage: use scsi_req_enqueue return value
make usb devices configurable
Leave the core usb devices (usb hub, tablet, mouse, keyboard)enabled unconditionally. Make the other ones configurable.
Exceptions: - bluetooth: not qdevified yet, has a vl.c dependency because of that, thus disabling isn't as easy as not linking the...
usb: Makefile cleanup
Group files, sprinkle in some comments.
net: intorduce qemu_del_nic()
To support multiqueue nic, this patch separate the nic destructor fromqemu_del_net_client() to a new helper qemu_del_nic() since the mapping bettweenNiCState and NetClientState were not 1:1 in multiqueue. The following patches...
net: introduce qemu_get_nic()
To support multiqueue, this patch introduces a helper qemu_get_nic() to getNICState from a NetClientState. The following patches would refactor this helperto support multiqueue.
Signed-off-by: Jason Wang <jasowang@redhat.com>...
net: introduce qemu_get_queue()
To support multiqueue, the patch introduce a helper qemu_get_queue()which is used to get the NetClientState of a device. The following patches wouldrefactor this helper to support multiqueue.
ohci: add missing break
usb: add usb-bot device (scsi bulk-only transport).
Basically the same as usb-storage, but without automatic scsidevice setup. Also features support for up to 16 LUNs.
Revert "usb-storage: Drop useless null test in usb_msd_handle_data()"
This reverts commit a1cbfd554e11bb8af38c2f3e1f1574bf4c563cd2.
Test isn't useless. scsi_req_enqueue() may finish the request (willactually happen for requests which don't trigger any I/O such as...
usb: Fix compilation for MinGW (regression)
84f2d0ea added an argument to function usb_host_info.The stub function must match the declaration in usb.h.
Signed-off-by: Stefan Weil <sw@weilnetz.de>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
HMP: add QDict to info callback handler
This patch change all info call back function to takeadditional QDict * parameter, which allow those commandtake parameter. Now it is set to NULL at default case.
Signed-off-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com>...
usb-storage: Drop useless null test in usb_msd_handle_data()
scsi_req_new() never returns null, and scsi_req_enqueue() dereferencesthe pointer, so checking for null is useless.
Spotted by Coverity.
Signed-off-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Merge remote-tracking branch 'kraxel/usb.76' into staging
ehci: Assert state machine is sane w.r.t. EHCIQueue
Coverity worries the EHCIQueue pointer could be null when we pass itto functions that reference it. The state machine ensures it can't benull then. Assert that, to hush the checker.
Signed-off-by: Markus Armbruster <armbru@redhat.com>...
usb-host: Drop superfluous null test from usb_host_auto_scan()
Coverity points out that port is later passed to usb_host_open(),which dereferences it. It actually can't be null: it always points tousb_host_scan()'s auto port[]. Drop the superfluous port == NULL...
usb-host: Initialize dev->port the obviously safe way
Coverity worries the strcpy() could overrun the destination. Itcan't, because the source always points to usb_host_scan()'s autoport[], which has the same size. Use pstrcpy() anyway, to hush thechecker....
xhci: nuke transfe5rs on detach