summaryrefslogtreecommitdiffstats
path: root/hw/usb
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* 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>
* unbreak hw/usb/redirect.c buildGerd Hoffmann2013-02-221-1/+1
| | | | | | | | Commit 8550a02d1239415342959f6a32d178bc05c557cc added a streams parameter 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 streamsGerd Hoffmann2013-02-191-42/+205
| | | | | | Add usb3 streams support to the uas (usb attached scsi) emulation. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* usb-xhci: usb3 streamsGerd Hoffmann2013-02-191-45/+223
| | | | | | | Add streams support to the xhci emulation. No secondary streams yet, only linear stream arays are supported for now. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* usb-core: usb3 streamsGerd Hoffmann2013-02-1913-27/+31
| | | | | | | 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. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* usb: fix endpoint descriptor orderingGerd Hoffmann2013-02-191-4/+5
| | | | | | | | Fix the ordering of the endpoint descriptors for superspeed endpoints: The superspeed companion must come first, possible additional descriptors for the endpoint after that. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* usb-redir: simplify packet copyGerd Hoffmann2013-02-191-14/+4
| | | | | | | | | 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. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* usb: make usb_packet_copy operate on combined packetsGerd Hoffmann2013-02-191-5/+14
| | | | | | | Likewise usb_packet_skip. Also usb_packet_size. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* usb: add usb_ep_set_haltedGerd Hoffmann2013-02-191-0/+6
| | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* usb-host: remove usb_host_device_closeGerd Hoffmann2013-02-193-35/+0
| | | | | | Nobody implements that anyway. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* usb-host: move legacy cmd line bitsGerd Hoffmann2013-02-194-101/+190
| | | | | | | The code handling the "-usbdevice host:..." legacy command line syntax is moved to the new hw/usb/host-legacy.c file. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* usb-storage: use scsi_req_enqueue return valueGerd Hoffmann2013-02-191-2/+3
| | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* allow disabling usb smartcard supportGerd Hoffmann2013-02-191-1/+0
| | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* make usb devices configurableGerd Hoffmann2013-02-191-8/+12
| | | | | | | | | | | | | | | 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 object file. - smardcard: ccid-card-emulated depends on that one *and* CONFIG_SMARTCARD_NSS. So it isn't a one-liner and comes as separate patch because of that. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* usb: Makefile cleanupGerd Hoffmann2013-02-191-7/+20
| | | | | | Group files, sprinkle in some comments. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* net: intorduce qemu_del_nic()Jason Wang2013-02-011-1/+1
| | | | | | | | | | To support multiqueue nic, this patch separate the nic destructor from qemu_del_net_client() to a new helper qemu_del_nic() since the mapping bettween NiCState and NetClientState were not 1:1 in multiqueue. The following patches would refactor this function to support multiqueue nic. Signed-off-by: Jason Wang <jasowang@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* net: introduce qemu_get_nic()Jason Wang2013-02-011-3/+3
| | | | | | | | | To support multiqueue, this patch introduces a helper qemu_get_nic() to get NICState from a NetClientState. The following patches would refactor this helper to support multiqueue. Signed-off-by: Jason Wang <jasowang@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* net: introduce qemu_get_queue()Jason Wang2013-02-011-5/+5
| | | | | | | | | To support multiqueue, the patch introduce a helper qemu_get_queue() which is used to get the NetClientState of a device. The following patches would refactor this helper to support multiqueue. Signed-off-by: Jason Wang <jasowang@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* usb: add usb-bot device (scsi bulk-only transport).Gerd Hoffmann2013-01-221-15/+79
| | | | | | | Basically the same as usb-storage, but without automatic scsi device setup. Also features support for up to 16 LUNs. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* ohci: add missing breakGerd Hoffmann2013-01-221-0/+1
| | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* Revert "usb-storage: Drop useless null test in usb_msd_handle_data()"Gerd Hoffmann2013-01-221-1/+1
| | | | | | | | | | | This reverts commit a1cbfd554e11bb8af38c2f3e1f1574bf4c563cd2. Test isn't useless. scsi_req_enqueue() may finish the request (will actually happen for requests which don't trigger any I/O such as INQUIRY), then call usb_msd_command_complete() which in turn will set s->req to NULL after unref'ing it. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* usb: Fix compilation for MinGW (regression)Stefan Weil2013-01-191-1/+1
| | | | | | | | 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 handlerWenchao Xia2013-01-173-3/+3
| | | | | | | | | This patch change all info call back function to take additional QDict * parameter, which allow those command take parameter. Now it is set to NULL at default case. Signed-off-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* usb-storage: Drop useless null test in usb_msd_handle_data()Markus Armbruster2013-01-161-1/+1
| | | | | | | | | | scsi_req_new() never returns null, and scsi_req_enqueue() dereferences the 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 stagingAnthony Liguori2013-01-143-8/+31
|\ | | | | | | | | | | | | | | | | | | | | | | * kraxel/usb.76: usb-host: Initialize dev->port the obviously safe way usb-host: Drop superfluous null test from usb_host_auto_scan() ehci: Assert state machine is sane w.r.t. EHCIQueue xhci: nuke transfe5rs on detach xhci: call xhci_detach_slot on root port detach too xhci: create xhci_detach_slot helper function Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
| * usb-host: Initialize dev->port the obviously safe wayMarkus Armbruster2013-01-141-1/+1
| | | | | | | | | | | | | | | | | | | | Coverity worries the strcpy() could overrun the destination. It can't, because the source always points to usb_host_scan()'s auto port[], which has the same size. Use pstrcpy() anyway, to hush the checker. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * usb-host: Drop superfluous null test from usb_host_auto_scan()Markus Armbruster2013-01-141-1/+1
| | | | | | | | | | | | | | | | | | | | Coverity points out that port is later passed to usb_host_open(), which dereferences it. It actually can't be null: it always points to usb_host_scan()'s auto port[]. Drop the superfluous port == NULL test. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * ehci: Assert state machine is sane w.r.t. EHCIQueueMarkus Armbruster2013-01-141-0/+4
| | | | | | | | | | | | | | | | | | Coverity worries the EHCIQueue pointer could be null when we pass it to functions that reference it. The state machine ensures it can't be null then. Assert that, to hush the checker. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * xhci: nuke transfe5rs on detachGerd Hoffmann2013-01-141-1/+7
| | | | | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * xhci: call xhci_detach_slot on root port detach tooGerd Hoffmann2013-01-141-0/+1
| | | | | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * xhci: create xhci_detach_slot helper functionGerd Hoffmann2013-01-141-6/+18
| | | | | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* | build: remove CONFIG_SMARTCARDPaolo Bonzini2013-01-121-1/+1
|/ | | | | | | The passthru smartcard does not have the shared library dependency, build it unconditionally. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* Make all static TypeInfos constAndreas Färber2013-01-1016-21/+21
| | | | | | | | | | | | | | | | | | | | | | | Since 39bffca2030950ef6efe57c2fac8327a45ae1015 (qdev: register all types natively through QEMU Object Model), TypeInfo as used in the common, non-iterative pattern is no longer amended with information and should therefore be const. Fix the documented QOM examples: sed -i 's/static TypeInfo/static const TypeInfo/g' include/qom/object.h Since frequently the wrong examples are being copied by contributors of new devices, fix all types in the tree: sed -i 's/^static TypeInfo/static const TypeInfo/g' */*.c sed -i 's/^static TypeInfo/static const TypeInfo/g' */*/*.c This also avoids to piggy-back these changes onto real functional changes or other refactorings. Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* uhci: stop using portio listsGerd Hoffmann2013-01-081-76/+30
| | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* usbredir: Add support for buffered bulk input (v2)Hans de Goede2013-01-086-19/+2706
| | | | | | | | | | | | | | | | | | | | | | | | Buffered bulk mode is intended for bulk *input* endpoints, where the data is of a streaming nature (not part of a command-response protocol). These endpoints' input buffer may overflow if data is not read quickly enough. So in buffered bulk mode the usb-host takes care of the submitting and re-submitting of bulk transfers. Buffered bulk mode is necessary for reliable operation with the bulk in endpoints of usb to serial convertors. Unfortunatelty buffered bulk input mode will only work with certain devices, therefor this patch also adds a usb-id table to enable it for devices which need it, while leaving the bulk ep handling for other devices unmodified. Note that the bumping of the required usbredir from 0.5.3 to 0.6 does not mean that we will now need a newer usbredir release then qemu-1.3, .pc files reporting 0.5.3 have only ever existed in usbredir builds directly from git, so qemu-1.3 needs the 0.6 release too. Changes in v2: -Split of quirk handling into quirks.c Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* usb/ehci: Add SysBus EHCI device for Exynos4210Andreas Färber2013-01-072-0/+17
| | | | | | | | | It uses a different capsbase and opregbase than the Xilinx device. Signed-off-by: Liming Wang <walimisdev@gmail.com> Signed-off-by: Andreas Färber <andreas.faerber@web.de> Cc: Igor Mitsyanko <i.mitsyanko@samsung.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* usb/ehci: Move capsbase and opregbase into SysBus EHCI classAndreas Färber2013-01-072-2/+26
| | | | | | | This allows specific derived models to use different values. Signed-off-by: Andreas Färber <andreas.faerber@web.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* usb/ehci: Clean up SysBus and PCI EHCI splitAndreas Färber2013-01-073-24/+60
| | | | | | | | | | | | | | | | SysBus EHCI was introduced in a hurry before 1.3 Soft Freeze. To use QOM casts in place of DO_UPCAST() / FROM_SYSBUS(), we need an identifying type. Introduce generic abstract base types for PCI and SysBus EHCI to allow multiple types to access the shared fields. While at it, move the state structs being amended with macros to the header file so that they can be embedded. The VMSTATE_PCI_DEVICE() macro does not play nice with the QOM parent_obj naming convention, so defer that cleanup. Signed-off-by: Andreas Färber <andreas.faerber@web.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* xhci: call set-address with dummy usbpacketGerd Hoffmann2013-01-071-1/+6
| | | | | | | | | Due to the way devices are addressed with xhci (done by hardware, not the guest os) there is no packet when invoking the set-address control request. Create a dummy packet in that case to avoid null pointer dereferences. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* usb-redir: Add debugging to bufpq save / restoreHans de Goede2013-01-071-3/+11
| | | | | Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* usbredir: Add usbredir_init_endpoints() helperHans de Goede2013-01-071-9/+13
| | | | | Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* usbredir: Verify we have 32 bits bulk length cap when redirecting to xhciHans de Goede2013-01-071-0/+2
| | | | | | | | | The xhci-hcd may submit bulk transfers > 65535 bytes even when not using bulk-in pipeling, so usbredir can only be used in combination with an xhci hcd if the client has the 32 bits bulk length capability. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
OpenPOWER on IntegriCloud