1.\" Copyright (c) 2002-2004 Roman Kurakin <rik@cronyx.ru> 2.\" Copyright (c) 2002-2004 Cronyx Engineering 3.\" All rights reserved. 4.\" 5.\" This software is distributed with NO WARRANTIES, not even the implied 6.\" warranties for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 7.\" 8.\" Authors grant any other persons or organisations a permission to use, 9.\" modify and redistribute this software in source and binary forms, 10.\" as long as this message is kept with the software, all derivative 11.\" works or modified versions. 12.\" 13.\" $FreeBSD$ 14.Dd May 19, 2004 15.Dt SCONFIG 8 i386 16.Os 17.Sh NAME 18.Nm sconfig 19.Nd "channel configuration utility for Cronyx adapters" 20.Sh SYNOPSIS 21.Nm 22.Op Fl aimsxeftuc 23.Op Ar device 24.Op Ar data_rate_options 25.Op Ar protocol_options ... 26.Op Ar interface_options ... 27.Sh DESCRIPTION 28The 29.Nm 30utility is used for configuring the channel options of the Cronyx 31adapters. 32In asynchronous mode, all parameters should be set using the standard 33.Xr stty 1 34utility. 35With 36.Nm , 37it is only possible to set some of them (see below). 38.Pp 39Some of the options can be set only on free channels, 40that is when the corresponding network interface is in the 41.Cm down 42state in the synchronous mode, 43and the terminal device 44.Pa /dev/tty* 45is closed in asynchronous mode. 46.Pp 47Other channel options can be changed 48.Dq "on the fly" . 49Generally, the channel options are set up during the operating system startup, 50for example, from the 51.Pa /etc/rc 52script. 53.Pp 54Note that not all options make sense in every particular case, 55and an attempt to set some of them may hung up the channel 56or the whole adapter. 57.\"-------------------------------------------------------------- 58.Ss "Information Options" 59Only one of these options can be specified. 60If information option is specified, 61.Nm 62will show the corresponding information and will ignore all other options, 63except 64.Ar device . 65See also the description of the 66.Ar device 67argument. 68.Bl -tag -width indent 69.It <none> 70This will show settings of the channel. 71.It Fl a 72Print all settings of the channel. 73.It Fl i 74Print interface settings, equal to the output of the 75.Xr ifconfig 8 76utility. 77.It Fl m 78Print modem signal status. 79The description of all signals can be found in any modem documentation. 80Only LE signal should be described. 81If this signal is ON then the channel is busy. 82If it is OFF then the channel is free. 83.It Fl s 84Print brief channel statistics. 85This is the generic statistics, 86see also the 87.Fl x , e , f , t , 88and 89.Fl u 90options. 91For a description of the output, see below. 92.Pp 93This statistics is very useful if something goes wrong. 94For example, if all interrupt counters are zero then the device 95was configured to use an interrupt that was not registered in the 96BIOS for use with the ISA bus. 97.It Fl x 98Print full channel statistics. 99This options prints additional counters, 100but with less precision than with the 101.Fl s 102option. 103.It Fl e 104Print brief E1/G703 statistics. 105If this option is selected, the 106statistics accumulated over the last 15 minutes is printed. 107For a description of the output, see below. 108.It Fl f 109Print full E1/G703 statistics. 110This option shows all E1/G703 statistics that the 111.Fl e 112option shows, 113plus total statistics for the whole period of time and statistics for 114last 24 hours (if available). 115For a description of the output, see below. 116.It Fl t 117Print brief E3/T3/STS-1 statistics. 118If this option is selected, the 119statistics accumulated over the last 15 minutes is printed. 120For a description of the output, see below. 121.It Fl u 122Print full E3/T3/STS-1 statistics. 123This option shows all E3/T3/STS-1 statistics that the 124.Fl t 125option shows, 126plus total statistics for the whole period of time and statistics for 127last 24 hours (if available). 128For a description of the output, see below. 129.It Fl c 130Cleans all kind of statistics. 131.El 132.\"-------------------------------------------------------------- 133.Ss "Device Selection" 134The device is selected using the name of the network interface, 135as shown by 136.Xr ifconfig 8 . 137The channel number depends on the order the drivers were loaded into the system. 138Sometimes people confuse channel number and adapter number because of the 139same spelling. 140The adapter number appears in the kernel context, while the channel number 141is in the configuration context. 142.Bl -tag -width indent 143.It <none> 144If the device name is omitted, 145.Nm 146will print information about all channels of all Cronyx adapters 147available in the system. 148If some settings need to be made, the device name must be specified. 149.It Li cx Ns Ar ## 150This is the channel name for the Sigma family of Cronyx adapters. 151(ISA bus.) 152.It Li ct Ns Ar ## 153This is the channel name for the Tau family of Cronyx adapters. 154(ISA bus.) 155.It Li cp Ns Ar ## 156This is the channel name for the Tau-PCI family of Cronyx adapters. 157(PCI bus.) 158.It Li ce Ns Ar ## 159This is the channel name for the Tau32-PCI family of Cronyx adapters. 160(PCI bus.) 161.El 162.\"-------------------------------------------------------------- 163.Ss "Data Rate Options" 164.Bl -tag -width indent 165.It Ar value 166A non-zero value will set the data rate to a given value 167in asynchronous mode, 168and will set the data rate and internal clock source of synchronization 169in synchronous mode. 170A zero value is equivalent to specifying the 171.Cm extclock 172option. 173The transmitted data (TxD) are synchronized using the internal on-board timing 174generator, the internally generated timing signal is driven on the TXCOUT pin, 175and the signal on the TXCIN pin is ignored. 176This mode is used for direct 177terminal-to-terminal communication, e.g., when connecting two computers together 178in synchronous mode with a relatively short cable. 179This method should also be 180used for testing channels with an external loopback connector. 181.It Cm extclock 182Set the external timing clock source for synchronous channels. 183External clock mode is the most commonly used method for connecting 184external modem hardware. 185In this mode, 186the external timing signal is received on the TXCIN pin of the connector, 187and it is used as a synchronization clock for transmitting data (TxD). 188.Pp 189Note: in 190.Cm extclock 191mode, the device cannot determine the value of the external timing clock 192since it does not have the built-in clock gauge. 193.El 194.\"-------------------------------------------------------------- 195.Ss "Protocol Options" 196Note: these option can only be used on a free channel, and they require 197specifying the device name. 198.Bl -tag -width indent 199.It Cm async 200(Only for Sigma family.) 201Select the asynchronous protocol (or mode). 202In this mode, Cronyx adapters behave as normal serial devices, 203and standard serial communications utilities can be used to 204work with them. 205All asynchronous settings should be set using the standard 206serial communications configuration utilities, e.g., 207.Xr stty 1 . 208With 209.Nm , 210it is only possible to set some of them. 211.It Cm cisco 212Select the Cisco HDLC synchronous protocol. 213.It Cm fr 214Select the Frame Relay synchronous protocol 215.Tn ( ANSI 216T1.617 Annex D). 217.It Cm ppp 218Select the synchronous PPP protocol. 219PPP parameters can be configured using the 220.Xr spppcontrol 8 221utility. 222.It Sm Cm keepalive No = Bro Cm on , off Brc Sm 223Turn on/off transmission of keepalive messages. 224This option is used only for synchronous PPP. 225If this option is 226.Cm on , 227PPP will periodically send ECHO-REQUEST messages. 228If it will not receive any ECHO-REPLY messages for 229some (definite) period of time it will break the connection. 230It is used for tracking the line state. 231.It Cm idle 232This mode is reported when using Netgraph. 233An actual protocol depends on the type of a connected Netgraph node, 234and it cannot be changed with 235.Nm . 236.El 237.\"-------------------------------------------------------------- 238.Ss "Interface Options" 239Not all of these options can be set on a busy channel, and not all of them 240are applicable to all kinds of adapters/channels. 241For all dual-state options, 242.Cm off 243is the default value. 244None of these options can be used in the asynchronous mode, 245except for the 246.Cm debug 247option. 248.Bl -tag -width indent 249.It Sm Cm port No = Bro Cm rs232 , v35 , rs449 Brc Sm 250Set the port type for old Sigma models. 251.It Sm Cm cfg No = Bro Cm A , B , C Brc Sm 252Set the configuration for the adapter. 253This option can be used only with Tau/E1 254and Tau/G703 adapters, and only if all channels are free. 255.Bl -tag -width ".Cm cfg Ns = Ns Cm A" 256.It Cm cfg Ns = Ns Cm A 257Two independent E1/G703 channels. 258This is the default setting. 259.It Cm cfg Ns = Ns Cm B 260(Only for ISA models.) 261For Tau/G703 this means one G703 channel and one digital channel. 262For Tau/E1, the first physical channel is divided into two subchannels. 263One of them goes to the first logical channel, another one goes to the 264second physical channel. 265Second (logical) channel is the digital channel. 266.It Cm cfg Ns = Ns Cm C 267(Only for E1 models.) 268In this mode, first 269physical channel consists of three data flows. 270Two of them go to the two (logical) channels. 271The last one goes to the second physical channel. 272On newer models (Tau32-PCI, Tau-PCI/2E1 and Tau-PCI/4E1), 273this programs the hardware to use a single source of synchronization 274and pass all unused (in both channels) timeslots from 275one channel to another. 276.El 277.Pp 278For a detailed description of available configuration modes, 279see the adapter documentation. 280This option cannot be set on a busy channel. 281.It Sm Cm loop No = Bro Cm on , off Brc Sm 282Turn on/off internal loopback. 283This mode is useful for debugging. 284When this mode is 285.Cm on , 286some data should be sent. 287If no interrupts are generated, chances are that 288the corresponding IRQ configuration entry in the BIOS 289was not switched from 290.Dq Li "PCI/ISA PNP" 291to 292.Dq Li "Legacy ISA" . 293.It Sm Cm rloop No = Bro Cm on , off Brc Sm 294(Only for Tau32-PCI and Tau-PCI/E3.) 295Turn on/off remote loopback feature. 296This mode is also useful for debugging. 297.It Sm Cm dpll No = Bro Cm on , off Brc Sm 298Turn on/off digital phase locked loop mode (DPLL). 299When enabled, the receiver 300timing clock signal is derived from the received data. 301Must be used with the NRZI 302encoding to avoid the synchronization loss. 303.It Sm Cm nrzi No = Bro Cm on , off Brc Sm 304Turn on/off NRZI encoding. 305If 306.Cm off , 307NRZ encoding is used. 308.Bl -tag -width "NRZI" 309.It NRZ 310The zero bit is transmitted by the zero signal level, 311the one bit is transmitted by the positive signal level. 312.It NRZI 313The zero bit is transmitted by the change of the signal 314level, the one bit is by the constant signal level. 315Commonly used with the 316.Cm dpll Ns = Ns Cm on 317option. 318.El 319.It Sm Cm invclk No = Bro Cm on , off Brc Sm 320(Tau and Tau-PCI only.) 321Invert both the transmit and receive clock signals. 322.It Sm Cm invrclk No = Bro Cm on , off Brc Sm 323(Tau-PCI only.) 324Invert the receive clock signals. 325.It Sm Cm invtclk No = Bro Cm on , off Brc Sm 326(Tau-PCI only.) 327Invert the transmit clock signals. 328.It Sm Cm higain No = Bro Cm on , off Brc Sm 329(E1 only.) 330In off state the sensitivity is -12 dB. 331Turn on/off increasing the E1 receiver's non-linear sensitivity to -30dB. 332This allows increasing of the line distance. 333.It Sm Cm cablen No = Bro Cm on , off Brc Sm 334(Tau-PCI/T3 and Tau-PCI/STS-1 only.) 335Turn on/off adjusting of the transmit signal for a long cable T3/STS-1. 336.It Sm Cm monitor No = Bro Cm on , off Brc Sm 337(Tau32-PCI, Tau-PCI/2E1 and Tau-PCI/4E1 only.) 338Turn on/off increasing of the E1 receiver's linear sensitivity to -30dB. 339This can be used for the interception purposes. 340.It Sm Cm phony No = Bro Cm on , off Brc Sm 341(Tau32-PCI and Tau-PCI E1 family only.) 342Turn on/off the so-called 343.Dq phony 344mode. 345This mode allows 346receiving raw CEPT frames from the E1 line. 347Raw frames can be accessed, for example, with the raw protocol. 348Packets would come at a rate of 500 frames per second 349with length 350.No 16* Ns Ar N 351(for Tau-PCI/E1 model), where 352.Ar N 353is the number of timeslots. 354For 355Tau-PCI/2E1 and Tau-PCI/4E1, 356.Ar N 357should be equal to 32 regardless of the number of 358used timeslots. 359.It Sm Cm unfram No = Bro Cm on , off Brc Sm 360(Tau32-PCI, Tau-PCI/2E1 and Tau-PCI/4E1 only.) 361Turn on/off unframed mode. 362.Bl -tag -width ".Cm unfram Ns = Ns Cm off" 363.It Cm unfram Ns = Ns Cm on 364Switch channel to the unframed G.703 mode. 365.It Cm unfram Ns = Ns Cm off 366Switch channel to the framed E1 (G.704) mode. 367.El 368.It Sm Cm scrambler No = Bro Cm on , off Brc Sm 369(Tau32-PCI, Tau-PCI/G.703, Tau-PCI/2E1, and 370Tau-PCI/4E1 in unframed mode only.) 371Turn on/off scrambling of the G.703 data. 372.It Sm Cm use16 No = Bro Cm on , off Brc Sm 373(Tau32-PCI and Tau-PCI E1 family only.) 374Turn on/off the usage of the 16th timeslot for data transmission. 375Normally, the 16th timeslot is used for signalling information 376(multiframing CAS). 377.It Sm Cm crc4 No = Bro Cm on , off Brc Sm 378(E1 only.) 379Turn on/off CRC4 superframe mode. 380.It Sm Cm syn No = Bro Cm int , rcv , rcv0 , rcv1 , rcv2 , rcv3 Brc Sm 381.Bl -tag -width ".Cm rcv3" 382.It Cm int 383Use an internal clock generator for G703 transmitter 384(clock master). 385.It Cm rcv 386Use the G703 receiver data clock as the transmit clock 387(clock slave). 388.It Cm rcv0 , rcv1 , rcv2 , rcv3 389Use the G703 receiver clock of the other channel 390(E1 models only). 391.El 392.It Cm dir Ns = Ns Ar number 393(Tau32-PCI, Tau-PCI/2E1 and Tau-PCI/4E1 only.) 394Bind a logical channel to a physical channel. 395Using this parameter it is possible, for example, to split 396physical E1 channel into several logical channels. 397.It Cm ts Ns = Ns Ar interval 398(E1 only.) 399Set up the list of timeslots for use by the channel. 400The timeslots are numbered from 1 to 31, 401and are separated by a comma or a minus sign, 402giving an interval. 403Example: 404.Dq Li ts=1-3,5,17 . 405.It Cm pass Ns = Ns Ar interval 406(Tau/E1 only.) 407Set up the list of timeslots, translated to the E1 subchannel in 408.Cm cfg Ns = Ns Cm B 409and 410.Cm cfg Ns = Ns Cm C 411configurations. 412.It Sm Cm debug No = Bro Cm 0 , 1 , 2 Brc Sm 413Turn on/off debug messages. 414.Bl -tag -width 2n 415.It Cm 0 416Turn debug messages off. 417.It Cm 1 418Turn debug messages on, equivalent to the 419.Cm debug 420option of the 421.Xr ifconfig 8 422utility. 423.It Cm 2 424High intensive debug messages, for developers only. 425.El 426.El 427.\"-------------------------------------------------------------- 428.Sh EXAMPLES 429Set up channel 1 for use with the HDSL modem or any other 430synchronous leased-line modem, and PPP/HDLC protocol (for Sigma): 431.Bd -literal -offset indent 432sconfig cx1 ppp extclock 433ifconfig cx1 158.250.244.2 158.250.244.1 up 434.Ed 435.Pp 436Set up channel 0 of Tau/E1 for use with the Cisco protocol 437over the E1 link, with a single virtual connection. 438The DLCI number is detected automatically. 439Use timeslots 1-10: 440.Bd -literal -offset indent 441sconfig ct0 cisco ts=1-10 442ifconfig ct0 158.250.244.2 158.250.244.1 up 443.Ed 444.Pp 445Set up channel 0 for the synchronous null-modem link to the nearby computer, 446internal clock source, 256000 bits/sec, protocol Cisco/HDLC (for Tau): 447.Bd -literal -offset indent 448sconfig ct0 cisco 256000 449ifconfig ct0 200.1.1.1 200.1.1.2 up 450.Ed 451.Pp 452Set up channel 1 for the leased line link using the data-only 453null-modem cable (or modems like Zelax+ M115). 454Synchronous DPLL mode, 128000 455bits/sec, protocol PPP/HDLC, NRZI encoding (for Sigma): 456.Bd -literal -offset indent 457sconfig cx1 ppp 128000 nrzi=on dpll=on 458ifconfig cx1 158.250.244.2 158.250.244.1 up 459.Ed 460.\"-------------------------------------------------------------- 461.Sh DIAGNOSTICS 462This section contains a description of abbreviations used by 463.Nm 464while displaying various statistics. 465For a description of options related to 466statistics, please see above. 467.\"-------------------------------------------------------------- 468.Ss Statistics 469When running, the driver gathers statistics about the channels, which 470can be accessed using the 471.Nm 472utility, 473or through the 474.Xr ioctl 2 475call 476.Dv SERIAL_GETSTAT . 477.Pp 478.Bl -tag -width indent -compact 479.It Va Rintr 480Total number of receive interrupts. 481.It Va Tintr 482Total number of transmit interrupts. 483.It Va Mintr 484Total number of modem interrupts. 485.It Va Ibytes 486Total bytes received. 487.It Va Ipkts 488Total packets received (for HDLC mode). 489.It Va Ierrs 490Number of receive errors. 491.It Va Obytes 492Total bytes transmitted. 493.It Va Opkts 494Total packets transmitted (for HDLC mode). 495.It Va Oerrs 496Number of transmit errors. 497.El 498.\"-------------------------------------------------------------- 499.Ss E1/G.703 Statistics 500For E1 and G.703 channels, the SNMP-compatible statistics data are gathered 501(see RFC 1406). 502It can be accessed using the 503.Nm 504utility, 505or through the 506.Xr ioctl 2 507call 508.Dv SERIAL_GETESTAT . 509.Bl -tag -width ".Va RCRC Pq Va rcrce" 510.It Va Unav Pq Va uas 511Unavailable seconds: receiving all ones, loss of carrier, or loss of 512signal. 513.It Va Degr Pq Va dm 514Degraded minutes: having error rate more than 10E-6, not counting unavailable 515and severely errored seconds. 516.It Va Bpv Pq Va bpv 517HDB3 bipolar violation errors. 518.It Va Fsyn Pq Va fse 519Frame synchronization errors (E1 only). 520.It Va CRC Pq Va crce 521CRC4 errors (E1). 522.It Va RCRC Pq Va rcrce 523Remote CRC4 errors: E-bit counter (E1). 524.It Va Err Pq Va es 525Errored seconds: any framing errors, or out of frame sync, or any slip events. 526.It Va Lerr Pq Va les 527Line errored seconds: any BPV. 528.It Va Sev Pq Va ses 529Severely errored seconds: 832 or more framing errors, or 2048 or more bipolar 530violations. 531.It Va Bur Pq Va bes 532Bursty errored seconds: more than 1 framing error, but not severely errored. 533.It Va Oof Pq Va oofs 534Severely errored framing seconds: out of frame sync. 535.It Va Slp Pq Va css 536Controlled slip seconds: any slip buffer overflow or underflow. 537.El 538.\"-------------------------------------------------------------- 539.Ss E1/G.703 Status 540The 541.Nm 542utility also prints the E1/G.703 channel status. 543The status can have the 544following values (non-exclusive): 545.Pp 546.Bl -tag -width ".Li FARLOMF" -compact 547.It Li Ok 548The channel is in a valid state, synchronized. 549.It Li LOS 550Loss of sync. 551.It Li AIS 552Receiving unframed all ones (E1 only). 553.It Li LOF 554Loss of framing (E1 only). 555.It Li LOMF 556Loss of multiframing (E1 only). 557.It Li FARLOF 558Receiving remote alarm (E1 only). 559.It Li AIS16 560Receiving all ones in the timeslot 16 (E1 only). 561.It Li FARLOMF 562Receiving distant multiframe alarm (E1 only). 563.It Li TSTREQ 564Receiving test request code (G.703 only). 565.It Li TSTERR 566Test error (G.703 only). 567.El 568.\"-------------------------------------------------------------- 569.Sh SEE ALSO 570.Xr stty 1 , 571.Xr ioctl 2 , 572.Xr sppp 4 , 573.Xr ifconfig 8 , 574.Xr route 8 , 575.Xr spppcontrol 8 576.\"-------------------------------------------------------------- 577.Sh HISTORY 578This utility is a replacement for the 579.Nm cxconfig 580and 581.Nm ctconfig 582utilities that were used in the past with 583.Fx 584drivers. 585Those two utilities and 586.Nm 587are not compatible, 588and therefore all scripts using them have to be rewritten. 589Moreover, 590.Tn Linux 591and 592.Fx 593versions of the 594.Nm 595utility are not fully compatible. 596.\"-------------------------------------------------------------- 597.Sh AUTHORS 598.An Cronyx Engineering Aq Mt info@cronyx.ru 599.Pp 600.Pa http://www.cronyx.ru 601.\"-------------------------------------------------------------- 602.Sh BUGS 603All software produced by Cronyx Engineering is thoroughly tested. 604But as created by a man, it can contain some bugs. 605If you have caught one, try to localize it and send an email with the 606description of the bug, and all operations that you have done. 607We will try to reproduce the error and fix it. 608