summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2014-03-23unifying: interface with HID++ 2.0 featuresPeter Wu4-2/+95
Prepare for adding more HID++ 2.0 features.
2014-03-20unifying: remove unnecessary commented out codePeter Wu1-5/+0
The USB_CFG_ATT_WAKEUP seems to be ignored by the device, perhaps it gets handled by the OS. usb_desc_attach is not necessary because we only have one full-speed configuration. If there would also be a high-speed (or super-speed) configuration, then usb_desc_attach must be added back to allow picking an appropriate configuration based on the speed of the controller port (UHCI, EHCI, XHCI). usb_desc_init() takes care of setting the initial configuration (there is only one now). Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-20usbdump: support xhciPeter Wu2-10/+23
The XHCI HCD sends an OUT packet which was unexpected by the usbdump code. That was the case because the core USB code that was normally calling handle_control only called when the full data was received from the host (from the Status stage, with PID == USB_TOKEN_IN). Then there is also the do_parameter function as used by XHCI that was not really handled. Fix this by allowing OUT tokens, also document why this is necessary. Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-20unifying: introduce usbdump property to specify dump namePeter Wu2-2/+10
Stop hard-coding capture file and introduce the "usbdump" property to specify the capture file path. When omitted, no capture will be done. Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-20hid: introduce usbdump property to specify dump namePeter Wu1-2/+12
Stop hard-coding capture file and introduce the "usbdump" property to specify the capture file path. When omitted, no capture will be done. Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-20unifying: start implementing HID++ 2.0 for devicesPeter Wu2-8/+67
New Hidpp20Msg type helps reading the HID++ 2.0 function format. Implemented error responses (undocumented), and IRoot.GetProtocol(). Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-20unifying: version reg F1 for receiver and HID++ 1.0 devsPeter Wu1-0/+40
Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-19unifying: start implementing device report processingPeter Wu1-2/+41
Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-19unifying: reject long DJ writes unconditionallyPeter Wu1-11/+5
Reports 0x21 always fails (-EPIPE) for Set_Report. Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-19unifying: implemented pairing info info for receiverPeter Wu1-0/+18
Undocumented, so it's guesswork based on https://git.lekensteyn.nl/ltunify/tree/registers.txt Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-19unifying: fix long reg read, implement reg b5 readPeter Wu1-2/+43
Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-19unifying: implement 0x41 notification, trigger on reg 02Peter Wu2-1/+39
Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-19unifying: fix mixup of reporting flags, HidppMsg tweaksPeter Wu2-15/+25
The "address" and "value" split for short and long HID++ messages only make sense for HID++ 1.0 register accesses. For others, use "params". Also fix a mixup of reporting flags. Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-19unifying: implement activity counters and rcvr reg B3Peter Wu2-0/+17
Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-19unifying: handle receiver regs 0 and 2Peter Wu2-4/+52
2014-03-19unifying: pass pointer to msg, handle kbd LED requestPeter Wu1-15/+18
It is not dangerous to modify the original data buffer, so just pass a pointer for the message instead. Also implement DJ report type 0x0E (LEDS). Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-19unifying: process receiver reports earlierPeter Wu1-5/+28
The idea of the input queue is probably that wireless devices cannot immediately be queried, but the receiver is able to respond immediately. Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-19unifying: fill in more device and receiver infoPeter Wu2-2/+20
These serial numbers are obviously fake, the product and device names, however, are real. Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-19unifying: fix device indices, fix error formatPeter Wu1-8/+12
Also enable processing of input reports. Now at least keyboard events work and the enumeration order is slightly more sane, yay! Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-19unifying: ensure that report lengths are validPeter Wu1-0/+7
The length should match our expectations, but let's check that to be sure. Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-19unifying: move mode to LHIdDevice, init/reset functionalityPeter Wu3-7/+177
WIP (partially untested). Handle input reports, respond with HID events if there are no queued output reports. Implemented input report processing for receiver: 0x80 (Switch and Keep-Alive), 0x81 (Get Paired Devices). Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-19unifying: rename input queue, fix error queuePeter Wu2-14/+40
Fix error queue name, rename input queue for clarity. Split input and output queue for further work and NAK when there is no interrupt data available.
2014-03-18unifying: WIP for HID++ supportPeter Wu4-14/+326
Error queue is implemented, possible receiver and device properties are filled in (in the header). Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-17unifying: move definitions to headerPeter Wu2-19/+47
Prepare for adding DJ support, which I expect to be huge and unrelated to the HID code. Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-17usbdump: fix endpoint lookupPeter Wu1-5/+9
bNumEndpoints specify the number of endpoints in the endpoint descriptor. When the mouse endpoint was tried (EP2), it triggered this assertion because there is only one endpoint for the interface. Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-17unifying: support HID Get_Report and Set_ReportPeter Wu1-8/+13
Copied from dev-hid.c (order changed to match interfaces order). Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-17unifying: implement basic HID processingPeter Wu1-22/+143
For now, the receiver has always a mouse and keyboard paired. Set_Idle, Get_Idle, Get_Protocol and Set_Protocol support interface-specific devices. Interrupt data for the HID mode are also implemented. Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-17usbdump: do not hard-code bus number, use nr from USBBusPeter Wu1-1/+3
Instead of changing bus.c (next_usb_bus) and possibly breaking configurations relying on this number, just add one in the dump code for cosmetic purposes. Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-16usbdump: fix start time offset of capturePeter Wu1-3/+2
There is still a discrepancy (seen 300 ms and 600 ms), but it is better than completely a difference equal to the uptime. Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-16usb-hid: usbdump example for control and interrupt INPeter Wu1-0/+17
This is verified to reproduce the same capture as done inside the VM. The differences are in time, bInterval, URB length, URB ID and the Copy of transfer flags. Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-16usbdump: comments updatePeter Wu2-3/+28
And I was wondering why the interrupt packets in dev-hid.c had a reversed type marking...
2014-03-16usbdump: fix IN marking for non-control packetsPeter Wu1-2/+8
Non-control transfers have a meaningless setup buffer. Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-16usbdump: constantify variablesPeter Wu2-17/+17
Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-16usbdump: fix reversal of URB length and captured lengthPeter Wu1-4/+11
The "length" field stores the expected size of data. "len_cap" stores the real length of the data in the current packet (the "captured" data). Also try to set a slightly more sane length value depending on submission type, but this is much braindead. Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-16usbdump: fix interval retrieval for endpointPeter Wu1-2/+4
Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-16usbdump: initial API extension for handle_dataPeter Wu2-1/+83
Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-16usbdump: fail early if dump file is not availablePeter Wu3-8/+15
This allows for less less checking by the consumer and avoids unnecessary work if the capture cannot be written anyway. Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-16net/dump: simplify timestamp calculationPeter Wu1-5/+3
The timestamp calculation in dump_receive is very unobvious now and looks completely arbitrary. qemu_clock_get_us already returns micro- seconds, so use that instead of manual calculating with nanoseconds. While at it, express the private start_ts field in microseconds too instead of seconds. This is supposed to yield a more accurate initial timestamp (based on host clock). NOTE: this patch ignores the RTC of the guest! Perhaps this part should be reverted.
2014-03-16unifying: remove unused leftover from dev-wacomPeter Wu1-186/+7
To make a tidy ship, remove unused parts that were taken from dev-wacom. Also enable a handle_data callback (currently empty), handle_reset (currently sets the device mode to HID instead of DJ). This is incomplete, the handle_data callback must contain something. Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-16usbdump: get interval from descriptorPeter Wu1-2/+21
It looks very ugly, perhaps a helper function should moved to desc.c? Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-16unifying: hook up usbdump with handle_controlPeter Wu1-6/+30
Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-16Initial usbdump helperPeter Wu3-0/+430
USB packets are captured in the pcap format using the Linux usbmon link-layer type. Right now, this only works with handle_ctrl. Data packets (isochronous, bulk and interrupt) are not (fully) implemented yet. Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-16unifying: WIP for Logitech Unifying Receiver emulationPeter Wu3-0/+670
Based on hw/usb/dev-wacom.c
2014-03-15Merge remote-tracking branch 'remotes/rth/tcg-aarch-6-2' into stagingPeter Maydell2-255/+594
* remotes/rth/tcg-aarch-6-2: tcg-aarch64: Introduce tcg_out_insn_3405 tcg-aarch64: Support div, rem tcg-aarch64: Support muluh, mulsh tcg-aarch64: Support add2, sub2 tcg-aarch64: Support deposit tcg-aarch64: Use tcg_out_insn for setcond tcg-aarch64: Support movcond tcg-aarch64: Support andc, orc, eqv, not, neg tcg-aarch64: Handle constant operands to and, or, xor tcg-aarch64: Handle constant operands to add, sub, and compare tcg-aarch64: Implement mov with tcg_out_insn tcg-aarch64: Introduce tcg_out_insn_3401 tcg-aarch64: Convert shift insns to tcg_out_insn tcg-aarch64: Introduce tcg_out_insn Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-03-14Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into ↵Peter Maydell11-22/+622
staging Block pull request # gpg: Signature made Fri 14 Mar 2014 16:12:14 GMT using RSA key ID 81AB73C8 # gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>" # gpg: aka "Stefan Hajnoczi <stefanha@gmail.com>" # gpg: WARNING: This key is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35 775A 9CA4 ABB3 81AB 73C8 * remotes/stefanha/tags/block-pull-request: qemu-iotests: remove 085 and 087 from 'quick' group qemu-iotests: add 083 NBD client disconnect tests tests: add nbd-fault-injector.py utility nbd: close socket if connection breaks block: Explicitly specify 'unsigned long long' for VHDX 64-bit constants blockdev: Refuse to open encrypted image unless paused Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-03-14Merge remote-tracking branch 'remotes/bonzini/scsi-next' into stagingPeter Maydell5-4/+38
* remotes/bonzini/scsi-next: virtio-scsi: actually honor sense_size from configuration space scsi: Fix migration of scsi sense data spapr-vscsi: fix CRQ status Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-03-14tcg-aarch64: Introduce tcg_out_insn_3405Richard Henderson1-21/+27
Cleaning up the implementation of tcg_out_movi at the same time. Signed-off-by: Richard Henderson <rth@twiddle.net> Reviewed-by: Claudio Fontana <claudio.fontana@huawei.com> Tested-by: Claudio Fontana <claudio.fontana@huawei.com>
2014-03-14tcg-aarch64: Support div, remRichard Henderson2-13/+45
Clean up multiply at the same time. For remainder, generic code will produce mul+sub, whereas we can implement with msub. Signed-off-by: Richard Henderson <rth@twiddle.net> Reviewed-by: Claudio Fontana <claudio.fontana@huawei.com> Tested-by: Claudio Fontana <claudio.fontana@huawei.com>
2014-03-14tcg-aarch64: Support muluh, mulshRichard Henderson2-2/+14
Signed-off-by: Richard Henderson <rth@twiddle.net> Reviewed-by: Claudio Fontana <claudio.fontana@huawei.com> Tested-by: Claudio Fontana <claudio.fontana@huawei.com>
2014-03-14tcg-aarch64: Support add2, sub2Richard Henderson2-4/+80
Signed-off-by: Richard Henderson <rth@twiddle.net> Reviewed-by: Claudio Fontana <claudio.fontana@huawei.com> Tested-by: Claudio Fontana <claudio.fontana@huawei.com>