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>
|
2010-06-28 Joel Sherrill <joel.sherrill@oarcorp.com>
|
||||||
|
|
||||||
* libmisc/dumpbuf/dumpbuf.c, libmisc/dumpbuf/dumpbuf.h: Add const.
|
* 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_iflag = BRKINT | ICRNL | IXON | IMAXBEL;
|
||||||
tty->termios.c_oflag = OPOST | ONLCR | XTABS;
|
tty->termios.c_oflag = OPOST | ONLCR | XTABS;
|
||||||
tty->termios.c_cflag = B9600 | CS8 | CREAD | CLOCAL;
|
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[VINTR] = '\003';
|
||||||
tty->termios.c_cc[VQUIT] = '\034';
|
tty->termios.c_cc[VQUIT] = '\034';
|
||||||
@@ -360,7 +361,8 @@ rtems_termios_close (void *arg)
|
|||||||
struct rtems_termios_tty *tty = args->iop->data1;
|
struct rtems_termios_tty *tty = args->iop->data1;
|
||||||
rtems_status_code sc;
|
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)
|
if (sc != RTEMS_SUCCESSFUL)
|
||||||
rtems_fatal_error_occurred (sc);
|
rtems_fatal_error_occurred (sc);
|
||||||
if (--tty->refcount == 0) {
|
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 */
|
/* check for incoming RTS/CTS flow control switched off */
|
||||||
if (( tty->flow_ctrl & FL_MDRTS) &&
|
if (( tty->flow_ctrl & FL_MDRTS) && !(tty->termios.c_cflag & CRTSCTS)) {
|
||||||
!(tty->termios.c_cflag & CRTSCTS)) {
|
|
||||||
/* clear related flags in flow_ctrl */
|
/* clear related flags in flow_ctrl */
|
||||||
tty->flow_ctrl &= ~(FL_MDRTS);
|
tty->flow_ctrl &= ~(FL_MDRTS);
|
||||||
|
|
||||||
/* restart remote Tx, if it was stopped */
|
/* restart remote Tx, if it was stopped */
|
||||||
if ((tty->flow_ctrl & FL_IRTSOFF) &&
|
if ((tty->flow_ctrl & FL_IRTSOFF) && (tty->device.startRemoteTx != NULL)) {
|
||||||
(tty->device.startRemoteTx != NULL)) {
|
|
||||||
tty->device.startRemoteTx(tty->minor);
|
tty->device.startRemoteTx(tty->minor);
|
||||||
}
|
}
|
||||||
tty->flow_ctrl &= ~(FL_IRTSOFF);
|
tty->flow_ctrl &= ~(FL_IRTSOFF);
|
||||||
@@ -1212,8 +1212,7 @@ rtems_termios_enqueue_raw_characters (void *ttyp, char *buf, int len)
|
|||||||
/* if chars_in_buffer > highwater */
|
/* if chars_in_buffer > highwater */
|
||||||
rtems_interrupt_disable(level);
|
rtems_interrupt_disable(level);
|
||||||
if ((((newTail - tty->rawInBuf.Head + tty->rawInBuf.Size)
|
if ((((newTail - tty->rawInBuf.Head + tty->rawInBuf.Size)
|
||||||
% tty->rawInBuf.Size)
|
% tty->rawInBuf.Size) > tty->highwater) &&
|
||||||
> tty->highwater) &&
|
|
||||||
!(tty->flow_ctrl & FL_IREQXOF)) {
|
!(tty->flow_ctrl & FL_IREQXOF)) {
|
||||||
/* incoming data stream should be stopped */
|
/* incoming data stream should be stopped */
|
||||||
tty->flow_ctrl |= FL_IREQXOF;
|
tty->flow_ctrl |= FL_IREQXOF;
|
||||||
@@ -1225,12 +1224,10 @@ rtems_termios_enqueue_raw_characters (void *ttyp, char *buf, int len)
|
|||||||
/* call write function here */
|
/* call write function here */
|
||||||
tty->flow_ctrl |= FL_ISNTXOF;
|
tty->flow_ctrl |= FL_ISNTXOF;
|
||||||
(*tty->device.write)(tty->minor,
|
(*tty->device.write)(tty->minor,
|
||||||
(void *)&(tty->termios.c_cc[VSTOP]),
|
(void *)&(tty->termios.c_cc[VSTOP]), 1);
|
||||||
1);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ((tty->flow_ctrl & (FL_MDRTS | FL_IRTSOFF))
|
else if ((tty->flow_ctrl & (FL_MDRTS | FL_IRTSOFF)) == (FL_MDRTS) ) {
|
||||||
== (FL_MDRTS ) ) {
|
|
||||||
tty->flow_ctrl |= FL_IRTSOFF;
|
tty->flow_ctrl |= FL_IRTSOFF;
|
||||||
/* deactivate RTS line */
|
/* deactivate RTS line */
|
||||||
if (tty->device.stopRemoteTx != NULL) {
|
if (tty->device.stopRemoteTx != NULL) {
|
||||||
@@ -1238,6 +1235,7 @@ rtems_termios_enqueue_raw_characters (void *ttyp, char *buf, int len)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* reenable interrupts */
|
/* reenable interrupts */
|
||||||
rtems_interrupt_enable(level);
|
rtems_interrupt_enable(level);
|
||||||
|
|
||||||
@@ -1289,8 +1287,7 @@ rtems_termios_refill_transmitter (struct rtems_termios_tty *tty)
|
|||||||
|
|
||||||
nToSend = 1;
|
nToSend = 1;
|
||||||
}
|
}
|
||||||
else if ((tty->flow_ctrl & (FL_IREQXOF | FL_ISNTXOF))
|
else if ((tty->flow_ctrl & (FL_IREQXOF | FL_ISNTXOF)) == FL_ISNTXOF) {
|
||||||
== FL_ISNTXOF) {
|
|
||||||
/* NOTE: send XON even, if no longer in XON/XOFF mode... */
|
/* NOTE: send XON even, if no longer in XON/XOFF mode... */
|
||||||
/* XON should be sent now... */
|
/* XON should be sent now... */
|
||||||
/*
|
/*
|
||||||
@@ -1415,7 +1412,8 @@ rtems_termios_dequeue_characters (void *ttyp, int len)
|
|||||||
rtems_fatal_error_occurred (sc);
|
rtems_fatal_error_occurred (sc);
|
||||||
return 0; /* nothing to output in IRQ... */
|
return 0; /* nothing to output in IRQ... */
|
||||||
}
|
}
|
||||||
else if (tty->t_line == PPPDISC ) {
|
|
||||||
|
if (tty->t_line == PPPDISC ) {
|
||||||
/*
|
/*
|
||||||
* call any line discipline start function
|
* call any line discipline start function
|
||||||
*/
|
*/
|
||||||
@@ -1424,10 +1422,9 @@ rtems_termios_dequeue_characters (void *ttyp, int len)
|
|||||||
}
|
}
|
||||||
return 0; /* nothing to output in IRQ... */
|
return 0; /* nothing to output in IRQ... */
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
return rtems_termios_refill_transmitter(tty);
|
return rtems_termios_refill_transmitter(tty);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* this task actually processes any transmit events
|
* this task actually processes any transmit events
|
||||||
|
|||||||
Reference in New Issue
Block a user