From: Jan-Benedict Glaw <jbglaw@lug-owl.de>
To: linux-kernel@vger.kernel.org
Subject: Re: ioctl to keyboard device file
Date: Wed, 11 May 2005 20:17:40 +0200 [thread overview]
Message-ID: <20050511181740.GO8176@lug-owl.de> (raw)
In-Reply-To: <1115834000.23458.77.camel@pegasus>
[-- Attachment #1: Type: text/plain, Size: 2664 bytes --]
On Wed, 2005-05-11 19:53:20 +0200, Marcel Holtmann <marcel@holtmann.org> wrote:
> > >> 1) what is the device file corresponding to keyboard (is it
> > >> /dev/input/keyboard).
> > >> 2) where file operations structure is defined for that.
> > >> 3) where the those ioctls handled(not found in keyboard.c).
> > >>
> > >> Any small help is appreciated.
> > >
> > > why not using uinput for this job?
> >
> > Thanks for the solution. I did the above task, by defining a new
> > character device driver and sending ioctl to it. and calling
> > handle_scancode from it. Now I want
> > to do the same task with in the keyboard driver. For that I need to send
> > ioctl to keyboard device file.
> > For that only I asked the
> > above doubts.
>
> what your are trying to do looks wrong to me. Why don't you use uinput.
> It is there and it is the correct thing for the job.
I don't know what device the initial sender tries to support, but uinput
is only a solution for "normal" human input. I yet fail to see how
you'd support eg. keyboard-based magnetic stripe readers or barcode
scanners with it. These devices don't play nicely with atkbd: they send
some "random" make and break codes so you'd get some garbage from stdin.
But in reality, you'd rather prefer to (like for /dev/input/event*)
select() for a fully received magnetic stripe or barcode or the like.
Also, you may need to write (in terms of raw bytes) to the keyboard port
of the i8042 eg. to use keyboards with built-in displays.
Right now, I'm writing a driver (for 2.6.x) for some MSR. I'm attempting
to do this by having a "relay" serio port which is a serio client wrt.
the serio port registered by i8042. It shall register another serio port
(to which atkbd then connects) and supply an interface for some other
module to intercept/filter the make/break codes. It *could* be done with
serio_raw, but then you'd need to implement a full atkbd implementation
in userspace (which I consider being quite ugly...).
So the resumée is that the Input API is *really* cool for normal
devices, but from my point of view, it cannot really handle these
complicated Point of Sale devices nicely. Give us some days, we'll at
least put the serio_relay.c driver on the table. Maybe it's useful for
somebody else...
MfG, JBG
--
Jan-Benedict Glaw jbglaw@lug-owl.de . +49-172-7608481 _ O _
"Eine Freie Meinung in einem Freien Kopf | Gegen Zensur | Gegen Krieg _ _ O
fuer einen Freien Staat voll Freier Bürger" | im Internet! | im Irak! O O O
ret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
next prev parent reply other threads:[~2005-05-11 18:18 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-05-11 16:43 ioctl to keyboard device file P.Manohar
2005-05-11 17:14 ` Marcel Holtmann
2005-05-11 17:34 ` P.Manohar
2005-05-11 17:53 ` Marcel Holtmann
2005-05-11 18:17 ` Jan-Benedict Glaw [this message]
[not found] ` <Pine.LNX.4.60.0505121454240.26644@lantana.cs.iitm.ernet.in>
2005-05-12 10:01 ` Marcel Holtmann
2005-05-16 8:58 ` P.Manohar
2005-05-16 9:54 ` Marcel Holtmann
[not found] ` <Pine.LNX.4.60.0505162112240.25368@lantana.cs.iitm.ernet.in>
2005-05-16 16:19 ` Marcel Holtmann
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=20050511181740.GO8176@lug-owl.de \
--to=jbglaw@lug-owl.de \
--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