4 .\" Copyright (c) 2002-2005 David Boggs. (boggs@boggs.palo-alto.ca.us)
5 .\" All rights reserved.
9 .\" Redistribution and use in source and binary forms, with or without
10 .\" modification, are permitted provided that the following conditions
12 .\" 1. Redistributions of source code must retain the above copyright
13 .\" notice, this list of conditions and the following disclaimer.
14 .\" 2. Redistributions in binary form must reproduce the above copyright
15 .\" notice, this list of conditions and the following disclaimer in the
16 .\" documentation and/or other materials provided with the distribution.
18 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
19 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
22 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" GNU General Public License:
32 .\" This program is free software; you can redistribute it and/or modify it
33 .\" under the terms of the GNU General Public License as published by the Free
34 .\" Software Foundation; either version 2 of the License, or (at your option)
35 .\" any later version.
37 .\" This program is distributed in the hope that it will be useful, but WITHOUT
38 .\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
39 .\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
42 .\" You should have received a copy of the GNU General Public License along with
43 .\" this program; if not, write to the Free Software Foundation, Inc., 59
44 .\" Temple Place - Suite 330, Boston, MA 02111-1307, USA.
46 .\" I forget these things:
47 .\" groff -Tascii -mdoc lmc.4 > lmc.0
48 .\" groff -Tps -mdoc lmc.4 > lmc.ps
49 .\" groff -Thtml -mdoc lmc.4 > lmc.html (buggy)
53 .Os \" sets \*(oS or \*[operating-system]
55 .\" substring works differently before minor version 19
56 .ie (\n(.y < 19) .nr ssfix 1
59 .ie "\*[operating-system]"" .ds aa \*(oS
60 .el .ds aa \*[operating-system]
61 .substring aa (0+\n[ssfix] (6+\n[ssfix])
62 .ie "\*(aa"FreeBSD" .nr fbsd 1
65 .ie "\*[operating-system]"" .ds aa \*(oS
66 .el .ds aa \*[operating-system]
67 .substring aa (0+\n[ssfix]) (5+\n[ssfix])
68 .ie "\*(aa"NetBSD" .nr nbsd 1
71 .ie "\*[operating-system]"" .ds aa \*(oS
72 .el .ds aa \*[operating-system]
73 .substring aa (0+\n[ssfix]) (7+\n[ssfix])
74 .ie "\*(aa"OpenBSD" .nr obsd 1
77 .ie "\*[operating-system]"" .ds aa \*(oS
78 .el .ds aa \*[operating-system]
79 .substring aa (0+\n[ssfix]) (4+\n[ssfix])
80 .ie "\*(aa"BSDI" .nr bsdi 1
83 .ie "\*[operating-system]"" .ds aa \*(oS
84 .el .ds aa \*[operating-system]
85 .ie "\*(aa"BSD" .nr linux 1
88 .\" if no operating system matched, select all OSs
89 .if !(\n[fbsd] : \n[nbsd] : \n[obsd] : \n[bsdi] : \n[linux]) \{\
100 .Nd device driver for
104 wide-area network interface cards.
110 .if (\n[nbsd] : \n[obsd] : \n[bsdi]) \{\
111 .Cd "lmc* at pci?" \}
113 .Cd "CONFIG_LANMEDIA=m" \}
117 This is an open-source Unix device driver for PCI-bus WAN interface cards.
118 It sends and receives packets in HDLC frames over synchronous circuits.
119 A generic PC plus Unix plus some
125 This driver works with FreeBSD, NetBSD, OpenBSD, BSD/OS and Linux OSs.
126 It has been tested on i386 (SMP 32-bit little-end), Sparc (64-bit big-end),
127 and Alpha (64-bit little-end) architectures.
131 driver works with the following cards:
132 .Bd -literal -offset 2m
133 SBE wanADAPT-HSSI High Speed Serial Interface,
134 (LMC5200) EIA612/613, 50-pin connector,
135 0 to 52 Mb/s, DTE only.
136 SBE wanADAPT-T3 T3: two 75-ohm BNC connectors,
137 (LMC5245) C-Parity or M13 Framing,
138 44.736 Mb/s, up to 950 ft.
139 SBE wanADAPT-SSI Synchronous Serial Interface,
140 (LMC1000) V.35, X.21, EIA449, EIA530(A), EIA232,
141 0 to 10 Mb/s, DTE or DCE.
142 SBE wanADAPT-T1E1 T1 or E1: RJ45 conn, 100 or 120 ohms,
143 (LMC1200) T1-ESF-B8ZS, T1-SF-AMI, E1-(many)-HDB3,
144 1.544 Mb/s or 2.048 Mb/s, up to 6 Kft.
147 Cards contain a high-performance
156 interfaces (HSSI and SSI).
157 .Bl -tag -width "Modem"
159 The PCI interface is a DEC 21140A "Tulip" Fast Ethernet chip.
160 This chip has an efficient PCI implementation with scatter/gather DMA,
161 and can run at 100 Mb/s full duplex (twice as fast as needed here).
163 The HDLC functions (ISO-3309: flags, bit-stuffing, CRC) are implemented
164 in a Field Programmable Gate Array (FPGA) which talks to the Ethernet
165 chip through a Media Independent Interface (MII).
166 The hardware in the FPGA translates between Ethernet packets and
167 HDLC frames on-the-fly; think it as a WAN PHY chip for Ethernet.
169 The modem chips are the main differences between cards.
170 HSSI cards use ECL10K chips to implement the EIA-612/613 interface.
171 T3 cards use a TranSwitch TXC-03401 framer chip.
172 SSI cards use Linear Technology LTC1343 modem interface chips.
173 T1 cards use a BrookTree/Conexant/Mindspeed Bt8370 framer
174 and line interface chip.
177 Line protocols exist above device drivers and below internet protocols.
178 They typically encapsulate packets in HDLC frames and deal with
179 higher-level issues like protocol multiplexing and security.
180 This driver is compatible with several line protocol packages:
181 .Bl -tag -width "Generic HDLC"
182 .if (\n[fbsd] : \n[nbsd]) \{\
185 implements many basic packet-handling functions as kernel loadable modules.
186 They can be interconnected in a graph to implement many protocols.
187 Configuration is done from userland without rebuilding the kernel.
188 Packets are sent and received through this interface if the driver's
190 hook is connected, otherwise the ifnet interface (SPPP and RawIP) is used.
191 ASCII configuration control messages are
193 currently supported. \}
197 implements Synchronous-PPP, Frame-Relay and Cisco-HDLC in the kernel. \}
198 .if (\n[nbsd] : \n[obsd]) \{\
201 implements Synchronous-PPP and Cisco-HDLC in the kernel. \}
205 implements Synchronous-PPP, Frame-Relay and Cisco-HDLC in the kernel. \}
207 .It Sy "Generic HDLC"
208 implements Synchronous-PPP, Frame-Relay, Cisco-HDLC,
209 Ether-in-HDLC, and IP-in-HDLC (aka RAWIP) in the kernel. \}
211 This null line protocol, built into the driver, sends and receives
212 raw IPv4 and IPv6 packets in HDLC frames (aka IP-in-HDLC) with
213 no extra bytes of overhead and no state at the end points.
218 .Ss ifconfig and lmcconfig
222 manipulates interface parameters beyond the scope of
224 In normal operation only a few arguments are needed:
225 .Bl -inset -offset 4n -compact
228 .if (\n[fbsd] : \n[nbsd] : \n[obsd]) SPPP
230 .if \n[linus] Generic-HDLC
231 line protocol package.
233 selects the built-in RawIP line protocol package.
234 .if (\n[fbsd] : \n[nbsd] : \n[obsd]) \{\
236 selects PPP line protocol.
238 selects Cisco-HDLC line protocol.
240 selects Frame-Relay line protocol.\}
245 displays interface configuration and status.
248 Some configuration options are available through
253 .Ic "ifconfig lmc0 media e1 timeslot all
255 selects E1 format using all 32 timeslots.
257 .Ic "ifconfig -m lmc0"
259 lists the available media options.
261 .Ic "ifconfig lmc0 -mediaopt hdlc-crc16"
263 deselects 16-bit CRCs, thereby selecting 32-bit CRCs.
265 .Ic "ifconfig lmc0 mediaopt loopback"
267 loops the interface transmitter to the receiver for testing.
268 Some cards have up to six loopback paths through the hardware.
270 selects a simple loopback present in every card type, but
272 can select them all.\}
274 .Ic "lmcconfig lmc0 -D"
276 enables debugging output from the device driver only.
278 .Ic "ifconfig lmc0 debug"
280 enables debugging output from the device driver and from
281 the line protocol module above it.
282 Debugging messages that appear on the console are also
284 .Ic "/var/log/messages" .
286 when things go very wrong, a torrent of debugging messages
287 can swamp the console and bring a machine to its knees.
288 .if (\n[fbsd] : \n[nbsd] : \n[obsd] : \n[bsdi]) \{\
290 .Ss Patching Ethernet Drivers
292 Since these cards use DEC 21140A Tulip Ethernet chips,
293 be aware that an Ethernet driver may mistake one for an
294 Ethernet card and try to drive it.
295 For some versions of some operating systems, it is
296 sufficient to list the
298 cards before any Ethernet cards in the kernel configuration.
299 Another solution is to unplug all 21140-based Ethernet cards
300 and remove their device drivers from the kernel configuration.
301 Finally, one can patch the Ethernet drivers to ignore
304 In any case, you must make a custom kernel.
306 Chapter 9 of the FreeBSD Handbook \}
308 Chapter 6 of the NetBSD Guide \}
310 Chapter 5 of the OpenBSD FAQ \}
312 "Rebuilding the Kernel" in the BSD/OS Administrator's Guide \}
313 explains how to configure and build custom kernels.
315 To patch an Ethernet device driver:
319 .Ic "tulip_pci_probe()"
321 .Ic "sys/pci/if_de.c" : \}
322 .if (\n[nbsd] : \n[obsd]) \{\
325 .Ic "tulip_pci_probe()"
327 .Ic "/sys/dev/pci/if_de.c" :
330 .Ic "dc_pci_match() "
332 .Ic "/sys/dev/pci/if_dc_pci.c" :
336 .Ic "tlp_pci_match() "
338 .Ic "/sys/dev/pci/if_tlp_pci.c" : \} \}
342 .Ic "tulip_pci_match()"
344 .Ic "/sys/i386/pci/if_de.c" : \}
347 .Ic "if (pci_get_subvendor(dev)==0x1376)"
351 This driver should already be patched. \}
352 .if (\n[nbsd] : \n[obsd]) \{\
353 .Ic "if ((pci_conf_read(pa->pa_pc, pa->pa_tag, 0x2C) & 0xFFFF)==0x1376)"
358 .Ic "if ((pci_inl(pa, 0x2C) & 0xFFFF)==0x1376)"
362 Make sure you patch the correct routine: many Ethernet drivers
363 contain probe/match routines for several operating systems inside
366 .Ic "/var/log/messages"
367 should contain a boot message like this:
370 .Ic "freebsd-4: pci0: <unknown card> (vendor=0x1011, dev=0x0009) at 18.0 irq 9"
372 .Ic "freebsd-5: pci0: <network, ethernet> at device 18.0 (no driver attached)" \}
374 .Ic "vendor 0x1011 product 0x0009 (ethernet network, revision 0x22)
376 .Ic "at pci0 dev 18 function 0 not configured" \}
378 .Ic "DEC 21140 rev 0x22 at pci0 dev 18 function 0 not configured" \}
380 .Ic "lmc0 at pci0 iobase 0xe880 irq 10 maddr 0xfebeff00-0xfebeff7f" \}
381 .if (\n[nbsd] : \n[obsd] : \n[bsdi]) \{\
383 If the boot message looks like this:
386 .Ic "de1 at pci0 dev 18 function 0 DEC 21140 rev 0x22:"
388 .Ic "de1: can't read ENET ROM (why=-4) (76130600000 ..."
390 .Ic "de1: 21140A [10-100Mb/s] pass 2.2 address unknown"
393 .Ic "tlp0 at pci0 dev 18 function 0: DECchip 21140A Ethernet, pass 2.2"
395 .Ic "tlp0: sorry, unable to handle your board"
398 .Ic "stray interrupt on irq 9"
400 then the Ethernet driver needs patching. \} \}
403 .Ss FreeBSD Configuration
405 Put the source files in
407 You may need to create the directory.
409 Add the following line to
410 .Ic "/sys/conf/files" :
412 .Ic "dev/lmc/if_lmc.c optional lmc pci"
418 For FreeBSD-5, change
422 in the entry for sppp:
424 .Ic "net/if_spppsubr.c count sppp"
426 To wire this driver into your kernel:
427 Add the following line to
428 .Ic "/sys/ARCH/conf/YOURKERNEL" :
430 .Ic "device lmc # LMC/SBE WAN cards"
432 Put this line near lines for other network devices.
433 To load the driver into a running kernel, see KLD below.
435 To wire a line protocol into your kernel, add:
437 .Ic "options netgraph # wired into the kernel"
439 .Ic "pseudo-device sppp # FreeBSD-4"
441 .Ic "device sppp # FreeBSD-5"
443 It is not necessary to wire line protocols into your kernel.
444 This driver and line protocols can be loaded later with kldload(8).
445 The driver can send and receive raw IP packets even if neither
446 SPPP nor Netgraph are configured into the kernel.
447 Netgraph and SPPP can both be enabled; netgraph will be used if the
449 hook is connected. \}
452 .Ss FreeBSD Kernel Loadable Modules ("KLD" mechanism)
454 To make this driver into a standard kernel loadable module:
456 Make a directory named
457 .Ic "/sys/modules/lmc" .
460 .Ic "/sys/dev/lmc/Makefile"
462 .Ic "/sys/modules/lmc/Makefile" .
467 .Ic "/sys/modules/Makefile"
468 for your machine architecture.
471 .Ic /sys/ARCH/compile/YOURKERNEL:
473 .Ic "make modules-depend"
474 generates all module dependencies.
479 .Ic "make modules-install"
480 installs all modules.
482 To make this driver into a kernel loadable module "by hand":
488 generates lmc module dependencies.
491 creates the lmc module.
494 installs the lmc module.
496 .Ic "make depend all install"
499 While standing anywhere (as root):
502 loads the driver and starts it.
504 .Ic "kldunload if_lmc"
505 stops the driver and unloads it.
508 displays status of loaded modules.
511 must be 0 to load modules; see
514 To load this module at boot time, add
516 .Ic "if_lmc_load=""YES"""
519 .Ic "/boot/loader.conf"; see
520 .Xr loader.conf 5 . \}
523 .Ss FreeBSD Operation
525 Activate a PPP link using SPPP and Netgraph with:
527 .Ic "ngctl mkpeer lmc0: sppp rawdata downstream"
529 .Ic "ifconfig sppp0 10.0.0.1 10.0.0.2"
531 Activate a PPP link using only SPPP with:
533 .Ic "lmcconfig lmc0 -XYZ"
535 .Ic "ifconfig lmc0 10.0.0.1 10.0.0.2"
537 Activate a Cisco-HDLC link using SPPP and Netgraph with:
539 .Ic "ngctl mkpeer lmc0: sppp rawdata downstream"
541 .Ic "ifconfig sppp0 10.0.0.1 10.0.0.2 link2"
543 Activate a Cisco-HDLC link using only SPPP with:
545 .Ic "lmcconfig lmc0 -XYz"
547 .Ic "ifconfig lmc0 10.0.0.1 10.0.0.2"
549 Activate a Cisco-HDLC link using only Netgraph with:
551 .Ic "ngctl mkpeer lmc0: cisco rawdata downstream"
553 .Ic "ngctl mkpeer lmc0:rawdata iface inet inet"
555 .Ic "ifconfig ng0 10.0.0.1 10.0.0.2"
557 Activate a Frame-Relay DTE link using SPPP with:
559 .Ic "lmcconfig lmc0 -XYF"
561 .Ic "ifconfig lmc0 10.0.0.1 10.0.0.2"
563 SPPP implements the ANSI T1.617 annex D LMI.
565 Activate a Frame-Relay DTE link using Netgraph with:
567 .Ic "ngctl mkpeer lmc0: frame_relay rawdata downstream"
569 .Ic "ngctl mkpeer lmc0:rawdata lmi dlci0 auto0"
571 .Ic "ngctl connect lmc0:rawdata dlci0 dlci1023 auto1023"
573 .Ic "ngctl mkpeer lmc0:rawdata rfc1490 dlci500 downstream"
575 .Ic "ngctl mkpeer lmc0:rawdata.dlci500 iface inet inet"
577 .Ic "ifconfig ng0 10.0.0.1 10.0.0.2"
581 possible Frame Relay configuration; there are many.
583 Activate a RAWIP link using only the driver with:
585 .Ic "lmcconfig lmc0 -x"
587 .Ic "ifconfig lmc0 10.0.0.1 10.0.0.2"
589 Activate a RAWIP link using Netgraph with:
591 .Ic "ngctl mkpeer lmc0: iface rawdata inet"
593 .Ic "ifconfig ng0 10.0.0.1 10.0.0.2"
595 If the driver is kldunloaded and then kldloaded, reconnect hooks by:
597 .Ic "ngctl connect lmc0: ng0: rawdata inet" \}
598 .if (\n[nbsd] : \n[obsd]) \{\
600 .if \n[nbsd] .Ss NetBSD Configuration
601 .if \n[obsd] .Ss OpenBSD Configuration
603 Put the source files in
604 .Ic "/sys/dev/pci/" .
606 Add the following lines to
607 .Ic "/sys/dev/pci/files.pci" :
609 .Ic "device lmc: ifnet, sppp"
610 .if \n[obsd] .Ic ", ifmedia"
612 .Ic "attach lmc at pci"
614 .Ic "file dev/pci/if_lmc.c lmc"
621 .Ic "/sys/conf/files" ,
624 to the end of this line:
626 .Ic "file net/if_spppsubr.c sppp needs-count"
628 To wire this driver into your kernel,
629 add the following line to
630 .Ic "/sys/arch/ARCH/conf/YOURKERNEL" :
632 .Ic "lmc* at pci? # LMC/SBE WAN cards"
634 Put this line near lines for other network devices.
635 To load the driver into a running kernel, see LKM below.
637 To wire SPPP into your kernel:
639 .Ic "pseudo-device sppp 1 # wired into the kernel"
641 The driver can send and receive raw IP packets even if
642 SPPP is not configured into the kernel. \}
643 .if (\n[nbsd] : \n[obsd]) \{\
645 .if \n[nbsd] .Ss NetBSD Loadable Kernel Modules ("LKM" mechanism)
646 .if \n[obsd] .Ss OpenBSD Loadable Kernel Modules ("LKM" mechanism)
648 Add the following line to
649 .Ic "/sys/arch/ARCH/conf/YOURKERNEL" :
651 .Ic "options LKM # loadable kernel modules"
653 Install symbolic links from the kernel compilation directory
654 to the source directory:
656 .Ic "ln -s /sys/dev/pci/if_lmc.c"
658 .Ic "ln -s /sys/dev/pci/if_lmc.h"
661 .Ic "/sys/arch/ARCH/compile/YOURKENEL" :
664 compiles the driver module.
666 .Ic "modload if_lmc.o"
667 loads the driver and starts it.
669 while standing anywhere (as root):
671 .Ic "modunload -n if_lmc.o"
672 stops the driver and unloads it.
675 displays status of loaded modules.
677 When the driver module is loaded, if you get a message like this:
679 .Ic lmc1: bus_space_map failed; error 35
681 then the Ethernet device driver needs patching.
684 must be 0 to load modules; see
687 One way is to include in
688 .Ic "/sys/arch/ARCH/conf/YOURKERNEL" :
690 .Ic "options INSECURE # disable kernel security levels"
693 LKM only works for PCI bus 0 on an i386 machine. \} \}
695 .if \n[nbsd] .Ss NetBSD Operation
696 .if \n[obsd] .Ss OpenBSD Operation
698 .if (\n[nbsd] : \n[obsd]) \{\
699 Activate a PPP link using SPPP with:
701 .Ic "lmcconfig lmc0 -XYZ"
703 .Ic "ifconfig lmc0 10.0.0.1 10.0.0.2"
705 Activate a Cisco-HDLC link using SPPP with:
707 .Ic "lmcconfig lmc0 -XYz"
709 .Ic "ifconfig lmc0 10.0.0.1 10.0.0.2"
711 Activate a RAWIP link with:
713 .Ic "lmcconfig lmc0 -x"
715 .Ic "ifconfig lmc0 10.0.0.1 10.0.0.2" \}
718 .Ss BSD/OS Configuration
720 Put the source files in
721 .Ic "/sys/i386/pci/" .
723 Add the following lines to
724 .Ic "/sys/i386/conf/files.i386" :
726 .Ic "device lmc at pci: pcisubr, p2p"
728 .Ic "file i386/pci/if_lmc.c lmc device-driver"
731 .Ic "i386/pci/if_*.c entries" .
733 Add the following lines to
734 .Ic "/sys/i386/conf/YOURKERNEL" :
736 .Ic "lmc* at pci? # LMC/SBE WAN cards"
738 Put the above line before any Ethernet devices.
740 .Ic "options PPP # include PPP code"
742 .Ic "options FR # include Frame-Relay code"
744 .Ic "options CISCO_HDLC # include Cisco-HDLC code"
750 To activate a PPP link, create file
754 .Ic "Plmc0: :device=lmc0:\e"
756 .Ic " :local-addr=10.0.0.1:\e"
758 .Ic " :remote-addr=10.0.0.2:\e"
760 .Ic " :immediate:dialout:direct:\e"
762 .Ic " :-pfc:-acfc:-tcpc:"
766 .Ic "ppp -bd Plmc0" .
770 to watch protocol events happen.
772 Activate a Cisco-HDLC link by setting LINKTYPE with ifconfig:
774 .Ic "ifconfig lmc0 10.0.0.1 10.0.0.2 linktype chdlc"
776 Activate a Fame-Relay link with:
778 .Ic "ifconfig lmc0 linktype fr"
780 By default the port is a DTE; add the next line to make it a DCE:
782 .Ic "frconfig lmc0 type dce"
784 .Ic "frconfig lmc0 lmi ansi"
786 .Ic "frconfig lmc0 dlci 500 10.0.0.2"
788 .Ic "ifconfig lmc0 10.0.0.1 10.0.0.2"
790 Activate a RAWIP link with:
792 .Ic "ifconfig lmc0 down -remove"
794 .Ic "lmcconfig lmc0 -x"
796 .Ic "ifconfig lmc0 10.0.0.1 10.0.0.2"
800 .Ss Linux Configuration
802 The source files are in
803 .Ic "/usr/src/linux/drivers/net/wan/lmc/" .
805 Configure the driver and line protocol into your kernel with
806 .Ic make menuconfig ,
807 navigating through the menus, select this device driver and the
808 generic HDLC layer as loadable kernel modules or wired into the kernel:
810 .Ic "Device Drivers --->"
812 .Ic "Networking Support --->"
814 .Ic "Wan interfaces --->"
816 .Ic "<M> SBE Inc. LMC1000/1200/5200/5245 support"
818 .Ic "<M> Generic HDLC layer"
821 configures code as a module and
823 wires it into the kernel.
825 Selecting the Generic HDLC layer selects all available protocols.
826 Raw, Cisco and Frame-Relay are in the generic-hdlc module;
827 PPP is a separate module.
829 .Ic "[*] Raw HDLC support"
831 .Ic "[*] Raw HDLC Ethernet device support"
833 .Ic "[*] Cisco HDLC support"
835 .Ic "[*] Frame Relay support"
837 .Ic "[*] Synchronous Point-to-Point Protocol (PPP) support"
840 includes support for a protocol and
844 The driver can send and receive raw IP packets even if
845 Generic-HDLC is not configured into the kernel.
846 The device name will be
848 if the generic HDLC code is used, or
853 .Ss Linux Loadable Kernel Modules
855 If configured as above, the kernel will recognize an LMC/SBE card
856 when it boots and load this driver and the Generic-HDLC code.
857 Messages similar to the following will appear in /var/log/messages:
859 .Ic "Cronyx Ltd, Synchronous PPP and CISCO HDLC (c) 1994"
861 .Ic "Linux port (c) 1998 Building Number Three Ltd & Jan 'Yenya' Kasprzak."
863 .Ic "HDLC support module revision 1.16"
865 .Ic "hdlc0: <SBE/LMC T3 Card> io 0xe880/9 mem 0xfebeff00/25"
866 .Ic "rom 0xfeb40000/14 irq 11 pci 0000:00:13.0"
868 The driver registers itself under the name
872 because the generic-HDLC code requires it.
874 When the card and line protocol are configured these messages will appear:
876 .Ic "hdlc0: PCI rev 2.2, MII rev 3.5,
877 .Ic "IEEE addr 00:60:99:00:13:c4, TXC03401 rev B"
879 .Ic "hdlc0: Driver rev 2004.6.17, Options IO_CSR LITTLE_END"
881 .Ic "hdlc0: protocol up"
883 While standing in /usr/src/linux/drivers/net/wan/lmc:
885 .Ic "make -C /usr/src/linux SUBDIRS=/usr/src/linux/drivers/net/wan/lmc \e"
887 .Ic " modules modules-install "
888 compiles and installs the driver.
890 .Ic "modprobe if_lmc "
891 loads the module into the kernel.
893 .Ic "modprobe -r if_lmc "
894 removes the module from the kernel.
897 displays status of loaded modules.
905 configures the generic-HDLC code.
907 .Ic "sethdlc hdlc0 (or pvc0 for frame relay)"
909 displays the current settings of a given device.
915 and the generic-hdlc kernel code are documented in
916 .Ic "/usr/src/linux/Documentation/networking/generic-hdlc.txt"
918 .Ic "http://hq.pm.waw.pl/hdlc"
920 Activate a PPP link with:
922 .Ic "sethdlc hdlc0 ppp"
924 .Ic "ifconfig hdlc0 10.0.0.1 pointopoint 10.0.0.2"
926 Activate a Cisco-HDLC link with:
928 .Ic "sethdlc hdlc0 cisco"
930 .Ic "ifconfig hdlc0 10.0.0.1 pointopoint 10.0.0.2"
932 Activate a Frame-Relay DTE link with:
934 .Ic "sethdlc hdlc0 fr lmi ansi [dce]"
936 .Ic "sethdlc hdlc0 create 500"
938 .Ic "ifconfig hdlc0 up"
940 .Ic "ifconfig pvc0 10.0.0.1 pointopoint 10.0.0.2"
944 possible Frame Relay configuration; there are many.
945 Adding "dce" after "ansi" configures it as a DCE (switch).
947 Activate a RAWIP link with:
949 .Ic "sethdlc hdlc0 hdlc"
951 .Ic "ifconfig hdlc0 10.0.0.1 pointopoint 10.0.0.2"
956 .Ss Testing with Loopbacks
958 Testing with loopbacks requires only one card.
959 Packets can be looped back at many points: in the PCI chip,
960 in the modem chips, through a loopback plug, in the
961 local external equipment, or at the far end of a circuit.
963 Testing with loopbacks does not work on Linux because the
964 kernel detects that an outgoing packet is destined for "self"
965 and loops it back without ever giving it to the hardware. \}
967 Activate the card with ifconfig:
969 .Ic "ifconfig lmc0 10.0.0.1 10.0.0.1"
971 All cards can be looped through the PCI chip.
972 Cards with internal modems can be looped through
973 the modem framer and the modem line interface.
974 Cards for external modems can be looped through
975 the driver/receiver chips.
980 Loopback plugs test everything on the card.
981 .Bl -tag -width "T1/E1" -offset 2m -compact
983 Loopback plugs can be ordered from SBE (and others).
984 Transmit clock is normally supplied by the external modem.
985 When an HSSI card is operated with a loopback plug, the PCI bus
986 clock must be used as the transmit clock, typically 33 MHz.
987 When testing an HSSI card with a loopback plug,
988 configure it with lmcconfig:
990 .Ic "lmcconfig lmc0 -a 2
993 selects the PCI bus clock as the transmit clock.
995 Connect the two BNC jacks with a short coax cable.
997 Loopback plugs can be ordered from SBE (only).
998 Transmit clock is normally supplied by the external modem.
999 When an SSI card is operated with a loopback plug,
1000 the on-board clock synthesizer must be used.
1001 When testing an SSI card with a loopback plug,
1002 configure it with lmcconfig:
1004 .Ic "lmcconfig lmc0 -E -f 10000000"
1007 puts the card in DCE mode to source a transmit clock.
1010 sets the internal clock source to 10 Mb/s.
1013 A loopback plug is a modular plug with two wires
1014 connecting pin 1 to pin 4 and pin 2 to pin 5.
1017 One can also test by connecting to a local modem (HSSI and SSI)
1018 or NI (T1 and T3) configured to loop back.
1019 Cards can generate signals to loopback remote equipment
1020 so that complete circuits can be tested; see
1024 .Ss Testing with a Modem
1026 Testing with a modem requires two cards of different types.
1027 .Bl -tag -width "T3/HSSI"
1029 If you have a T3 modem with an HSSI interface
1030 (made by Digital Link, Larscom, Kentrox etc.)
1031 then use an HSSI card in one machine and a T3 card in the other machine.
1032 The T3 coax cables must use the null modem configuration (see below).
1034 If you have a T1 (or E1) modem with a V.35, X.21 or EIA530 interface,
1035 then use an SSI card in one machine and a T1 card in the other machine.
1036 Use a T1 null modem cable (see below).
1039 .Ss Testing with a Null Modem Cable
1041 Testing with a null modem cable requires two cards of the same type.
1042 .Bl -tag -width "T1/E1"
1044 Three-meter HSSI null-modem cables can be ordered from SBE.
1045 In a pinch, a 50-pin SCSI-II cable up to a few meters will
1046 work as a straight HSSI cable (not a null modem cable).
1047 Longer cables should be purpose-built HSSI cables because
1048 the cable impedance is different.
1049 Transmit clock is normally supplied by the external modem.
1050 When an HSSI card is connected by a null modem cable, the PCI bus
1051 clock can be used as the transmit clock, typically 33 MHz.
1052 When testing an HSSI card with a null modem cable, configure it
1055 .Ic "lmcconfig lmc0 -a 2
1058 selects the PCI bus clock as the transmit clock.
1060 T3 null modem cables are just 75-ohm coax cables with BNC connectors.
1061 TX OUT on one card should be connected to RX IN on the other card.
1062 In a pinch, 50-ohm thin Ethernet cables
1064 work up to a few meters, but they will
1066 work for longer runs -- 75-ohm coax is
1069 Three-meter SSI null modem cables can be ordered from SBE.
1070 An SSI null modem cable reports a cable type of V.36/EIA449.
1071 Transmit clock is normally supplied by the external modem.
1072 When an SSI card is connected by a null modem cable,
1073 an on-board clock synthesizer is used.
1074 When testing an SSI card with a null modem cable, configure it
1077 .Ic "lmcconfig lmc0 -E -f 10000000"
1080 puts the card in DCE mode to source a transmit clock.
1083 sets the internal clock source to 10 Mb/s.
1087 A T1 null modem cable has two twisted pairs that connect
1088 pins 1 and 2 on one plug to pins 4 and 5 on the other plug.
1089 Looking into the cable entry hole of a plug,
1090 with the locking tab oriented down,
1091 pin 1 is on the left.
1092 A twisted pair Ethernet cable makes an excellent straight T1 cable.
1093 Alas, Ethernet cross-over cables do not work as T1 null modem cables.
1099 Maximum transmit and receive packet length is unlimited.
1101 Minimum transmit and receive packet length is one byte.
1103 Cleaning up after one packet and setting up for the next
1104 packet involves making several DMA references.
1105 This can take longer than the duration of a short packet,
1106 causing the adapter to fall behind.
1107 For typical PCI bus traffic levels and memory system latencies,
1108 back-to-back packets longer than about 20 bytes will always
1109 work (53 byte cells work), but a burst of several hundred
1110 back-to-back packets shorter than 20 bytes will cause packets
1112 This usually isn't a problem since an IPv4 packet header is
1113 at least 20 bytes long.
1115 This device driver imposes no constraints on packet size.
1116 Most operating systems set the default Maximum Transmission
1117 Unit (MTU) to 1500 bytes; the legal range is usually (72..65535).
1118 This can be changed with
1120 .Ic "ifconfig lmc0 mtu 2000" .
1122 .if (\n[fbsd] : \n[nbsd] : \n[obsd]) \{\
1123 SPPP enforces an MTU of (128..far-end-MRU) for PPP
1124 and 1500 bytes for Cisco-HDLC. \}
1126 P2P enforces an MTU of 1500 bytes for PPP and Cisco-HDLC
1127 and 4000 bytes for Frame Relay. \}
1129 Generic-HDLC enforces an MTU range of (68..1500) bytes. \}
1130 RAWIP sets the default MTU to 4032 bytes,
1131 but it can be changed to anything.
1132 .if (\n[fbsd] : \n[nbsd] : \n[obsd]) \{\
1134 .Ss ALTQ - Alternate Output Queue Disciplines
1136 This driver has hooks for
1138 the Alternate Queueing package.
1139 To see Altq in action, use your favorite traffic generation
1140 program to generate three flows sending down one T3 circuit.
1141 Without Altq, the speeds of the three connections will vary chaotically.
1142 Turn on Altq and two of the connections will run at 21 Mb/s and
1143 the third will run at 1.5 Mb/s.
1145 To include ALTQ in your kernel,
1146 add the following line to
1147 .Ic "conf/YOURKERNEL" :
1149 .Ic "options ALTQ # ALTQ enabled"
1151 The example below requires the Hierarchical
1152 Fair Service Curve (HSFC) queue discipline:
1154 .Ic "options ALTQ_HFSC # queue discipline"
1159 .Ic "/etc/altq.conf"
1162 .Bd -literal -offset 2m -compact
1163 .Ic "interface lmc0 bandwidth 44M hfsc"
1165 .Ic "class hfsc lmc0 a root pshare 49"
1167 .Ic "filter lmc0 a 10.0.0.2 12345 10.0.0.1 0 6"
1169 .Ic "filter lmc0 a 10.0.0.1 0 10.0.0.2 12345 6"
1171 .Ic "class hfsc lmc0 b root pshare 49"
1173 .Ic "filter lmc0 b 10.0.0.2 12346 10.0.0.1 0 6"
1175 .Ic "filter lmc0 b 10.0.0.1 0 10.0.0.2 12346 6"
1177 .Ic "class hfsc lmc0 c root pshare 2 default"
1179 .Ic "filter lmc0 c 10.0.0.2 12347 10.0.0.1 0 6"
1181 .Ic "filter lmc0 c 10.0.0.1 0 10.0.0.2 12347 6"
1184 .if (\n[fbsd] : \n[nbsd] : \n[obsd] : \n[bsdi]) \{\
1186 .Ss BPF - Berkeley Packet Filter
1188 This driver has hooks for
1190 the Berkeley Packet Filter.
1191 The line protocol header length reported to BPF is four bytes
1192 for SPPP and P2P line protocols and zero bytes for RawIP.
1194 To include BPF for ifnet in your kernel,
1195 add the following line to
1196 .Ic "conf/YOURKERNEL" :
1198 .Ic "pseudo-device bpf # FreeBSD-4, NetBSD, OpenBSD, BSD/OS"
1200 .Ic "device bpf # FreeBSD-5"
1202 To test the BPF kernel interface,
1203 bring up a link between two machines, then run
1210 and in a different window:
1212 .Ic "tcpdump -i lmc0"
1214 The output from tcpdump should look like this:
1216 .Ic "03:54:35.979965 10.0.0.2 > 10.0.0.1: icmp: echo request"
1218 .Ic "03:54:35.981423 10.0.0.1 > 10.0.0.2: icmp: echo reply"
1220 Line protocol control packets will appear among the
1221 ping packets occasionally. \}
1222 .if (\n[fbsd] : \n[linux]) \{\
1226 A T3 receiver can generate over 100K interrupts per second,
1227 This can cause a system to "live-lock": spend all of its
1228 time servicing interrupts.
1229 Linux and FreeBSD have polling mechanisms to prevent live-lock.
1232 Linux's mechanism disables a card's interrupt when it interrupts,
1233 calls the card's interrupt service routine with kernel interrupts
1234 enabled, and then reenables the card's interrupt.
1235 The driver is permitted to process a limited number of packets each
1236 time it is called by the kernel.
1237 Card interrupts are left disabled if more packets arrive than are
1238 permitted to be processed, which in extreme cases will result in
1239 packets being dropped in hardware at no cost to software. \}
1242 FreeBSD's mechanism permanently disables interrupts from the card
1243 and instead the card's interrupt service routine is called each
1244 time the kernel is entered (syscall, timer interrupt, etc) and
1245 from the kernel idle loop; this adds some latency.
1246 The driver is permitted to process a limited number of packets.
1247 The percentage of the CPU that can be consumed this way is settable.
1251 mechanism is enabled with:
1253 .Ic "sysctl kern.polling.enable=1"
1255 The kernel must be built with polling enabled:
1257 .Ic "options DEVICE_POLLING"
1259 .Ic "options HZ=1000" \} \}
1261 .Ss SNMP: Simple Network Management Protocol
1263 This driver is aware of what is required to be a Network Interface
1264 Object managed by an Agent of the Simple Network Management Protocol.
1265 The driver exports SNMP-formatted configuration and status
1266 information sufficient for an SNMP Agent to create MIBs for:
1267 .Bl -inset -compact -offset 2m
1268 .It RFC-2233: Interfaces group,
1269 .It RFC-2496: DS3 interfaces,
1270 .It RFC-2495: DS1/E1 interfaces,
1271 .It RFC-1659: RS232-like interfaces.
1274 An SNMP Agent is a user program, not a kernel function.
1275 Agents can retrieve configuration and status information
1278 Netgraph control messages or \}
1281 User programs should poll
1283 which increments once per second after the SNMP state has been updated.
1285 .Ss HSSI and SSI LEDs
1287 The card should be operational if all three green LEDs are on
1288 (the upper-left one should be blinking) and the red LED is off.
1289 All four LEDs turn on at power-on and module-unload.
1290 .Bl -column -compact -offset 2m "YELLOW" "upper-right" "Software"
1291 .It "RED" Ta "upper-right" Ta "No Transmit clock"
1292 .It "GREEN" Ta "upper-left" Ta "Device driver is alive if blinking"
1293 .It "GREEN" Ta "lower-right" Ta "Modem signals are good"
1294 .It "GREEN" Ta "lower-left" Ta "Cable is plugged in (SSI only)"
1297 .Ss T1E1 and T3 LEDs
1299 The card should be operational if the upper-left green LED is blinking
1300 and all other LEDs are off. For the T3 card, if other LEDs are on or
1301 blinking, try swapping the coax cables!
1302 All four LEDs turn on at power-on and module-unload.
1303 .Bl -column -compact -offset 2m "YELLOW" "upper-right" "Received"
1304 .It "RED" Ta "upper-right" Ta "Received signal is wrong"
1305 .It "GREEN" Ta "upper-left" Ta "Device driver is alive if blinking"
1306 .It "BLUE" Ta "lower-right" Ta "Alarm Information Signal (AIS)"
1307 .It "YELLOW" Ta "lower-left" Ta "Remote Alarm Indication (RAI)"
1309 .Bl -column -compact "The yellow" "LED"
1310 .It "The green" Ta "LED blinks if the device driver is alive."
1311 .It "The red" Ta "LED blinks if an outward loopback is active."
1312 .It "The blue" Ta "LED blinks if sending AIS, on solid if receiving AIS."
1313 .It "The yellow" Ta "LED blinks if sending RAI, on solid if receiving RAI."
1318 Phone companies usually insist that customers put a
1319 .Em Frame Alignment Signal
1320 (FAS) in time slot 0.
1321 A Cyclic Redundancy Checksum (CRC) can also ride in time slot 0.
1322 .Em Channel Associated Signalling
1323 (CAS) uses Time Slot 16.
1326 is on/off hook, ringing, busy, etc.
1327 Signalling is not needed here and consumes 64 Kb/s.
1328 Only use E1-CAS formats if the other end insists on it!
1329 Use E1-FAS+CRC framing format on a public circuit.
1330 Depending on the equipment installed in a private circuit,
1331 it may be possible to use all 32 time slots for data (E1-NONE).
1335 M13 is a technique for multiplexing 28 T1s into a T3.
1336 Muxes use the C-bits for speed-matching the tributaries.
1337 Muxing is not needed here and usurps the FEBE and FEAC bits.
1338 Only use T3-M13 format if the other end insists on it!
1339 Use T3-CParity framing format if possible.
1340 Loop Timing, Fractional T3, and HDLC packets in
1341 the Facility Data Link are
1345 .Ss T1 & T3 Frame Overhead Functions
1347 Performance Report Messages (PRMs) are enabled in T1-ESF.
1349 Bit Oriented Protocol (BOP) messages are enabled in T1-ESF.
1351 In-band loopback control (framed or not) is enabled in T1-SF.
1353 Far End Alarm and Control (FEAC) msgs are enabled in T3-CPar.
1355 Far End Block Error (FEBE) reports are enabled in T3-CPar.
1357 Remote Alarm Indication (RAI) is enabled in T3-Any.
1359 Loopbacks initiated remotely time out after 300 seconds.
1361 .Ss T1/E1 'Fractional' 64 kb/s Time Slots
1363 T1 uses time slots 24..1; E1 uses time slots 31..0.
1364 E1 uses TS0 for FAS overhead and TS16 for CAS overhead.
1367 overhead, so all 32 TSs are available for data.
1368 Enable/disable time slots by setting 32 1s/0s in a config param.
1369 Enabling an E1 overhead time slot,
1370 or enabling TS0 or TS25-TS31 for T1,
1371 is ignored by the driver, which knows better.
1372 The default TS param, 0xFFFFFFFF, enables the maximum number
1373 of time slots for whatever frame format is selected.
1374 56 Kb/s time slots are
1380 Special gate array microcode exists for the T1/E1 card.
1381 Each T1 frame of 24 bytes is treated as a packet.
1382 A raw T1 byte stream can be delivered to main memory
1383 and transmitted from main memory.
1384 The T1 card adds or deletes framing bits but does not
1386 ATM cells can be transmitted and received this way, with
1387 the software doing all the work.
1388 But that's not hard; after all it's only 1.5 Mb/s second!
1390 .Ss T3 Circuit Emulation Mode
1392 Special gate array microcode exists for the T3 card.
1393 Each T3 frame of 595 bytes is treated as a packet.
1394 A raw T3 signal can be
1396 transported through a
1397 packet network (using some protocol) and then
1399 as a T3 signal at the far end. The output transmitter's
1400 bit rate can be controlled from software so that it can be
1401 .Em frequency locked
1402 to the distant input signal.
1404 .Ss HSSI and SSI Transmit Clocks
1406 Synchronous interfaces use two transmit clocks to eliminate
1408 caused by speed-of-light delays in the modem cable.
1409 DCEs (modems) drive ST, Send Timing. the first transmit clock.
1410 DTEs (hosts) receive ST and use it to clock transmit data, TD,
1411 onto the modem cable.
1412 DTEs also drive a copy of ST back towards the DCE and call it TT,
1413 Transmit Timing. the second trasmit clock.
1414 DCEs receive TT and TD and use TT to clock TD into a flip flop.
1415 TT experiences the same delay as (and has no
1418 Thus, cable length does not affect data/clock timing.
1424 .if (\n[fbsd] : \n[nbsd] : \n[obsd]) \{\
1426 .if (\n[fbsd] : \n[nbsd] : \n[obsd] : \n[bsdi]) \{\
1436 .if (\n[fbsd] : \n[nbsd] : \n[obsd]) \{\
1442 .if (\n[fbsd] : \n[nbsd] : \n[obsd]) \{\
1444 .if (\n[nbsd] : \n[obsd]) \{\
1453 .if (\n[fbsd] : \n[nbsd] : \n[obsd] : \n[bsdi]) \{\
1457 .Pa /usr/ports/net/mpd . \}
1460 .Pa http://hq.pm.waw.pl/hdlc . \}
1462 .Pa http://www.sbei.com .
1466 Ron Crane had the idea to use a Fast Ethernet chip as a PCI interface
1467 and add an Ethernet-to-HDLC gate array to make a WAN card.
1468 David Boggs designed the Ethernet-to-HDLC gate array and PC cards.
1469 We did this at our company, LAN Media Corporation
1474 and continues to make the cards.
1476 Since the cards use Tulip Ethernet chips, we started with Matt Thomas'
1477 ubiquitous "de" driver. Michael Graff stripped out the Ethernet stuff
1478 and added HSSI stuff. Basil Gunn ported it to Solaris (lost) and
1479 Rob Braun ported it to Linux. Andrew Stanley-Jones added support
1480 for three more cards and wrote the first version of lmcconfig.
1481 David Boggs rewrote everything and now feels responsible for it.
1485 .An "David Boggs" Aq boggs@boggs.palo-alto.ca.us .