build: remove CONFIG_SMARTCARD
The passthru smartcard does not have the shared library dependency, buildit unconditionally.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Make all static TypeInfos const
Since 39bffca2030950ef6efe57c2fac8327a45ae1015 (qdev: register alltypes natively through QEMU Object Model), TypeInfo as used inthe common, non-iterative pattern is no longer amended with informationand should therefore be const....
usbredir: Add support for buffered bulk input (v2)
Buffered bulk mode is intended for bulk input endpoints, where the data isof a streaming nature (not part of a command-response protocol). Theseendpoints' input buffer may overflow if data is not read quickly enough....
uhci: stop using portio lists
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
uhci: Fix 1 ms delay in interrupt reporting to the guest
Re-arrange how we process frames / increase frnum / report pending interrupts,to avoid a 1 ms delay in interrupt reporting to the guest. This increasesthe packet throughput for cases where the guest submits a single packet,...
uhci: Fix pending interrupts getting lost on migration
Signed-off-by: Hans de Goede <hdegoede@redhat.com>Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
uhci: Add a QH_VALID define
Rather then using the magic 32 value in various places.
uhci: Limit amount of frames processed in one go
Before this patch uhci would process an unlimited amount of frames whenbehind on schedule, by setting the timer to a time already past, causing thetimer subsys to immediately recall the frame_timer function gain....
uhci: Maximize how many frames we catch up when behind
If somehow we've gotten behind a lot, simply skip ahead, like the ehci codedoes.
hid: Change idle handling to use a timer
This leads to cleaner code in usb-hid, and removes up to a 1000 calls / sec toqemu_get_clock_ns(vm_clock) if idle-time is set to its default value of 0.
usb: Fix usb_ep_find_packet_by_id
usb_ep_find_packet_by_id mistakenly only checks the first packet and if thatis not a match, keeps trying the first packet! This patch fixes this.
usb: Add an usb_device_ep_stopped USBDevice method
Some usb devices (host or network redirection) can benefit from knowing whenthe guest stops using an endpoint. Redirection may involve submitting packetsindependently from the guest (in combination with a fifo buffer between the...
usbredir: Add an usbredir_stop_ep helper function
usbredir: Add USBEP2I and I2USBEP helper macros
usbredir: Add ep_stopped USBDevice method
To ensure that interrupt receiving is properly stopped when the guest isno longer interested in an interrupt endpoint.
usbredir: Verify we have 32 bits bulk length cap when redirecting to xhci
The xhci-hcd may submit bulk transfers > 65535 bytes even when not usingbulk-in pipeling, so usbredir can only be used in combination with an xhcihcd if the client has the 32 bits bulk length capability....
usbredir: Add usbredir_init_endpoints() helper
usb-redir: Add debugging to bufpq save / restore
xhci: call set-address with dummy usbpacket
Due to the way devices are addressed with xhci (done by hardware, notthe guest os) there is no packet when invoking the set-address controlrequest. Create a dummy packet in that case to avoid null pointerdereferences....
usb/ehci: Clean up SysBus and PCI EHCI split
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 anidentifying type. Introduce generic abstract base types for PCI andSysBus EHCI to allow multiple types to access the shared fields....
usb/ehci: Move capsbase and opregbase into SysBus EHCI class
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: Add SysBus EHCI device for Exynos4210
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>...
ehci: Add a ehci_writeback_async_complete_packet helper function
Also drop the warning printf, which was there mainly because this was anuntested code path (as the previous bug fixes to it show), but that nolonger is the case now :)
Signed-off-by: Hans de Goede <hdegoede@redhat.com>...
ehci: Add ehci_verify_qh and ehci_verify_qtd helper functions
ehci: Verify guest does not change the token of inflight qtd-s
This is not allowed, except for clearing active on cancellation, so don'twarn when the new token does not have its active bit set.
This unifies the cancellation path for modified qtd-s, and prepares...
ehci: Move get / put_dwords upwards
No other changes.
ehci: writeback_async_complete_packet: verify qh and qtd
ehci: Verify qtd for async completed packets
Remove the short-circuiting of fetchqtd in fetchqh, so that theqtd gets properly verified before completing the transaction.
ehci: Add an ehci_get_pid helper function
ehci: Verify a queue's ep direction does not change
ehci_fill_queue assumes that there is a one on one relationship between an epand a qh, this patch adds a check to ensure this.
Note I don't expect this to ever trigger, this is just something I noticed...
ehci: Use uframe precision for interrupt threshold checking (v2)
Before this patch, the following could happen:1) Transfer completes, raises interrupt2) .5 ms later we check if the guest has queued up any new transfers3) We find and execute a new transfer...
ehci: Further speedup rescanning if async schedule after raising an interrupt
I tried lowering the time between raising an interrupt and rescanning theasync schedule to see if the guest has queued a new transfer before, butthat did not have any positive effect. I now believe the cause for this is...
ehci: Don't call commit_irq after raising PCD
ehci_raise_irq(s, USBSTS_PCD), gets applied immediately so there is no needto call commit_irq after it.
usb/redirect.c: unbreak compilation due to include/char/char.h
Broken since:
commit 927d4878b0ff319ed87fed9363f314613b0a5ed9Author: Paolo Bonzini <pbonzini@redhat.com>Date: Mon Dec 17 18:20:05 2012 +0100
softmmu: move remaining include files to include/ subdirectories...
softmmu: move remaining include files to include/ subdirectories
softmmu: move include files to include/sysemu/
misc: move include files to include/qemu/
monitor: move include files to include/monitor/
janitor: add guards to headers
exec: move include files to include/exec/
ui: move files to ui/ and include/ui/
net: reorganize headers
Move public headers to include/net, and leave private headers in net/.Put the virtio headers in include/net/tap.h, removing the multiple copiesthat existed. Leave include/net/tap.h as the interface for NICs, andnet/tap_int.h as the interface for OS-specific parts of the tap backend....
net: move Bluetooth stuff out of net.h
janitor: do not rely on indirect inclusions of or from qemu-char.h
Various header files rely on qemu-char.h including qemu-config.h ormain-loop.h, but they really do not need qemu-char.h at all (particularlyinteresting is the case of the block layer!). Clean this up, and also...
pci: update all users to look in pci/
update all users so we can remove the makefile hack.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
usb-tablet: Allow connecting to ehci
Our ehci code has is capable of significantly lowering the wakeup ratefor the hcd emulation while the device is idle. It is possible to addsimilar code ot the uhci emulation, but that simply is not there atm,and there is no reason why a (virtual) usb-tablet can not be a USB-2 device....
usb: Call wakeup when data becomes available for all devices with int eps
This is necessary for proper interaction with the xhci controller, and itwill allow other hcds to lower there frame timer while waiting for interruptdata.
usb: Don't allow USB_RET_ASYNC for interrupt packets
It is tempting to use USB_RET_ASYNC for interrupt packets, rather then thecurrent NAK + polling approach, but this causes issues for migration, asan async completed packet will not getting written back to guest memory until...
usb: Allow overriding of usb_desc at the device level
This allows devices to present a different set of descriptors based ondevice properties.
ehci: Lower timer freq when the periodic schedule is idle
Lower the timer freq if no iso schedule packets complete for 64 frames ina row.
We can safely do this, without adding latency, because:1) If there is isoc traffic this will never trigger2) For async handled interrupt packets (only usb-host), the completion handler...
usb: tag usb host adapters as not hotpluggable.
Hotplugging them simply doesn't work, so tag them accordingly toavoid users trying and then crashing qemu.
For xhci there is nothing fundamental which prevents hotplug fromworking, we'll "only" need a exit() function which cleans up...
usb: fail usbdevice_create() when there is no USB bus
Report an error instead of segfaulting when attaching a USB device to amachine with no USB busses:
$ qemu-system-arm -machine vexpress-a9 \ -sd Fedora-17-armhfp-vexpress-mmcblk0.img \ -kernel vmlinuz-3.4.2-3.fc17.armv7hl \...
ehci-sysbus: Attach DMA context.
This was left as NULL on the initial merge due to debate on the mailing list onhow to handle DMA contexts for sysbus devices. Patch9e11908f12f92e31ea94dc2a4c962c836cba9f2a was later merged to fix OHCI. This is the,equivalent fix for sysbus EHCI....
uhci: Add a completions_only flag for async completions
Add a completions_only flag, and set this when running process_frame for asynccompletion handling, this fixes 2 issues in a single patch:
1) It makes sure async completed packets get written to guest mem immediately,...
uhci: Don't allow the guest to set port-enabled when there is no dev connected
It is possible for device disconnect and the guest trying to reset the port(because of USB xact errors prior to the disconnect getting signaled) to race,when we hit this race, the guest will write the port-control register with its...
uhci: Fix double unlink
uhci_async_cancel() already does a uhci_async_unlink().
usb-bt: Return NAK instead of STALL when interrupt ep has no data
I noticed this while making all devices with interrupt endpoints properlydo wakeup. While at it also add wakeup support.
Note that I've not tested this, but returning STALL for an interrupt ep...
usb-smartcard-reader: Properly NAK interrupt eps when we've no events
When we've no data to return from the interrupt endpoint, return NAK ratherthen a 0 length packet.
CC: Alon Levy <alevy@redhat.com>Signed-off-by: Hans de Goede <hdegoede@redhat.com>...
usb-redir: Split usb_handle_interrupt_data into separate in/out functions
No functional changes.
usb-redir: Don't handle interrupt output packets async
Instead report them as successfully completed directly on submission, thishas 2 advantages:
1) This matches the timing of interrupt output packets on real hardware,with the previous async handling, if an ep has an interval of say 500 ms,...
usb: host-linux: Ignore parsing errors of the device descriptors
The Linux is more tolerant here as well: Just stop parsing the devicedescriptors when an error is detected but do not reset what was foundso far. This allows to run buggy devices with partially invalid...
ehci: Don't access packet after freeing it
ehci_state_writeback() will free the packet, so we should not accessthe packet after calling ehci_state_writeback().
ehci: Fixup q->qtdaddr after cancelling an already completed packet
This avoids the q->qtdaddr == p->qtdaddr asserts we have triggering, whena queue contains multiple completed packages when we cancel the queue.
I triggered this with windows7 + async interrupt endpoint handling (*)...
ehci: Better detection for qtd-s linked in circles
Windows links interrupt qtd-s in circles, which means that when interruptendpoints return USB_RET_ASYNC, combined with the recent"ehci: Retry to fill the queue while waiting for td completion" patch,we keep adding the tds to the queue over and over again, as we detect the...
ehci: Don't verify the next pointer for periodic qh-s and qtd-s
While testing the move to async packet handling for interrupt endpoints Inoticed that Windows-XP likes to play tricks with the next pointer forperiodic qh-s, so we should not fail qh / qtd verification when it changes....
ehci: keep the frame timer running in case the guest asked for frame list rollover interrupts
ehci: handle dma errors
Starting with commit 1c380f9460522f32c8dd2577b2a53d518ec91c6d dmatransfers can actually fail. This patch makes ehci keep trackof the busmaster bit in pci config space, by setting/clearing thedma_context pointer. Attempts to dma without context will result...
usb-redir: Only add actually in flight packets to the in flight queue
Packets which are queued up, but not yet handed over to the device, arenot in flight.
usb-redir: Set default debug level to warning
The previous default of 0 means that even errors and warnings would notget printed, which is really not a good default.
usb-host: update tracing
Now that we have separate status and length fields in USBPacketupdate the completion tracepoint to log both.
usb-host: fix splitted transfers
USBPacket->actual_length wasn't updated correctly for USBPacketssplitted into multiple urbs. Fix it.
usb: Fix (another) bug in usb_packet_map() for IOMMU handling
Elements in qemu SGLists can cross IOMMU page boundaries. So, in commit39c138c8420f51a7da7b35233a8d7400a0b589ac "usb: Fix usb_packet_map() in thepresence of IOMMUs", I changed usb_packet_map() to split up each SGList...
usb-host: scan for usb devices when the vm starts
Commit a844ed842d9a9d929645c09ae0f52f753d7a02e0 leads to usb-hostdetecting devices not right after qemu startup because the guestisn't running yet. Instead they are found on the first of theregular usb device poll runs. Which is too late for seabios to see...
Merge remote-tracking branch 'bonzini/scsi-next' into staging
dma: Define dma_context_memory and use in sysbus-ohci
Define a new global dma_context_memory which is a DMAContext correspondingto the global address_space_memory AddressSpace. This can be used bysysbus peripherals like sysbus-ohci which need to do DMA....
ehci: fix migration
Commit 5010d4dc618b6b8e7c21129c487c06f6493f71fc reorganized vmstate tosplit core + pci, but got two little details wrong. Fix them.
xhci: Fix some DMA host endian bugs
The xhci device does correct endian switches on the results of some DMAsbut not all. In particular, there are many DMAs of what are essentiallyarrays of 32-bit integers which never get byteswapped. This causes them...
ehci: Add support for packets with both data and an error status
xhci: Add support for packets with both data and an error status
usb/combined-packet: Move freeing of combined to usb_combined_packet_remove()
usb: split packet result into actual_length + status
Since with the ehci and xhci controllers a single packet can be largerthen maxpacketsize, it is possible for the result of a single packetto be both having transferred some data as well as the transfer to have...
usb-redir: Allow packets to have both data and an error-status
ehci: Get rid of the magical PROC_ERR status
Instead make ehci_execute and ehci_fill_queue return the again value.
usb-redir: Add an usbredir_setup_usb_eps() helper function
usb-redir: Use reject rather the disconnect on bad ep info
So that the client gets a notification about us disconnecting the device.
usb-redir: Allow to attach USB 2.0 devices to 1.1 host controller
This follows the logic of host-linux: If a 2.0 device has no ISOendpoint and no interrupt endpoint with a packet size > 64, we canattach it also to an 1.1 host controller. In case the redir server does...
usb-redir: Allow redirecting super speed devices to high speed controllers
usb-redir: Add support for input pipelining
usb/ehci-pci: add ich9 00:1a.* variant
usb/ehci-pci: add helper to create ich9 usb controllers
uhci: Add a uhci_handle_td_error() helper function
uhci: Don't crash on device disconnect
My recent uhci cleanup series has introduced a regression, whereqemu sometimes crashes on a device disconnect. The problem is thatthe uhci code never checked for a device not / no longer existing, insteadit was relying on usb_handle_packet accepting a NULL device....
usb: Add packet combining functions
Currently we only do pipelining for output endpoints, since to properlysupport short-not-ok semantics we can only have one outstanding inputpacket. Since the ehci and uhci controllers have a limited per td packetsize guests will split large input transfers to into multiple packets,...
combined-packet: Add a workaround for Linux usbfs + live migration
Older versions (anything but the latest) of Linux usbfs + libusb(x),will submit larger (bulk) transfers split into multiple 16k submissions,which means that rather then all tds getting linked into the queue in...
usb-redir: Add support for 32 bits bulk packet length
uhci: dynamic type generation
uhci: stick irq routing info into UHCIInfo too.
Kills the ugly "switch (device_id) { ... }" struct and makes it easierto figure what the differences between the uhci variants are.
Need our own DeviceClass struct for that so we can allocate some spaceto store UHCIInfo....
uhci: add ich9 00:1a.* variants
usb/ehci-pci: dynamic type generation
usb/ehci: add sysbus variant