AVM Fritz ISDN Card troubles.

I got a strange effect. Setup is RedHat 6.2, Tosiba Portege 7200CT. Other PCMCIA devices work well (CD ROM, Xircom Network etc). I'm trying to get a Fritz Card PCMCIA ISDN Adapter (also known as AVM A1 PCMCIA) to work with my kernel. If you read the docs in the kernel and on www.isdn4linux.de, this card is fully supported. If I read the docs in pcmcia_cs, this card is not mentioned. The card is a passive ISDN card so it doesnt fit into the section "Modem cards which have their own UART". So there are differentiating statements. The german Suse distribution comes with the device listed in /etc/pcmcia/config. I copied that into my RedHat config file and adopted the modules accordingly. All modules load properly so that part works for shure.

Anyway, the situation I have now is if you insert the card you get a high beep followed by a low beep. The correct ISDN drivers are ready to be installed and get loaded properly at the insertion. However I get this message in syslog:

It seems to be that this last line is the killer. What I see off /proc is that the card has an IRQ but the io ports dont get assigned somehow. Under Windows the card gets either 0x1000 or 0x1400 (or maybe it was 0x100 and 0x140). Both areas are valid in the config. I tried various IRQ's with no difference. The BIOS of the Toshiba is set to CardBus 16. That works best and I dont have any problem with any other card.

I tried the latest kernel 2.4.0test4 with the lates PCMCIA_CS tools downloaded today and I get the same results whatsoever.

I have a FRITZ!Card PCMCIA (v2.0) which I use with my Sony VAIO C1XN laptop. It worked well when I was running Windows 2000 on the laptop. I recently installed linux redhat 6.2 on the laptop. I compiled the kernel 2.2.16 and compiled the pcmcia cardservices package.

Everything works. I am able to use my other pcmcia cards (3com and Xircom) network and modem cards.

I manually added the FRITZ!Card drive to the pcmcia card services (fcpcmcia_cs.c) and recompiled. I configured /etc/pcmcia/config to recognize the card. I compiled the fcpcmcia.o module. I compiled capi and isdn modules into the kernel.
When I insert the card, the fcpcmcia_cs.o module is unable to determine the IO port of the card. To help understand what is happening, here are the kernel messages when I start the pcmcia card services:

Here is some more information concerning the problem with the FRITZ!Card PCMCIA. I compiled the pcmcia package and the fcpcmcia_cs module with debugging turned on. After inserting the card, I get the following messages:

===========================================

fcpcmcia_cs: fcpcmcia_config(0xc3f7cc80)

i82365: SetMemMap(0, 0, 0x23, 300 ns, 0xa0000000-0xa0000fff, 0x00000)

i82365: SetMemMap(0, 0, 0x23, 300 ns, 0xa0000000-0xa0000fff, 0x00000)

fcpcmcia_cs: testing i/o 0x140-0x148

odd IO request: base 0140 align 0020

i82365: SetMemMap(0, 0, 0x23, 300 ns, 0xa0000000-0xa0000fff, 0x00000)

fcpcmcia_cs: testing i/o 0x300-0x308

odd IO request: base 0300 align 0020

fcpcmcia_cs: RequestIO: No more items

============================================

I haven't had the time to figure out what these "odd" messages indicate. However they may help narrow down the problem.

cs: request_io() calls alloc_io_space() for Port1. This is when the "odd io request" message is generated. However the function returns normally.
cs: request_io() calls alloc_io_space() for Port2. This calls ends with an error.

request_io() calls alloc_io_space() for Port2 since fcpcmcia_cs initializes the socket structures for both ports (see line 164 and 165 of the source code in function fcpcmcia_attach). However, when it calls CardServices() with function RequestIO, it does not specify the base address for Port 2, hence the error.

To fix the problem, I commented out lines 164 and 165 in fcpcmcia_cs.c:

At 06:24 27-08-2000, you wrote:
>I did some debugging of the source code and discovered that the
>following:
>
>fcpcmcia_cs: sets up the request io structure for Port1.
>fcpcmcia_cs: calls CardServices() with function RequestIO and request io structure.
>
>cs: function RequestIO calls request_io() with the request info.
>
>cs: request_io() calls alloc_io_space() for Port1. This is when the "odd io request" message is generated. However the function returns normally.
>cs: request_io() calls alloc_io_space() for Port2. This calls ends with an error.
>
>request_io() calls alloc_io_space() for Port2 since fcpcmcia_cs
>initializes the socket structures for both ports (see line 164 and 165
>of the source code in function fcpcmcia_attach). However, when it calls
>CardServices() with function RequestIO, it does not specify the base
>address for Port 2, hence the error.
>
>To fix the problem, I commented out lines 164 and 165 in fcpcmcia_cs.c:
>
>/*
> link->io.NumPorts2 = 16
> link->io.Attributes2 = IO_DATA_PATH_WIDTH_16
>*/
>
>With this change, the card configures correctly. Unfortunately I do not
>have access to an ISDN line today to test if the card actually works!! I
>will check this tomorrow and post the results.
>
>I will also ask AVM support to confirm if the use of Port2 is necessary
>or if this is a bug. Let's see!
>
>Marc
Hey good work! I was guessing that this could be something like that but I was not sure if that part is in the pcmcia driver or the card driver.
Now for the card driver, it should also be possible to use the hisax driver instead as the card is supported in the kernel. I must say that I don't like the AVM supplied driver because its 100% based for the Suse distribution and SUSE does everything different. Just to make the developers life easier. Recompiling the drivers for my RedHat kernel was a small nightmare until I fixed the Makefile coorrectly. Install of course does put the files at the wrong place and so on. So I prefer to try to fix the hisax driver because that means its also going to work on other platforms like PowerPC or Alpha. I've heard that the card might not work with PowerPC because of the byte order. When I get home to my ISDN line I will try your fix and I will also see what happens on my PowerBook G3.
Andreas Fink
------------------------------------------------------------
Home Address: Albisstr. 48, 8932 Mettmenstetten, Switzerland
Tel: +41-1-7683534, Fax: +41-1-7683531, GSM: +41-79-2457333
------------------------------------------------------------

The uncommenting of those lines did not work for me.
I still get the same error messages like resource
unavailable.
You have apparently traced through the code. Can you tell
me which module calls which one in what sequence?
What entries do you have in /etc/pcmcia/config?
Andreas Fink

Once I made the patch change, I noticed that instead of having an RequestIO error, I had a RequestIRQ error. I was using PCI interrupts (irq_mode=0). I turned this off so that ISA interrupt routing would be used. That solved the problem.
Unfortunately, I still can't make an ISDN connection now that I have the card recognized.

Last night I was looking at the avm ftp site. I went into ftp://ftp.avm.de/pub/cardware/b1/linux and found all the latest stuff including patches for pcmcia-cs. I downloaded the whole think, recompiled pcmcia-cs with the avm patch. The card is now recognized without a problem. I need to compile isdn4linux and capi4linux tonight and see if it works!

I never thought to check in b1 for drivers, however it seems to be the most recent code and it supports the a1 pcmcia card. I recommend that you try this out. You will need to downgrade to pcmcia-cs 3.0.9, but I don't see that as a problem. I am sure they will soon have a patch for the more recent versions.