Compiling AVM FritzCard PCI Linux kernel driver - SLES11

From OS4X
Revision as of 00:19, 26 March 2011 by Admin (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Compiling the AVM FritzCard kernel module in SuSE Enterprise Linux

This documentation is based on a default installation of SLES11 without any patches applied. Needed packages are documented.

Download Source RPM

Foehr IT offers free AVM FritzCard packages for different openSuSE versions, where the sources of these packages also work in SLES11.

Download an actual version, i.e.: fcpci-0.1-0.src.rpm:

linux-109v:/ # cd /tmp
linux-109v:/tmp # wget http://opensuse.foehr-it.de/rpms/11_1/src/fcpci-0.1-0.src.rpm

If the file is no longer available, use the local copy

linux-109v:/ # cd /tmp
linux-109v:/tmp # wget http://www.os4x.com/fileadmin/downloads/fcpci-0.1-0.src.rpm

Install compiler

Without a compiler, you're unable to compile software, so that's an absolute must-have:

zypper install gcc

Install kernel sources

zypper install kernel-source

Install kernel syms

zypper install kernel-syms

Start the build process

rpmbuild --rebuild fcpci-0.1-0.src.rpm

This will build the kernel module. The resulting file is then created in the directory

/usr/src/packages/RPMS/i586
linux-109v:/usr/src/packages/RPMS/i586 # ls -l
total 2272
-rw-r--r-- 1 root root 381236 Mar 26 01:42 fcpci-kmp-debug-0.1_2.6.27.19_5-0.i586.rpm
-rw-r--r-- 1 root root 376738 Mar 26 01:42 fcpci-kmp-default-0.1_2.6.27.19_5-0.i586.rpm
-rw-r--r-- 1 root root 379532 Mar 26 01:43 fcpci-kmp-pae-0.1_2.6.27.19_5-0.i586.rpm
-rw-r--r-- 1 root root 376353 Mar 26 01:43 fcpci-kmp-trace-0.1_2.6.27.19_5-0.i586.rpm
-rw-r--r-- 1 root root 394579 Mar 26 01:43 fcpci-kmp-vmi-0.1_2.6.27.19_5-0.i586.rpm
-rw-r--r-- 1 root root 382633 Mar 26 01:43 fcpci-kmp-xen-0.1_2.6.27.19_5-0.i586.rpm

Use this newly created RPM package to install the kernel module:

 linux-109v:/usr/src/packages/RPMS/i586 # rpm -ihv fcpci-kmp-pae-0.1_2.6.27.19_5-0.i586.rpm
Preparing...                ########################################### [100%]
   1:fcpci-kmp-pae          ########################################### [100%]
24591 blocks

Install capi4linux

zypper install capi4linux

create default configuration file for CAPI

Create the following file:

/etc/capi.conf

with the following content:

fcpci           -               -       -       -       -       -

This will tell capi4linux that the fcpci kernel module will be used.

configure device

Configure your FritzCard via yast2:

yast2 isdn

Yourt device should be listed as an unconfigured device. Configure it using the "edit" option. Configure it using the CAPI 2.0 driver, not via HiSax or another solution!! Activating the device at boot time is always a good idea.

load module manually

insmod /lib/modules/2.6.27.19-5-pae/updates/fcpci.ko 

Verify installation of the module

There are several ways to check the success of the installation of the kernel module.

Kernel output

Check the output of

dmesg

It should contain messages of a successful load of fcpci:

fcpci: module license 'Proprietary' taints kernel.
fcpci: AVM FRITZ!Card PCI driver, revision 0.7.2
fcpci: (fcpci built on Mar 26 2011 at 01:41:37)
fcpci: -- 32 bit CAPI driver --
vendor=1106 device=b353
fcpci 0000:04:03.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16
fcpci: AVM FRITZ!Card PCI found: port 0xbc00, irq 16
fcpci: Loading...
fcpci: Driver 'fcpci' attached to fcpci-stack. (152)
fcpci: Stack version 3.11-07
kcapi: Controller [001]: fcpci-bc00-16 attached
kcapi: card [001] "fcpci-bc00-16" ready.
fcpci: Loaded.
capidrv: controller 1 up
capidrv-1: now up (2 B channels)
capidrv-1: D2 trace enabled

Check capiinfo

When CAPI inserts the new controller(s), they must be visible via

capiinfo

Sample ouput:

Number of Controllers : 1
Controller 1:
Manufacturer: AVM GmbH
CAPI Version: 2.0
Manufacturer Version: 3.11-07  (49.23)
Serial Number: 1000001
BChannels: 2
Global Options: 0x00000039
   internal controller supported
   DTMF supported
   Supplementary Services supported
   channel allocation supported (leased lines)
B1 protocols support: 0x4000011f
   64 kbit/s with HDLC framing
   64 kbit/s bit-transparent operation
   V.110 asynconous operation with start/stop byte framing
   V.110 synconous operation with HDLC framing
   T.30 modem for fax group 3
   Modem asyncronous operation with start/stop byte framing
B2 protocols support: 0x00000b1b
   ISO 7776 (X.75 SLP)
   Transparent
   LAPD with Q.921 for D channel X.25 (SAPI 16)
   T.30 for fax group 3
   ISO 7776 (X.75 SLP) with V.42bis compression
   V.120 asyncronous mode
   V.120 bit-transparent mode
B3 protocols support: 0x800000bf
   Transparent
   T.90NL, T.70NL, T.90
   ISO 8208 (X.25 DTE-DTE)
   X.25 DCE
   T.30 for fax group 3
   T.30 for fax group 3 with extensions
   Modem

  0100
  0200
  39000000
  1f010040
  1b0b0000
  bf000080
  00000000 00000000 00000000 00000000 00000000 00000000
  01000001 00020000 00000000 00000000 00000000

Supplementary services support: 0x000003ff
   Hold / Retrieve
   Terminal Portability
   ECT
   3PTY
   Call Forwarding
   Call Deflection
   MCID
   CCBS

check CAPI device

In order to use CAPI2 in applications, a device file must exist:

linux-109v:/ # ls -ld /dev/capi20
crw-rw---- 1 root dialout 68, 0 Mar 26 01:59 /dev/capi20

This device file must be writable to the user running the application, so in OS4X environments it's best practice to add the webserver user (mostly "www-data" or similar) to the group "dialout":

groupmod -A www-data dialout

open points

The kernel module doesn't load automatically. Anybody who has experience in adding an

insmod /lib/modules/2.6.27.19-5-pae/updates/fcpci.ko 

into the boot process? This should normally be the work of capi4linux and modules.dep. Fortunately, fcpci.ko is automatically added to modules.dep in the correct version and directory:

/lib/modules/2.6.27.19-5-pae/updates/fcpci.ko: /lib/modules/2.6.27.19-5-pae/kernel/drivers/isdn/capi/kernelcapi.ko

But even a modprobe doesn't work.