mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Niels de Vos <niels.devos@wincor-nixdorf.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: linux-input@vger.kernel.org, Jiri Kosina <jkosina@suse.cz>,
	linux-kernel@vger.kernel.org
Subject: Re: [RFC][PATCH] POSKeyboard driver for exclusive keyboard access
Date: Tue, 26 Aug 2008 11:19:30 +0200	[thread overview]
Message-ID: <48B3CAA2.5040207@wincor-nixdorf.com> (raw)
In-Reply-To: <20080822135507.ZZRA012@mailhub.coreip.homeip.net>

[-- Attachment #1: Type: text/plain, Size: 2612 bytes --]

Hello Dmitry,

Dmitry Torokhov wrote:
> Hi Niels,
> 
> On Fri, Aug 22, 2008 at 06:17:28PM +0200, Niels de Vos wrote:
>> This new driver makes it possible for middleware like JavaPOS to use
>> a POSKeyboard (connected to PS/2) with exclusive access. This is
>> required by the UnifiedPOS Specification which is available from
>> http://www.nrf-arts.org/UnifiedPOS. Any middleware using this driver
>> should implement the full exception-handling in user-space. Therefor
>> it is possible to use specific POS-extensions of POSKeyboards, without
>> abusing other keyboard-drivers.
>>
>> Opening /dev/poskeyboard will route all scancodes to this device. The
>> scancodes will not be processes by the input-subsystem anymore. Reading
>> /dev/poskeyboard results in receiving the scancodes as raw data for
>> further processing by the reader. Sending commands to the hardware can
>> be done by writing to /dev/poskeyboard.
>>
>> If the driver is loaded and /dev/poskeyboard is not opened, all
>> scancodes are given to the input-subsystem. This allows 'normal' use of
>> the keyboard.
>>
>> Making the driver active involves some commands like the following:
>>    echo -n serio1 > /sys/bus/serio/drivers/atkbd/unbind
>>    echo -n serio1 > /sys/bus/serio/drivers/poskbd/bind
>>
> 
> It seems you have just reimplemented serio_raw driver, therefore NAK.
> Right now serio_raw is limited to untranslated ports but adding
> SERIO_I8042XL signature should be easy.

Okay, thanks for pointing this out, I'll look into using serio_raw
instead. If a patch is needed I'll send you one.


>> Open questions:
>> - How to achieve the same with USB-HID complaint keyboards?
> 
> Thsi is probably is the candidate for legitimate use of EVIOCGRAB.
> Just grab device for exclusive access and do your processing, probably
> looking at MSC_SCAN (or KEY_*, depends on how hardware-sepcific this
> thing is). This approach shoudl work equally well for HID, PS/2,
> serial or any other kind of keyboard/input device actually. You can
> also re-inject the keystrokes you are not interested in back into
> input core via uinput.

Great. I already saw input_dev->grab but never really understood what
it would do or how it could be used. Tried it with a small test and
should be sufficient for the UnifiedPOS requirements.


>> - Does serio_unregister_port() a kfree() on the port?
> 
> Eventually, after the last user drops off.

Okay, so the driver allocates it, but never needs to do a kfree() on
it, because the serio-layer takes care of it.

Thanks for the infos,
Niels


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2008-08-26  9:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-22 16:17 Niels de Vos
2008-08-22 18:02 ` Dmitry Torokhov
2008-08-26  9:19   ` Niels de Vos [this message]
2008-08-22 18:19 ` Andrew Morton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48B3CAA2.5040207@wincor-nixdorf.com \
    --to=niels.devos@wincor-nixdorf.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=jkosina@suse.cz \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®