1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-16 10:20:30 +00:00

add in CONSPEED option which controls console serial port speed

This commit is contained in:
Paul Traina 1996-11-02 02:26:06 +00:00
parent 7fe8c7a026
commit 39daae723d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=19325
6 changed files with 39 additions and 18 deletions

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)com.c 7.5 (Berkeley) 5/16/91
* $Id: sio.c,v 1.146 1996/09/14 04:27:42 bde Exp $
* $Id: sio.c,v 1.147 1996/09/30 12:22:27 bde Exp $
*/
#include "opt_comconsole.h"
@ -329,6 +329,7 @@ static struct cdevsw sio_cdevsw = {
static int comconsole = -1;
static speed_t comdefaultrate = TTYDEF_SPEED;
static speed_t condefaultrate = CONSPEED;
static u_int com_events; /* input chars + weighted output completions */
static int sio_timeout;
static int sio_timeouts_until_log;
@ -807,9 +808,11 @@ sioattach(isdp)
com->it_in.c_cflag = TTYDEF_CFLAG | CLOCAL;
com->it_in.c_lflag = TTYDEF_LFLAG;
com->lt_out.c_cflag = com->lt_in.c_cflag = CLOCAL;
}
com->it_in.c_ispeed = com->it_in.c_ospeed = condefaultrate;
} else
com->it_in.c_ispeed = com->it_in.c_ospeed = comdefaultrate;
termioschars(&com->it_in);
com->it_in.c_ispeed = com->it_in.c_ospeed = comdefaultrate;
com->it_out = com->it_in;
/* attempt to determine UART type */
@ -2339,7 +2342,7 @@ siocnopen(sp)
/*
* Save all the device control registers except the fifo register
* and set our default ones (cs8 -parenb speed=comdefaultrate).
* and set our default ones (cs8 -parenb speed=condefaultrate).
* We can't save the fifo register since it is read-only.
*/
iobase = siocniobase;
@ -2356,7 +2359,7 @@ siocnopen(sp)
* data input register. This also reduces the effects of the
* UMC8669F bug.
*/
divisor = ttspeedtab(comdefaultrate, comspeedtab);
divisor = ttspeedtab(condefaultrate, comspeedtab);
dlbl = divisor & 0xFF;
if (sp->dlbl != dlbl)
outb(iobase + com_dlbl, dlbl);

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)comreg.h 7.2 (Berkeley) 5/9/91
* $Id: sioreg.h,v 1.3 1995/01/20 07:34:18 wpaul Exp $
* $Id: sioreg.h,v 1.4 1995/12/10 13:39:15 phk Exp $
*/
@ -119,3 +119,7 @@
#ifndef CONUNIT
#define CONUNIT (0)
#endif
#ifndef CONSPEED
#define CONSPEED (9600)
#endif

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)com.c 7.5 (Berkeley) 5/16/91
* $Id: sio.c,v 1.146 1996/09/14 04:27:42 bde Exp $
* $Id: sio.c,v 1.147 1996/09/30 12:22:27 bde Exp $
*/
#include "opt_comconsole.h"
@ -329,6 +329,7 @@ static struct cdevsw sio_cdevsw = {
static int comconsole = -1;
static speed_t comdefaultrate = TTYDEF_SPEED;
static speed_t condefaultrate = CONSPEED;
static u_int com_events; /* input chars + weighted output completions */
static int sio_timeout;
static int sio_timeouts_until_log;
@ -807,9 +808,11 @@ sioattach(isdp)
com->it_in.c_cflag = TTYDEF_CFLAG | CLOCAL;
com->it_in.c_lflag = TTYDEF_LFLAG;
com->lt_out.c_cflag = com->lt_in.c_cflag = CLOCAL;
}
com->it_in.c_ispeed = com->it_in.c_ospeed = condefaultrate;
} else
com->it_in.c_ispeed = com->it_in.c_ospeed = comdefaultrate;
termioschars(&com->it_in);
com->it_in.c_ispeed = com->it_in.c_ospeed = comdefaultrate;
com->it_out = com->it_in;
/* attempt to determine UART type */
@ -2339,7 +2342,7 @@ siocnopen(sp)
/*
* Save all the device control registers except the fifo register
* and set our default ones (cs8 -parenb speed=comdefaultrate).
* and set our default ones (cs8 -parenb speed=condefaultrate).
* We can't save the fifo register since it is read-only.
*/
iobase = siocniobase;
@ -2356,7 +2359,7 @@ siocnopen(sp)
* data input register. This also reduces the effects of the
* UMC8669F bug.
*/
divisor = ttspeedtab(comdefaultrate, comspeedtab);
divisor = ttspeedtab(condefaultrate, comspeedtab);
dlbl = divisor & 0xFF;
if (sp->dlbl != dlbl)
outb(iobase + com_dlbl, dlbl);

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)comreg.h 7.2 (Berkeley) 5/9/91
* $Id: sioreg.h,v 1.3 1995/01/20 07:34:18 wpaul Exp $
* $Id: sioreg.h,v 1.4 1995/12/10 13:39:15 phk Exp $
*/
@ -119,3 +119,7 @@
#ifndef CONUNIT
#define CONUNIT (0)
#endif
#ifndef CONSPEED
#define CONSPEED (9600)
#endif

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)com.c 7.5 (Berkeley) 5/16/91
* $Id: sio.c,v 1.146 1996/09/14 04:27:42 bde Exp $
* $Id: sio.c,v 1.147 1996/09/30 12:22:27 bde Exp $
*/
#include "opt_comconsole.h"
@ -329,6 +329,7 @@ static struct cdevsw sio_cdevsw = {
static int comconsole = -1;
static speed_t comdefaultrate = TTYDEF_SPEED;
static speed_t condefaultrate = CONSPEED;
static u_int com_events; /* input chars + weighted output completions */
static int sio_timeout;
static int sio_timeouts_until_log;
@ -807,9 +808,11 @@ sioattach(isdp)
com->it_in.c_cflag = TTYDEF_CFLAG | CLOCAL;
com->it_in.c_lflag = TTYDEF_LFLAG;
com->lt_out.c_cflag = com->lt_in.c_cflag = CLOCAL;
}
com->it_in.c_ispeed = com->it_in.c_ospeed = condefaultrate;
} else
com->it_in.c_ispeed = com->it_in.c_ospeed = comdefaultrate;
termioschars(&com->it_in);
com->it_in.c_ispeed = com->it_in.c_ospeed = comdefaultrate;
com->it_out = com->it_in;
/* attempt to determine UART type */
@ -2339,7 +2342,7 @@ siocnopen(sp)
/*
* Save all the device control registers except the fifo register
* and set our default ones (cs8 -parenb speed=comdefaultrate).
* and set our default ones (cs8 -parenb speed=condefaultrate).
* We can't save the fifo register since it is read-only.
*/
iobase = siocniobase;
@ -2356,7 +2359,7 @@ siocnopen(sp)
* data input register. This also reduces the effects of the
* UMC8669F bug.
*/
divisor = ttspeedtab(comdefaultrate, comspeedtab);
divisor = ttspeedtab(condefaultrate, comspeedtab);
dlbl = divisor & 0xFF;
if (sp->dlbl != dlbl)
outb(iobase + com_dlbl, dlbl);

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)comreg.h 7.2 (Berkeley) 5/9/91
* $Id: sioreg.h,v 1.3 1995/01/20 07:34:18 wpaul Exp $
* $Id: sioreg.h,v 1.4 1995/12/10 13:39:15 phk Exp $
*/
@ -119,3 +119,7 @@
#ifndef CONUNIT
#define CONUNIT (0)
#endif
#ifndef CONSPEED
#define CONSPEED (9600)
#endif