From: Ed Vance <EdV@macrolink.com>
To: "'henrique.gobbi@cyclades.com'" <henrique.gobbi@cyclades.com>
Cc: linux-kernel@vger.kernel.org,
"'linux-serial'" <linux-serial@vger.kernel.org>
Subject: RE: Interpretation of termios flags on a serial driver
Date: Wed, 26 Mar 2003 15:33:56 -0800 [thread overview]
Message-ID: <11E89240C407D311958800A0C9ACF7D1A33E03@EXCHANGE> (raw)
On Wed, Mar 26, 2003 at 6:51 AM, Henrique Gobbi wrote:
>
> I'm having some problems understanding three flags on the termios
> struct: PARENB, INPCK, IGNPAR. After reading the termios
> manual a couple
> of times I'm still not able to understand the different purposes of
> these flags.
>
> What I understood:
>
> 1 - PARENB: if this flag is set the serial chip must generate parity
> (odd or even depending on the flag PARODD). If this flag is
> not set, use
> parity none.
>
> 2 - IGNPAR: two cases here:
> 2.1 - PARENB is set: if IGNPAR is set the driver should
> ignore all
> parity and framing errors and send the problematic bytes to
> tty flip
> buffer as normal data. If this flag is not set the
> driver must send the
> problematic data to the tty as problematic data.
>
> 2.2 - PARENB is not set: disregard IGNPAR
>
> What I don't understand:
>
> 3 - Did I really understand the items 1 and 2 ?
>
> 4 - INPCK flag: What's the purpose of this flag. What's the
> diference in
> relation to IGNPAR;
If INPCK is set, input parity checking is enabled. If
INPCK is not set, input parity checking is disabled. This
allows output parity generation without input parity errors.
Note that whether input parity checking is enabled or dis-
abled is independent of whether parity detection is enabled
or disabled. If parity detection is enabled but input parity
checking is disabled, the hardware to which the terminal is
connected will recognize the parity bit, but the terminal
special file will not check whether this is set correctly or
not.
If IGNPAR is set, a byte with framing or parity errors
(other than break) is ignored. This means that the data byte
with the error is thrown away by the driver as if the byte
had never been received.
In short,
If INPCK is _not_ set, then all received data bytes will be delivered
to the user level, regardless of parity errors.
If IGNPAR is set, then only received data bytes that do not have
parity errors will be delivered to the user level.
If PARENB is _not_ set, then the receiver hardware will not detect
bad parity, so all received data bytes are considered free of errors.
Since there are no data bytes with associated error indications,
setting IGNPAR would have no effect. All of the data are considered
error free.
>
> 5 - If the TTY knows the data status (PARITY, FRAMING,
> OVERRUN, NORMAL),
> why the driver has to deal with the flag IGNPAR. Shouldn't
> the TTY being
> doing it ?
Not sure I understand the question. Received data does not carry any
information about errors with it after it leaves the driver, unless
PARMRK is set.
>
> Thanks in advance
> Henrique
Cheers,
Ed
----------------------------------------------------------------
Ed Vance edv (at) macrolink (dot) com
Macrolink, Inc. 1500 N. Kellogg Dr Anaheim, CA 92807
----------------------------------------------------------------
next reply other threads:[~2003-03-26 23:22 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-03-26 23:33 Ed Vance [this message]
2003-03-27 0:17 ` Henrique Gobbi
-- strict thread matches above, loose matches on Subject: below --
2003-03-27 17:00 Ed Vance
2003-03-27 16:41 Ed Vance
2003-03-27 0:59 Ed Vance
2003-03-06 0:19 Kernel Boot Speedup Ro0tSiEgE LKML
2003-03-26 9:23 ` Daniel Phillips
2003-03-26 14:51 ` Interpretation of termios flags on a serial driver Henrique Gobbi
2003-03-26 23:18 ` Richard B. Johnson
2003-03-26 15:33 ` Henrique Gobbi
2003-03-27 0:24 ` Russell King
2003-03-27 1:41 ` Richard B. Johnson
2003-03-27 1:01 ` Robert White
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=11E89240C407D311958800A0C9ACF7D1A33E03@EXCHANGE \
--to=edv@macrolink.com \
--cc=henrique.gobbi@cyclades.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
/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 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®