linux-api.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] ps2emu - PS/2 emulation module
@ 2015-07-21 19:07 Stephen Chandler Paul
  2015-07-21 19:07 ` [RFC] Input: Add ps2emu module Stephen Chandler Paul
  2015-07-21 20:48 ` [RFC] ps2emu - PS/2 emulation module Dmitry Torokhov
  0 siblings, 2 replies; 10+ messages in thread
From: Stephen Chandler Paul @ 2015-07-21 19:07 UTC (permalink / raw)
  To: Dmitry Torokhov, Andrew Morton, Mauro Carvalho Chehab, Greg KH,
	Arnd Bergmann, Joe Perches, Jiri Slaby, Vishnu Patekar,
	Sebastian Ott, linux-doc-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-input-u79uwXL29TY76Z2rM5mHXA,
	linux-api-u79uwXL29TY76Z2rM5mHXA
  Cc: Benjamin Tissoires, Hans de Goede

Hi! So, following this is a patch to add the ps2emu module to the kernel. This
module basically allows for us to create virtual PS/2 devices and control them
from userspace. With this, we can do useful things such as playing back
recordings of PS/2 devices in a similar manner to evemu-replay and hid-replay.
This lets us debug PS/2 devices that we may not have physical access to, such
as laptop touchpads. This is a huge help when we receive bug reports for devices that
we can't get access to. We've already used this module to assist with fixing
bugs[1] where we needed to be able to replicate the device on a lower level then
we could with evemu-replay or hid-replay. This module could also come into use
when trying to debug the initialization process of devices, along with testing
for regressions with various devices.

The module itself creates a character device at /dev/ps2emu, which userspace
applications can connect to and use to send/receive data straight through the
serio driver. It doesn't need to do much more then that, so it's not a very
large driver. There is a very basic command protocol used for this which has
room for potentially being extended upon in the future if the situation calls
for it.

Right now we make use of this module with the ps2emu userland tools[2] that I've
wrote recently. Recording of PS/2 devices is done by enabling the debugging
output from i8042, triggering a rescan of the PS/2 ports, and doing some clever
trimming of data to remove anything that goes across the i8042 chip that isn't
relevant to the PS/2 protocol. The replay application is pretty simple, and just
sends all of the events from the log through /dev/ps2emu. No additional
processing of the log has to be done, making the replay process very trivial so
long as the behavior of the driver in question is the same as it was when the
recording was done. This also means any bugs encountered during the recording
are easy to reproduce when we play the device back, and we don't need to be
concerned about a virtual device potentially exhibiting different behaviors in
the kernel than the physical one.

If you have any questions or comments, please don't hesitate.

Cheers,
	Stephen Chandler Paul

[1] https://bugzilla.redhat.com/show_bug.cgi?id=1235175
[2] https://github.com/Lyude/ps2emu/releases/tag/v0.1.2

Stephen Chandler Paul (1):
  Input: Add ps2emu module

 Documentation/input/ps2emu.txt |  72 ++++++++++++
 MAINTAINERS                    |   6 +
 drivers/input/serio/Kconfig    |  10 ++
 drivers/input/serio/Makefile   |   1 +
 drivers/input/serio/ps2emu.c   | 251 +++++++++++++++++++++++++++++++++++++++++
 include/uapi/linux/ps2emu.h    |  42 +++++++
 6 files changed, 382 insertions(+)
 create mode 100644 Documentation/input/ps2emu.txt
 create mode 100644 drivers/input/serio/ps2emu.c
 create mode 100644 include/uapi/linux/ps2emu.h

--
2.4.3

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2015-07-21 22:13 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-21 19:07 [RFC] ps2emu - PS/2 emulation module Stephen Chandler Paul
2015-07-21 19:07 ` [RFC] Input: Add ps2emu module Stephen Chandler Paul
2015-07-21 19:15   ` Greg KH
2015-07-21 19:47     ` [RFC 1/1 v2] " Stephen Chandler Paul
2015-07-21 19:57       ` Greg KH
2015-07-21 20:46       ` Dmitry Torokhov
2015-07-21 21:42         ` Stephen Chandler Paul
2015-07-21 22:13           ` Dmitry Torokhov
2015-07-21 19:16   ` [RFC] " Greg KH
2015-07-21 20:48 ` [RFC] ps2emu - PS/2 emulation module Dmitry Torokhov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).