2020-04-28 01:01:39 +03:00
.. SPDX-License-Identifier: GPL-2.0
==================
2005-04-17 02:20:36 +04:00
Generic HDLC layer
2020-04-28 01:01:39 +03:00
==================
2005-04-17 02:20:36 +04:00
Krzysztof Halasa <khc@pm.waw.pl>
Generic HDLC layer currently supports:
2020-04-28 01:01:39 +03:00
2008-08-14 21:17:38 +04:00
1. Frame Relay (ANSI, CCITT, Cisco and no LMI)
2020-04-28 01:01:39 +03:00
2005-04-21 17:57:25 +04:00
- Normal (routed) and Ethernet-bridged (Ethernet device emulation)
interfaces can share a single PVC.
- ARP support (no InARP support in the kernel - there is an
experimental InARP user-space daemon available on:
http://www.kernel.org/pub/linux/utils/net/hdlc/).
2020-04-28 01:01:39 +03:00
2008-08-14 21:17:38 +04:00
2. raw HDLC - either IP (IPv4) interface or Ethernet device emulation
3. Cisco HDLC
4. PPP
2005-04-21 17:57:25 +04:00
5. X.25 (uses X.25 routines).
Generic HDLC is a protocol driver only - it needs a low-level driver
for your particular hardware.
2005-04-17 02:20:36 +04:00
Ethernet device emulation (using HDLC or Frame-Relay PVC) is compatible
with IEEE 802.1Q (VLANs) and 802.1D (Ethernet bridging).
Make sure the hdlc.o and the hardware driver are loaded. It should
create a number of "hdlc" (hdlc0 etc) network devices, one for each
WAN port. You'll need the "sethdlc" utility, get it from:
2020-04-28 01:01:39 +03:00
2005-04-21 17:57:25 +04:00
http://www.kernel.org/pub/linux/utils/net/hdlc/
2005-04-17 02:20:36 +04:00
2020-04-28 01:01:39 +03:00
Compile sethdlc.c utility::
2005-04-17 02:20:36 +04:00
gcc -O2 -Wall -o sethdlc sethdlc.c
2020-04-28 01:01:39 +03:00
2005-04-17 02:20:36 +04:00
Make sure you're using a correct version of sethdlc for your kernel.
Use sethdlc to set physical interface, clock rate, HDLC mode used,
and add any required PVCs if using Frame Relay.
2020-04-28 01:01:39 +03:00
Usually you want something like::
2005-04-17 02:20:36 +04:00
sethdlc hdlc0 clock int rate 128000
sethdlc hdlc0 cisco interval 10 timeout 25
2020-04-28 01:01:39 +03:00
or::
2005-04-17 02:20:36 +04:00
sethdlc hdlc0 rs232 clock ext
sethdlc hdlc0 fr lmi ansi
sethdlc hdlc0 create 99
ifconfig hdlc0 up
ifconfig pvc0 localIP pointopoint remoteIP
In Frame Relay mode, ifconfig master hdlc device up (without assigning
any IP address to it) before using pvc devices.
Setting interface:
2020-04-28 01:01:39 +03:00
* v35 | rs232 | x21 | t1 | e1
- sets physical interface for a given port
if the card has software-selectable interfaces
loopback
- activate hardware loopback (for testing only)
* clock ext
- both RX clock and TX clock external
* clock int
- both RX clock and TX clock internal
* clock txint
- RX clock external, TX clock internal
* clock txfromrx
- RX clock external, TX clock derived from RX clock
* rate
- sets clock rate in bps (for "int" or "txint" clock only)
2005-04-21 17:57:25 +04:00
2005-04-17 02:20:36 +04:00
Setting protocol:
* hdlc - sets raw HDLC (IP-only) mode
2020-04-28 01:01:39 +03:00
2005-04-17 02:20:36 +04:00
nrz / nrzi / fm-mark / fm-space / manchester - sets transmission code
2020-04-28 01:01:39 +03:00
2005-04-17 02:20:36 +04:00
no-parity / crc16 / crc16-pr0 (CRC16 with preset zeros) / crc32-itu
2020-04-28 01:01:39 +03:00
2005-04-17 02:20:36 +04:00
crc16-itu (CRC16 with ITU-T polynomial) / crc16-itu-pr0 - sets parity
* hdlc-eth - Ethernet device emulation using HDLC. Parity and encoding
as above.
* cisco - sets Cisco HDLC mode (IP, IPv6 and IPX supported)
2020-04-28 01:01:39 +03:00
2005-04-17 02:20:36 +04:00
interval - time in seconds between keepalive packets
2020-04-28 01:01:39 +03:00
2005-04-17 02:20:36 +04:00
timeout - time in seconds after last received keepalive packet before
2020-04-28 01:01:39 +03:00
we assume the link is down
2005-04-17 02:20:36 +04:00
* ppp - sets synchronous PPP mode
* x25 - sets X.25 mode
* fr - Frame Relay mode
2020-04-28 01:01:39 +03:00
2005-04-21 17:57:25 +04:00
lmi ansi / ccitt / cisco / none - LMI (link management) type
2020-04-28 01:01:39 +03:00
2005-04-17 02:20:36 +04:00
dce - Frame Relay DCE (network) side LMI instead of default DTE (user).
2020-04-28 01:01:39 +03:00
2005-04-17 02:20:36 +04:00
It has nothing to do with clocks!
2020-04-28 01:01:39 +03:00
- t391 - link integrity verification polling timer (in seconds) - user
- t392 - polling verification timer (in seconds) - network
- n391 - full status polling counter - user
- n392 - error threshold - both user and network
- n393 - monitored events count - both user and network
2005-04-17 02:20:36 +04:00
Frame-Relay only:
2020-04-28 01:01:39 +03:00
2005-04-17 02:20:36 +04:00
* create n | delete n - adds / deletes PVC interface with DLCI #n.
Newly created interface will be named pvc0, pvc1 etc.
* create ether n | delete ether n - adds a device for Ethernet-bridged
frames. The device will be named pvceth0, pvceth1 etc.
Board-specific issues
---------------------
2020-04-28 01:01:39 +03:00
n2.o and c101.o need parameters to work::
2005-04-17 02:20:36 +04:00
insmod n2 hw=io,irq,ram,ports[:io,irq,...]
2020-04-28 01:01:39 +03:00
example::
2005-04-17 02:20:36 +04:00
insmod n2 hw=0x300,10,0xD0000,01
2020-04-28 01:01:39 +03:00
or::
2005-04-17 02:20:36 +04:00
insmod c101 hw=irq,ram[:irq,...]
2020-04-28 01:01:39 +03:00
example::
2005-04-17 02:20:36 +04:00
insmod c101 hw=9,0xdc000
2020-04-28 01:01:39 +03:00
If built into the kernel, these drivers need kernel (command line) parameters::
2005-04-17 02:20:36 +04:00
n2.hw=io,irq,ram,ports:...
2020-04-28 01:01:39 +03:00
or::
2005-04-17 02:20:36 +04:00
c101.hw=irq,ram:...
2005-04-21 17:57:25 +04:00
If you have a problem with N2, C101 or PLX200SYN card, you can issue the
2020-04-28 01:01:39 +03:00
"private" command to see port's packet descriptor rings (in kernel logs)::
2005-04-17 02:20:36 +04:00
sethdlc hdlc0 private
2005-04-21 17:57:25 +04:00
The hardware driver has to be build with #define DEBUG_RINGS.
2005-04-17 02:20:36 +04:00
Attaching this info to bug reports would be helpful. Anyway, let me know
if you have problems using this.
2005-04-21 17:57:25 +04:00
For patches and other info look at:
<http://www.kernel.org/pub/linux/utils/net/hdlc/> .