forked from Imagelibrary/rtems
2010-06-28 Joel Sherrill <joel.sherrilL@OARcorp.com>
* libcsupport/src/termios.c: Formatting.
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
2010-06-28 Joel Sherrill <joel.sherrilL@OARcorp.com>
|
||||
|
||||
* libcsupport/src/termios.c: Formatting.
|
||||
|
||||
2010-06-28 Joel Sherrill <joel.sherrill@oarcorp.com>
|
||||
|
||||
* libmisc/dumpbuf/dumpbuf.c, libmisc/dumpbuf/dumpbuf.h: Add const.
|
||||
|
||||
@@ -272,7 +272,8 @@ rtems_termios_open (
|
||||
tty->termios.c_iflag = BRKINT | ICRNL | IXON | IMAXBEL;
|
||||
tty->termios.c_oflag = OPOST | ONLCR | XTABS;
|
||||
tty->termios.c_cflag = B9600 | CS8 | CREAD | CLOCAL;
|
||||
tty->termios.c_lflag = ISIG | ICANON | IEXTEN | ECHO | ECHOK | ECHOE | ECHOCTL;
|
||||
tty->termios.c_lflag =
|
||||
ISIG | ICANON | IEXTEN | ECHO | ECHOK | ECHOE | ECHOCTL;
|
||||
|
||||
tty->termios.c_cc[VINTR] = '\003';
|
||||
tty->termios.c_cc[VQUIT] = '\034';
|
||||
@@ -360,7 +361,8 @@ rtems_termios_close (void *arg)
|
||||
struct rtems_termios_tty *tty = args->iop->data1;
|
||||
rtems_status_code sc;
|
||||
|
||||
sc = rtems_semaphore_obtain (rtems_termios_ttyMutex, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
|
||||
sc = rtems_semaphore_obtain(
|
||||
rtems_termios_ttyMutex, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
|
||||
if (sc != RTEMS_SUCCESSFUL)
|
||||
rtems_fatal_error_occurred (sc);
|
||||
if (--tty->refcount == 0) {
|
||||
@@ -483,14 +485,12 @@ termios_set_flowctrl(struct rtems_termios_tty *tty)
|
||||
}
|
||||
|
||||
/* check for incoming RTS/CTS flow control switched off */
|
||||
if (( tty->flow_ctrl & FL_MDRTS) &&
|
||||
!(tty->termios.c_cflag & CRTSCTS)) {
|
||||
if (( tty->flow_ctrl & FL_MDRTS) && !(tty->termios.c_cflag & CRTSCTS)) {
|
||||
/* clear related flags in flow_ctrl */
|
||||
tty->flow_ctrl &= ~(FL_MDRTS);
|
||||
|
||||
/* restart remote Tx, if it was stopped */
|
||||
if ((tty->flow_ctrl & FL_IRTSOFF) &&
|
||||
(tty->device.startRemoteTx != NULL)) {
|
||||
if ((tty->flow_ctrl & FL_IRTSOFF) && (tty->device.startRemoteTx != NULL)) {
|
||||
tty->device.startRemoteTx(tty->minor);
|
||||
}
|
||||
tty->flow_ctrl &= ~(FL_IRTSOFF);
|
||||
@@ -1212,25 +1212,22 @@ rtems_termios_enqueue_raw_characters (void *ttyp, char *buf, int len)
|
||||
/* if chars_in_buffer > highwater */
|
||||
rtems_interrupt_disable(level);
|
||||
if ((((newTail - tty->rawInBuf.Head + tty->rawInBuf.Size)
|
||||
% tty->rawInBuf.Size)
|
||||
> tty->highwater) &&
|
||||
% tty->rawInBuf.Size) > tty->highwater) &&
|
||||
!(tty->flow_ctrl & FL_IREQXOF)) {
|
||||
/* incoming data stream should be stopped */
|
||||
tty->flow_ctrl |= FL_IREQXOF;
|
||||
if ((tty->flow_ctrl & (FL_MDXOF | FL_ISNTXOF))
|
||||
== (FL_MDXOF ) ){
|
||||
== (FL_MDXOF ) ) {
|
||||
if ((tty->flow_ctrl & FL_OSTOP) ||
|
||||
(tty->rawOutBufState == rob_idle)) {
|
||||
/* if tx is stopped due to XOFF or out of data */
|
||||
/* call write function here */
|
||||
tty->flow_ctrl |= FL_ISNTXOF;
|
||||
(*tty->device.write)(tty->minor,
|
||||
(void *)&(tty->termios.c_cc[VSTOP]),
|
||||
1);
|
||||
(void *)&(tty->termios.c_cc[VSTOP]), 1);
|
||||
}
|
||||
}
|
||||
else if ((tty->flow_ctrl & (FL_MDRTS | FL_IRTSOFF))
|
||||
== (FL_MDRTS ) ) {
|
||||
else if ((tty->flow_ctrl & (FL_MDRTS | FL_IRTSOFF)) == (FL_MDRTS) ) {
|
||||
tty->flow_ctrl |= FL_IRTSOFF;
|
||||
/* deactivate RTS line */
|
||||
if (tty->device.stopRemoteTx != NULL) {
|
||||
@@ -1238,6 +1235,7 @@ rtems_termios_enqueue_raw_characters (void *ttyp, char *buf, int len)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* reenable interrupts */
|
||||
rtems_interrupt_enable(level);
|
||||
|
||||
@@ -1289,8 +1287,7 @@ rtems_termios_refill_transmitter (struct rtems_termios_tty *tty)
|
||||
|
||||
nToSend = 1;
|
||||
}
|
||||
else if ((tty->flow_ctrl & (FL_IREQXOF | FL_ISNTXOF))
|
||||
== FL_ISNTXOF) {
|
||||
else if ((tty->flow_ctrl & (FL_IREQXOF | FL_ISNTXOF)) == FL_ISNTXOF) {
|
||||
/* NOTE: send XON even, if no longer in XON/XOFF mode... */
|
||||
/* XON should be sent now... */
|
||||
/*
|
||||
@@ -1415,7 +1412,8 @@ rtems_termios_dequeue_characters (void *ttyp, int len)
|
||||
rtems_fatal_error_occurred (sc);
|
||||
return 0; /* nothing to output in IRQ... */
|
||||
}
|
||||
else if (tty->t_line == PPPDISC ) {
|
||||
|
||||
if (tty->t_line == PPPDISC ) {
|
||||
/*
|
||||
* call any line discipline start function
|
||||
*/
|
||||
@@ -1424,9 +1422,8 @@ rtems_termios_dequeue_characters (void *ttyp, int len)
|
||||
}
|
||||
return 0; /* nothing to output in IRQ... */
|
||||
}
|
||||
else {
|
||||
|
||||
return rtems_termios_refill_transmitter(tty);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user