Back to home page

OSCL-LXR

 
 

    


0001 .. SPDX-License-Identifier: GPL-2.0
0002 
0003 ==================
0004 Generic HDLC layer
0005 ==================
0006 
0007 Krzysztof Halasa <khc@pm.waw.pl>
0008 
0009 
0010 Generic HDLC layer currently supports:
0011 
0012 1. Frame Relay (ANSI, CCITT, Cisco and no LMI)
0013 
0014    - Normal (routed) and Ethernet-bridged (Ethernet device emulation)
0015      interfaces can share a single PVC.
0016    - ARP support (no InARP support in the kernel - there is an
0017      experimental InARP user-space daemon available on:
0018      http://www.kernel.org/pub/linux/utils/net/hdlc/).
0019 
0020 2. raw HDLC - either IP (IPv4) interface or Ethernet device emulation
0021 3. Cisco HDLC
0022 4. PPP
0023 5. X.25 (uses X.25 routines).
0024 
0025 Generic HDLC is a protocol driver only - it needs a low-level driver
0026 for your particular hardware.
0027 
0028 Ethernet device emulation (using HDLC or Frame-Relay PVC) is compatible
0029 with IEEE 802.1Q (VLANs) and 802.1D (Ethernet bridging).
0030 
0031 
0032 Make sure the hdlc.o and the hardware driver are loaded. It should
0033 create a number of "hdlc" (hdlc0 etc) network devices, one for each
0034 WAN port. You'll need the "sethdlc" utility, get it from:
0035 
0036         http://www.kernel.org/pub/linux/utils/net/hdlc/
0037 
0038 Compile sethdlc.c utility::
0039 
0040         gcc -O2 -Wall -o sethdlc sethdlc.c
0041 
0042 Make sure you're using a correct version of sethdlc for your kernel.
0043 
0044 Use sethdlc to set physical interface, clock rate, HDLC mode used,
0045 and add any required PVCs if using Frame Relay.
0046 Usually you want something like::
0047 
0048         sethdlc hdlc0 clock int rate 128000
0049         sethdlc hdlc0 cisco interval 10 timeout 25
0050 
0051 or::
0052 
0053         sethdlc hdlc0 rs232 clock ext
0054         sethdlc hdlc0 fr lmi ansi
0055         sethdlc hdlc0 create 99
0056         ifconfig hdlc0 up
0057         ifconfig pvc0 localIP pointopoint remoteIP
0058 
0059 In Frame Relay mode, ifconfig master hdlc device up (without assigning
0060 any IP address to it) before using pvc devices.
0061 
0062 
0063 Setting interface:
0064 
0065 * v35 | rs232 | x21 | t1 | e1
0066     - sets physical interface for a given port
0067       if the card has software-selectable interfaces
0068   loopback
0069     - activate hardware loopback (for testing only)
0070 * clock ext
0071     - both RX clock and TX clock external
0072 * clock int
0073     - both RX clock and TX clock internal
0074 * clock txint
0075     - RX clock external, TX clock internal
0076 * clock txfromrx
0077     - RX clock external, TX clock derived from RX clock
0078 * rate
0079     - sets clock rate in bps (for "int" or "txint" clock only)
0080 
0081 
0082 Setting protocol:
0083 
0084 * hdlc - sets raw HDLC (IP-only) mode
0085 
0086   nrz / nrzi / fm-mark / fm-space / manchester - sets transmission code
0087 
0088   no-parity / crc16 / crc16-pr0 (CRC16 with preset zeros) / crc32-itu
0089 
0090   crc16-itu (CRC16 with ITU-T polynomial) / crc16-itu-pr0 - sets parity
0091 
0092 * hdlc-eth - Ethernet device emulation using HDLC. Parity and encoding
0093   as above.
0094 
0095 * cisco - sets Cisco HDLC mode (IP, IPv6 and IPX supported)
0096 
0097   interval - time in seconds between keepalive packets
0098 
0099   timeout - time in seconds after last received keepalive packet before
0100             we assume the link is down
0101 
0102 * ppp - sets synchronous PPP mode
0103 
0104 * x25 - sets X.25 mode
0105 
0106 * fr - Frame Relay mode
0107 
0108   lmi ansi / ccitt / cisco / none - LMI (link management) type
0109 
0110   dce - Frame Relay DCE (network) side LMI instead of default DTE (user).
0111 
0112   It has nothing to do with clocks!
0113 
0114   - t391 - link integrity verification polling timer (in seconds) - user
0115   - t392 - polling verification timer (in seconds) - network
0116   - n391 - full status polling counter - user
0117   - n392 - error threshold - both user and network
0118   - n393 - monitored events count - both user and network
0119 
0120 Frame-Relay only:
0121 
0122 * create n | delete n - adds / deletes PVC interface with DLCI #n.
0123   Newly created interface will be named pvc0, pvc1 etc.
0124 
0125 * create ether n | delete ether n - adds a device for Ethernet-bridged
0126   frames. The device will be named pvceth0, pvceth1 etc.
0127 
0128 
0129 
0130 
0131 Board-specific issues
0132 ---------------------
0133 
0134 n2.o and c101.o need parameters to work::
0135 
0136         insmod n2 hw=io,irq,ram,ports[:io,irq,...]
0137 
0138 example::
0139 
0140         insmod n2 hw=0x300,10,0xD0000,01
0141 
0142 or::
0143 
0144         insmod c101 hw=irq,ram[:irq,...]
0145 
0146 example::
0147 
0148         insmod c101 hw=9,0xdc000
0149 
0150 If built into the kernel, these drivers need kernel (command line) parameters::
0151 
0152         n2.hw=io,irq,ram,ports:...
0153 
0154 or::
0155 
0156         c101.hw=irq,ram:...
0157 
0158 
0159 
0160 If you have a problem with N2, C101 or PLX200SYN card, you can issue the
0161 "private" command to see port's packet descriptor rings (in kernel logs)::
0162 
0163         sethdlc hdlc0 private
0164 
0165 The hardware driver has to be build with #define DEBUG_RINGS.
0166 Attaching this info to bug reports would be helpful. Anyway, let me know
0167 if you have problems using this.
0168 
0169 For patches and other info look at:
0170 <http://www.kernel.org/pub/linux/utils/net/hdlc/>.