generic-hdlc.rst 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. .. SPDX-License-Identifier: GPL-2.0
  2. ==================
  3. Generic HDLC layer
  4. ==================
  5. Krzysztof Halasa <khc@pm.waw.pl>
  6. Generic HDLC layer currently supports:
  7. 1. Frame Relay (ANSI, CCITT, Cisco and no LMI)
  8. - Normal (routed) and Ethernet-bridged (Ethernet device emulation)
  9. interfaces can share a single PVC.
  10. - ARP support (no InARP support in the kernel - there is an
  11. experimental InARP user-space daemon available on:
  12. http://www.kernel.org/pub/linux/utils/net/hdlc/).
  13. 2. raw HDLC - either IP (IPv4) interface or Ethernet device emulation
  14. 3. Cisco HDLC
  15. 4. PPP
  16. 5. X.25 (uses X.25 routines).
  17. Generic HDLC is a protocol driver only - it needs a low-level driver
  18. for your particular hardware.
  19. Ethernet device emulation (using HDLC or Frame-Relay PVC) is compatible
  20. with IEEE 802.1Q (VLANs) and 802.1D (Ethernet bridging).
  21. Make sure the hdlc.o and the hardware driver are loaded. It should
  22. create a number of "hdlc" (hdlc0 etc) network devices, one for each
  23. WAN port. You'll need the "sethdlc" utility, get it from:
  24. http://www.kernel.org/pub/linux/utils/net/hdlc/
  25. Compile sethdlc.c utility::
  26. gcc -O2 -Wall -o sethdlc sethdlc.c
  27. Make sure you're using a correct version of sethdlc for your kernel.
  28. Use sethdlc to set physical interface, clock rate, HDLC mode used,
  29. and add any required PVCs if using Frame Relay.
  30. Usually you want something like::
  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 hdlc0 fr lmi ansi
  36. sethdlc hdlc0 create 99
  37. ifconfig hdlc0 up
  38. ifconfig pvc0 localIP pointopoint remoteIP
  39. In Frame Relay mode, ifconfig master hdlc device up (without assigning
  40. any IP address to it) before using pvc devices.
  41. Setting interface:
  42. * v35 | rs232 | x21 | t1 | e1
  43. - sets physical interface for a given port
  44. if the card has software-selectable interfaces
  45. loopback
  46. - activate hardware loopback (for testing only)
  47. * clock ext
  48. - both RX clock and TX clock external
  49. * clock int
  50. - both RX clock and TX clock internal
  51. * clock txint
  52. - RX clock external, TX clock internal
  53. * clock txfromrx
  54. - RX clock external, TX clock derived from RX clock
  55. * rate
  56. - sets clock rate in bps (for "int" or "txint" clock only)
  57. Setting protocol:
  58. * hdlc - sets raw HDLC (IP-only) mode
  59. nrz / nrzi / fm-mark / fm-space / manchester - sets transmission code
  60. no-parity / crc16 / crc16-pr0 (CRC16 with preset zeros) / crc32-itu
  61. crc16-itu (CRC16 with ITU-T polynomial) / crc16-itu-pr0 - sets parity
  62. * hdlc-eth - Ethernet device emulation using HDLC. Parity and encoding
  63. as above.
  64. * cisco - sets Cisco HDLC mode (IP, IPv6 and IPX supported)
  65. interval - time in seconds between keepalive packets
  66. timeout - time in seconds after last received keepalive packet before
  67. we assume the link is down
  68. * ppp - sets synchronous PPP mode
  69. * x25 - sets X.25 mode
  70. * fr - Frame Relay mode
  71. lmi ansi / ccitt / cisco / 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. Frame-Relay only:
  80. * create n | delete n - adds / deletes PVC interface with DLCI #n.
  81. Newly created interface will be named pvc0, pvc1 etc.
  82. * create ether n | delete ether n - adds a device for Ethernet-bridged
  83. frames. The device will be named pvceth0, pvceth1 etc.
  84. Board-specific issues
  85. ---------------------
  86. n2.o and c101.o need parameters to work::
  87. insmod n2 hw=io,irq,ram,ports[:io,irq,...]
  88. example::
  89. insmod n2 hw=0x300,10,0xD0000,01
  90. or::
  91. insmod c101 hw=irq,ram[:irq,...]
  92. example::
  93. insmod c101 hw=9,0xdc000
  94. If built into the kernel, these drivers need kernel (command line) parameters::
  95. n2.hw=io,irq,ram,ports:...
  96. or::
  97. c101.hw=irq,ram:...
  98. If you have a problem with N2, C101 or PLX200SYN card, you can issue the
  99. "private" command to see port's packet descriptor rings (in kernel logs)::
  100. sethdlc hdlc0 private
  101. The hardware driver has to be build with #define DEBUG_RINGS.
  102. Attaching this info to bug reports would be helpful. Anyway, let me know
  103. if you have problems using this.
  104. For patches and other info look at:
  105. <http://www.kernel.org/pub/linux/utils/net/hdlc/>.