1: /*
2: * Copyright (c) 1986 Regents of the University of California.
3: * All rights reserved. The Berkeley software License Agreement
4: * specifies the terms and conditions for redistribution.
5: *
6: * @(#)dhvreg.h 1.2 (2.11BSD) 1997/5/1
7: */
8:
9: /*
10: * DHV-11 device register definitions.
11: */
12: struct dhvdevice {
13: union {
14: u_short csr; /* control-status register */
15: struct {
16: char csrl; /* low byte for line select */
17: char csrh; /* high byte for tx line */
18: } cb;
19: } un1;
20: #define dhvcsr un1.csr
21: #define dhvcsrl un1.cb.csrl
22: #define dhvcsrh un1.cb.csrh
23: union {
24: u_short rbuf; /* recv.char/ds.change register (R) */
25: u_short timo; /* delay between recv -> intr (W) */
26: } un2;
27: #define dhvrbuf un2.rbuf
28: #define dhvtimo un2.timo
29: u_short dhvlpr; /* line parameter register */
30: union {
31: char fbyte[1]; /* fifo data byte (low byte only) (W) */
32: u_short fdata; /* fifo data word (W) */
33: char sbyte[2]; /* line status/fifo size (R) */
34: } un3;
35: #define dhvbyte un3.fbyte[0]
36: #define dhvfifo un3.fdata
37: #define dhvsize un3.sbyte[0]
38: #define dhvstat un3.sbyte[1]
39: u_short dhvlcr; /* line control register */
40: u_short dhvbar1; /* buffer address register 1 */
41: char dhvbar2; /* buffer address register 2 */
42: char dhvlcr2; /* xmit enable bit */
43: short dhvbcr; /* buffer count register */
44: };
45:
46: /* Bits in dhvcsr */
47: #define DHV_CS_TIE 0x4000 /* transmit interrupt enable */
48: #define DHV_CS_DFAIL 0x2000 /* diagnostic fail */
49: #define DHV_CS_RI 0x0080 /* receiver interrupt */
50: #define DHV_CS_RIE 0x0040 /* receiver interrupt enable */
51: #define DHV_CS_MCLR 0x0020 /* master clear */
52: #define DHV_CS_IAP 0x0007 /* indirect address pointer */
53:
54: #define DHV_IE (DHV_CS_TIE|DHV_CS_RIE)
55:
56: /* map unit into iap register select */
57: #define DHV_SELECT(unit) ((unit) & DHV_CS_IAP)
58:
59: /* Transmitter bits in high byte of dhvcsr */
60: #define DHV_CSH_TI 0x80 /* transmit interrupt */
61: #define DHV_CSH_NXM 0x10 /* transmit dma err: non-exist-mem */
62: #define DHV_CSH_TLN 0x0f /* transmit line number */
63:
64: /* map csrh line bits into line */
65: #define DHV_TX_LINE(csrh) ((csrh) & DHV_CSH_TLN)
66:
67: /* Bits in dhvrbuf */
68: #define DHV_RB_VALID 0x8000 /* data valid */
69: #define DHV_RB_STAT 0x7000 /* status bits */
70: #define DHV_RB_DO 0x4000 /* data overrun */
71: #define DHV_RB_FE 0x2000 /* framing error */
72: #define DHV_RB_PE 0x1000 /* parity error */
73: #define DHV_RB_RLN 0x0f00 /* receive line number */
74: #define DHV_RB_RDS 0x00ff /* receive data/status */
75: #define DHV_RB_DIAG 0x0001 /* if DHV_RB_STAT -> diag vs modem */
76:
77: /* map rbuf line bits into line */
78: #define DHV_RX_LINE(rbuf) (((rbuf) & DHV_RB_RLN) >> 8)
79:
80: /* Bits in dhvlpr */
81: #define DHV_LP_TSPEED 0xf000
82: #define DHV_LP_RSPEED 0x0f00
83: #define DHV_LP_TWOSB 0x0080
84: #define DHV_LP_EPAR 0x0040
85: #define DHV_LP_PENABLE 0x0020
86: #define DHV_LP_BITS8 0x0018
87: #define DHV_LP_BITS7 0x0010
88: #define DHV_LP_BITS6 0x0008
89:
90: /* Bits in dhvstat */
91: #define DHV_ST_DSR 0x80 /* data set ready */
92: #define DHV_ST_RI 0x20 /* ring indicator */
93: #define DHV_ST_DCD 0x10 /* carrier detect */
94: #define DHV_ST_CTS 0x08 /* clear to send */
95: #define DHV_ST_DHU 0x01 /* always one on a dhu, zero on dhv */
96:
97: /* Bits in dhvlcr */
98: #define DHV_LC_RTS 0x1000 /* request to send */
99: #define DHV_LC_DTR 0x0200 /* data terminal ready */
100: #define DHV_LC_MODEM 0x0100 /* modem control enable */
101: #define DHV_LC_MAINT 0x00c0 /* maintenance mode */
102: #define DHV_LC_FXOFF 0x0020 /* force xoff */
103: #define DHV_LC_OAUTOF 0x0010 /* output auto flow */
104: #define DHV_LC_BREAK 0x0008 /* break control */
105: #define DHV_LC_RXEN 0x0004 /* receiver enable */
106: #define DHV_LC_IAUTOF 0x0002 /* input auto flow */
107: #define DHV_LC_TXABORT 0x0001 /* transmitter abort */
108:
109: /* Bits in dhvlcr2 */
110: #define DHV_LC2_TXEN 0x80 /* transmitter enable */
111:
112: /* Bits in dhvbar2 */
113: #define DHV_BA2_DMAGO 0x80 /* transmit dma start */
114: #define DHV_BA2_XBA 0x03 /* top two bits of dma address */
115: #define DHV_XBA_SHIFT 16 /* amount to shift xba bits */
116:
117: /* Bits for dhvmctl only: stat bits are shifted up 16 */
118: #define DHV_ON (DHV_LC_DTR|DHV_LC_RTS|DHV_LC_MODEM)
119: #define DHV_OFF DHV_LC_MODEM
120:
121: #define DHV_DSR ((long)DHV_ST_DSR << 16)
122: #define DHV_RNG ((long)DHV_ST_RI << 16)
123: #define DHV_CAR ((long)DHV_ST_DCD << 16)
124: #define DHV_CTS ((long)DHV_ST_CTS << 16)
125:
126: #define DHV_RTS DHV_LC_RTS
127: #define DHV_DTR DHV_LC_DTR
128: #define DHV_BRK DHV_LC_BREAK
129: #define DHV_LE DHV_LC_MODEM
Defined struct's
dhvdevice
defined in line
12; used 30 times
- in /usr/src/sys/autoconfig/dhvauto.c line
15(2)
- in /usr/src/sys/pdpuba/dhv.c line
133(2),
141(2),
257(2),
263(2),
456-461(4),
519(2),
528(2),
572(2),
578(2),
646-649(4),
685(2),
693(2)
Defined macros
Usage of this include