summaryrefslogtreecommitdiffstats
path: root/hw/usb
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* xhci: fix portsc writesGerd Hoffmann2013-04-161-7/+35
| | | | | | | | | | 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. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* xhci: add xhci_cap_writeGerd Hoffmann2013-04-161-0/+7
| | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* xhci: remove leftover debug printfGerd Hoffmann2013-04-161-1/+0
| | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* usb-serial: Remove double call to qemu_chr_add_handlers( NULL )Hans de Goede2013-04-161-9/+0
| | | | | | | | | | | | | | | | | | | | | | | | usb-serial has a qdev chardev property, and hw/qdev-properties-system.c already contains: static void release_chr(Object *obj, const char *name, void *opaque) { DeviceState *dev = DEVICE(obj); Property *prop = opaque; CharDriverState **ptr = qdev_get_prop_ptr(dev, prop); CharDriverState *chr = *ptr; if (chr) { qemu_chr_add_handlers(chr, NULL, NULL, NULL, NULL); qemu_chr_fe_release(chr); } } So doing the qemu_chr_add_handlers(s->cs, NULL, NULL, NULL, NULL); from the usb handle_destroy function too will lead to it being done twice. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* include: avoid useless includes of exec/ headersPaolo Bonzini2013-04-151-1/+1
| | | | | | | 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/ subdirectoriesPaolo Bonzini2013-04-155-5/+5
| | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* Merge remote-tracking branch 'bonzini/hw-dirs' into stagingAnthony Liguori2013-04-089-7/+1031
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | # By Paolo Bonzini # Via Paolo Bonzini * bonzini/hw-dirs: (35 commits) hw: move private headers to hw/ subdirectories. MAINTAINERS: update for source code movement hw: move last file to hw/arm/ hw: move hw/kvm/ to hw/i386/kvm hw: move ARM CPU cores to hw/cpu/, configure with default-configs/ hw: move other devices to hw/misc/, configure with default-configs/ hw: move NVRAM interfaces to hw/nvram/, configure with default-configs/ hw: move GPIO interfaces to hw/gpio/, configure with default-configs/ hw: move interrupt controllers to hw/intc/, configure with default-configs/ hw: move DMA controllers to hw/dma/, configure with default-configs/ hw: move VFIO and ivshmem to hw/misc/ hw: move PCI bridges to hw/pci-* or hw/ARCH hw: move SD/MMC devices to hw/sd/, configure with default-configs/ hw: move timer devices to hw/timer/, configure with default-configs/ hw: move ISA bridges and devices to hw/isa/, configure with default-configs/ hw: move char devices to hw/char/, configure via default-configs/ hw: move more files to hw/xen/ hw: move SCSI controllers to hw/scsi/, configure via default-configs/ hw: move SSI controllers to hw/ssi/, configure via default-configs/ hw: move I2C controllers to hw/i2c/, configure via default-configs/ ... Message-id: 1365442249-18259-1-git-send-email-pbonzini@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
| * hw: move private headers to hw/ subdirectories.Paolo Bonzini2013-04-084-3/+68
| | | | | | | | | | | | | | Many headers are used only in a single directory. These can be kept in hw/. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * hw: make all of hw/usb/ configurable via default-configs/Paolo Bonzini2013-04-081-0/+1
| | | | | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * hw: move target-independent files to subdirectoriesPaolo Bonzini2013-04-083-1/+959
| | | | | | | | | | | | | | This patch tackles all files that are compiled once, moving them to subdirectories of hw/. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * hw: move headers to include/Paolo Bonzini2013-04-084-5/+5
| | | | | | | | | | | | | | | | | | Many of these should be cleaned up with proper qdev-/QOM-ification. Right now there are many catch-all headers in include/hw/ARCH depending on cpu.h, and this makes it necessary to compile these files per-target. However, fixing this does not belong in these patches. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* | Merge remote-tracking branch 'kraxel/usb.79' into stagingAnthony Liguori2013-04-085-19/+62
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | # By Gerd Hoffmann (7) and Hans de Goede (3) # Via Gerd Hoffmann * kraxel/usb.79: usb-tablet: Don't claim wakeup capability for USB-2 version usb: update docs for bus name change usb-hub: report status changes only once usb-hub: limit chain length xhci: zap unused name field xhci: remove unimplemented printfs xhci: remove leftover debug printf xhci: fix numintrs sanity checks usb-redir: Add flow control support usb-redir: Fix crash on migration with no client connected
| * usb-tablet: Don't claim wakeup capability for USB-2 versionHans de Goede2013-04-031-1/+1
| | | | | | | | | | | | | | | | | | | | Our ehci code does not implement wakeup support, so claiming support for it with usb-tablet in USB-2 mode causes all tablet events to get lost. http://bugzilla.redhat.com/show_bug.cgi?id=929068 Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * usb-hub: report status changes only onceGerd Hoffmann2013-04-031-1/+5
| | | | | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * usb-hub: limit chain lengthGerd Hoffmann2013-04-032-0/+8
| | | | | | | | | | | | | | USB supports up to 5 hubs chained. Catch attempts to chain more. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * xhci: zap unused name fieldGerd Hoffmann2013-04-031-1/+0
| | | | | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * xhci: remove unimplemented printfsGerd Hoffmann2013-04-031-13/+9
| | | | | | | | | | | | Replace them with a tracepoint, so they don't spam stderr by default. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * xhci: remove leftover debug printfGerd Hoffmann2013-04-031-2/+0
| | | | | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * xhci: fix numintrs sanity checksGerd Hoffmann2013-04-031-0/+3
| | | | | | | | | | | | | | | | Make sure numintrs is a power of two, msi requires this. https://bugzilla.redhat.com/show_bug.cgi?id=918035 Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * usb-redir: Add flow control supportHans de Goede2013-04-031-1/+32
| | | | | | | | | | Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * usb-redir: Fix crash on migration with no client connectedHans de Goede2013-04-031-0/+4
| | | | | | | | | | | | | | | | | | If no client is connected on the src side, then we won't receive a parser during migrate, in this case usbredir_post_load() should be a nop, rather then to try to derefefence the NULL dev->parser pointer. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* | usb-storage: Forward serial number to scsi-diskKevin Wolf2013-04-051-1/+1
|/ | | | | | | | | | | usb-storage takes care to fetch the USB serial number from -drive options, but it neglected to pass its own 'serial' property to the scsi-disk it creates. With this patch, the 'serial' qdev property and the 'serial' option in -drive behave the same and correctly apply the serial number on both USB and SCSI level. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com>
* qemu-char: Automatically do fe_open / fe_close on qemu_chr_add_handlersHans de Goede2013-03-271-2/+0
| | | | | | | | | | | | | | Most frontends can't really determine if the guest actually has the frontend side open. So lets automatically generate fe_open / fe_close as soon as a frontend becomes ready (as signalled by calling qemu_chr_add_handlers) / becomes non ready (as signalled by setting all handlers to NULL). And allow frontends which can actually determine if the guest is listening to opt-out of this. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Message-id: 1364292483-16564-5-git-send-email-hdegoede@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* qemu-char: Rename opened to be_openHans de Goede2013-03-272-2/+2
| | | | | | | | | Rename the opened variable to be_open to reflect that it contains the opened state of the backend. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Message-id: 1364292483-16564-2-git-send-email-hdegoede@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* pcie: Add endpoint capability initialization wrapperAlex Williamson2013-03-261-1/+1
| | | | | | | | | | Fix the awkward API of mangling the caller specified PCIe type and just provide an interface to initialize an endpoint device. This will pick either a regular endpoint or integrated endpoint based on the bus and return pcie_cap_init to doing exactly what is asked. Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* hw: move qdev-monitor.o to toplevel directoryPaolo Bonzini2013-03-011-0/+1
| | | | | | | | | | qdev-monitor.c is the only "core qdev" file that is not used in user-mode emulation, and it does not define anything that is used by hardware models. Remove it from the hw/ directory and remove hw/qdev-monitor.h from hw/qdev.h too; this requires some files to have some new explicitly includes. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* xhci: fix bad print specifierHervé Poussineau2013-02-231-2/+2
| | | | | | | | | | | 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> Reviewed-by: Stefan Weil <sw@weilnetz.de> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
OpenPOWER on IntegriCloud