Homepage Johann Hanne 
Valid XHTML 1.0 Strict
About | Projects | Gadgets | Photos | Links
Projects - Linksys BEFSX41 stuff - ADM6996 driver 

Warning: This driver is unstable, see below!

The Linksys BEFSX41 contains an ADMtek ADM6996, which is a six port (i.e. one CPU port + five ethernet ports) switch chip. There is a driver for the ADM6996 in conjunction with the Linksys WRT54G (local copy) written by Lev Melnikovsky which I have modified to work with the CX82100 CPU which is used in the BEFSX41.

Before I was able to modify the driver, I had to find out which GPIO lines of the CX82100 the ADM6996 chip is connected to. I just used a voltmeter and a little program which triggered the GPIO lines. So here are the connections (pin number one of the ADM6996 is the leftmost pin on the bottom side, counting starts to the right direction moving along counter-clockwise).

ADM6996 pin CX82100 GPIO line
112 (RC, reset) GPIO5 out
80 (EECS, chip select) GPIO6 out
81 (EESK, clock) GPIO7 in/out
79 (EDI, data) GPIO18 in/out

Downloads:
Patch for using the ADM6996 driver with the CX82100 CPU
Precompiled driver module

The switch chip is controlled via some /proc files, please see the README file included in the driver tarball for details. The above patch adds /proc/driver/adm6996_regdump which simply dumps all EEPROM and serial registers of the ADM6996. This file can be used for checking if the driver is stable. If this is the case, dumping the registers 100 times should give the same results 100 times (with the exception of the port counters of the connected ports). But as mentioned, the driver is not stable. This is the point where you can help out: Download the driver, correct it and check if the register dump is stable:

  • Log into the BEFSX41
  • Load the ADM6996 driver:
    insmod befsx41-adm6996.o
  • Dump the registers 100 times:
    for i in 0 1 2 3 4 5 6 7 8 9; do
    for j in 0 1 2 3 4 5 6 7 8 9; do
    cat /proc/driver/adm6996_regdump >/dump-$i$j.txt;
    done;
    done
    
  • On your workstation, with cwd /var/befsx41-root/, run:
    for f in dump-??.txt; do
    grep -v "0x06\|0x0c\|0x0f\|0x15\|0x18\|0x1e\|0x21\|0x27\|0x2a\|0x30\|0x33\|0x39" $f | md5sum;
    done
    

The grep command filters out the port counters for port 1 (this is the LAN port next to the WAN port, you have to connect the BEFSX41 to your network via this port for the check to work!) and port 5 (this is the CPU port). The loop will print out 100 md5sums which will all be the same if the driver is really stable.