summaryrefslogtreecommitdiffstats
path: root/hw/usb
Commit message (Collapse)AuthorAgeFilesLines
...
* usb/hcd-xhci: QOM parent field cleanupAndreas Färber2013-07-231-35/+48
| | | | | | | | Replace direct uses of XHCIState::pci_dev with QOM casts and rename it to parent_obj. Acked-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
* usb/hcd-xhci: QOM Upcast SweepPeter Crosthwaite2013-07-231-7/+14
| | | | | | | | | Define and use standard QOM cast macro. Remove usages of DO_UPCAST() and direct -> style upcasting. Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> [AF: Dropped usb_xhci_init() DeviceState argument and renamed variable] Signed-off-by: Andreas Färber <afaerber@suse.de>
* hw: Avoid use of QOM type name macros in VMStateDescriptionsPeter Maydell2013-07-232-2/+2
| | | | | | | | | | | | | | The name field in a VMStateDescription is part of the migration state versioning, so changing it will break migration. It's therefore a bad idea to use a QOM typename macro to initialize it, because in general we're free to rename QOM types as part of code refactoring and cleanup. For the handful of devices that were doing this by mistake, replace the QOM typenames with the corresponding literal strings. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> [AF: Use TYPE_PVSCSI for TypeInfo instead] Signed-off-by: Andreas Färber <afaerber@suse.de>
* hw/[u-x]*: pass owner to memory_region_init* functionsPaolo Bonzini2013-07-045-13/+16
| | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* memory: add owner argument to initialization functionsPaolo Bonzini2013-07-045-13/+13
| | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* dma: keep a device alive while it has SGListsPaolo Bonzini2013-07-041-2/+4
| | | | | Reviewed-by: Anthony Liguori <aliguori@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* usb: add serial bus propertyGerd Hoffmann2013-06-244-10/+13
| | | | | | | | This patch adds a serial property for all usb devices, which can be used 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_HOSTGerd Hoffmann2013-06-241-0/+1
| | | | | | | ... like host-{linux,bsd}.c do. Cc: qemu-stable@nongnu.org Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* usb/host-libusb: Fix building with libusb git master codeHans de Goede2013-06-241-0/+4
| | | | | | | | The next libusb release will deprecate libusb_get_port_path, and since we 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: Add Faraday FUSBH200 supportKuo-Jung Su2013-06-242-0/+87
| | | | | | | | | 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> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* usb/hcd-ehci: Replace PORTSC macros with variablesKuo-Jung Su2013-06-244-14/+28
| | | | | | | | | 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>
* usb/hcd-ehci: Add Tegra2 SysBus EHCI deviceAndreas Färber2013-06-242-0/+16
| | | | | | | | | 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> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* usb/hcd-ehci: Split off instance_init from realizeAndreas Färber2013-06-244-20/+44
| | | | | | | | | 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-sysbus: Convert to QOM realizeAndreas Färber2013-06-244-10/+9
| | | | | | | | | | | | 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>
* dma: eliminate DMAContextPaolo Bonzini2013-06-206-27/+27
| | | | | | | | | 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>
* xhci: add live migration supportGerd Hoffmann2013-06-031-1/+163
| | | | | | | With all preparing pieces in place we can finally drop in the vmstate structs and the postload function. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* xhci: add xhci_init_epctxGerd Hoffmann2013-06-031-18/+25
| | | | | | | Factor out endpoint context initialization to a separate function. xhci live migration will need that too, in post_load. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* xhci: add xhci_alloc_epctxGerd Hoffmann2013-06-031-11/+21
| | | | | | | Factor out endpoint context allocation to a separate function. xhci live migration will need that too, in post_load. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* xhci: add XHCISlot->addressedGerd Hoffmann2013-06-031-0/+3
| | | | | | Preparing for live-migration support, post_load will need that. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* host-libusb: Correct test for USB packet stateEd Maste2013-06-031-1/+1
| | | | | | | | USB_RET_ASYNC is -6, so inflight was always false. Signed-off-by: Ed Maste <emaste@freebsd.org> Cc: qemu-stable@nongnu.org Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* Fix usage of USB_DEV_FLAG_IS_HOST flag.Michael Marineau2013-06-031-1/+1
| | | | | | | | | 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.org Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* remove double semicolonsDong Xu Wang2013-05-121-2/+2
| | | | | Signed-off-by: Dong Xu Wang <wdongxu@linux.vnet.ibm.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
* xhci: handle USB_RET_BABBLEGerd Hoffmann2013-05-071-0/+5
| | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* uhci: Use an intermediate buffer for usb packet dataHans de Goede2013-05-071-8/+13
| | | | | | | | | | | | | | | | | | Due to various unfortunate reasons we cannot reliable detect a guest cancelling a packet as soon as it happens, instead we detect cancels with some delay. When packets are handled async, and we directly pass the guest memory for the packet to the usb-device as iovec, this means that the usb-device can write to guest-memory which the guest has already re-used for other purposes -> not good! This patch fixes this by adding an intermediate buffer and writing back not only the result, but also the data, of async completed packets when scanning the schedule. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* usb-host: add usb_host_full_speed_compatGerd Hoffmann2013-05-071-3/+37
| | | | | | | | | Alloes to pass through usb2 devices on usb1 host controllers if possible. Brings the libusb implementation to feature-parity with the linux usbfs code, so the usb-host implementation in 1.5 (libusb) doesn't regress compared to 1.4 (usbfs). Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* usb-host: live migration support for the libusb versionGerd Hoffmann2013-05-071-5/+49
| | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* scsi: add bus_name parameter to scsi_bus_new.KONRAD Frederic2013-05-032-3/+3
| | | | | | | | | | 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> Message-id: 1367330931-12994-4-git-send-email-fred.konrad@greensocs.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* audio: remove the need for audio card CONFIG_* symbolsPaolo Bonzini2013-04-291-1/+0
| | | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-id: 1366303444-24620-3-git-send-email-pbonzini@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* ccid: Fix crash when backend isn't specifiedCole Robinson2013-04-271-2/+8
| | | | | | | | | 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)Alon Levy2013-04-241-0/+4
| | | | | Signed-off-by: Alon Levy <alevy@redhat.com> Reviewed-by: Marc-André Lureau <mlureau@redhat.com>
* dev-smartcard-reader: copy atr protocol to ccid parametersAlon Levy2013-04-241-0/+45
| | | | | | | Adds todos. Signed-off-by: Alon Levy <alevy@redhat.com> Reviewed-by: Marc-André Lureau <mlureau@redhat.com>
* dev-smartcard-reader: change default protocol to T=0Alon Levy2013-04-241-3/+3
| | | | | | | | | | | | | We don't support T=1 so we shouldn't advertise it by default. Two independent changes: * Default ATR sets T=0. This gets overwritten by the client provided ATR later. * Class descriptor changes dwAdvertise dwProtocols.PPPP to 0x1 and dwProtocols.RRRR=0 per spec. Signed-off-by: Alon Levy <alevy@redhat.com> Reviewed-by: Marc-André Lureau <mlureau@redhat.com>
* dev-smartcard-reader: define structs for CCID_Parameter internalsAlon Levy2013-04-241-27/+47
| | | | | Signed-off-by: Alon Levy <alevy@redhat.com> Reviewed-by: Marc-André Lureau <mlureau@redhat.com>
* ccid-card-passthru, dev-smartcard-reader: add debug environment variablesAlon Levy2013-04-242-0/+3
| | | | | | | | | | | | | | | | | | | | Introduces a new utility function: parse_debug_env to avoid code duplication. This overrides whatever debug value is set on the corresponding devices from the command line, and is meant to ease the usage with any management stack. For libvirt you can set environment variables by extending the dom namespace, i.e: <domain type='kvm' id='3' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'> <qemu:commandline> <qemu:env name='QEMU_CCID_PASSTHRU_DEBUG' value='4'/> <qemu:env name='QEMU_CCID_DEBUG' value='4'/> </qemu:commandline> </domain> Signed-off-by: Alon Levy <alevy@redhat.com> Reviewed-by: Marc-André Lureau <mlureau@redhat.com>
* ccid-card-passthru: add atr checkAlon Levy2013-04-241-0/+59
| | | | | Signed-off-by: Alon Levy <alevy@redhat.com> Reviewed-by: Marc-André Lureau <mlureau@redhat.com>
* dev-smartcard-reader: reuse usb.h definitionsAlon Levy2013-04-241-11/+5
| | | | | Signed-off-by: Alon Levy <alevy@redhat.com> Reviewed-by: Marc-André Lureau <mlureau@redhat.com>
* dev-smartcard-reader: support windows guestAlon Levy2013-04-241-2/+2
| | | | | | | By not advertising USB wakeup support (which we don't). Signed-off-by: Alon Levy <alevy@redhat.com> Reviewed-by: Marc-André Lureau <mlureau@redhat.com>
* dev-smartcard-reader: remove aborts (never triggered, but just in case)Alon Levy2013-04-241-8/+12
| | | | | Signed-off-by: Alon Levy <alevy@redhat.com> Reviewed-by: Marc-André Lureau <mlureau@redhat.com>
* dev-smartcard-reader: nicer debug messagesAlon Levy2013-04-241-6/+63
| | | | | Signed-off-by: Alon Levy <alevy@redhat.com> Reviewed-by: Marc-André Lureau <mlureau@redhat.com>
* dev-smartcard-reader: white space fixesAlon Levy2013-04-241-0/+4
| | | | | Signed-off-by: Alon Levy <alevy@redhat.com> Reviewed-by: Marc-André Lureau <mlureau@redhat.com>
* ccid: declare DEFAULT_ATR table to be "static const"Jim Meyering2013-04-241-1/+1
| | | | | | 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 usersJim Meyering2013-04-241-3/+3
| | | | | | Signed-off-by: Jim Meyering <meyering@redhat.com> Reviewed-by: Alon Levy <alevy@redhat.com> Reviewed-by: Marc-André Lureau <mlureau@redhat.com>
* ccid-card-emul: do not crash if backend is not providedMarc-André Lureau2013-04-241-0/+3
| | | | | | | | | | | | Program received signal SIGSEGV, Segmentation fault. __strcmp_sse42 () at ../sysdeps/x86_64/multiarch/strcmp-sse42.S:164 164 movdqu (%rsi), %xmm2 (gdb) bt at /home/elmarco/320g/src/qemu/hw/ccid-card-emulated.c:477 at /home/elmarco/320g/src/qemu/hw/ccid-card-emulated.c:503 Signed-off-by: Marc-André Lureau <mlureau@redhat.com> Reviewed-by: Alon Levy <alevy@redhat.com>
* usb-host: raise libusbx minimum version to 1.0.13Gerd Hoffmann2013-04-231-5/+0
| | | | | | | | | Allows to remove one FIXME. Makes LIBUSB_LOG_LEVEL_WARNING build errors go away. And starting with that version libusb has a LIBUSBX_API_VERSION define which allows to easily #ifdef version dependencies should that need arrive in the future. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* usb: better speed mismatch error reportingGerd Hoffmann2013-04-232-6/+32
| | | | | | | | | Report the supported speeds for device and port in the error message. Also add the speeds to the tracepoint. And while being at it drop the redundant error message in usb_desc_attach, usb_device_attach will report the error anyway. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* ehci_free_packet: Discard finished packets when the queue is haltedHans de Goede2013-04-231-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>
* xhci: remove XHCIRing->base (unused)Gerd Hoffmann2013-04-231-3/+1
| | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* use libusb for usb-hostGerd Hoffmann2013-04-162-2/+1461
| | | | | | | | | | | | | | | | | | | | | | | | | | 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. (4) Bring usb-host support to any platform supported by libusbx. For now this goes side-by-side to the existing code. That is only to simplify regression testing though, at the end of the day I want remove the old code and support libusb exclusively. Merge early in 1.5 cycle, remove the old code after 1.5 release or something like this. Thanks to qdev the old and new code can coexist nicely on linux. Just use "-device usb-host-linux" to use the old linux driver instead of the libusb one (which takes over the "usb-host" name). The bsd driver isn't qdev'ified so it isn't that easy for bsd. I didn't bother making it runtime switchable, so you have to rebuild qemu with --disable-libusb to get back the old code. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* xhci: fix address deviceGerd Hoffmann2013-04-161-0/+4
| | | | | | | | | Zero-initialize the set-address dummy USBPacket, also add buffer to avoid sanity checks triggering. https://bugzilla.redhat.com/show_bug.cgi?id=929019 Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* xhci: use slotid as device addressGerd Hoffmann2013-04-161-22/+3
| | | | | | | | Is good enougth for unique device addresses and avoids the need for any state for device addressing. Makes live migration support easier. Also makes device->slot lookups trivial. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
OpenPOWER on IntegriCloud