Huw Ayling-Miller @ Huw.org.uk

Using the BeWAN ADSL PCIst with Debian 4.0 (etch)

Introduction


I bought a BeWAN ADSL PCIst modem in August 2007 to use in a Linux box as part of a router. Unfortunately
the instructions that are provided by BeWAN and Debian aren't up to much so I've attempted to document the process here.

Debian provides two packages related to unicorn (the name for the BeWAN PCIst chipset) in the non-free repository however these are outdated.

Prerequisites

The currently drivers only support kernels below 2.6.20 however this shouldn't be a problem as the default etch kernel is 2.6.18.

You'll need to download the latest drivers from the BeWAN site (as of writing the version number is 0.9.3) and these patches (courtesy of Gentoo).

Next you'll need to download some packages from the Debian repository. I'm unsure if all these are needed, I just used the list of dependencies from the broken debian packages. In a terminal run:

aptitude install libc6 libglib1.2 libgtk1.2 libx11-6 libxext6 libxi6 libc6-dev make gcc linux-source

You'll need to add a symlink to /usr/src/linux. This can be done by running the following command in the terminal:

ln -s /usr/src/pathtolinuxsource /usr/src/linux

(Obviously replacing pathtolinuxsource with the linux-version folder!)

When this is done you'll need to extract the tar files containing the driver and patches. In a terminal type:

tar xvf bewan-adsl-0.9.3-patches-20061220.tar.gz
tar xvf A1012-A1006-A904-A888-A983-0.9.3.tgz

(You may need to adapt the file names!)

Now you need to modify the patches and some of the filenames. In you're favourite editor open up each one of the patches in turn and replace .cpp with .c

Then go to the unicorn folder and rename all all files ending in .cpp with .c

You should have renamed the following files:

unicorn/msw/msw.cpp
unicorn/amu/amas.cpp
unicorn/amu/amu.cpp
unicorn/amu/bsp_pci.cpp
unicorn/amu/bsp_usb.cpp

Now you'll need to patch the drivers. Make sure you're in the directory 'above' the drivers. So if you're drivers have been extracted to:

/home/user/unicorn

You'll need to be in the:

/home/user/

directory.

Type the following commands into the terminal:

patch -p0 < bewan-adsl-0.9.3-kernel-changes.patch
patch -p0 < bewan-adsl-0.9.3-no-strip.patch
patch -p0 < bewan-adsl-0.9.3-smp.patch

Now you go into the unicorn directory and type:

make

When the driver has finished you'll need to copy the relevant files. There are two methods for doing this.

1) Type make install and have the script copy the file for you and add the startup scripts. This method isn't recommended as I haven't tested it.

2)The manual method.

Copy the unicorn_pci_atm.ko and unicorn_pci_eth.ko to /lib/modules/linuxversion/extra (replace linuxversion!) and then run the following command in the terminal:

depmod -ae

Now open /etc/modprobe.conf. Check that it contains the following line:

include /etc/modprobe.d

Now open /etc/modprobe.d/blacklists and add the following at the bottom of the file:

blacklist unicorn_pci_atm
blacklist unicorn_pci_eth

These lines are needed to stop the module loading with the incorrect parameters.

Now open /etc/modules (create it if it doesn't already exist) and add:

unicorn_pci_atm ActivationMode=

The number you put after ActivationMode= depends on the type of broadband you have.
ANSI mode is 1, G.lite is 2, G.dmt is 4 and MULTI mode is 3. Type 4 is used in the UK and some of Europe.
There are also other options you can add after ActivationMode=. For more information on these see the README in the unicorn folder.

If you reboot you should get some information about unicorn appear as part of the boot sequence. This should mean the driver is working successfully.

You can check by typing the following at the command line about a minute after the computer has finished booting and checking to see if the "modem state" is SHOWTIME:

cat /proc/net/atm/UNICORN:0

There are some useful command line debug tools in the tools folder of the unicorn source and a graphical tool in the adsl_status folder. You may want to take a look at them and perhaps copy them to a different directory.

Now you just need to setup the PPP configuration which will authenticate and communicate with your broadband provider. You can read the Debian documentation or read mine.