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