Two-FritzCards-Howto ==================== Introduction ------------ It's possible to use two Fritz cards simultaneously in one computer. 2 Fritz/PCI Cards are about 3 times cheaper than an AVM C2 Card and both have the same number of B-Channels, so this is a good way to save money. The kernel driver for Fritz!Cards can easily handle 2 or more of them. When doing CAPI, however, you need the AVM Drivers, which need some tweaking before they work in "dual mode". The following procedure can safely be described as "big hack". However, it works. Step 1: Preparing the Drivers ----------------------------- The fcpci-suse*.*-*-*-*.tar.gz package on ftp.avm.de/cardware can be used to build a module fcpci.o. This module, when inserted into the kernel, registers with the kernel capi interface the first Fritz!card found in the computer- it's simple to build a second module which loads the second. First point the kernel directory, "KRNLINCL" in src.drv/makefile to your kernel sources. Then, run "make" in src.drv. You get a file "fcpci.o". Copy that one (it's the module for the first card) to a save place, and then do the following changes: Edit the makefile in "src.drv" again, and insert the following line: CARD = f2pci Now copy lib/fcpci-lib.o to lib/f2pci-lib.o and replace all occurences of "fcpci" in f2pci-lib.o by "f2pci". (It's a binary file, so be careful) Replace all occurences of __fcpci__ in src.drv/* by __f2pci__. (quite many) In src.drv/defs.h, replace # define PRODUCT_LOGO "AVM FRITZ!Card PCI" by # define PRODUCT_LOGO "AVM FRITZ!Card PCI (2nd)" And #define SHORT_LOGO "fritz-" INTERFACE by #define SHORT_LOGO "fritz2-" INTERFACE . In src.drv/driver.c, around line 144, replace dev = pci_find_device (AVM_VENDOR_ID, AVM_DEVICE_ID, dev); by dev = pci_find_device (AVM_VENDOR_ID, AVM_DEVICE_ID, dev); dev = pci_find_device (AVM_VENDOR_ID, AVM_DEVICE_ID, dev); and dev = pci_find_device (AVM_VENDOR_ID, AVM_DEVICE_ID2, dev); by dev = pci_find_device (AVM_VENDOR_ID, AVM_DEVICE_ID2, dev); dev = pci_find_device (AVM_VENDOR_ID, AVM_DEVICE_ID2, dev); (i.e. duplicate the pci_find_device line to make the driver look for the second available card) Insert the line extern short unsigned int CAPI_INDEX; in driver.h. Now make sure CAPI_INDEX is always set to 1 by inserting CAPI_INDEX=1; right after (*card->reg_func) (ptr, appl); in src/driver.c (about line 579). Now run "make" (in src.drv/, otherwise the CARD line in the makefile might not be parsed (!)). You now should have two object files: fcpci.o (the original one), and f2pci.o (the one compiled after making the changes above). Copy both of them into your kernel module directory (/lib/modules/2.4.xx/misc/ or something). Step 2 - /etc/capi.conf ----------------------- In /etc/capi.conf, there should be two lines: fcpci - - - - - - f2pci - - - - - - Step 3 - capiinit ----------------- run the capiinit program from isdn4kutils. With the 7.3 drivers from AVM, there probably will be the two error messages add_card(fcpci) failed - Device or resource busy (16) add_card(f2pci) failed - Device or resource busy (16) That's ok- as the fcpci modules as well as capiinit insert the card into the kernelcapi interface, it get's inserted two times, causing the second call to fail. Probably even something like f2pci: Cannot handle two controllers! shows up in your /var/log/messages, for the same reason. However /proc/capi/controller should read: 1 fcpci running fritz-pci A1 3.09-10 0xE400 11 2 f2pci running fritz2-pci A1 3.09-10 0xE800 10 (With probably different interrupts/ioports, of course) Your linux capi system has now 2 Controllers with 2 BChannels each, so 4 logical lines! By repeating the steps above with f3pci, f4pci... and incrementing CAPI_INDEX to 2, 3 etc., even more cards should be possible. Author: Matthias Kramm , Last modified: March 23th, 2004