if (dart_cd.cd_ndevs == 0 || port > NDARTPORTS) return (ENODEV);
dartioctl(dev, cmd, data, flag, p)	dev_t dev;	u_long cmd;	caddr_t data;	int flag;	struct proc *p;{	int error;	int port;	struct tty *tp;	struct dart_info *dart;	struct dartsoftc *sc;	port = DART_PORT(dev);	sc = (struct dartsoftc *) dart_cd.cd_devs[0];	dart = &sc->sc_dart[port];	tp = dart->tty;	if (!tp)		return ENXIO;	error = (*linesw[tp->t_line].l_ioctl)(tp, cmd, data, flag, p);	if (error >= 0)		return(error);	error = ttioctl(tp, cmd, data, flag, p);	if (error >= 0)		return(error);	switch (cmd) {	case TIOCSBRK:		/* */		break;	case TIOCCBRK:		/* */		break;	case TIOCSDTR:		(void) dartmctl(dev, TIOCM_DTR | TIOCM_RTS, DMBIS);		break;	case TIOCCDTR:		(void) dartmctl(dev, TIOCM_DTR | TIOCM_RTS, DMBIC);		break;	case TIOCMSET:		(void) dartmctl(dev, *(int *) data, DMSET);		break;	case TIOCMBIS:		(void) dartmctl(dev, *(int *) data, DMBIS);		break;	case TIOCMBIC:		(void) dartmctl(dev, *(int *) data, DMBIC);		break;	case TIOCMGET:/*		*(int *)data = dartmctl(dev, 0, DMGET);*/		break;	case TIOCGFLAGS:		if (dart_cons == port)			dart->dart_swflags |= TIOCFLAG_SOFTCAR;		*(int *)data = dart->dart_swflags;		break;	case TIOCSFLAGS:		error = suser(p, 0); 		if (error != 0)			return(EPERM); 		dart->dart_swflags = *(int *)data;		if (dart_cons == port)			dart->dart_swflags |= TIOCFLAG_SOFTCAR;		dart->dart_swflags &= /* only allow valid flags */			(TIOCFLAG_SOFTCAR | TIOCFLAG_CLOCAL | TIOCFLAG_CRTSCTS);		break;	default:		return(ENOTTY);	}	return 0;}