}
dartopen (dev, flag, mode, p)	dev_t dev;	int flag;	int mode;	struct proc *p;{	int s, port;	struct dart_info *dart;	struct dartsoftc *sc;	struct tty *tp;	if ((port = DART_PORT(dev)) > 1) {		return (ENODEV);	}	sc = (struct dartsoftc *) dart_cd.cd_devs[0]; /* the only one */	dart = &sc->sc_dart[port];	s = spltty();	if (dart->tty) {		tp = dart->tty;	} else {		tp = dart->tty = ttymalloc();		simple_lock_init(&dart->t_lock);	}	simple_lock(&dart->t_lock);	tp->t_oproc = dartstart;	tp->t_param = dartparam;	tp->t_dev = dev;	if ((tp->t_state & TS_ISOPEN) == 0) {		ttychars(tp);		tp->t_iflag = TTYDEF_IFLAG;		tp->t_oflag = TTYDEF_OFLAG;		tp->t_lflag = TTYDEF_LFLAG;		tp->t_ispeed = tp->t_ospeed = B9600;		dartparam(tp, &tp->t_termios);		if (port == dart_cons) {			/* console is 8N1 */			tp->t_cflag = (CREAD | CS8 | HUPCL);		} else {			tp->t_cflag = TTYDEF_CFLAG;		}		ttsetwater(tp);		(void)dartmctl(dev, TIOCM_DTR | TIOCM_RTS, DMSET);		tp->t_state |= TS_CARR_ON;	} else if (tp->t_state & TS_XCLUDE && p->p_ucred->cr_uid != 0) {		simple_unlock(&dart->t_lock);		splx(s);		return (EBUSY);	}	/*	 * Reset the tty pointer, as there could have been a dialout	 * use of the tty with a dialin open waiting.	 */	tp->t_dev = dev;	simple_unlock(&dart->t_lock);	splx(s);	return ((*linesw[tp->t_line].l_open)(dev, tp));}