summaryrefslogtreecommitdiffstats
path: root/hw/input
Commit message (Collapse)AuthorAgeFilesLines
* qapi: Mechanically convert FOO_lookup[...] to FOO_str(...)Markus Armbruster2017-09-041-2/+2
| | | | | | Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <1503564371-26090-14-git-send-email-armbru@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
* trace-events: fix code style: print 0x before hex numbersVladimir Sementsov-Ogievskiy2017-08-011-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The only exception are groups of numers separated by symbols '.', ' ', ':', '/', like 'ab.09.7d'. This patch is made by the following: > find . -name trace-events | xargs python script.py where script.py is the following python script: ========================= #!/usr/bin/env python import sys import re import fileinput rhex = '%[-+ *.0-9]*(?:[hljztL]|ll|hh)?(?:x|X|"\s*PRI[xX][^"]*"?)' rgroup = re.compile('((?:' + rhex + '[.:/ ])+' + rhex + ')') rbad = re.compile('(?<!0x)' + rhex) files = sys.argv[1:] for fname in files: for line in fileinput.input(fname, inplace=True): arr = re.split(rgroup, line) for i in range(0, len(arr), 2): arr[i] = re.sub(rbad, '0x\g<0>', arr[i]) sys.stdout.write(''.join(arr)) ========================= Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Acked-by: Cornelia Huck <cohuck@redhat.com> Message-id: 20170731160135.12101-5-vsementsov@virtuozzo.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* trace-events: fix code style: %# -> 0x%Vladimir Sementsov-Ogievskiy2017-08-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In trace format '#' flag of printf is forbidden. Fix it to '0x%'. This patch is created by the following: check that we have a problem > find . -name trace-events | xargs grep '%#' | wc -l 56 check that there are no cases with additional printf flags before '#' > find . -name trace-events | xargs grep "%[-+ 0'I]+#" | wc -l 0 check that there are no wrong usage of '#' and '0x' together > find . -name trace-events | xargs grep '0x%#' | wc -l 0 fix the problem > find . -name trace-events | xargs sed -i 's/%#/0x%/g' [Eric Blake noted that xargs grep '%[-+ 0'I]+#' should be xargs grep "%[-+ 0'I]+#" instead so the shell quoting is correct. --Stefan] Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-id: 20170731160135.12101-3-vsementsov@virtuozzo.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* docs: fix broken paths to docs/devel/tracing.txtPhilippe Mathieu-Daudé2017-07-311-1/+1
| | | | | | | | | With the move of some docs/ to docs/devel/ on ac06724a71, no references were updated. Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
* ui: drop ac_search and ac_stopGerd Hoffmann2017-07-281-4/+4
| | | | | | | | | Both keys exist already: "ac_search" is "find" and "ac_stop" is "stop". Fixes: 37810e80553c19f0dac3644924895a9bf5c70785 Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Daniel P. Berrange <berrange@redhat.com> Message-id: 20170728063415.27480-1-kraxel@redhat.com
* ui: drop altgr and altgr_r QKeyCodesGerd Hoffmann2017-07-272-3/+0Star
| | | | | | | | | The right alt key (alt_r aka KEY_RIGHTALT) is used for AltGr. The altgr and altgr_r keys simply don't exist. Drop them. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-id: 20170727104720.30061-1-kraxel@redhat.com
* ps2: enable multimedia keysGerd Hoffmann2017-07-271-4/+0Star
| | | | | | | Fixes: 8c10e0baf0260b59a4e984744462a18016662e3e Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-id: 20170726152918.11995-6-kraxel@redhat.com
* memory: Rename memory_region_init_ram() to memory_region_init_ram_nomigrate()Peter Maydell2017-07-141-2/+2
| | | | | | | | | | Rename memory_region_init_ram() to memory_region_init_ram_nomigrate(). This leaves the way clear for us to provide a memory_region_init_ram() which does handle migration. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Message-id: 1499438577-7674-4-git-send-email-peter.maydell@linaro.org
* vmstate: error hint for failed equal checksHalil Pasic2017-06-281-1/+1
| | | | | | | | | | | | | | | | | In some cases a failing VMSTATE_*_EQUAL does not mean we detected a bug, but it's actually the best we can do. Especially in these cases a verbose error message is required. Let's introduce infrastructure for specifying a error hint to be used if equal check fails. Let's do this by adding a parameter to the _EQUAL macros called _err_hint. Also change all current users to pass NULL as last parameter so nothing changes for them. Signed-off-by: Halil Pasic <pasic@linux.vnet.ibm.com> Message-Id: <20170623144823.42936-1-pasic@linux.vnet.ibm.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
* ps2: reset queue in ps2_reset_keyboardGerd Hoffmann2017-06-231-0/+1
| | | | | | | | | | | When the guest resets the keyboard also clear the queue. It is highly unlikely that the guest is still interested in the events stuck in the queue, and it avoids confusing the guest in case the queue is full and the ACK can't be queued up. Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1372583 Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 20170606112105.13331-4-kraxel@redhat.com
* ps2: add ps2_reset_queueGerd Hoffmann2017-06-231-5/+10
| | | | | | | | Factor out ps2 queue reset to a separate function. No functional change. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 20170606112105.13331-3-kraxel@redhat.com
* ps2: add and use PS2State typedefGerd Hoffmann2017-06-231-7/+5Star
| | | | | | | | Cleanup: Create and use a typedef for PS2State and stop passing void pointers. No functional change. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 20170606112105.13331-2-kraxel@redhat.com
* hid: Reset kbd modifiers on resetAlexander Graf2017-06-231-0/+1
| | | | | | | | | | | When resetting the keyboard, we need to reset not just the pending keystrokes, but also any pending modifiers. Otherwise there's a race when we're getting reset while running an escape sequence (modifier 0x100). Cc: qemu-stable@nongnu.org Signed-off-by: Alexander Graf <agraf@suse.de> Message-id: 1498117295-162030-1-git-send-email-agraf@suse.de Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* shutdown: Add source information to SHUTDOWN and RESETEric Blake2017-05-231-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Time to wire up all the call sites that request a shutdown or reset to use the enum added in the previous patch. It would have been less churn to keep the common case with no arguments as meaning guest-triggered, and only modified the host-triggered code paths, via a wrapper function, but then we'd still have to audit that I didn't miss any host-triggered spots; changing the signature forces us to double-check that I correctly categorized all callers. Since command line options can change whether a guest reset request causes an actual reset vs. a shutdown, it's easy to also add the information to reset requests. Signed-off-by: Eric Blake <eblake@redhat.com> Acked-by: David Gibson <david@gibson.dropbear.id.au> [ppc parts] Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> [SPARC part] Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com> [s390x parts] Message-Id: <20170515214114.15442-5-eblake@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
* qdev: Replace cannot_instantiate_with_device_add_yet with !user_creatableEduardo Habkost2017-05-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | cannot_instantiate_with_device_add_yet was introduced by commit efec3dd631d94160288392721a5f9c39e50fb2bc to replace no_user. It was supposed to be a temporary measure. When it was introduced, we had 54 cannot_instantiate_with_device_add_yet=true lines in the code. Today (3 years later) this number has not shrunk: we now have 57 cannot_instantiate_with_device_add_yet=true lines. I think it is safe to say it is not a temporary measure, and we won't see the flag go away soon. Instead of a long field name that misleads people to believe it is temporary, replace it a shorter and less misleading field: user_creatable. Except for code comments, changes were generated using the following Coccinelle patch: @@ expression DC; @@ ( -DC->cannot_instantiate_with_device_add_yet = false; +DC->user_creatable = true; | -DC->cannot_instantiate_with_device_add_yet = true; +DC->user_creatable = false; ) @@ typedef ObjectClass; expression dc; identifier class, data; @@ static void device_class_init(ObjectClass *class, void *data) { ... dc->hotpluggable = true; +dc->user_creatable = true; ... } @@ @@ struct DeviceClass { ... -bool cannot_instantiate_with_device_add_yet; +bool user_creatable; ... } @@ expression DC; @@ ( -!DC->cannot_instantiate_with_device_add_yet +DC->user_creatable | -DC->cannot_instantiate_with_device_add_yet +!DC->user_creatable ) Cc: Alistair Francis <alistair.francis@xilinx.com> Cc: Laszlo Ersek <lersek@redhat.com> Cc: Marcel Apfelbaum <marcel@redhat.com> Cc: Markus Armbruster <armbru@redhat.com> Cc: Peter Maydell <peter.maydell@linaro.org> Cc: Thomas Huth <thuth@redhat.com> Acked-by: Alistair Francis <alistair.francis@xilinx.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Marcel Apfelbaum <marcel@redhat.com> Acked-by: Marcel Apfelbaum <marcel@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Message-Id: <20170503203604.31462-2-ehabkost@redhat.com> [ehabkost: kept "TODO remove once we're there" comment] Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
* ui: Support non-zero minimum values for absolute input axesPhilippe Voinov2017-05-111-2/+4
| | | | | | | | | | This patch refactors ui/input.c to support absolute axis minimum values other than 0. All dependent calls to qemu_input_queue_abs have been updated to explicitly supply 0 as the axis minimum value. Signed-off-by: Philippe Voinov <philippevoinov@gmail.com> Message-id: 20170505133952.29885-1-philippevoinov@gmail.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* input: Add trace event for empty keyboard queueAlexander Graf2017-05-032-0/+5
| | | | | | | | | | | | | | When driving QEMU from the outside, we have basically no chance to determine how quickly the guest OS picks up key events, so we usually have to limit ourselves to very slow keyboard presses to make sure the guest always has enough chance to pick them up. This patch adds a trace events when the keyboarde queue is drained. An external driver can use that as hint that new keys can be pressed. Signed-off-by: Alexander Graf <agraf@suse.de> Message-id: 1490883775-94658-1-git-send-email-agraf@suse.de Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* virtio-input: fix eventq batchingLadi Prosek2017-03-271-15/+14Star
| | | | | | | | | | | | | | | | | | | | virtio_input_send buffers input events until it sees a SYNC. Then it either sends or drops the entire batch, depending on whether eventq has enough space available. The case to avoid here is partial sends where only part of the batch would get to the guest. Using virtqueue_get_avail_bytes to check the state of eventq was not correct. The queue may have a smaller number of larger buffers available so bytes may be enough but the batch would still not be possible to send, leading to the "Huh? No vq elem available" error. Instead of checking available bytes, this patch optimistically pops buffers from the queue and puts them back in case it runs out of space and the batch needs to be dropped. Signed-off-by: Ladi Prosek <lprosek@redhat.com> Message-id: 1490365490-4854-3-git-send-email-lprosek@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* virtio-input: free event queue when finalizingLadi Prosek2017-03-271-2/+4
| | | | | | | | | | VirtIOInput.queue was never freed. This commit adds an explicit g_free to virtio_input_finalize and switches the allocation function from realloc to g_realloc in virtio_input_send. Signed-off-by: Ladi Prosek <lprosek@redhat.com> Message-id: 1490365490-4854-2-git-send-email-lprosek@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* Merge remote-tracking branch 'remotes/stefanha/tags/tracing-pull-request' ↵Peter Maydell2017-02-021-2/+0Star
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into staging # gpg: Signature made Wed 01 Feb 2017 13:44:32 GMT # gpg: using RSA key 0x9CA4ABB381AB73C8 # gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>" # gpg: aka "Stefan Hajnoczi <stefanha@gmail.com>" # Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35 775A 9CA4 ABB3 81AB 73C8 * remotes/stefanha/tags/tracing-pull-request: trace: clean up trace-events files qapi: add missing trace_visit_type_enum() call trace: improve error reporting when parsing simpletrace header trace: update docs to reflect new code generation approach trace: switch to modular code generation for sub-directories trace: move setting of group name into Makefiles trace: move hw/i386/xen events to correct subdir trace: move hw/xen events to correct subdir trace: move hw/block/dataplane events to correct subdir make: move top level dir to end of include search path # Conflicts: # Makefile Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * trace: clean up trace-events filesStefan Hajnoczi2017-01-311-2/+0Star
| | | | | | | | | | | | | | | | | | | | | | | | There are a number of unused trace events that scripts/cleanup-trace-events.pl finds. The "hw/vfio/pci-quirks.c" filename was typoed and "qapi/qapi-visit-core.c" was missing the qapi/ directory prefix. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-id: 20170126171613.1399-3-stefanha@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* | ps2: add support for mice with extra/side buttonsFabian Lesniak2017-01-311-3/+5
|/ | | | | | | | | | This enables the ps2 controller to process mouse events for buttons 4 and 5. Additionally, distinct definitions for the ps2 mouse button state are introduced. The legacy definitions from console.h are not used anymore. Signed-off-by: Fabian Lesniak <fabian@lesniak-it.de> Message-id: 20161206190007.7539-3-fabian@lesniak-it.de Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* Merge remote-tracking branch 'remotes/kraxel/tags/pull-ui-20170110-1' into ↵Peter Maydell2017-01-101-0/+10
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | staging gtk,vnc: misc bugfixes. kbd: add jp keys, fix ps2 regressions. sdl: export window id for baum, remove sdl hooks from baum. egl: egl-helpers.c license change. # gpg: Signature made Tue 10 Jan 2017 07:16:05 GMT # gpg: using RSA key 0x4CB6D8EED3E87138 # 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>" # Primary key fingerprint: A032 8CFF B93A 17A7 9901 FE7D 4CB6 D8EE D3E8 7138 * remotes/kraxel/tags/pull-ui-20170110-1: ps2: Fix lost scancodes by recent changes curses: Fix compiler warnings (Mingw-w64 redefinition of macro KEY_EVENT) ui/vnc: Fix problem with sending too many bytes as server name gtk: avoid oob array access egl-helpers: Change file licensing to LGPLv2 sdl2: set window ID console: move window ID code from baum to sdl console: add API to get underlying gui window ID ui: use evdev keymap when running under wayland ui/gtk: fix crash at startup when no console is available Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * ps2: Fix lost scancodes by recent changesOGAWA Hirofumi2017-01-101-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | With "ps2: use QEMU qcodes instead of scancodes", key handling was changed to qcode base. But all scancodes are not converted to new one. This adds some missing qcodes/scancodes what I found in using. [set1 and set3 are from <hpoussin@reactos.org>] Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> Reviewed-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* | i2c: Allow I2C devices to NAK start eventsCorey Minyard2017-01-091-1/+3
|/ | | | | | | | | | | | | | | | | | | | Add a return value to the event handler. Some I2C devices will NAK if they have no data, so allow them to do this. This required the following changes: Go through all the event handlers and change them to return int and return 0. Modify i2c_start_transfer to terminate the transaction on a NAK. Modify smbus handing to not assert if a NAK occurs on a second operation, and terminate the transaction and return -1 instead. Add some information on semantics to I2CSlaveClass. Signed-off-by: Corey Minyard <cminyard@mvista.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* hw/input/hid: support alternative sysrq/break scancodes for gtk-vncPeter Korsgaard2016-11-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The printscreen/sysrq and pause/break keys currently don't work for guests using -usbdevice keyboard when accessed through vnc with a gtk-vnc based client. The reason for this is a mismatch between gtk-vnc and qemu in how these keys should be mapped to XT keycodes. On the original IBM XT these keys behaved differently than other keys. Quoting from https://www.win.tue.nl/~aeb/linux/kbd/scancodes-1.html: The keys PrtSc/SysRq and Pause/Break are special. The former produces scancode e0 2a e0 37 when no modifier key is pressed simultaneously, e0 37 together with Shift or Ctrl, but 54 together with (left or right) Alt. (And one gets the expected sequences upon release. But see below.) The latter produces scancode sequence e1 1d 45 e1 9d c5 when pressed (without modifier) and nothing at all upon release. However, together with (left or right) Ctrl, one gets e0 46 e0 c6, and again nothing at release. It does not repeat. Gtk-vnc supports the 'QEMU Extended Key Event Message' RFB extension to send raw XT keycodes directly to qemu, but the specification doesn't explicitly specify how to map such long/complicated keycode sequences. From the spec (https://github.com/rfbproto/rfbproto/blob/master/rfbproto.rst#qemu-extended-key-event-message) The keycode is the XT keycode that produced the keysym. An XT keycode is an XT make scancode sequence encoded to fit in a single U32 quantity. Single byte XT scancodes with a byte value less than 0x7f are encoded as is. 2-byte XT scancodes whose first byte is 0xe0 and second byte is less than 0x7f are encoded with the high bit of the first byte set hid.c currently expects the keycode sequence with shift/ctl for sysrq (e0 37 -> 0xb7 in RFB), whereas gtk-vnc uses the sequence with alt (0x54). Likewise, hid.c expects the code without modifiers (e1 1d 45 -> 0xc5 in RFB), whereas gtk-vnc sends the keycode sequence with ctrl for pause (e0 46 -> 0xc6 in RFB). See keymaps.cvs in gtk-vnc for the mapping used: https://git.gnome.org/browse/gtk-vnc/tree/src/keymaps.csv#n150 Now, it isn't obvious to me which sequence is really "right", but as the 0x54/0xc6 keycodes are currently unused in hid.c, supporting both seems like the pragmatic solution to me. The USB HID keyboard boot protocol used by hid.c doesn't have any other mapping applicable to these keys. The other guest keyboard interfaces (ps/2, virtio, ..) are not affected, because they handle these keys differently. Signed-off-by: Peter Korsgaard <peter@korsgaard.com> Message-id: 20161028145132.1702-1-peter@korsgaard.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* adb: change handler only when recognizedHervé Poussineau2016-10-281-3/+23
| | | | | | | | | | | ADB devices must take new handler into account only when they recognize it. This lets operating systems probe for valid/invalid handles, to know device capabilities. Add a FIXME in keyboard handler, which should use a different translation table depending of the selected handler. Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* virtio: cleanup VMSTATE_VIRTIO_DEVICEHalil Pasic2016-10-101-2/+0Star
| | | | | | | | | Now all the usages of the old version of VMSTATE_VIRTIO_DEVICE are gone, so we can get rid of the conditionals, and the old macro. Signed-off-by: Halil Pasic <pasic@linux.vnet.ibm.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* virtio-input: convert VMSTATE_VIRTIO_DEVICEHalil Pasic2016-10-101-10/+13
| | | | | | | | Use the new VMSTATE_VIRTIO_DEVICE macro. Signed-off-by: Halil Pasic <pasic@linux.vnet.ibm.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* vmstateify tsc210xDr. David Alan Gilbert2016-10-041-123/+104Star
| | | | | | | | | | | | I'm now saving all 3 of the pll entries; only 2 were saved before. There are a couple of times that were previously stored as offsets from 'now' calculated before saving; with vmstate it's easier to store the 'now' and fix it up on reload. Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Message-id: 1474977735-10156-3-git-send-email-dgilbert@redhat.com Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* vmstateify tsc2005Dr. David Alan Gilbert2016-10-041-115/+75Star
| | | | | | | | | | I've converted the fields in it's main data structure to fixed size types in ways that look sane. Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Message-id: 1474977735-10156-2-git-send-email-dgilbert@redhat.com Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* ps2: do not generate invalid key codes for unknown keysHervé Poussineau2016-09-281-13/+7Star
| | | | | | | | Instead, print a warning message. Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Message-id: 1473969987-5890-6-git-send-email-hpoussin@reactos.org Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* ps2: use QEMU qcodes instead of scancodesHervé Poussineau2016-09-281-48/+485
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes problems with translated set 1, where most make code were wrong. This fixes problems with set 3 for extended keys (like arrows) and lot of other keys. Added a FIXME for set 3, where most keys must not (by default) deliver a break code. Detailed list of changes on untranslated set 2: - change of ALTGR break code from 0xe4 to 0xf0 0x08 - change of ALTGR_R break code from 0xe0 0xe4 to 0xe0 0xf0 0x08 - change of F7 make code from 0x02 to 0x83 - change of F7 break code from 0xf0 0x02 to 0xf0 0x83 - change of PRINT make code from 0xe0 0x7c to 0xe0 0x12 0xe0 0x7c - change of PRINT break code from 0xe0 0xf0 0x7c to 0xe0 0xf0 0x7c 0xe0 0xf0 0x12 - change of PAUSE key: new make code = old make code + old break code, no more break code - change on RO break code from 0xf3 to 0xf0 0x51 - change on KP_COMMA break code from 0xfe to 0xf0 0x6d Detailed list of changes on translated set 2 (the most commonly used): - change of PRINT make code from 0xe0 0x37 to 0xe0 0x2a 0xe0 0x37 - change of PRINT break code from 0xe0 0xb7 to 0xe0 0xb7 0xe0 0xaa - change of PAUSE key: new make code = old make code + old break code, no more break code Reference: http://www.computer-engineering.org/ps2keyboard/scancodes1.html http://www.computer-engineering.org/ps2keyboard/scancodes2.html http://www.computer-engineering.org/ps2keyboard/scancodes3.html Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Message-id: 1473969987-5890-5-git-send-email-hpoussin@reactos.org Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* ps2: allow keycode translation for all scancode setsHervé Poussineau2016-09-281-26/+97
| | | | | | | | | | | | | | | | Change ps2_put_keycode to get an untranslated scancode, which is translated if needed. As qemu_input_key_value_to_scancode() gives translated scancodes, untranslate them in ps2_keyboard_event first before giving them to ps2_put_keycode. Results are not changed, except for some keys in translated set 3. Translation table is available at https://www.win.tue.nl/~aeb/linux/kbd/scancodes-10.html Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Message-id: 1473969987-5890-4-git-send-email-hpoussin@reactos.org Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* ps2: correctly handle 'get/set scancode' commandHervé Poussineau2016-09-281-3/+5
| | | | | | | | | When getting scancode, current scancode must be preceded from reply ack. When setting scancode, we must reject invalid scancodes. Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Message-id: 1473969987-5890-3-git-send-email-hpoussin@reactos.org Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* ps2: reject unknown commands, instead of blindly accepting themHervé Poussineau2016-09-281-1/+1
| | | | | | Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Message-id: 1473969987-5890-2-git-send-email-hpoussin@reactos.org Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* adb.c: prevent NO_KEY value from going to guestJohn Arbuckle2016-09-231-14/+9Star
| | | | | | | The NO_KEY value should not be sent to the guest. This patch drops that value. Signed-off-by: John Arbuckle <programmingkidx@gmail.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* adb.c: correct several key assignmentsJohn Arbuckle2016-09-231-6/+6
| | | | | | | | The original pc_to_adb_keycode mapping did have several keys that were incorrectly mapped. This patch fixes these mappings. Signed-off-by: John Arbuckle <programmingkidx@gmail.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* adb.c: add support for QKeyCodeJohn Arbuckle2016-09-231-45/+189
| | | | | | | | The old pc scancode translation is replaced with QEMU's QKeyCode. This is just a mechanical substitution, which a number of broken mappings left in. Signed-off-by: John Arbuckle <programmingkidx@gmail.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* pc: simplify passing qemu_irqMarc-André Lureau2016-09-081-2/+2
| | | | | | | qemu_irq is already a pointer, no need to have an extra pointer level. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
* trace-events: fix first line comment in trace-eventsLaurent Vivier2016-08-121-1/+1
| | | | | | | | | | | | Documentation is docs/tracing.txt instead of docs/trace-events.txt. find . -name trace-events -exec \ sed -i "s?See docs/trace-events.txt for syntax documentation.?See docs/tracing.txt for syntax documentation.?" \ {} \; Signed-off-by: Laurent Vivier <lvivier@redhat.com> Message-id: 1470669081-17860-1-git-send-email-lvivier@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* virtio-input: free config listMarc-André Lureau2016-08-071-0/+11
| | | | | | | | | | | | Clear the list when finalizing. The list is created during realize with virtio_input_idstr_config() and later by further calls to virtio_input_init_config() and virtio_input_add_config(). This leak can be reproduced with device-introspect-test -p /x86_64/device/introspect/concrete. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
* virtio-input: Wrap in vmstateDr. David Alan Gilbert2016-07-211-20/+6Star
| | | | | | | | | | Forcibly convert it to a vmstate wrapper; proper conversion comes later. Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* input: add trace events for full queuesGerd Hoffmann2016-07-123-2/+10
| | | | | | | | | | It isn't unusual to happen, for example during reboot when the guest doesn't reveice events for a while. So better don't flood stderr with alarming messages. Turn them into tracepoints instead so they can be enabled in case they are needed for trouble-shooting. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 1466675495-28797-1-git-send-email-kraxel@redhat.com
* pckbd: handle A20 IRQ as GPIOEfimov Vasily2016-06-291-14/+7Star
| | | | | | | | | | | The i8042 device has outgouing IRQ line A20. Currently the IRQ is referenced by a pointer which normally is set during machine initialization. The pointer is never changed at runtime. So common GPIO model can be applied to A20 IRQ line. Note that checking for IRQ to be connected as in previous version of code is not required because qemu_set_irq will do it. Signed-off-by: Efimov Vasily <real@ispras.ru> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* trace: split out trace events for hw/input/ directoryDaniel P. Berrange2016-06-201-0/+25
| | | | | | | | | Move all trace-events for files in the hw/input/ directory to their own file. Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Message-id: 1466066426-16657-19-git-send-email-berrange@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* hw: explicitly include qemu/log.hPaolo Bonzini2016-05-191-0/+1
| | | | | | Move the inclusion out of hw/hw.h, most files do not need it. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* virtio-input: support absolute axis config in pass-throughLadi Prosek2016-04-132-5/+47
| | | | | | | | | | VIRTIO_INPUT_CFG_ABS_INFO was not implemented for pass-through input devices. This patch follows the existing design and pre-fetches the config for all absolute axes using EVIOCGABS at realize time. Signed-off-by: Ladi Prosek <lprosek@redhat.com> Message-id: 1460558603-18331-1-git-send-email-lprosek@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* virtio-input: fix emulated tablet axis rangesLadi Prosek2016-04-131-2/+2
| | | | | | | | | The reported maximum was wrong. The X and Y coordinates are 0-based so if size is 8000 maximum must be 7FFF. Signed-off-by: Ladi Prosek <lprosek@redhat.com> Message-id: 1460128893-10244-1-git-send-email-lprosek@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* virtio-input: add live migration supportGerd Hoffmann2016-04-131-0/+40
| | | | | | | | | | | | | virtio-input is simple enough that it doesn't need to xfer any state. Still we have to wire up savevm manually, so the generic pci and virtio are saved correctly. Additionally we need to do some post-load processing to figure whenever the guest uses the device or not, so we can give input routing hints to the qemu input layer using qemu_input_handler_{activate,deactivate}. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 1459859501-16965-1-git-send-email-kraxel@redhat.com