}
dartmctl (dev, flags, how)	dev_t dev;	int flags;	int how;{	union dartreg *addr;	int port;	unsigned int dcdstate;	int newflags = 0;	struct dart_info *dart;	struct dartsoftc *sc;	int s; 	if ((port = DART_PORT(dev)) > 1) {		return (ENODEV);	}	sc = (struct dartsoftc *) dart_cd.cd_devs[0];	dart = &sc->sc_dart[port];	addr = sc->dart_reg;	/* special case: set or clear break */#if 0	if (flags & TIOCSBRK) {		dartbreak(port, 1);		flags &= ~TIOCSBRK;	}	if (flags & TIOCCBRK) {		dartbreak(port, 0);		flags &= ~TIOCCBRK;	}#endif 	s = spltty();		HANDLE_FLAG(TIOCM_DTR, port, OPDTRA, OPDTRB);	HANDLE_FLAG(TIOCM_RTS, port, OPRTSA, OPRTSB);#if 0	if (flags) {		printf("dartmctl: currently only BRK, DTR and RTS supported\n");		printf("dartmctl: op=%s flags left = 0x%b\n",		       HOW2STR(how), flags, FLAGSTRING);		panic("dartmctl");	}#endif 	dprintf(("dartmctl: action=%s flags=0x%x\n",		 HOW2STR(how), newflags));	switch (how) {	case DMSET:		addr->write.wr_oprset = newflags;		addr->write.wr_oprreset = ~newflags;		break;	case DMBIS:		addr->write.wr_oprset = newflags;		break;	case DMBIC:		addr->write.wr_oprreset = newflags;		break;	case DMGET:		panic("dartmctl: DMGET not supported (yet)");		break;	}	/* read DCD input */	/* input is inverted at port */	dcdstate = !(addr->read.rd_ip & ((port == A_PORT) ? IPDCDA : IPDCDB));	dprintf(("dartmctl: DCD is %s\n", dcdstate ? "up" : "down"));	splx(s);	return dcdstate;}