tty line discipline

From: Rabih ElMasri
Date: Wed Oct 19 2005 - 06:55:52 EST


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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/