* Line disciplines.
@ 2008-07-15 20:10 ian
2008-07-15 21:37 ` Paul Fulghum
0 siblings, 1 reply; 4+ messages in thread
From: ian @ 2008-07-15 20:10 UTC (permalink / raw)
To: linux-serial
Hi!
Im trying to use a line discipline as a way to hook my kernel module up
to a serial port.
I've implemented methods for open, close, and receive_buf, and
registered the line discipline (Im using N_MOUSE as my number for now)
I've tried using stty line 2 < /dev/ttyS1 to attach my line discipline
to a serial port (and tried this on an already open port too (using cat
to open the port) and my methods never get called.
I've even written a little userspace program that opens ttyS1 and uses
tcsetattr() to select c_line=N_MOUSE.
It looks like the ldisc is being set because after this stty reports
ttyS1 to be using '2' which is correct, however my methods are still
never called.
What am I missing?
TIA,
-Ian
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Line disciplines.
2008-07-15 20:10 Line disciplines ian
@ 2008-07-15 21:37 ` Paul Fulghum
2008-07-15 22:57 ` ian
0 siblings, 1 reply; 4+ messages in thread
From: Paul Fulghum @ 2008-07-15 21:37 UTC (permalink / raw)
To: ian; +Cc: linux-serial
ian wrote:
> Im trying to use a line discipline as a way to hook my kernel module up
> to a serial port.
>
> I've implemented methods for open, close, and receive_buf, and
> registered the line discipline (Im using N_MOUSE as my number for now)
>
> I've tried using stty line 2 < /dev/ttyS1 to attach my line discipline
> to a serial port (and tried this on an already open port too (using cat
> to open the port) and my methods never get called.
>
> I've even written a little userspace program that opens ttyS1 and uses
> tcsetattr() to select c_line=N_MOUSE.
>
> It looks like the ldisc is being set because after this stty reports
> ttyS1 to be using '2' which is correct, however my methods are still
> never called.
>
> What am I missing?
I suspect that since you are using an existing ldisc number
that the existing ldisc module is being loaded instead of
your module.
Do you see the init routine of your module called?
If so, what is the return value from tty_register_ldisc()?
--
Paul Fulghum
MicroGate Systems, Ltd.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Line disciplines.
2008-07-15 21:37 ` Paul Fulghum
@ 2008-07-15 22:57 ` ian
2008-07-16 2:10 ` Paul Fulghum
0 siblings, 1 reply; 4+ messages in thread
From: ian @ 2008-07-15 22:57 UTC (permalink / raw)
To: Paul Fulghum; +Cc: linux-serial
On Tue, 2008-07-15 at 15:37 -0600, Paul Fulghum wrote:
> I suspect that since you are using an existing ldisc number
> that the existing ldisc module is being loaded instead of
> your module.
I dont think this is the case, and looking in /proc my line disc was
listed with the number 2. there were no others other than n_tty
> Do you see the init routine of your module called?
Yes.
> If so, what is the return value from tty_register_ldisc()?
Offhand I cant recall (several days ago) but since the ldisc appeared
in /proc/tty/ldiscs I would have thought this succeded?
-Ian
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Line disciplines.
2008-07-15 22:57 ` ian
@ 2008-07-16 2:10 ` Paul Fulghum
0 siblings, 0 replies; 4+ messages in thread
From: Paul Fulghum @ 2008-07-16 2:10 UTC (permalink / raw)
To: ian; +Cc: linux-serial
ian wrote:
> On Tue, 2008-07-15 at 15:37 -0600, Paul Fulghum wrote:
>> If so, what is the return value from tty_register_ldisc()?
Never mind, that function always returns 0 unless an
invalid ldisc number is specified.
> Offhand I cant recall (several days ago) but since the ldisc appeared
> in /proc/tty/ldiscs I would have thought this succeded?
OK, since your open method is not being called I would
try placing some strategic printks in
drivers/char/tty_io.c:tty_set_ldisc()
to trace the path taken when the line discipline is selected.
That is where the open() method should be called.
--
Paul
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-07-16 2:11 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-15 20:10 Line disciplines ian
2008-07-15 21:37 ` Paul Fulghum
2008-07-15 22:57 ` ian
2008-07-16 2:10 ` Paul Fulghum
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox