fa3608cdfc21835eed7e50470db3a5033a2105f7
[dragonfly.git] / share / man / man4 / man4.i386 / cx.4
1 .\"
2 .\" $FreeBSD: src/share/man/man4/man4.i386/cx.4,v 1.7.2.6 2001/08/17 13:08:45 ru Exp $
3 .\" $DragonFly: src/share/man/man4/man4.i386/cx.4,v 1.4 2006/11/14 22:27:49 swildner Exp $
4 .\"
5 .Dd December 12, 1994
6 .Dt CX 4 i386
7 .Os
8 .Sh NAME
9 .Nm cx
10 .Nd asynchronous/synchronous Cronyx-Sigma adapter driver
11 .Sh SYNOPSIS
12 .Cd "device cx0 at isa? port 0x240 irq 15 drq 7"
13 .Cd "device cx1 at isa? port 0x260 irq 12 drq 6"
14 .Cd pseudo-device sppp
15 .Pp
16 The base i/o port address should be set by jumpers on the board.
17 The DMA i/o channel and interrupt request numbers are configured
18 by software at adapter initialization.  Legal values are:
19 .Pp
20 .Bl -tag -compact -width Port
21 .It Port
22 0x240, 0x260, 0x280, 0x300, 0x320, 0x380
23 .It IRQ
24 3, 5, 7, 10, 11, 12, 15
25 .It DMA
26 5, 6, 7
27 .El
28 .Sh DESCRIPTION
29 The Cronyx-Sigma driver supports the adapters of models 100,
30 400, 500, 401, 404, 410, 440, 703, 801, 810, 840. Different models have
31 different set of channels:
32 .Pp
33 .Bl -tag -compact -width Cronyx-Sigma-999
34 .It Model
35 Channels
36 .It Cronyx-Sigma-100
37 0
38 .It Cronyx-Sigma-400
39 4, 5, 6, 7
40 .It Cronyx-Sigma-500
41 0, 4, 5, 6, 7
42 .It Cronyx-Sigma-401
43 0, 1, 2, 3
44 .It Cronyx-Sigma-404
45 0, 1, 2, 3
46 .It Cronyx-Sigma-410
47 0, 1, 2, 3
48 .It Cronyx-Sigma-440
49 0, 1, 2, 3
50 .It Cronyx-Sigma-703
51 0, 1, 2, 4, 5, 6, 7
52 .It Cronyx-Sigma-801
53 0, 1, 2, 3, 4, 5, 6, 7
54 .It Cronyx-Sigma-810
55 0, 1, 2, 3, 4, 5, 6, 7
56 .It Cronyx-Sigma-840
57 0, 1, 2, 3, 4, 5, 6, 7
58 .El
59 .Pp
60 A pair of two adapters can be united together by the special
61 short inter-board cable.  Two united adapters use the same
62 IRQ and DMA channels and from the point of driver works
63 as the single 16-channel multiplexer.  One of the united
64 boards is ``master'' and the other is ``slave''.
65 .Pp
66 The channels of the slave united board are numbered by the driver
67 beginning with 8, for example, the united adapter of the model 100/500
68 has channels 0, 8, 12, 13, 14, 15.
69 .Pp
70 The channels which have the RS-232 interface can be used
71 both in synchronous and asynchronous modes (software selectable
72 by cxconfig utility) and hence are called ``universal'' channels.
73 .Pp
74 The special device files,
75 .Pa /dev/* ,
76 for the adapter Cronyx-Sigma
77 are created by th
78 .Xr MAKEDEV 8
79 An example:
80 .Bd -literal
81 cd /dev
82 sh MAKEDEV cronyx ttyx0 ttyx1 ttyy0
83 .Ed
84 .Sh "Asynchronous driver"
85 The asynchronous channel device files have the names:
86 .Pa /dev/ttyx#
87 - for adapter cx0,
88 .Pa /dev/ttyy#
89 - for adapter cx1,
90 .Pa /dev/ttyz#
91 - for cx2.
92 Here # is the channel number in hexadecimal form, 0-9-a-f.
93 .Pp
94 The driver fulfills the following standard ioctl requests (see
95 .Xr ioctl 2 ) :
96 .Pp
97 .Bl -tag -width TIOCXXXXX -compact
98 .It Dv TIOCSBRK
99 Start sending BREAK.
100 .It Dv TIOCCBRK
101 Stop sending BREAK.
102 .It Dv TIOCSDTR
103 Set DTR signal (DTR := 1).  The DTR signal is always set
104 on the first
105 .Xr open 2
106 and could be changed by
107 .Dv TIOCCDTR ,
108 .Dv TIOCSDTR ,
109 .Dv TIOCMSET ,
110 .Dv TIOCMBIS ,
111 .Dv TIOCMBIC
112 ioctl calls.
113 .It TIOCCDTR
114 Clear DTR signal (DTR := 0).
115 .It TIOCMSET
116 Set the given values of DTR and RTS signals (<DTR:RTS> := data).
117 The signals DTR and RTS are controlled by
118 .Dv TIOCM_DTR
119 and
120 .Dv TIOCM_RTS
121 bits of the data argument of the ioctl system call.
122 .It TIOCMBIS
123 Set DTR and RTS signals (<DTR:RTS> |= data).
124 The signals DTR and RTS are controlled by
125 .Dv TIOCM_DTR
126 and
127 .Dv TIOCM_RTS
128 bits of the data argument of the ioctl system call.
129 .It TIOCMBIC
130 Clear DTR and RTS signals (<DTR:RTS> &= ~data).
131 The signals DTR and RTS are controlled by
132 .Dv TIOCM_DTR
133 and
134 .Dv TIOCM_RTS
135 bits of the data argument of the ioctl system call.
136 .It TIOCMGET
137 Determine the state of the modem signals of the line.
138 After the call the data argument contains the following bits:
139 .Pp
140 .Bl -tag -width TIOCM_XXX -compact
141 .It TIOCM_LE
142 always set (Line Enabled)
143 .It TIOCM_DSR
144 Data Set Ready signal received
145 .It TIOCM_CTS
146 Clear To Send signal received
147 .It TIOCM_CD
148 Data Carrier Detect signal received
149 .It TIOCM_DTR
150 Data Terminal Ready signal transmitted
151 .It TIOCM_RTS
152 Request To Send signal transmitted
153 .El
154 .El
155 .Sh "Synchronous driver"
156 The synchronous channels and universal channels, turned to the synchronous
157 mode by the
158 .Xr cxconfig 8
159 utility, are accessible as network
160 interfaces named ``cx#'' where # is the channel number, 0..47.
161 All standard network interface parameters could be set by
162 .Xr ifconfig 8
163 utility.
164 The
165 .Xr cxconfig 8
166 command is used to change some extended channel
167 options, and also for setting the high-level software protocol
168 (e.g. PpP or Cisco HDLC).
169 .Pp
170 The universal channels could be used both in asynchronous and synchronous modes.
171 By default the asynchronous mode is set.
172 The mode could be changed by
173 .Xr cxconfig 8
174 utility.
175 The mode is blocked while the channel is busy (an asynchronous channel
176 in open state or the network interface is up).
177 .Sh "Synchronous Point-to-Point protocol"
178 The Cronyx-Sigma driver uses the built-in implementation of the synchronous
179 Point-to-Point protocol (sppp).  It includes the support for such
180 protocols as PpP/HDLC and Cisco/HDLC, and also the automatic
181 connection loss test (via keepalive packets).
182 The sppp protocol set is implemented as an independent module
183 and could be used by other drivers of synchronous serial channels.
184 The version of the driver for BSD/386 (BSDI) operating system
185 also supports the usage of the general set of synchronous
186 protocols, implemented inside the OS.
187 The external protocol set could be selected by ``cxconfig ext'' command
188 (see
189 .Xr cxconfig 8 ) .
190 .Sh "Channel Options Management"
191 The
192 .Xr cxconfig 8
193 utility is used for setting the channels options.
194 The channel options are generally set at the start of the operating
195 system (for example, from the file
196 .Pa /etc/rc ) .
197 Note, that not all options have a sense for every particular
198 case, and an attempt to set some of them can hang up the channel or
199 the whole adapter.
200 .Pp
201 The actual channel options control functions are implemented via
202 the ioctl-s on the special device file /dev/cronyx.
203 There are the following ioctl-s available:
204 .Pp
205 .Bl -tag -width CXIOCXXXXXXX -compact
206 .It CXIOCGETMODE
207 Get the channel option values.
208 .It CXIOCSETMODE
209 Set the channel option values.
210 .El
211 .Pp
212 The data argument of the ioctl call has an address of the options structure:
213 .Bd -literal
214 typedef struct {
215     unsigned char board;   /* adapter number, 0..2 */
216     unsigned char channel; /* channel number, 0..15 */
217     unsigned char type;    /* channel type (read only) */
218     unsigned char iftype;  /* chan0 interface */
219     unsigned long rxbaud;  /* receiver speed */
220     unsigned long txbaud;  /* transmitter speed */
221     cx_chan_mode_t mode;   /* channel mode */
222     cx_chan_opt_t opt;     /* common channel options */
223     cx_opt_async_t aopt;   /* async mode options */
224     cx_opt_hdlc_t hopt;    /* hdlc mode options */
225     cx_opt_bisync_t bopt;  /* bisync mode options */
226     cx_opt_x21_t xopt;     /* x.21 mode options */
227     cx_soft_opt_t sopt;    /* software options and state flags */
228 } cx_options_t;            /* user settable options */
229 .Ed
230 .Pp
231 .Bl -tag -width rxbaudxxx
232 .It Fa board
233 The adapter number, 0..2.
234 .It Fa channel
235 The channel number, 0..15.
236 .It Fa type
237 The type of the channel (read-only argument).
238 .It Fa iftype
239 The interface type of the zero (and also the eight) channel: 0 - RS-232,
240 1 - RS-449/V.35.
241 .It Fa rxbaud
242 The receiver data baud rate.
243 .It Fa txbaud
244 The transmitter data baud rate.
245 .It Fa mode
246 The channel mode: asynchronous/HDLC/Bisync/X.21.
247 .It Fa opt
248 The general channel options.
249 .It Fa aopt
250 The asynchronous mode options.
251 .It Fa hopt
252 The HDLC mode options.
253 .It Fa bopt
254 The Bisync mode options.
255 .It Fa xopt
256 The X.21 mode options.
257 .It Fa sopt
258 The software protocol options.
259 .El
260 .Sh FILES
261 .Bl -tag -width /dev/cxXXXX -compact
262 .It Pa /dev/cx??
263 Asynchronous channels.
264 .It Pa /dev/cronyx
265 The special device file for the channel options management.
266 .El
267 .Pp
268 The sources for the driver reside in:
269 .Pp
270 .Bl -tag -width /dev/cxXXXX -compact
271 .It Pa /sys/dev/serial/cronyx/cronyx.c
272 .It Pa /sys/dev/netif/cx/cx.c
273 .It Pa /sys/dev/netif/cx/if_cx.c
274 .It Pa /sys/machine/pc32/include/cronyx.h
275 .It Pa /sys/dev/netif/cx/cxreg.h
276 .It Pa /sys/net/sppp/if_spppsubr.c
277 .It Pa /sys/net/sppp/if_sppp.h
278 .El
279 .Sh SEE ALSO
280 .Xr cxconfig 8 ,
281 .Xr ifconfig 8