1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16#ifndef __DIGI_H
17#define __DIGI_H
18
19#ifndef TIOCM_LE
20#define TIOCM_LE 0x01
21#define TIOCM_DTR 0x02
22#define TIOCM_RTS 0x04
23#define TIOCM_ST 0x08
24#define TIOCM_SR 0x10
25#define TIOCM_CTS 0x20
26#define TIOCM_CAR 0x40
27#define TIOCM_RNG 0x80
28#define TIOCM_DSR 0x100
29#define TIOCM_RI TIOCM_RNG
30#define TIOCM_CD TIOCM_CAR
31#endif
32
33#if !defined(TIOCMSET)
34#define TIOCMSET (('d' << 8) | 252)
35#define TIOCMGET (('d' << 8) | 253)
36#endif
37
38#if !defined(TIOCMBIC)
39#define TIOCMBIC (('d' << 8) | 254)
40#define TIOCMBIS (('d' << 8) | 255)
41#endif
42
43#define DIGI_GETA (('e' << 8) | 94)
44#define DIGI_SETA (('e' << 8) | 95)
45#define DIGI_SETAW (('e' << 8) | 96)
46#define DIGI_SETAF (('e' << 8) | 97)
47#define DIGI_GET_NI_INFO (('d' << 8) | 250)
48#define DIGI_LOOPBACK (('d' << 8) | 252)
49
50
51
52#define DIGI_FAST 0x0002
53#define RTSPACE 0x0004
54#define CTSPACE 0x0008
55#define DIGI_COOK 0x0080
56#define DIGI_FORCEDCD 0x0100
57#define DIGI_ALTPIN 0x0200
58#define DIGI_PRINTER 0x0800
59#define DIGI_DTR_TOGGLE 0x2000
60#define DIGI_RTS_TOGGLE 0x8000
61#define DIGI_PLEN 28
62#define DIGI_TSIZ 10
63
64
65
66
67struct digi_t {
68 unsigned short digi_flags;
69 unsigned short digi_maxcps;
70 unsigned short digi_maxchar;
71 unsigned short digi_bufsize;
72 unsigned char digi_onlen;
73 unsigned char digi_offlen;
74 char digi_onstr[DIGI_PLEN];
75 char digi_offstr[DIGI_PLEN];
76 char digi_term[DIGI_TSIZ];
77};
78
79
80
81
82struct digi_dinfo {
83 unsigned int dinfo_nboards;
84 char dinfo_reserved[12];
85 char dinfo_version[16];
86};
87
88#define DIGI_GETDD (('d' << 8) | 248)
89
90
91
92
93
94
95struct digi_info {
96 unsigned int info_bdnum;
97 unsigned int info_ioport;
98 unsigned int info_physaddr;
99 unsigned int info_physsize;
100 unsigned int info_memsize;
101
102 unsigned short info_bdtype;
103 unsigned short info_nports;
104 char info_bdstate;
105 char info_reserved[7];
106};
107
108#define DIGI_GETBD (('d' << 8) | 249)
109
110struct digi_getbuffer
111{
112 unsigned long tx_in;
113 unsigned long tx_out;
114 unsigned long rxbuf;
115 unsigned long txbuf;
116 unsigned long txdone;
117};
118
119struct digi_getcounter {
120 unsigned long norun;
121 unsigned long noflow;
122 unsigned long nframe;
123 unsigned long nparity;
124 unsigned long nbreak;
125 unsigned long rbytes;
126 unsigned long tbytes;
127};
128
129
130#define BD_RUNNING 0x0
131#define BD_NOFEP 0x5
132
133#define DIGI_SETCUSTOMBAUD _IOW('e', 106, int)
134#define DIGI_GETCUSTOMBAUD _IOR('e', 107, int)
135
136#define DIGI_REALPORT_GETBUFFERS (('e' << 8) | 108)
137#define DIGI_REALPORT_SENDIMMEDIATE (('e' << 8) | 109)
138#define DIGI_REALPORT_GETCOUNTERS (('e' << 8) | 110)
139#define DIGI_REALPORT_GETEVENTS (('e' << 8) | 111)
140
141#define EV_OPU 0x0001
142#define EV_OPS 0x0002
143#define EV_IPU 0x0010
144#define EV_IPS 0x0020
145#define EV_TXB 0x0040
146
147
148
149
150
151struct ni_info {
152 int board;
153 int channel;
154 int dtr;
155 int rts;
156 int cts;
157 int dsr;
158 int ri;
159 int dcd;
160 int curtx;
161 int currx;
162 unsigned short iflag;
163 unsigned short oflag;
164 unsigned short cflag;
165 unsigned short lflag;
166 unsigned int mstat;
167 unsigned char hflow;
168 unsigned char xmit_stopped;
169 unsigned char recv_stopped;
170 unsigned int baud;
171};
172
173#define T_CLASSIC 0002
174#define T_PCIBUS 0400
175#define T_NEO_EXPRESS 0001
176#define T_NEO 0000
177
178#define TTY_FLIPBUF_SIZE 512
179#endif
180