All of lore.kernel.org
 help / color / mirror / Atom feed
From: Baurzhan Ismagulov <ibr@radix50.net>
To: Luke Kenneth Casson Leighton <lkcl@lkcl.net>
Cc: linux-kernel@vger.kernel.org
Subject: Re: tty line discipline driver advice sought, to do a 1-byte header and 2-byte CRC checksum on GSM data
Date: Sat, 25 Nov 2006 17:50:54 +0100	[thread overview]
Message-ID: <20061125165054.GA23585@radix50.net> (raw)
In-Reply-To: <20061125040614.GI16214@lkcl.net>

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.

  parent reply	other threads:[~2006-11-25 16:51 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-25  4:06 tty line discipline driver advice sought, to do a 1-byte header and 2-byte CRC checksum on GSM data Luke Kenneth Casson Leighton
2006-11-25 16:20 ` Guennadi Liakhovetski
2006-11-25 16:50 ` Baurzhan Ismagulov [this message]
2006-11-25 23:08 ` Alan
2006-11-26  3:09   ` Luke Kenneth Casson Leighton
2006-11-27 14:23     ` Stuart MacDonald

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20061125165054.GA23585@radix50.net \
    --to=ibr@radix50.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkcl@lkcl.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.