From: Grant Edwards <grant.b.edwards@gmail.com>
To: linux-serial@vger.kernel.org
Subject: set_termios() function not getting called
Date: Tue, 29 Jan 2013 21:43:03 +0000 (UTC) [thread overview]
Message-ID: <ke9fp7$2lh$1@ger.gmane.org> (raw)
I'm having problems getting xon/xoff flow control in the new rp2.c
driver working.
The problem is that the driver's set_termios() function is not getting
called when the user-space application calls tcsetattr() to change
IXON, IXOFF, IXANY, c_cc[VSTOP], or c_cc[VSTART].
According to Documentation/serial/driver:
set_termios(port,termios,oldtermios)
Change the port parameters, including word length, parity, stop
bits.
[...]
Other flags may be used (eg, xon/xoff characters) if your
hardware supports hardware "soft" flow control.
My hardware supports xon/xoff flow control, so how do I use other
flags?
It looks like serial_core.c is hiding some termios changes from
low-level drivers:
1193 static void uart_set_termios(struct tty_struct *tty,
1194 struct ktermios *old_termios)
1195 {
1196 struct uart_state *state = tty->driver_data;
1197 unsigned long flags;
1198 unsigned int cflag = tty->termios->c_cflag;
1199
1200
1201 /*
1202 * These are the bits that are used to setup various
1203 * flags in the low level driver. We can ignore the Bfoo
1204 * bits in c_cflag; c_[io]speed will always be set
1205 * appropriately by set_termios() in tty_ioctl.c
1206 */
1207 #define RELEVANT_IFLAG(iflag) ((iflag) & (IGNBRK|BRKINT|IGNPAR|PARMRK|INPCK))
1208 if ((cflag ^ old_termios->c_cflag) == 0 &&
1209 tty->termios->c_ospeed == old_termios->c_ospeed &&
1210 tty->termios->c_ispeed == old_termios->c_ispeed &&
1211 RELEVANT_IFLAG(tty->termios->c_iflag ^ old_termios->c_iflag) == 0) {
1212 return;
1213 }
When I look at omap-serial.c, it looks like it's trying to handle
IXANY, IXON and IXOFF the same way I am -- but I don't get notified
when they change.
I don't understand...
--
Grant Edwards grant.b.edwards Yow! If I am elected no one
at will ever have to do their
gmail.com laundry again!
reply other threads:[~2013-01-29 21:43 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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='ke9fp7$2lh$1@ger.gmane.org' \
--to=grant.b.edwards@gmail.com \
--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 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.