lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20080527084431.ZZRA012@mailhub.coreip.homeip.net>
Date:	Tue, 27 May 2008 08:53:13 -0400
From:	Dmitry Torokhov <dmitry.torokhov@...il.com>
To:	N?stor Amigo Cairo <nestorac@...il.com>
Cc:	linux-kernel@...r.kernel.org
Subject: Re: QUESTION: How can I make a driver for a special serial
	keyboard which also supports output (maybe via serio_raw)?

Hi,

On Sun, May 25, 2008 at 06:52:26PM +0200, N?stor Amigo Cairo wrote:
> Hello!
> 
> I'm trying to make a driver for a special keyboard with just three keys, for
> an embedded application. This really is a PIC attached to a serial interface
> which sends some bytes to the computer to manage an application, and then
> receives some others to control an embedded device using the same cable. So
> there's a two way connection between them.
> For now, I have been able to customize the newtonkbd driver to adapt it to
> receive some bytes and translate them to keys, but I'm not able to send any
> data. /dev/ttyS0 gets blocked when setting up the driver with a customized
> version of `inputattach`, an application which ioctl's the serial device to
> the driver. Write() does not work, since it's not implemented in the driver.
> Is there any way of implementing access to this device using the same
> Write() calls as in other apps?
> Or is there any other way of doing it?? Some documentation??
> 

You would need to implement ->event() handler in your 'keyboard' that
would call serio->write() on the underlying serio port. Then, by
opening /dev/input/eventX and writing into it you can send input
events back to the device.

Although I wonder if your device really useable as a generic
keyboard/button device. You may be better off just using the serial
port from the userspace.

-- 
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ