t.c_ispeed= 0; t.c_ospeed = 9600; t.c_cflag = CREAD | CS8 | HUPCL; sc->sc_tty->t_ospeed = 0; sabttyparam(sc, sc->sc_tty, &t);
sabtty_attach(parent, self, aux)	struct device *parent;	struct device *self;	void *aux;{	struct sabtty_softc *sc = (struct sabtty_softc *)self;	struct sabtty_attach_args *sa = aux;	int r;	sc->sc_tty = ttymalloc();	if (sc->sc_tty == NULL) {		printf(": failed to allocate tty\n");		return;	}	tty_attach(sc->sc_tty);	sc->sc_tty->t_oproc = sabtty_start;	sc->sc_tty->t_param = sabtty_param;	sc->sc_parent = (struct sab_softc *)parent;	sc->sc_bt = sc->sc_parent->sc_bt;	sc->sc_portno = sa->sbt_portno;	sc->sc_rend = sc->sc_rbuf + SABTTY_RBUF_SIZE;	switch (sa->sbt_portno) {	case 0:	/* port A */		sc->sc_pvr_dtr = SAB_PVR_DTR_A;		sc->sc_pvr_dsr = SAB_PVR_DSR_A;		r = bus_space_subregion(sc->sc_bt, sc->sc_parent->sc_bh,		    SAB_CHAN_A, SAB_CHANLEN, &sc->sc_bh);		break;	case 1:	/* port B */		sc->sc_pvr_dtr = SAB_PVR_DTR_B;		sc->sc_pvr_dsr = SAB_PVR_DSR_B;		r = bus_space_subregion(sc->sc_bt, sc->sc_parent->sc_bh,		    SAB_CHAN_B, SAB_CHANLEN, &sc->sc_bh);		break;	default:		printf(": invalid channel: %u\n", sa->sbt_portno);		return;	}	if (r != 0) {		printf(": failed to allocate register subregion\n");		return;	}	sabtty_console_flags(sc);	if (sc->sc_flags & (SABTTYF_CONS_IN | SABTTYF_CONS_OUT)) {		char *acc;		switch (sc->sc_flags & (SABTTYF_CONS_IN | SABTTYF_CONS_OUT)) {		case SABTTYF_CONS_IN:			acc = "input";			break;		case SABTTYF_CONS_OUT:			acc = "output";			break;		case SABTTYF_CONS_IN|SABTTYF_CONS_OUT:		default:			acc = "i/o";			break;		}		/* Let current output drain */		DELAY(100000);		if (sc->sc_flags & SABTTYF_CONS_IN) {			sabtty_cons_input = sc;			cn_tab->cn_pollc = sab_cnpollc;			cn_tab->cn_getc = sab_cngetc;			cn_tab->cn_dev = makedev(77/*XXX*/, self->dv_unit);			shutdownhook_establish(sabtty_shutdown, sc);		}		if (sc->sc_flags & SABTTYF_CONS_OUT) {			sabtty_cons_output = sc;			cn_tab->cn_putc = sab_cnputc;			cn_tab->cn_dev = makedev(77/*XXX*/, self->dv_unit);		}		printf(": console %s", acc);	} else {		/* Not a console... */		sabtty_reset(sc);	}	printf("\n");}