- if (tp->t_outq.c_cc == 0)
- goto out;
- if (tp->t_flags & (RAW | LITOUT))
- nch = ndqb(&tp->t_outq, 0);
- else {
- nch = ndqb(&tp->t_outq, 0200);
- if (nch == 0) {
- nch = getc(&tp->t_outq);
- timeout(ttrstrt, (caddr_t)tp, (nch & 0x7f)+6);
- tp->t_state |= TS_TIMEOUT;
- goto out;
- }
- }
-
- /*
- * Should we use DMA or SILO mode?
- * If nch is greater than DO_DMA_COUNT then DMA.
- */
- if (nch) {
- dmz_addr->octet[octet].octet_csr =
- DMZ_IE | IR_LCTMR | (unit & 07);
- dmz_addr->octet[octet].octet_lctmr =
- (dmz_addr->octet[octet].octet_lctmr | DMZ_TE);
- tp->t_state |= TS_BUSY;
-
- use_dma = FALSE;
- room = DMZ_SIZ;
-
- if (nch > DO_DMA_COUNT)
- use_dma = TRUE;
-
- if (use_dma && dmz_dma_on) {
- car = UBACVT(tp->t_outq.c_cf,
- dmzinfo[controller]->ui_ubanum);
- dmz_softc[unit].dmz_count = nch;
- dmz_softc[unit].dmz_state |= ST_DMA;
- dmz_addr->octet[octet].octet_csr =
- DMZ_IE | IR_TBA | (unit & 07);
- dmz_addr->octet[octet].octet_tba = car;
- dmz_addr->octet[octet].octet_tcc =
- ((car >> 2) & 0xc000) | nch;
- } else {
- dmz_softc[unit].dmz_state &= ~ST_DMA;
- cp = tp->t_outq.c_cf;
- nch = MIN(nch, room);
- dmz_addr->octet[octet].octet_csr =
- DMZ_IE | IR_TBUF | (unit & 07);
- for (i = 0; i < nch; i++)
- dmz_addr->octet[octet].octet_tbf = *cp++ ;
- ndflush(&tp->t_outq, nch);
- }
- }
-
-out:
- splx(priority);
- return;