All of lore.kernel.org
 help / color / mirror / Atom feed
* set_termios() function not getting called
@ 2013-01-29 21:43 Grant Edwards
  0 siblings, 0 replies; only message in thread
From: Grant Edwards @ 2013-01-29 21:43 UTC (permalink / raw)
  To: linux-serial

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!


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2013-01-29 21:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-29 21:43 set_termios() function not getting called Grant Edwards

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.