Re: tty line discipline driver advice sought, to do a 1-byte header and 2-byte CRC checksum on GSM data

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Luke,

On Sat, Nov 25, 2006 at 04:06:14AM +0000, Luke Kenneth Casson Leighton wrote:
> i've never encountered tty line discipline's before.  which one is the
> best example that i should start with to cut/paste?

The second link by Guennadi is very good.

You can think of ldiscs as a layer between the serial driver and the
application. You fill struct tty_ldisc and call tty_register_ldisc. The
app opens a tty device and calls the TIOCSETD ioctl on it. The app (the
"above") sees the usual driver API -- read, write, etc. Your routines
manipulate the data as you like; you call tty->driver.write to write to
the serial driver (the "below"). The serial driver can call your
routines to tell you that, e.g., it has data for you, etc. You may
convert the data, buffer it till the app calls your read, etc.

You can find many examples if you search for tty_register_ldisc in the
kernel tree. However, understanding how this works and reading
include/linux/tty_ldisc.h should be enough.

With kind regards,
Baurzhan.

P.S. I'm subscribed only to linux-arm-kernel.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux