Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933645AbbGUTHk (ORCPT ); Tue, 21 Jul 2015 15:07:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41322 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933358AbbGUTHg (ORCPT ); Tue, 21 Jul 2015 15:07:36 -0400 From: Stephen Chandler Paul To: Dmitry Torokhov , Andrew Morton , Mauro Carvalho Chehab , Greg KH , Arnd Bergmann , Joe Perches , Jiri Slaby , Vishnu Patekar , Sebastian Ott , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, linux-api@vger.kernel.org Cc: Benjamin Tissoires , Hans de Goede Subject: [RFC] ps2emu - PS/2 emulation module Date: Tue, 21 Jul 2015 15:07:13 -0400 Message-Id: <1437505634-8633-1-git-send-email-cpaul@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3119 Lines: 62 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/