* This driver calls on the DHDM driver.
* If the DH has no DM11-BB, then the latter will
* be fake. To insure loading of the correct DM code,
* lib2 should have dhdm.o, dh.o and dhfdm.o in that order.
#define NDH11 16 /* number of lines */
#define DHNCH 8 /* max number of DMA chars */
* Place from which to do DMA on output
char dh_clist
[NDH11
][DHNCH
];
* Used to communicate the number of lines to the DM
/* DEC manuals incorrectly say this bit causes generation of even parity. */
#define SSPEED 7 /* standard speed: 300 baud */
* Software copy of last dhbar
if (dev
.d_minor
>= NDH11
) {
DHADDR
->dhcsr
=| IENABLE
;
tp
->t_state
=| WOPEN
|SSTART
;
if ((tp
->t_state
&ISOPEN
) == 0) {
tp
->t_speeds
= SSPEED
| (SSPEED
<<8);
tp
->t_flags
= ODDP
|EVENP
|ECHO
;
if (u
.u_procp
->p_ttyp
== 0)
tp
->t_state
=& (CARR_ON
|SSTART
);
ttread(&dh11
[dev
.d_minor
]);
ttwrite(&dh11
[dev
.d_minor
]);
* DH11 receiver interrupt.
while ((c
= DHADDR
->dhnxch
) < 0) { /* char. present */
if((tp
->t_state
&ISOPEN
)==0 || (c
&PERROR
)) {
if (c
&FRERROR
) /* break */
c
= 0; /* null (for getty) */
c
= 0177; /* DEL (intr) */
* Set parameters from open or stty into the DH hardware
DHADDR
->dhcsr
.lobyte
= tp
->t_dev
.d_minor
| IENABLE
;
if (tp
->t_speeds
.lobyte
==0) {
lpr
= (tp
->t_speeds
.hibyte
<<10) | (tp
->t_speeds
.lobyte
<<6);
if (tp
->t_speeds
.lobyte
== 4) /* 134.5 baud */
lpr
=| BITS6
|PENABLE
|HDUPLX
; else
lpr
=| BITS7
|PENABLE
; else
lpr
=| BITS7
|OPAR
|PENABLE
;
if (tp
->t_speeds
.lobyte
== 3) /* 110 baud */
* DH11 transmitter interrupt.
* Restart each line which used to be active but has
* terminated transmission since the last interrupt.
bar
= dhsar
& ~DHADDR
->dhbar
;
for (tp
= dh11
; bar
; tp
++) {
* Start (restart) transmission on the given DH11 line.
* If it's currently active, or delaying,
* no need to do anything.
if (tp
->t_state
&(TIMEOUT
|BUSY
))
* t_char is a delay indicator which may have been
* left over from the last start.
timeout(ttrstrt
, tp
, (c
&0177)+6);
cp
= dh_clist
[tp
->t_dev
.d_minor
];
* Copy DHNCH characters, or up to a delay indicator,
while (nch
> -DHNCH
&& (c
= getc(&tp
->t_outq
))>=0) {
* If the writer was sleeping on output overflow,
* wake him when low tide is reached.
if (tp
->t_outq
.c_cc
<=TTLOWAT
&& tp
->t_state
&ASLEEP
) {
* If any characters were set up, start transmission;
* otherwise, check for possible delay.
DHADDR
->dhcsr
.lobyte
= tp
->t_dev
.d_minor
| IENABLE
;
c
= 1<<tp
->t_dev
.d_minor
;
} else if (c
= tp
->t_char
) {
timeout(ttrstrt
, tp
, (c
&0177)+6);