2003-09-26 Cedric Aubert <cedric_aubert@yahoo.fr>

PR 501/rtems_misc
	* console.c: console_open disables ICANON on non-console port, which
	should be ok for the first open but not for subsequent ones. If you
	open one serial port, you will configure it, when you reopen it you
	will lost the ICANON parameters if you had put it. Should be done by
	console only at first open.
This commit is contained in:
Joel Sherrill
2003-09-26 17:33:59 +00:00
parent 174bf23ac4
commit 29e214e4d5
2 changed files with 32 additions and 13 deletions

View File

@@ -1,3 +1,12 @@
2003-09-26 Cedric Aubert <cedric_aubert@yahoo.fr>
PR 501/rtems_misc
* console.c: console_open disables ICANON on non-console port, which
should be ok for the first open but not for subsequent ones. If you
open one serial port, you will configure it, when you reopen it you
will lost the ICANON parameters if you had put it. Should be done by
console only at first open.
2003-09-04 Joel Sherrill <joel@OARcorp.com>
* bootcard.c, bspclean.c, clockdrv_shell.c, console-polled.c,

View File

@@ -20,6 +20,7 @@
#include <assert.h>
#include <termios.h>
#include <rtems/termiostypes.h>
#include <libchip/serial.h>
/*
@@ -50,6 +51,7 @@ rtems_device_driver console_open(
struct termios Termios;
rtems_termios_callbacks Callbacks;
console_tbl *cptr;
struct rtems_termios_tty *current_tty;
/*
* Verify the port number is valid.
@@ -80,18 +82,26 @@ rtems_device_driver console_open(
status = rtems_termios_open ( major, minor, arg, &Callbacks );
Console_Port_Data[minor].termios_data = args->iop->data1;
if (minor!=Console_Port_Minor) {
/*
* If this is not the console we do not want ECHO and
* so forth
*/
IoctlArgs.iop=args->iop;
IoctlArgs.command=RTEMS_IO_GET_ATTRIBUTES;
IoctlArgs.buffer=&Termios;
rtems_termios_ioctl(&IoctlArgs);
Termios.c_lflag=ICANON;
IoctlArgs.command=RTEMS_IO_SET_ATTRIBUTES;
rtems_termios_ioctl(&IoctlArgs);
/* Get tty pointeur from the Console_Port_Data */
current_tty = Console_Port_Data[minor].termios_data;
if ( (current_tty->refcount == 1) ) {
/*
* If it's the first open, modified, if need, the port parameters
*/
if (minor!=Console_Port_Minor) {
/*
* If this is not the console we do not want ECHO and
* so forth
*/
IoctlArgs.iop=args->iop;
IoctlArgs.command=RTEMS_IO_GET_ATTRIBUTES;
IoctlArgs.buffer=&Termios;
rtems_termios_ioctl(&IoctlArgs);
Termios.c_lflag=ICANON;
IoctlArgs.command=RTEMS_IO_SET_ATTRIBUTES;
rtems_termios_ioctl(&IoctlArgs);
}
}
if ( (args->iop->flags&LIBIO_FLAGS_READ) &&