sys/sparc/dev/zs.c
/*
 * Set up the given unit as console input, output, both, or neither, as
 * needed.  Return console tty if it is to receive console input.
 */
Set up the given unit as console input, output, both, or neither, as
needed.  Return console tty if it is to receive console input.
Set up the given unit as console input output both or neither as needed . Return console tty if it is to receive console input .
static struct tty *
zs_checkcons(struct zsinfo *zi, int unit, struct zs_chanstate *cs)
{
	register struct tty *tp;
	char *i, *o;
	if ((tp = zs_ctty) == NULL)
		return (0);
	i = zs_consin == unit ? "input" : NULL;
	o = zs_consout == unit ? "output" : NULL;
	if (i == NULL && o == NULL)
		return (0);
	tp->t_dev = makedev(major(tp->t_dev), unit);
	if (i) {
		tp->t_param = zsparam;
		tp->t_ispeed = tp->t_ospeed = cs->cs_speed;
		tp->t_cflag = CS8;
		ttsetwater(tp);
	}
	if (o) {
		tp->t_oproc = zsstart;
		tp->t_stop = zsstop;
	}
	printf("%s%c: console %s\n",
	    zi->zi_dev.dv_xname, (unit & 1) + 'a', i ? (o ? "i/o" : i) : o);
	cs->cs_consio = 1;
	cs->cs_brkabort = 1;
	return (tp);
}
static struct tty * zs_checkcons ( struct zsinfo * zi , int unit , struct zs_chanstate * cs ) { register struct tty * tp ; char * i , * o ; if ( ( tp = zs_ctty ) == NULL ) return ( 0 ) ; i = zs_consin == unit ? " " : NULL ; o = zs_consout == unit ? " " : NULL ; if ( i == NULL && o == NULL ) return ( 0 ) ; tp -> t_dev = makedev ( major ( tp -> t_dev ) , unit ) ; if ( i ) { tp -> t_param = zsparam ; tp -> t_ispeed = tp -> t_ospeed = cs -> cs_speed ; tp -> t_cflag = CS8 ; ttsetwater ( tp ) ; } if ( o ) { tp -> t_oproc = zsstart ; tp -> t_stop = zsstop ; } printf ( " \n " , zi -> zi_dev . dv_xname , ( unit & 1 ) + ' ' , i ? ( o ? " " : i ) : o ) ; cs -> cs_consio = 1 ; cs -> cs_brkabort = 1 ; return ( tp ) ; }
Set up the given unit as console input, output, both, or neither, as
 needed.
Set up the given unit as console input output both or neither as needed .
/* rewire the minor device (gack) */ /*
	 * Rewire input and/or output.  Note that baud rate reflects
	 * input settings, not output settings, but we can do no better
	 * if the console is split across two ports.
	 *
	 * XXX	split consoles don't work anyway -- this needs to be
	 *	thrown away and redone
	 */