blob: 31bc8b759b755e03875426f3678e92e86a022b33 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001Generic HDLC layer
2Krzysztof Halasa <khc@pm.waw.pl>
Linus Torvalds1da177e2005-04-16 15:20:36 -07003
4
5Generic HDLC layer currently supports:
Krzysztof Halasab3dd65f2005-04-21 15:57:25 +020061. Frame Relay (ANSI, CCITT, Cisco and no LMI).
7 - Normal (routed) and Ethernet-bridged (Ethernet device emulation)
8 interfaces can share a single PVC.
9 - ARP support (no InARP support in the kernel - there is an
10 experimental InARP user-space daemon available on:
11 http://www.kernel.org/pub/linux/utils/net/hdlc/).
122. raw HDLC - either IP (IPv4) interface or Ethernet device emulation.
133. Cisco HDLC.
144. PPP (uses syncppp.c).
155. X.25 (uses X.25 routines).
Linus Torvalds1da177e2005-04-16 15:20:36 -070016
Krzysztof Halasab3dd65f2005-04-21 15:57:25 +020017Generic HDLC is a protocol driver only - it needs a low-level driver
18for your particular hardware.
Linus Torvalds1da177e2005-04-16 15:20:36 -070019
20Ethernet device emulation (using HDLC or Frame-Relay PVC) is compatible
21with IEEE 802.1Q (VLANs) and 802.1D (Ethernet bridging).
22
23
24Make sure the hdlc.o and the hardware driver are loaded. It should
25create a number of "hdlc" (hdlc0 etc) network devices, one for each
26WAN port. You'll need the "sethdlc" utility, get it from:
Krzysztof Halasab3dd65f2005-04-21 15:57:25 +020027 http://www.kernel.org/pub/linux/utils/net/hdlc/
Linus Torvalds1da177e2005-04-16 15:20:36 -070028
29Compile sethdlc.c utility:
30 gcc -O2 -Wall -o sethdlc sethdlc.c
31Make sure you're using a correct version of sethdlc for your kernel.
32
33Use sethdlc to set physical interface, clock rate, HDLC mode used,
34and add any required PVCs if using Frame Relay.
35Usually you want something like:
36
37 sethdlc hdlc0 clock int rate 128000
38 sethdlc hdlc0 cisco interval 10 timeout 25
39or
40 sethdlc hdlc0 rs232 clock ext
41 sethdlc hdlc0 fr lmi ansi
42 sethdlc hdlc0 create 99
43 ifconfig hdlc0 up
44 ifconfig pvc0 localIP pointopoint remoteIP
45
46In Frame Relay mode, ifconfig master hdlc device up (without assigning
47any IP address to it) before using pvc devices.
48
49
50Setting interface:
51
52* v35 | rs232 | x21 | t1 | e1 - sets physical interface for a given port
53 if the card has software-selectable interfaces
54 loopback - activate hardware loopback (for testing only)
Krzysztof Halasab3dd65f2005-04-21 15:57:25 +020055* clock ext - both RX clock and TX clock external
56* clock int - both RX clock and TX clock internal
57* clock txint - RX clock external, TX clock internal
58* clock txfromrx - RX clock external, TX clock derived from RX clock
59* rate - sets clock rate in bps (for "int" or "txint" clock only)
60
Linus Torvalds1da177e2005-04-16 15:20:36 -070061
62Setting protocol:
63
64* hdlc - sets raw HDLC (IP-only) mode
65 nrz / nrzi / fm-mark / fm-space / manchester - sets transmission code
66 no-parity / crc16 / crc16-pr0 (CRC16 with preset zeros) / crc32-itu
67 crc16-itu (CRC16 with ITU-T polynomial) / crc16-itu-pr0 - sets parity
68
69* hdlc-eth - Ethernet device emulation using HDLC. Parity and encoding
70 as above.
71
72* cisco - sets Cisco HDLC mode (IP, IPv6 and IPX supported)
73 interval - time in seconds between keepalive packets
74 timeout - time in seconds after last received keepalive packet before
75 we assume the link is down
76
77* ppp - sets synchronous PPP mode
78
79* x25 - sets X.25 mode
80
81* fr - Frame Relay mode
Krzysztof Halasab3dd65f2005-04-21 15:57:25 +020082 lmi ansi / ccitt / cisco / none - LMI (link management) type
Linus Torvalds1da177e2005-04-16 15:20:36 -070083 dce - Frame Relay DCE (network) side LMI instead of default DTE (user).
84 It has nothing to do with clocks!
85 t391 - link integrity verification polling timer (in seconds) - user
86 t392 - polling verification timer (in seconds) - network
87 n391 - full status polling counter - user
88 n392 - error threshold - both user and network
89 n393 - monitored events count - both user and network
90
91Frame-Relay only:
92* create n | delete n - adds / deletes PVC interface with DLCI #n.
93 Newly created interface will be named pvc0, pvc1 etc.
94
95* create ether n | delete ether n - adds a device for Ethernet-bridged
96 frames. The device will be named pvceth0, pvceth1 etc.
97
98
99
100
101Board-specific issues
102---------------------
103
104n2.o and c101.o need parameters to work:
105
106 insmod n2 hw=io,irq,ram,ports[:io,irq,...]
107example:
108 insmod n2 hw=0x300,10,0xD0000,01
109
110or
111 insmod c101 hw=irq,ram[:irq,...]
112example:
113 insmod c101 hw=9,0xdc000
114
115If built into the kernel, these drivers need kernel (command line) parameters:
116 n2.hw=io,irq,ram,ports:...
117or
118 c101.hw=irq,ram:...
119
120
121
Krzysztof Halasab3dd65f2005-04-21 15:57:25 +0200122If you have a problem with N2, C101 or PLX200SYN card, you can issue the
123"private" command to see port's packet descriptor rings (in kernel logs):
Linus Torvalds1da177e2005-04-16 15:20:36 -0700124
125 sethdlc hdlc0 private
126
Krzysztof Halasab3dd65f2005-04-21 15:57:25 +0200127The hardware driver has to be build with #define DEBUG_RINGS.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700128Attaching this info to bug reports would be helpful. Anyway, let me know
129if you have problems using this.
130
Krzysztof Halasab3dd65f2005-04-21 15:57:25 +0200131For patches and other info look at:
132<http://www.kernel.org/pub/linux/utils/net/hdlc/>.