mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* tty line discipline
@ 2005-10-19 11:55 Rabih ElMasri
  2005-10-19 12:01 ` Arjan van de Ven
  0 siblings, 1 reply; 3+ messages in thread
From: Rabih ElMasri @ 2005-10-19 11:55 UTC (permalink / raw)
  To: lkml

hi,

I am trying to assign a new line discipline to ttyS0 from within the
kernel-space. During the initialization of my module I do the
following:

fp=filp_open(dev,O_RDWR | O_NOCTTY,0);
tty=fp->private_data;  //the tty_struct

then I initialize the fields of the new line discipline (ldisc). and
assign it to the tty_struct:

tty->ldisc=ldisc;

It works fine the first time I insert the module, but gets problems
with tty->count if I insert it again.

I tried to call the tty_ioctl function of tty_io.c (with flag
TIOCSETD) using the corresponding field in the file structure
(fp->f_op->ioctl(..)), but it seems to expect a call from user-space,
and returns -EFAULT due to the get_user macro.

I would really appreciate it if someone can tell me how to deal with
this problem.

Regards,
Rabih

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

end of thread, other threads:[~2005-10-19 14:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-10-19 11:55 tty line discipline Rabih ElMasri
2005-10-19 12:01 ` Arjan van de Ven
2005-10-19 14:53   ` Rabih ElMasri

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®