blob: 1c3bb5cb98d47844ce548825a35c98f7d6569125 [file] [log] [blame]
Mauro Carvalho Chehab16128ad2020-04-28 00:01:39 +02001.. SPDX-License-Identifier: GPL-2.0
2
3==================
Linus Torvalds1da177e2005-04-16 15:20:36 -07004Generic HDLC layer
Mauro Carvalho Chehab16128ad2020-04-28 00:01:39 +02005==================
6
Linus Torvalds1da177e2005-04-16 15:20:36 -07007Krzysztof Halasa <khc@pm.waw.pl>
Linus Torvalds1da177e2005-04-16 15:20:36 -07008
9
10Generic HDLC layer currently supports:
Mauro Carvalho Chehab16128ad2020-04-28 00:01:39 +020011
Krzysztof Hałasae022c2f2008-08-14 19:17:38 +0200121. Frame Relay (ANSI, CCITT, Cisco and no LMI)
Mauro Carvalho Chehab16128ad2020-04-28 00:01:39 +020013
Krzysztof Halasab3dd65f2005-04-21 15:57:25 +020014 - Normal (routed) and Ethernet-bridged (Ethernet device emulation)
15 interfaces can share a single PVC.
16 - ARP support (no InARP support in the kernel - there is an
17 experimental InARP user-space daemon available on:
18 http://www.kernel.org/pub/linux/utils/net/hdlc/).
Mauro Carvalho Chehab16128ad2020-04-28 00:01:39 +020019
Krzysztof Hałasae022c2f2008-08-14 19:17:38 +0200202. raw HDLC - either IP (IPv4) interface or Ethernet device emulation
213. Cisco HDLC
224. PPP
Krzysztof Halasab3dd65f2005-04-21 15:57:25 +0200235. X.25 (uses X.25 routines).
Linus Torvalds1da177e2005-04-16 15:20:36 -070024
Krzysztof Halasab3dd65f2005-04-21 15:57:25 +020025Generic HDLC is a protocol driver only - it needs a low-level driver
26for your particular hardware.
Linus Torvalds1da177e2005-04-16 15:20:36 -070027
28Ethernet device emulation (using HDLC or Frame-Relay PVC) is compatible
29with IEEE 802.1Q (VLANs) and 802.1D (Ethernet bridging).
30
31
32Make sure the hdlc.o and the hardware driver are loaded. It should
33create a number of "hdlc" (hdlc0 etc) network devices, one for each
34WAN port. You'll need the "sethdlc" utility, get it from:
Mauro Carvalho Chehab16128ad2020-04-28 00:01:39 +020035
Krzysztof Halasab3dd65f2005-04-21 15:57:25 +020036 http://www.kernel.org/pub/linux/utils/net/hdlc/
Linus Torvalds1da177e2005-04-16 15:20:36 -070037
Mauro Carvalho Chehab16128ad2020-04-28 00:01:39 +020038Compile sethdlc.c utility::
39
Linus Torvalds1da177e2005-04-16 15:20:36 -070040 gcc -O2 -Wall -o sethdlc sethdlc.c
Mauro Carvalho Chehab16128ad2020-04-28 00:01:39 +020041
Linus Torvalds1da177e2005-04-16 15:20:36 -070042Make sure you're using a correct version of sethdlc for your kernel.
43
44Use sethdlc to set physical interface, clock rate, HDLC mode used,
45and add any required PVCs if using Frame Relay.
Mauro Carvalho Chehab16128ad2020-04-28 00:01:39 +020046Usually you want something like::
Linus Torvalds1da177e2005-04-16 15:20:36 -070047
48 sethdlc hdlc0 clock int rate 128000
49 sethdlc hdlc0 cisco interval 10 timeout 25
Mauro Carvalho Chehab16128ad2020-04-28 00:01:39 +020050
51or::
52
Linus Torvalds1da177e2005-04-16 15:20:36 -070053 sethdlc hdlc0 rs232 clock ext
54 sethdlc hdlc0 fr lmi ansi
55 sethdlc hdlc0 create 99
56 ifconfig hdlc0 up
57 ifconfig pvc0 localIP pointopoint remoteIP
58
59In Frame Relay mode, ifconfig master hdlc device up (without assigning
60any IP address to it) before using pvc devices.
61
62
63Setting interface:
64
Mauro Carvalho Chehab16128ad2020-04-28 00:01:39 +020065* v35 | rs232 | x21 | t1 | e1
66 - sets physical interface for a given port
67 if the card has software-selectable interfaces
68 loopback
69 - activate hardware loopback (for testing only)
70* clock ext
71 - both RX clock and TX clock external
72* clock int
73 - both RX clock and TX clock internal
74* clock txint
75 - RX clock external, TX clock internal
76* clock txfromrx
77 - RX clock external, TX clock derived from RX clock
78* rate
79 - sets clock rate in bps (for "int" or "txint" clock only)
Krzysztof Halasab3dd65f2005-04-21 15:57:25 +020080
Linus Torvalds1da177e2005-04-16 15:20:36 -070081
82Setting protocol:
83
84* hdlc - sets raw HDLC (IP-only) mode
Mauro Carvalho Chehab16128ad2020-04-28 00:01:39 +020085
Linus Torvalds1da177e2005-04-16 15:20:36 -070086 nrz / nrzi / fm-mark / fm-space / manchester - sets transmission code
Mauro Carvalho Chehab16128ad2020-04-28 00:01:39 +020087
Linus Torvalds1da177e2005-04-16 15:20:36 -070088 no-parity / crc16 / crc16-pr0 (CRC16 with preset zeros) / crc32-itu
Mauro Carvalho Chehab16128ad2020-04-28 00:01:39 +020089
Linus Torvalds1da177e2005-04-16 15:20:36 -070090 crc16-itu (CRC16 with ITU-T polynomial) / crc16-itu-pr0 - sets parity
91
92* hdlc-eth - Ethernet device emulation using HDLC. Parity and encoding
93 as above.
94
95* cisco - sets Cisco HDLC mode (IP, IPv6 and IPX supported)
Mauro Carvalho Chehab16128ad2020-04-28 00:01:39 +020096
Linus Torvalds1da177e2005-04-16 15:20:36 -070097 interval - time in seconds between keepalive packets
Mauro Carvalho Chehab16128ad2020-04-28 00:01:39 +020098
Linus Torvalds1da177e2005-04-16 15:20:36 -070099 timeout - time in seconds after last received keepalive packet before
Mauro Carvalho Chehab16128ad2020-04-28 00:01:39 +0200100 we assume the link is down
Linus Torvalds1da177e2005-04-16 15:20:36 -0700101
102* ppp - sets synchronous PPP mode
103
104* x25 - sets X.25 mode
105
106* fr - Frame Relay mode
Mauro Carvalho Chehab16128ad2020-04-28 00:01:39 +0200107
Krzysztof Halasab3dd65f2005-04-21 15:57:25 +0200108 lmi ansi / ccitt / cisco / none - LMI (link management) type
Mauro Carvalho Chehab16128ad2020-04-28 00:01:39 +0200109
Linus Torvalds1da177e2005-04-16 15:20:36 -0700110 dce - Frame Relay DCE (network) side LMI instead of default DTE (user).
Mauro Carvalho Chehab16128ad2020-04-28 00:01:39 +0200111
Linus Torvalds1da177e2005-04-16 15:20:36 -0700112 It has nothing to do with clocks!
Mauro Carvalho Chehab16128ad2020-04-28 00:01:39 +0200113
114 - t391 - link integrity verification polling timer (in seconds) - user
115 - t392 - polling verification timer (in seconds) - network
116 - n391 - full status polling counter - user
117 - n392 - error threshold - both user and network
118 - n393 - monitored events count - both user and network
Linus Torvalds1da177e2005-04-16 15:20:36 -0700119
120Frame-Relay only:
Mauro Carvalho Chehab16128ad2020-04-28 00:01:39 +0200121
Linus Torvalds1da177e2005-04-16 15:20:36 -0700122* create n | delete n - adds / deletes PVC interface with DLCI #n.
123 Newly created interface will be named pvc0, pvc1 etc.
124
125* create ether n | delete ether n - adds a device for Ethernet-bridged
126 frames. The device will be named pvceth0, pvceth1 etc.
127
128
129
130
131Board-specific issues
132---------------------
133
Mauro Carvalho Chehab16128ad2020-04-28 00:01:39 +0200134n2.o and c101.o need parameters to work::
Linus Torvalds1da177e2005-04-16 15:20:36 -0700135
136 insmod n2 hw=io,irq,ram,ports[:io,irq,...]
Mauro Carvalho Chehab16128ad2020-04-28 00:01:39 +0200137
138example::
139
Linus Torvalds1da177e2005-04-16 15:20:36 -0700140 insmod n2 hw=0x300,10,0xD0000,01
141
Mauro Carvalho Chehab16128ad2020-04-28 00:01:39 +0200142or::
143
Linus Torvalds1da177e2005-04-16 15:20:36 -0700144 insmod c101 hw=irq,ram[:irq,...]
Mauro Carvalho Chehab16128ad2020-04-28 00:01:39 +0200145
146example::
147
Linus Torvalds1da177e2005-04-16 15:20:36 -0700148 insmod c101 hw=9,0xdc000
149
Mauro Carvalho Chehab16128ad2020-04-28 00:01:39 +0200150If built into the kernel, these drivers need kernel (command line) parameters::
151
Linus Torvalds1da177e2005-04-16 15:20:36 -0700152 n2.hw=io,irq,ram,ports:...
Mauro Carvalho Chehab16128ad2020-04-28 00:01:39 +0200153
154or::
155
Linus Torvalds1da177e2005-04-16 15:20:36 -0700156 c101.hw=irq,ram:...
157
158
159
Krzysztof Halasab3dd65f2005-04-21 15:57:25 +0200160If you have a problem with N2, C101 or PLX200SYN card, you can issue the
Mauro Carvalho Chehab16128ad2020-04-28 00:01:39 +0200161"private" command to see port's packet descriptor rings (in kernel logs)::
Linus Torvalds1da177e2005-04-16 15:20:36 -0700162
163 sethdlc hdlc0 private
164
Krzysztof Halasab3dd65f2005-04-21 15:57:25 +0200165The hardware driver has to be build with #define DEBUG_RINGS.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700166Attaching this info to bug reports would be helpful. Anyway, let me know
167if you have problems using this.
168
Krzysztof Halasab3dd65f2005-04-21 15:57:25 +0200169For patches and other info look at:
170<http://www.kernel.org/pub/linux/utils/net/hdlc/>.