www.ekr-home.de

HOWTO: Use an AVM Fritz!Card USB v2.1 in Debian

April 2005

Contents

Send errors, corrections, enhancements

This HOWTO explains how to use an AVM Fritz!Card USB v2.1 on a Debian system using the standard Debian kernel.

It is here mainly because this way I can cut'n'paste it when I need it somewhere, myself. :-)

What do you get?

A working PPP connection. This is not a totally clean ISDN install yet, it just gets you going.

What do you need to do?

I'm assuming that you are using the Debian "kernel-image-2.4.27-2-386" package for your kernel. uname -r tells you which kernel you are using.

Installing the standard packages

Installing some packages
apt-get install kernel-headers-2.4.27-2-386
apt-get install isdnactivecards isdnutils

You will be prompted for your ISDN provider settings, so enter them (phone number, username, password, etc.). Don't use dummy entries, enter the real stuff.

Compiling the module

Here I'm assuming that that "lsusb" displays the card ("ID 057c:1900 AVM GmbH"). If this is not the case, check the USB HOWTOs on the net for more information.

Get the source...

Getting the source code
wget ftp://ftp.avm.de/cardware/fritzcrdusb.v20/linux/suse.82/fcusb2-suse8.2-03.11.02.tar.gz

Unpack the archive, enter the "fritz" directory, and edit "src.drv/makefile" to look like:

src.drv/makefile
.
.
.
# As propsed by /usr/include/linux/version.h...
# KRNLINCL      = /lib/modules/`uname -r`/build/include
# KRNLINCL      = /usr/src/linux/include
KRNLINCL        = /usr/src/kernel-source-2.4.27/include

DEFINES         = -DMODULE -DMODVERSIONS -D__KERNEL__ -DNDEBUG \
                  -D__$(CARD)__ -DTARGET=\"$(CARD)\"
CCFLAGS         = -c $(DEFINES) -march=i586 -O2 -Wall -I $(KRNLINCL) \
                  -include /usr/src/kernel-source-2.4.27/include/linux/modversions.h
.
.
.

(Thanks to this page for this tip).

Then...

Compiling, installing and loading the module
cd fritz
make
cp src.drv/fcusb2.o /lib/modules/`uname -r`/kernel/drivers/isdn/avmb1
update-modules
modprobe fcusb2

If the module loads successfully, then skip to the next chapter.

If the module fails without "unresolved symbols", check "dmesg" and see if you can find a solution.

Otherwise, you're getting lots of "unresolved symbols". This means that the include tree (KRNLINCL) you compiled against was not the same as the kernel you are running right now. To verify this, execute the following commands:

Getting the module versions
find /lib/modules/2.4.27-2-386/ -name "*usb*" | \
xargs grep usb_unlink_urb|xargs strings 2>/dev/null|grep ^usb_unlink_urb

grep usb_unlink_urb /usr/src/kernel-source-2.4.27/include/linux/modules/usb.ver

Those two commands will give you a version number (something like "ab23b25b"). If the numbers are the same, then you got a real problem :-) . If the numberes differ, then you are simply using the wrong KRNLINCL directory; you really have to use the one your kernel was compiled with.

You can search your disk for "usb.ver"... if you find one which has the same version number for usb_unlink_urb as the kernel module, then use that directory tree as KRNLINCL.

Putting everything together

Here I'm assuming that you have the working kernel module, that "lsusb" displays the card ("ID 057c:1900 AVM GmbH"), and that the ISDN line is connected to the card.

Add this line to /etc/isdn/capi.conf, comment out anything else in that file:

/etc/isdn/capi.conf
fcusb2          fus3base.frm - - - - -

Load the USB card firmware:

Copying the firmware
cp fritz/*.frm /var/lib/isdn/
avmcapictrl load fus3base.frm

Yes, that's "fus3base.frm" not "fus2base.frm", as far as I know, "fus3base.frm" is for v2.1 of the card, while "fus2base.frm" is for v2.0. The version number of the card is printed on a label on its back.

If you get an error message about "ioctl LOAD: No such process", then unplug and re-plug the USB card and try again...

Do these (should happen automatically via the dependencies, but doesn't hurt to be sure):

Loading modules
modprobe isdn
modprobe capi
modprobe capidrv
/etc/init.d/capiutils start

Now it's time to start up the ISDN connetion:

Starting the ISDN connection
/etc/init.d/isdnutils start

Voila. "ifconfig" should now display the "ippp0" interface, and you should be online. If it does not work, check "dmesg" or /var/log... for messages. You can now continue with any of the many ISDN/PPP HOWTOs, and you should obviously put all those configuration commands in the proper places (/etc/init.d, /etc/modules etc.).

Fixing the route

In my case, the ISDN connection was not a normal internet connection; I'm using it to access only a single other machine (which has the IP 192.168.10.10). This means that I do not want the ISDN connection to be my "default gateway". To fix this issue, I use these commands after bringing up the ISDN connection:

Fixing the default gateway
route del default
route add default dev ppp0   # Note, that's not "ippp0", but my DSL/PPPoE connection
route add -net 192.168.10.10 netmask 255.255.255.255 dev ippp0