Knowledge Base


11.08.08

Compile CAPI driver for Fritz! Card PCI on kernel 2.6.26

This really drove me mad. Becausing i am getting annoyed far too much by call centres trying to sell crap to me on the phone i wanted to use asterisk to get rid of these buggers.
Well if you go and get the capi driver from AVM directly you will find out that the driver has not been updated for some years and does not compile on kernel 2.6. You will encounter problems such as

make[2]: Entering directory `/updates/kernel/linux-2.6.26.2'
  CC [M]  /updates/asterisk/fritz/src/main.o
/updates/asterisk/fritz/src/main.c:25:26: error: linux/config.h: No such file or directory

Resolve this by creating a symlink from /usr/src/linux/include/linux/autoconf.h to config.h

and

/updates/asterisk/fritz/src/tools.h:74: error: expected identifier or '(' before 'typeof'
/updates/asterisk/fritz/src/tools.h:74: error: expected ')' before '__xchg'
In file included from /updates/asterisk/fritz/src/main.c:45:
/updates/asterisk/fritz/src/driver.h:101: error: conflicting types for 'driver_init'
include/linux/device.h:425: error: previous declaration of 'driver_init' was here
/updates/asterisk/fritz/src/main.c: In function 'fritz_init':
/updates/asterisk/fritz/src/main.c:367: error: implicit declaration of function 'pci_module_init'

and

/updates/asterisk/fritz/src/main.c: In function 'fritz_probe':
/updates/asterisk/fritz/src/main.c:273: error: wrong type argument to unary exclamation mark

and

make[2]: Entering directory `/updates/kernel/linux-2.6.26.2'
  CC [M]  /updates/asterisk/fritz-2.6.26.2/src/main.o
In file included from /updates/asterisk/fritz-2.6.26.2/src/main.c:45:
/updates/asterisk/fritz-2.6.26.2/src/driver.h:101: error: conflicting types for 'driver_init'
include/linux/device.h:425: error: previous declaration of 'driver_init' was here
/updates/asterisk/fritz-2.6.26.2/src/main.c: In function 'fritz_init':
/updates/asterisk/fritz-2.6.26.2/src/main.c:367: error: implicit declaration of function 'pci_module_init'
make[3]: *** [/updates/asterisk/fritz-2.6.26.2/src/main.o] Error 1
make[2]: *** [_module_/updates/asterisk/fritz-2.6.26.2/src] Error 2

and

/updates/asterisk/fritz/src/driver.c:377: error: 'SA_INTERRUPT' undeclared (first use in this function)
/updates/asterisk/fritz/src/driver.c:377: error: (Each undeclared identifier is reported only once
/updates/asterisk/fritz/src/driver.c:377: error: for each function it appears in.)
/updates/asterisk/fritz/src/driver.c:377: error: 'SA_SHIRQ' undeclared (first use in this function)
/updates/asterisk/fritz/src/driver.c:383: warning: passing argument 2 of 'request_irq' from incompatible pointer type

and

Thanks to postings found here, here and here, i managed to finally compile the bloody module, which now installs fine:

Aug 11 23:36:34 kernel: fcpci: module license 'Proprietary' taints kernel.
Aug 11 23:36:34 kernel: fcpci: AVM FRITZ!Card PCI driver, revision 0.7.2
Aug 11 23:36:34 kernel: fcpci: (fcpci built on Aug 11 2008 at 23:25:58)
Aug 11 23:36:34 kernel: fcpci: -- 32 bit CAPI driver --
Aug 11 23:36:34 kernel: ACPI: PCI Interrupt Link [LNKD] enabled at IRQ 12
Aug 11 23:36:35 kernel: ACPI: PCI Interrupt 0000:00:08.0[A] -> Link [LNKD] -> GSI 12 (level, low) -> IRQ 12
Aug 11 23:36:35 kernel: fcpci: AVM FRITZ!Card PCI found: port 0xb400, irq 12
Aug 11 23:36:35 kernel: fcpci: Loading...
Aug 11 23:36:35 kernel: fcpci: Driver 'fcpci' attached to fcpci-stack. (152)
Aug 11 23:36:35 kernel: fcpci: Stack version 3.11-07
Aug 11 23:36:35 kernel: kcapi: Controller [001]: fcpci-b400-12 attached
Aug 11 23:36:35 kernel: kcapi: card [001] "fcpci-b400-12" ready.
Aug 11 23:36:35 kernel: fcpci: Loaded.


I attached a complete diffs to this posting for each file (driver.c|h, tools.h and main.c)



driver.c.patch
driver.h.patch
main.c.patch
tools.h.patch
<- Zurück zur Übersicht



Guestbook
Forum Gästebuch
Welcome to my Blog! weblog!

Ich bin eine Falle für Dosenfleischversender. Meine Adresse: aafalle@buechsenfleisch.mine.nu

Please write mail to me. I am a decoy. contact@weblog.podzone.net