Hello,

I developed a driver to support the HDLC/Frame Relay transmission for
the MPC8xx/FADS. Currently the driver supports only the asynchronous
mode but, as soon as I have the proper hardware, I'll add the
synchronous mode too.

I posted my software hoping that it can be useful and hoping someone
will test and improve it! ;-p

Please, feel free to write me back for any suggestions or
modifications.

This software is a part oif a bigger project by Ascensit
(http://www.ascensit.com) to expand the current CPM support in
Linux. Our next steps will be:

* Add a better CPM subsystems support by adding a set of
  regiter/unregister functions and by adding a proc-filesystem support
  to track down who are using what.

* Add support for other CPM subsystems like, for istance the I2C and
  so on.

* Other minor featurs in order to stabilize the CPM support.

INSTALL
=======

In order to have a working code I took a patched linux-2.4.17 from my
(great) colleague Christian Pellegrin who applied some patched from
denx and modified some code by himself.

Here the patch from vanilla linux-2.4.17 to linux-2.4.17-fads in order
to have a running code for the FADS developing board.

Warning! it is possible that this patch adds some extra unneeded code
since nor me nor Christian are able to find the patches that we used
to obtain the working code for the FADS... sorry! That was our fault!

Obviously if you already have a running kernel for the FADS you don't
need to apply this patch.

   http://www.ascensit.com/developers/ehdlc/patch-linux-2.4.17-fads.gz

Here the patch from linux-2.4.17-fads to linux-2.4.17-fads-fr in order
to have the right Frame Relay support.

   http://www.ascensit.com/developers/ehdlc/hdlc-2.5.1.patch.gz
   http://www.ascensit.com/developers/ehdlc/hdlc-S0.gz

Here the patch from linux-2.4.17-fads-fr to linux-2.4.17-fads-fr-ehdlc
in order to have my code! :-D

Please note that my patch doesn't modify the new Frame Relay support
provided by the above patch.

   http://www.ascensit.com/developers/ehdlc/patch-linux-2.4.17-fads-fr-ehdlc.gz

Finaly you can apply the patch for version 1.0

   http://www.ascensit.com/developers/ehdlc/ehdlc-1.0

Obviously you have to apply the above patches in the same order as I
explained.

MY TESTS
========

Async HDLC mode:

I used only three wires in order to connect my two FADS each other,
and more precisely I used the PINS B2, B3 and B32 of the expansion
connector. Since I used only the TXD and RXD signals I didn't check
the options "CTS and CD input enabled" in order to have "CTS and CD
always asserted". Currently the driver uses only the SCC3.

In order to configure the HDLC subsystem I used the sethdlc program
version 1.08 (you can find that program on
http://www.ascensit.com/developers/ehdlc/sethdlc.c.gz).

Regarding the asynchronous HDLC test I used the following commands:

   /sbin/insmod /lib/modules/2.4.17/kernel/drivers/net/wan/syncppp.o 
   /sbin/insmod /lib/modules/2.4.17/kernel/drivers/net/wan/hdlc.o
   /sbin/insmod /lib/modules/2.4.17/kernel/arch/ppc/8xx_io/ehdlc.o
   /sbin/sethdlc hdlc0 clock int rate 64000
   
   /sbin/sethdlc hdlc0 hdlc nrz no-parity
   /sbin/ifconfig hdlc0 192.168.1.1 pointopoint 192.168.1.2
      /sbin/ifconfig hdlc0 192.168.1.2 pointopoint 192.168.1.1   [on the other machine]

Then I used the normal ping command.

Regarding the Frame Relay (on asynchronous HDLC) I used the following
commands:

   /sbin/insmod /lib/modules/2.4.17/kernel/drivers/net/wan/syncppp.o 
   /sbin/insmod /lib/modules/2.4.17/kernel/drivers/net/wan/hdlc.o
   /sbin/insmod /lib/modules/2.4.17/kernel/arch/ppc/8xx_io/ehdlc.o
   /sbin/sethdlc hdlc0 clock int rate 64000
   
   /sbin/sethdlc hdlc0 fr lmi ansi
      /sbin/sethdlc hdlc0 fr lmi ansi dce   [on the DCE]
   /sbin/sethdlc hdlc0 create 666
   /sbin/ifconfig hdlc0 up
   /sbin/ifconfig pvc0 192.168.1.1 pointopoint 192.168.1.2
      /sbin/ifconfig pvc0 192.168.1.2 pointopoint 192.168.1.1   [on the other machine]

Sync HDLC Mode:

The test bench was made of:

   1) a FADS850SAR
   
   2) a board to interface the TTL levels from the FADS CONN Expansion connector
      to V.35 levels.
      
   3) A Cisco 2500 Router.

The clock was actually routed from the FADS to the Cisco. The connection was
tested both in Cisco HDLC mode and Frame-Relay (with a sub-interface for every
PVC).

The configuration for Cisco HDLC was:

insmod slhc
insmod syncppp
insmod hdlc
insmod ehdlc 
sethdlc hdlc0 clock int rate 64000
sethdlc hdlc0 cisco
ifconfig hdlc0 217.27.75.225 pointopoint 217.27.75.226
ping 217.27.75.226

The configuration for FR:

insmod slhc
insmod syncppp
insmod hdlc
insmod ehdlc
sethdlc hdlc0 clock int rate 64000
sethdlc hdlc0 fr lmi ansi dce
sethdlc hdlc0 create 102
ifconfig pvc0 217.27.75.225 pointopoint 217.27.75.226
ifconfig hdlc0 up
ifconfig pvc0 up

Enjoy! :-D

Rodolfo
