On Mon, Nov 21, 2016 at 10:36 PM, Samuel Thibault < samuel.thibault@xxxxxxxxxxxx> wrote: > Hello, > > Okash Khawaja, on Mon 21 Nov 2016 22:32:52 +0000, wrote: > > 1. register ldisc structure in spk_tty_probe(). > > Registering the speakup line discipline should be done on speakup module > insertion (speakup_init), since we're supposed to do it just once. > > > 2. in spk_tty_probe(), attach line discipline - like you would for > /dev/ttyX > > from user space > > spk_tty_probe also needs to open ttySX itsef. > > > 3. in open() method of ldisc structure, take the tty_struct and cache it. > > Yes. > > > 4. in spk_serial_out_tty() call tty->ops->write() instead of outb(). > > Yes. > > Samuel > Thanks. So I have a simple kernel module that registers a new ldisc. When userspace attaches that ldisc to /dev/ttyS0, the kernel module is able to write to that serial port using tty->ops->write(). Currently I'm investigating the core problem of opening /dev/ttyS0 from kernel space and attaching our ldisc to it. Are there any existing ideas around this? Is this worth investigating: to find correct tty without opening /dev/ttyS0 and assigning our ldisc to it. Realistically, how early in boot process do we want the ldisc assigned? _______________________________________________ Speakup mailing list Speakup@xxxxxxxxxxxxxxxxx http://linux-speakup.org/cgi-bin/mailman/listinfo/speakup