Explicitly default the input baud rate (c_ispeed) to the output baud rate (c_ospeed)

instead of setting it to zero.  Otherwise nothing ever sets it unless some code
explicitly changes the baud rate.  For a serial console (in particular) we want
to use the baud rate set by the bios (or whatever) and used by theboot code.
This is the way it was before a 'new version of com driver' was added in 1997 (rev 1.99)
This commit is contained in:
dsl 2005-11-06 21:34:37 +00:00
parent 5a7eec5112
commit 80c644a6b9
1 changed files with 3 additions and 3 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: com.c,v 1.236 2005/09/06 21:40:39 kleink Exp $ */
/* $NetBSD: com.c,v 1.237 2005/11/06 21:34:37 dsl Exp $ */
/*-
* Copyright (c) 1998, 1999, 2004 The NetBSD Foundation, Inc.
@ -73,7 +73,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: com.c,v 1.236 2005/09/06 21:40:39 kleink Exp $");
__KERNEL_RCSID(0, "$NetBSD: com.c,v 1.237 2005/11/06 21:34:37 dsl Exp $");
#include "opt_com.h"
#include "opt_ddb.h"
@ -889,7 +889,6 @@ comopen(dev_t dev, int flag, int mode, struct proc *p)
* Initialize the termios status to the defaults. Add in the
* sticky bits from TIOCSFLAGS.
*/
t.c_ispeed = 0;
if (ISSET(sc->sc_hwflags, COM_HW_CONSOLE)) {
t.c_ospeed = comconsrate;
t.c_cflag = comconscflag;
@ -897,6 +896,7 @@ comopen(dev_t dev, int flag, int mode, struct proc *p)
t.c_ospeed = TTYDEF_SPEED;
t.c_cflag = TTYDEF_CFLAG;
}
t.c_ispeed = t.c_ospeed;
if (ISSET(sc->sc_swflags, TIOCFLAG_CLOCAL))
SET(t.c_cflag, CLOCAL);
if (ISSET(sc->sc_swflags, TIOCFLAG_CRTSCTS))