summary refs log tree commit diff stats
path: root/hw/usb (follow)
Commit message (Collapse)AuthorAgeFilesLines
* xhci: order superspeed ports firstGerd Hoffmann2014-06-021-8/+37
| | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* xhci: make port reset trace point more verboseGerd Hoffmann2014-06-021-1/+1
| | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* usb: add usb_pick_speedGerd Hoffmann2014-06-022-12/+21
| | | | | | | | | | | | | | We can pick the usb port speed in generic code, by looking at the port and device speed masks and looking for the fastest match. So add a function to do exactly that, and drop the speed setting code from usb_desc_attach as it isn't needed any more. This way we can set the device speed before calling port->ops->attach, which fixes some xhci hotplug issues. https://bugzilla.redhat.com/show_bug.cgi?id=1046873 Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* usb-host: add HAVE_STREAMS defineGerd Hoffmann2014-06-021-7/+11
|
* usb-host: allow attaching usb3 devices to ehciGerd Hoffmann2014-06-021-8/+54
| | | | | | | | Extend compatibility test function to also figure whenever usb3 devices can be supported on ehci. Tweak ep0 maxpacketsize field due to usb2 <-> usb3 difference. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* usb: move ehci register defines to header fileGerd Hoffmann2014-06-021-78/+1
| | | | | | So we can easily use them in tests. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* usb: move uhci register defines to header fileGerd Hoffmann2014-06-021-35/+1
| | | | | | So we can easily use them in tests. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* Merge remote-tracking branch 'remotes/kraxel/tags/pull-usb-7' into stagingPeter Maydell2014-05-284-23/+242
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | usb: usb3 streams support for usb-host and usb-redir usb: xhci and mtp bugfixes. # gpg: Signature made Mon 26 May 2014 09:44:09 BST using RSA key ID D3E87138 # gpg: Can't check signature: public key not found * remotes/kraxel/tags/pull-usb-7: usb-host-libusb: Set stream id when submitting bulk-stream transfers usb-host-libusb: Add alloc / free streams ops usb-host-libusb: Fill in endpoint max_streams when available usb-redir: Add support for bulk streams usb-mtp: handle usb_mtp_get_object failure usb-mtp: handle lseek failure usb-mtp: use bool to track MTPObject init status xhci: add xhci_get_flag xhci: add endpoint cap on express bus only xhci: child detach fix Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * usb-host-libusb: Set stream id when submitting bulk-stream transfersHans de Goede2014-05-261-4/+17
| | | | | | | | | | Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * usb-host-libusb: Add alloc / free streams opsHans de Goede2014-05-261-0/+50
| | | | | | | | | | Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * usb-host-libusb: Fill in endpoint max_streams when availableHans de Goede2014-05-261-0/+12
| | | | | | | | | | Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * usb-redir: Add support for bulk streamsHans de Goede2014-05-261-5/+132
| | | | | | | | | | Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * usb-mtp: handle usb_mtp_get_object failureGerd Hoffmann2014-05-261-2/+7
| | | | | | | | | | Cc: Dr. David Alan Gilbert <dgilbert@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * usb-mtp: handle lseek failureGerd Hoffmann2014-05-261-1/+4
| | | | | | | | | | Cc: Dr. David Alan Gilbert <dgilbert@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * usb-mtp: use bool to track MTPObject init statusGerd Hoffmann2014-05-261-6/+8
| | | | | | | | | | | | | | | | | | | | Stop setting nchildren to -1. Use separate bool variable to track whenever we've already fetched the child objects instead. Also make nchildren unsigned. Cc: Dr. David Alan Gilbert <dgilbert@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * xhci: add xhci_get_flagGerd Hoffmann2014-05-261-2/+7
| | | | | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * xhci: add endpoint cap on express bus onlyGerd Hoffmann2014-05-261-2/+4
| | | | | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * xhci: child detach fixGerd Hoffmann2014-05-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | xhci_child_detach() zaps the wrong slot when unplugging a device connected via usb-hub: Instead of the device's slot the slot of the usb-hub is used. Fix it. https://bugzilla.redhat.com/show_bug.cgi?id=1075846 Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Gonglei <arei.gonglei@huawei.com>
* | usb: add input routing support for tablet and keyboardGerd Hoffmann2014-05-261-0/+13
|/ | | | | | | | | | Add display property to the keyboard. Add display and head properties to the tablet. If properties are set bind device to the display specified to setup input routing. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* usb: fix up post load checksMichael S. Tsirkin2014-05-141-2/+2
| | | | | | | | | | | | | | | Correct post load checks: 1. dev->setup_len == sizeof(dev->data_buf) seems fine, no need to fail migration 2. When state is DATA, passing index > len will cause memcpy with negative length, resulting in heap overflow First of the issues was reported by dgilbert. Reported-by: "Dr. David Alan Gilbert" <dgilbert@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
* savevm: Remove all the unneeded version_minimum_id_old (usb)Juan Quintela2014-05-148-13/+11
| | | | | | | | | | | | | | | | | | | | After previous Peter patch, they are redundant. This way we don't assign them except when needed. Once there, there were lots of case where the ".fields" indentation was wrong: .fields = (VMStateField []) { and .fields = (VMStateField []) { Change all the combinations to: .fields = (VMStateField[]){ The biggest problem (appart from aesthetics) was that checkpatch complained when we copy&pasted the code from one place to another. Signed-off-by: Juan Quintela <quintela@redhat.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com>
* libcacard: remove libcacard-specific CFLAGS and LIBS from global varsMichael Tokarev2014-05-091-0/+1
| | | | | | | | | | | | | | | | | | | Currently all what's needed for single file libcacard/vcard_emul_nss.c (libnss cflags) and hw/usb/ccid-card-emulated.c (libcacard includes) together with the libs is added to global QEMU_CFLAGS and libs_softmmu. Use the cflags only where really used (for two mentioned files), and libs only where needed. While at it, rename variables to better reflect reality: libcacard_* is really nss_*. This needs a bit more tweaking: $(NSS_LIBS) should not contain $glib_libs (ditto for _cflags). But in order to fix it, some more preparations should be made first. So add a FIXME comment. Signed-off-by: Michael Tokarev <mjt@tls.msk.ru> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* Merge remote-tracking branch 'remotes/juanquintela/tags/migration/20140505' ↵Peter Maydell2014-05-071-1/+3
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into staging migration/next for 20140505 # gpg: Signature made Mon 05 May 2014 21:27:24 BST using RSA key ID 5872D723 # gpg: Can't check signature: public key not found * remotes/juanquintela/tags/migration/20140505: (36 commits) migration: expose xbzrle cache miss rate migration: expose the bitmap_sync_count to the end migration: Add counts of updating the dirty bitmap XBZRLE: Fix one XBZRLE corruption issues migration: remove duplicate code Coverity: Fix failure path for qemu_accept in migration Init the XBZRLE.lock in ram_mig_init Provide init function for ram migration Count used RAMBlock pages for migration_dirty_pages Make qemu_peek_buffer loop until it gets it's data Disallow outward migration while awaiting incoming migration virtio: validate config_len on load virtio-net: out-of-bounds buffer write on load openpic: avoid buffer overrun on incoming migration ssi-sd: fix buffer overrun on invalid state load savevm: Ignore minimum_version_id_old if there is no load_state_old usb: sanity check setup_index+setup_len in post_load vmstate: s/VMSTATE_INT32_LE/VMSTATE_INT32_POSITIVE_LE/ virtio-scsi: fix buffer overrun on invalid state load zaurus: fix buffer overrun on invalid state load ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * usb: sanity check setup_index+setup_len in post_loadMichael S. Tsirkin2014-05-051-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | CVE-2013-4541 s->setup_len and s->setup_index are fed into usb_packet_copy as size/offset into s->data_buf, it's possible for invalid state to exploit this to load arbitrary data. setup_len and setup_index should be checked to make sure they are not negative. Cc: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
* | usb: mtp: reply INCOMPLETE_TRANSFER on read errorsGerd Hoffmann2014-05-051-1/+3
| | | | | | | | | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Peter Wu <peter@lekensteyn.nl> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
* | usb: mtp: fix possible buffer overflowGerd Hoffmann2014-05-051-0/+8
| | | | | | | | | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Peter Wu <peter@lekensteyn.nl> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
* | usb: mtp: drop data-out hexdumpGerd Hoffmann2014-05-051-2/+1
| | | | | | | | | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Peter Wu <peter@lekensteyn.nl> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
* | usb: mtp: avoid empty description stringGerd Hoffmann2014-05-051-1/+1
| | | | | | | | | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Peter Wu <peter@lekensteyn.nl> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
* | usb: mtp: fix error path memory leakGerd Hoffmann2014-05-051-0/+2
| | | | | | | | | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Peter Wu <peter@lekensteyn.nl> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
* | usb: mtp: fix serial (must be exact 32 chars)Gerd Hoffmann2014-05-051-1/+1
| | | | | | | | | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Peter Wu <peter@lekensteyn.nl> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
* | usb: mtp: fix version (is decimal not bcd)Gerd Hoffmann2014-05-051-1/+1
| | | | | | | | | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Peter Wu <peter@lekensteyn.nl> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
* | usb: mtp: fix usb_mtp_add_u64Gerd Hoffmann2014-05-051-2/+2
| | | | | | | | | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Peter Wu <peter@lekensteyn.nl> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
* | usb: mtp: replace debug printfs with trace pointsGerd Hoffmann2014-05-051-4/+4
| | | | | | | | | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Peter Wu <peter@lekensteyn.nl> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
* | usb-ohci: Add vmstate descriptorAlexey Kardashevskiy2014-05-051-8/+111
|/ | | | | | | | | | | | | | | This adds migration support for OHCI. This defines a descriptor for OHCIState. This changes some OHCIState field types to be migration compatible. This adds a descriptor for OHCIPort. This migrates the EOF timer if the USB was started at the time of migration. Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* usb: mtp filesharingGerd Hoffmann2014-04-232-0/+1107
| | | | | | | | | Implementation of a USB Media Transfer Device device for easy filesharing. Read-only. No access control inside qemu, it will happily export any file it is able to open to the guest, i.e. standard unix access rights for the qemu process apply. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* usb: add CompatibleID support to msosGerd Hoffmann2014-04-222-1/+6
| | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* hw/usb/hcd-ohci.c: Avoid shifting left into sign bitPeter Maydell2014-03-271-16/+16
| | | | | | | | | Add U suffix to avoid undefined behaviour. This is only strictly necessary for the 1<<31 cases, but we add it for the other constants in these groups for consistency. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
* Add a 'name' parameter to qemu_thread_createDr. David Alan Gilbert2014-03-091-4/+4
| | | | | | | | | | If enabled, set the thread name at creation (on GNU systems with pthread_set_np) Fix up all the callers with a thread name Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
* Merge remote-tracking branch 'remotes/kraxel/tags/pull-usb-3' into stagingPeter Maydell2014-02-2013-70/+72
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - xhci improvements and fixes. - uhci bugfix. - cleanups. # gpg: Signature made Tue 18 Feb 2014 15:48:10 GMT using RSA key ID D3E87138 # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" # gpg: aka "Gerd Hoffmann <gerd@kraxel.org>" # gpg: aka "Gerd Hoffmann (private) <kraxel@gmail.com>" * remotes/kraxel/tags/pull-usb-3: xhci: use DPRINTF() instead of fprintf(stderr, ...) xhci: switch debug printf to tracepoint xhci iso: allow for some latency xhci iso: fix time calculation uhci: invalidate queue on device address changes xhci: fix overflow in usb_xhci_post_load usb: Remove magic constants from device bmAttributes Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * xhci: use DPRINTF() instead of fprintf(stderr, ...)Gerd Hoffmann2014-02-181-45/+45
| | | | | | | | | | | | So we don't spam stderr with (guest-triggerable) messages by default. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * xhci: switch debug printf to tracepointGerd Hoffmann2014-02-181-3/+1
| | | | | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * xhci iso: allow for some latencyGerd Hoffmann2014-02-181-1/+1
| | | | | | | | | | | | | | | | | | | | Allow the scheduled transfer time be a bit behind, to compensate for latencies. Without this xhci will wait way to often for the mfindex wraparound, assuming the scheduled time is in the future just because qemu is a bit behind in processing the iso transfer requests. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * xhci iso: fix time calculationGerd Hoffmann2014-02-181-2/+2
| | | | | | | | | | | | | | Frameid specifies frames not microframes, so we need to shift it to get the microframe index. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * uhci: invalidate queue on device address changesGerd Hoffmann2014-02-181-0/+2
| | | | | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * xhci: fix overflow in usb_xhci_post_loadGerd Hoffmann2014-02-181-1/+1
| | | | | | | | | | | | | | Found by Coverity. Reported-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * usb: Remove magic constants from device bmAttributesPantelis Koukousoulas2014-02-1811-18/+20
| | | | | | | | | | | | | | | | Replace magic constants in device bmAttributes with symbolic ones from Linux kernel ch9.h Signed-off-by: Pantelis Koukousoulas <pktoss@gmail.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* | Merge remote-tracking branch 'remotes/afaerber/tags/qom-devices-for-peter' ↵Peter Maydell2014-02-201-2/+2
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into staging QOM infrastructure fixes and device conversions * QTest cleanups and test cases for PCI NICs * NAND fix for "info qtree" * Cleanup and extension of QOM machine tests * IndustryPack test cases and conversion to QOM realize * I2C cleanups * Cleanups of legacy qdev properties # gpg: Signature made Mon 17 Feb 2014 22:15:37 GMT using RSA key ID 3E7E013F # gpg: Good signature from "Andreas Färber <afaerber@suse.de>" # gpg: aka "Andreas Färber <afaerber@suse.com>" * remotes/afaerber/tags/qom-devices-for-peter: (49 commits) qtest: Include system headers before user headers qapi: Refine human printing of sizes qdev: Use QAPI type names for properties qdev: Add enum property types to QAPI schema block: Handle "rechs" and "large" translation options qdev: Remove hex8/32/64 property types qdev: Remove most legacy printers qdev: Use human mode in "info qtree" qapi: Add human mode to StringOutputVisitor qdev: Inline qdev_prop_parse() qdev: Legacy properties are just strings qdev: Legacy properties are now read-only qdev: Remove legacy parsers for hex8/32/64 qdev: Sizes are now parsed by StringInputVisitor qapi: Add size parser to StringInputVisitor qtest: Don't segfault with invalid -qtest option ipack: Move IndustryPack out of hw/char/ ipoctal232: QOM parent field cleanup ipack: QOM parent field cleanup for IPackDevice ipack: QOM parent field cleanup for IPackBus ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * | qdev: Remove hex8/32/64 property typesPaolo Bonzini2014-02-141-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Replace them with uint8/32/64. Reviewed-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
* | | Use error_is_set() only when necessaryMarkus Armbruster2014-02-171-1/+1
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | error_is_set(&var) is the same as var != NULL, but it takes whole-program analysis to figure that out. Unnecessarily hard for optimizers, static checkers, and human readers. Dumb it down to obvious. Gets rid of several dozen Coverity false positives. Note that the obvious form is already used in many places. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* | qdev:pci: refactor PCIDevice to use generic "hotpluggable" propertyIgor Mammedov2014-02-104-4/+4
|/ | | | | | | | | Get rid of PCIDevice specific PCIDeviceClass.no_hotplug and use generic DeviceClass.hotpluggable field instead. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>