# HG changeset patch # User jlarmour # Date 1219243720 0 # Node ID af5755a0cc71050651bcc1e92c19d0517080e8b1 # Parent cc005a9f3575266565a3b6dd95109a703a896e04 * src/common/termiostty.c (set_attr) : Fixed bug for XON/XOFF flow control that was wrong in termiostty. set_attr() now looks into c_iflag for IXON/IXOFF flags. diff --git a/packages/io/serial/current/ChangeLog b/packages/io/serial/current/ChangeLog --- a/packages/io/serial/current/ChangeLog +++ b/packages/io/serial/current/ChangeLog @@ -1,3 +1,9 @@ +2008-08-13 Rainer Arndt + + * src/common/termiostty.c (set_attr) : Fixed bug for XON/XOFF + flow control that was wrong in termiostty. + set_attr() now looks into c_iflag for IXON/IXOFF flags. + 2008-01-30 Andrew Lunn * src/common/termiostty.c (termios_lookup): Add missing set of diff --git a/packages/io/serial/current/src/common/termiostty.c b/packages/io/serial/current/src/common/termiostty.c --- a/packages/io/serial/current/src/common/termiostty.c +++ b/packages/io/serial/current/src/common/termiostty.c @@ -465,11 +465,11 @@ set_attr( struct termios *t, struct term } } - if ( (t->c_cflag & IXOFF) != (ptermios->c_cflag & IXOFF) ) { + if ( (t->c_iflag & IXOFF) != (ptermios->c_iflag & IXOFF) ) { new_dev_conf = dev_conf; new_dev_conf.flags &= ~(CYGNUM_SERIAL_FLOW_XONXOFF_RX|CYGNUM_SERIAL_FLOW_RTSCTS_RX); - if ( t->c_cflag & IXOFF ) + if ( t->c_iflag & IXOFF ) if ( t->c_cflag & CRTSCTS) new_dev_conf.flags |= CYGNUM_SERIAL_FLOW_RTSCTS_RX; else @@ -485,16 +485,18 @@ set_attr( struct termios *t, struct term // It worked, so update dev_conf to reflect the new state dev_conf.flags = new_dev_conf.flags; // and termios - ptermios->c_cflag &= ~(IXOFF|CRTSCTS); - ptermios->c_cflag |= t->c_cflag & (IXOFF|CRTSCTS); + ptermios->c_cflag &= ~(CRTSCTS); + ptermios->c_cflag |= t->c_cflag & (CRTSCTS); + ptermios->c_iflag &= ~(IXOFF); + ptermios->c_iflag |= t->c_iflag & (IXOFF); } } - if ( (t->c_cflag & IXON) != (ptermios->c_cflag & IXON) ) { + if ( (t->c_iflag & IXON) != (ptermios->c_iflag & IXON) ) { new_dev_conf = dev_conf; new_dev_conf.flags &= ~(CYGNUM_SERIAL_FLOW_XONXOFF_TX|CYGNUM_SERIAL_FLOW_RTSCTS_TX); - if ( t->c_cflag & IXON ) + if ( t->c_iflag & IXON ) if ( t->c_cflag & CRTSCTS) new_dev_conf.flags |= CYGNUM_SERIAL_FLOW_RTSCTS_TX; else @@ -510,8 +512,10 @@ set_attr( struct termios *t, struct term // It worked, so update dev_conf to reflect the new state dev_conf.flags = new_dev_conf.flags; // and termios - ptermios->c_cflag &= ~(IXON|CRTSCTS); - ptermios->c_cflag |= t->c_cflag & (IXON|CRTSCTS); + ptermios->c_cflag &= ~(CRTSCTS); + ptermios->c_cflag |= t->c_cflag & (CRTSCTS); + ptermios->c_iflag &= ~(IXON); + ptermios->c_iflag |= t->c_iflag & (IXON); } }