Re: How to access correctly serial port inside module?

From: Lars K.W. Gohlke
Date: Thu Jun 07 2007 - 18:27:50 EST


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I asked vojtech@xxxxxxx as one of the driver developer

this is how I did it (just prototype, with implicite line discipline)

(neccessary just one folder and two files)
1. copy template linux-source/drivers/input/joystick/magellan.c
2. insert in line 90 :
printk("%s:\"%s\"\n",__FUNCTION__, data);
3. make and insert it
4. inputattach --magellan /dev/ttyS0 &
5. date > /dev/ttyS0
6. dmesg | tail

voilà!

[output von dmesg]

[27336.486980] serio: Serial port ttyS0
[27336.487270] input: LogiCad3D Magellan / SpaceMouse as
/class/input/input6 [27336.518603] magellan_process_packet:"Mi 6 Jun
19:22:31 CEST 2007"

[/output]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (MingW32) - GPGrelay v0.959

iD8DBQFGaIZbAAomYJ1taN8RAsMLAKDC1+OjCj+herKBXCNBknSu0K+uaACffNtk
Pdo0NVAjdBapHtg38m0u6Aw=
=DEP0
-----END PGP SIGNATURE-----
begin:vcard
fn:Lars K.W. Gohlke
n:Gohlke;Lars K.W.
email;internet:lkwg82@xxxxxx
x-mozilla-html:FALSE
version:2.1
end:vcard