linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* How to access correctly serial port inside module?
@ 2007-05-14 13:00 Lars K.W. Gohlke
  2007-05-14 17:40 ` Lars K.W. Gohlke
  2007-05-14 22:37 ` Tilman Schmidt
  0 siblings, 2 replies; 31+ messages in thread
From: Lars K.W. Gohlke @ 2007-05-14 13:00 UTC (permalink / raw)
  To: linux-kernel

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

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

hallo,

after searching the mailing list and searching the web, I still don't
know how to access correctly the serial port (in user space known as
/dev/ttyS01)

This thread ends before the answer was given and the site redirecting
too is restructured: http://marc.info/?l=kernelnewbies&m=98314502419089&w=2

would somebody be so kind to give me an example:

with this behaviour:

1. read from port
2. output via printk()
3. write to port

I'm learning how to write modules:

I've created already my own char-dev and used it in user-space.
However I don't know really how to get information from kernel-code to
solve this.

thx in advance

14.05.2007 14:46
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (MingW32) - GPGrelay v0.959

iD8DBQFGSF2FAAomYJ1taN8RAnPfAKCdpnT+Uxa8a1Mc85TCyDzNwsvuQQCgzHIx
f7V/XEWtWCa2IWtYjk7W7dg=
=y/NM
-----END PGP SIGNATURE-----

[-- Attachment #2: lkwg82.vcf --]
[-- Type: text/x-vcard, Size: 124 bytes --]

begin:vcard
fn:Lars K.W. Gohlke
n:Gohlke;Lars K.W.
email;internet:lkwg82@gmx.de
x-mozilla-html:FALSE
version:2.1
end:vcard


^ permalink raw reply	[flat|nested] 31+ messages in thread
* Re: How to access correctly serial port inside module?
@ 2007-06-05  7:55 Lars K.W. Gohlke
  0 siblings, 0 replies; 31+ messages in thread
From: Lars K.W. Gohlke @ 2007-06-05  7:55 UTC (permalink / raw)
  To: linux-kernel; +Cc: tilman, huang.ying.caritas, jengelh

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

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

Tilman Schmidt schrieb:
 > Am 17.05.2007 08:15 schrieb huang ying:
 >> I think the "serio" (through drivers/input/serio/serport.c) may be a
 >> choice too, like that in linux/drivers/input/mouse/sermouse.c, which
 >> is an example to program serial port in kernel space.
 >
 > Interesting. I wonder if that would have been a better choice for
 > the Gigaset M101 driver. It seems even to have a probe mechanism
 > so one could try to determine if the expected device is really
 > connected to the port.
 >
 > Is there any documentation on this interface? I find the source a
 > bit hard to understand, sparsely commented as it is.
 >
 > Thanks
 > Tilman
 >
how can I open ttyS1 with major=4 and minor=65?

Does anybody have some code to read from it the first e.g. 2bytes?

thx
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (MingW32) - GPGrelay v0.959

iD4DBQFGZRboAAomYJ1taN8RAkUQAJdOOvEOqXoiWPKd1cWLCpaksMkjAJ9QxH+w
sEIKnmL2TjPB53E1XkLQng==
=K9hA
-----END PGP SIGNATURE-----

[-- Attachment #2: lkwg82.vcf --]
[-- Type: text/x-vcard, Size: 124 bytes --]

begin:vcard
fn:Lars K.W. Gohlke
n:Gohlke;Lars K.W.
email;internet:lkwg82@gmx.de
x-mozilla-html:FALSE
version:2.1
end:vcard


^ permalink raw reply	[flat|nested] 31+ messages in thread
* Re: How to access correctly serial port inside module?
@ 2007-06-07 22:27 Lars K.W. Gohlke
  0 siblings, 0 replies; 31+ messages in thread
From: Lars K.W. Gohlke @ 2007-06-07 22:27 UTC (permalink / raw)
  To: linux-kernel

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

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

I asked vojtech@suse.cz 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-----

[-- Attachment #2: lkwg82.vcf --]
[-- Type: text/x-vcard, Size: 124 bytes --]

begin:vcard
fn:Lars K.W. Gohlke
n:Gohlke;Lars K.W.
email;internet:lkwg82@gmx.de
x-mozilla-html:FALSE
version:2.1
end:vcard


^ permalink raw reply	[flat|nested] 31+ messages in thread

end of thread, other threads:[~2007-06-08  0:24 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-14 13:00 How to access correctly serial port inside module? Lars K.W. Gohlke
2007-05-14 17:40 ` Lars K.W. Gohlke
2007-05-14 20:00   ` Jan Engelhardt
2007-05-14 20:25     ` Lars K.W. Gohlke
2007-05-14 23:00     ` Tilman Schmidt
2007-05-15  8:43       ` Jan Engelhardt
2007-05-22 22:17         ` Tilman Schmidt
2007-05-24 10:22           ` Lars K.W. Gohlke
2007-05-24 10:26             ` Jan Engelhardt
2007-05-24 10:45               ` Lars K.W. Gohlke
2007-05-24 10:50                 ` Jan Engelhardt
2007-05-24 11:20                   ` Lars K.W. Gohlke
2007-05-24 17:03             ` Tilman Schmidt
2007-05-24 17:19               ` Lars K.W. Gohlke
2007-05-24 17:29                 ` Jan Engelhardt
2007-05-24 19:15                   ` Lars K.W. Gohlke
2007-05-28 17:05                     ` Tilman Schmidt
2007-05-28 19:03                       ` Jan Engelhardt
2007-05-30  7:07                       ` Lars K.W. Gohlke
2007-05-30  7:46                         ` Lars K.W. Gohlke
2007-05-30  9:38                           ` Tilman Schmidt
     [not found]       ` <851fc09e0705162315w3380ddabh9b9f0b2198cb8457@mail.gmail.com>
2007-05-22 21:55         ` Tilman Schmidt
2007-06-03 20:28           ` Lars K.W. Gohlke
2007-06-05 21:41             ` Tilman Schmidt
2007-06-06  8:27               ` Lars K.W. Gohlke
2007-06-07 22:25                 ` Lars K.W. Gohlke
2007-06-08  0:27                   ` Tilman Schmidt
2007-05-14 22:37 ` Tilman Schmidt
2007-05-24 10:51   ` Lars K.W. Gohlke
  -- strict thread matches above, loose matches on Subject: below --
2007-06-05  7:55 Lars K.W. Gohlke
2007-06-07 22:27 Lars K.W. Gohlke

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).