summaryrefslogtreecommitdiff
path: root/hw/usb/dev-unifying.c
AgeCommit message (Collapse)AuthorFilesLines
2014-08-17WIP firmware reverse engineeringlogitech-unifyingPeter Wu1-0/+29
Not touched since 7 April 2014.
2014-03-31unifying: fix double reporting when in HID++ modePeter Wu1-3/+27
Keys would appear "stuck" before this patch. It turns out that interrupt transfers to EP1 (keyboard) and EP2 (mouse) were still happening while the devices really are in HID++ mode instead of HID. To fix this, pretend there is no data when in HID++ mode. Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-24unifying: mouse compat with Win guests, other mouse fixesPeter Wu1-3/+9
Two stupid mistakes slipped in while refactoring the HID report generation in 3615170bd1ed6f09f878a8b538321044efddd8e0 ("unifying: fix mouse report format, DRY"). This makes evtest in Linux report mouse events again and openbox seems happy too. Another mistake went in the calculation of the Y field, the high and low bits of Y were accidentally swapped. As the descriptor for interface 2 (mouse, etc.) includes Report IDs, this ID must be prepended to the HID payload for mice reports. This makes the mouse function for Windows guests. (See section 8.1 of HID 1.11). Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-24unifying: prevent sending HID++ reports if not enabledPeter Wu1-0/+1
Interrupts were enabled for EP3, but the WinXP driver did not support the reports sent through it. Prevent generating HID++ reports for devices that are not in DJ mode (i.e. in standard HID mode). Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-24unifying: allow keyboard to be disabled with nokbdPeter Wu1-4/+16
Used for debugging WinXP. Turns out that even usb-kbd is broken, so it must be the USB stack used by WinXP that is problematic. Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-24unifying: make Get_Report provide sane mouse reportsPeter Wu1-5/+1
...and ignore Get_Report for HID++ queries. 0x20 and 0x21 already return EPIPE on real hw, but even querying 0x10 and 0x11 does not make sense as the device index is not known. Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-24unifying: fix mouse report format, DRYPeter Wu1-9/+38
Introduce new function to retrieve HID data for a given HIDState (if any) and fix the incompatibility between the HID format for mice as used by QEMU and the format described by the report (it contains an extra field for buttons). Signed-off-by: Peter Wu <peter@lekensteyn.nl>
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-20unifying: introduce usbdump property to specify dump namePeter Wu1-2/+9
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-19unifying: move mode to LHIdDevice, init/reset functionalityPeter Wu1-2/+9
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-18unifying: WIP for HID++ supportPeter Wu1-11/+6
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 Wu1-19/+2
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-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-16usbdump: fail early if dump file is not availablePeter Wu1-6/+2
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-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-16unifying: hook up usbdump with handle_controlPeter Wu1-6/+30
Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-03-16unifying: WIP for Logitech Unifying Receiver emulationPeter Wu1-0/+668
Based on hw/usb/dev-wacom.c