import of ftp.dlink.com/GPL/DSMG-600_reB/ppclinux.tar.gz
[linux-2.4.21-pre4.git] / Documentation / networking / generic-hdlc.txt
1 Generic HDLC layer for Linux kernel 2.4/2.5
2 Krzysztof Halasa <khc@pm.waw.pl>
3 May, 2001
4
5
6 Generic HDLC layer currently supports:
7 - Frame Relay (ANSI, CCITT and no LMI), with ARP support (no InARP),
8 - raw HDLC (IPv4 only),
9 - Cisco HDLC,
10 - PPP (uses syncppp.c),
11 - X.25 (uses X.25 routines).
12
13 There are hardware drivers for the following cards:
14 - C101 by Moxa Technologies Co., Ltd.
15 - RISCom/N2 by SDL Communications Inc.
16 - and others, some not in the official kernel.
17
18 Make sure the hdlc.o and the hardware driver are loaded. It should
19 create a number of "hdlc" (hdlc0 etc) network devices, one for each
20 WAN port. You'll need the "sethdlc" utility, get it from:
21         http://hq.pm.waw.pl/hdlc/
22
23 Compile sethdlc.c utility:
24         gcc -O2 -Wall -o sethdlc sethdlc.c
25 Make sure you're using a correct version of sethdlc for your kernel.
26
27 Use sethdlc to set physical interface, clock rate, HDLC mode used,
28 and add any required PVCs if using Frame Relay.
29 Usually you want something like:
30
31         sethdlc hdlc0 clock int rate 128000
32         sethdlc hdlc0 cisco interval 10 timeout 25
33 or
34         sethdlc hdlc0 rs232 clock ext
35         sethdlc fr lmi ansi
36         sethdlc create 99
37
38 In Frame Relay mode, ifconfig master hdlc device up (without assigning
39 any IP address to it) before using pvc devices.
40
41
42 Setting interface:
43
44 * v35 | rs232 | x21 | t1 | e1 - sets physical interface for a given port
45                                 if the card has software-selectable interfaces
46   loopback - activate hardware loopback (for testing only)
47 * clock ext - external clock (uses DTE RX and TX clock)
48 * clock int - internal clock (provides clock signal on DCE clock output)
49 * clock txint - TX internal, RX external (provides TX clock on DCE output)
50 * clock txfromrx - TX clock derived from RX clock (TX clock on DCE output)
51 * rate - sets clock rate in bps (not required for external clock or
52                                  for txfromrx)
53
54 Setting protocol:
55
56 * hdlc - sets raw HDLC (IP-only) mode
57   nrz / nrzi / fm-mark / fm-space / manchester - sets transmission code
58   no-parity / crc16 / crc16-pr0 (CRC16 with preset zeros) / crc32-itu
59   crc16-itu (CRC16 with ITU-T polynomial) / crc16-itu-pr0 - sets parity
60
61 * cisco - sets Cisco HDLC mode (IP, IPv6 and IPX supported)
62   interval - time in seconds between keepalive packets
63   timeout - time in seconds after last received keepalive packet before
64             we assume the link is down
65
66 * ppp - sets synchronous PPP mode
67
68 * x25 - sets X.25 mode
69
70 * fr - Frame Relay mode
71   lmi ansi / ccitt / none - LMI (link management) type
72   dce - Frame Relay DCE (network) side LMI instead of default DTE (user).
73   It has nothing to do with clocks!
74   t391 - link integrity verification polling timer (in seconds) - user
75   t392 - polling verification timer (in seconds) - network
76   n391 - full status polling counter - user
77   n392 - error threshold - both user and network
78   n393 - monitored events count - both user and network
79
80 * create | delete n - FR only - adds / deletes PVC interface with DLCI #n.
81
82
83
84
85 Board-specific issues
86 ---------------------
87
88 n2.o and c101.o need parameters to work (note double quotes):
89
90         insmod n2 hw='"io,irq,ram,ports[:io,irq,...]"'
91 example:
92         insmod n2 hw='"0x300,10,0xD0000,01"'
93
94 or
95         insmod c101 hw='"irq,ram[:irq,...]"
96 example:
97         insmod c101 hw='"9,0xdc000"'
98
99 If built into the kernel, these drivers need kernel (command line) parameters:
100         n2=io,irq,ram,ports:...
101 or
102         c101=irq,ram:...
103
104
105
106 If you have a problem with N2 or C101 card, you can issue the "private"
107 command to see port's packet descriptor rings:
108
109         sethdlc hdlc0 private
110
111 The hardware driver have to be build with CONFIG_HDLC_DEBUG_RINGS.
112 Attaching this info to bug reports would be helpful. Anyway, let me know
113 if you have problems using this.
114
115 For patches and other info look at http://hq.pm.waw.pl/hdlc/