Subject: PCMCIA interrupt problem
To: None <port-i386@netbsd.org>
From: Ingolf Koch <ingolf@maus.rz.uni-jena.de>
List: port-i386
Date: 10/27/1998 00:04:21
Hi,

as the Compex LinkPort PCMCIA Ethernet card is not recognized
by 1.3.2, I tried to write the corresponding entry (see kern/6349).
Unfortunately, this did not make the card work perfectly on my
laptop.

I have the following problems:
1) The screen is switched off when
        bus_space_write_1(asict, asich, NE2000_ASIC_RESET, tmp);
   is called (sys/dev/ic/ne2000.c, line 276)
2) From a remote machine, ping to the laptop succeeds (via the
   ethernet card). But nothing more works from remote (no
   traceroute, telnet, etc).
   From the laptop, I can use the network without problems
   (telnet, ftp, nfs mounts, etc).

I suspect, this is an irq problem, so I tried to have another
irq allocated to the card. This is usually irq 5. Probably,
it conflicts with some irq used by the laptop's apm...

As there seems to be no irq option for pcmcia cards in config
files, I changed the "mask" in isa_intr_alloc() (located in
sys/arch/i386/isa/isa_machdep.c, lines 358 ff) to explicitly
exclude irq 5 from being allocated.

This resulted in assigning irq 7 to the card, but after that,
I got timeouts for ne0. Probably, the card still used irq 5,
but the driver software expected irq 7 in this case.

The card's "manual" says that the irq can be configured to
a number other than the default 5.

Is this a standard feature for pcmcia cards (at least i/o cards)?

If so, is the irq number allocated by isa_intr_alloc() indeed
written to the card (or the controller)?

Excerpt from dmesg output:

mainbus0 (root)
isa0 at mainbus0
pcic0 at isa0 port 0x3e0-0x3e1 iomem 0xd0000-0xd3fff: using irq 3
pcic0: controller 0 (Cirrus PD672X) has sockets A and B
pcmcia0 at pcic0 controller 0 socket 0
pcmcia0: CIS version 2.0 or 2.01
pcmcia0: CIS info: PCMCIA, Ethernet Card, ,
pcmcia0: Manufacturer code 0x8a01, product 0x100
pcmcia0: function 0: network adapter, ccr addr 3f8 mask 3
pcmcia0: function 0, config table entry 32: I/O card; irq mask ffff; iomask a, iospace 300-31f; mwait_required rdybsy_active wp_active bvd_active io8 io16 irqlevel
pcmcia0: function 0, config table entry 33: I/O card; irq mask ffff; iomask a, iospace 320-33f; mwait_required rdybsy_active wp_active bvd_active io8 io16 irqlevel
pcmcia0: function 0, config table entry 34: I/O card; irq mask ffff; iomask a, iospace 340-35f; mwait_required rdybsy_active wp_active bvd_active io8 io16 irqlevel
pcmcia0: function 0, config table entry 35: I/O card; irq mask ffff; iomask a, iospace 360-37f; mwait_required rdybsy_active wp_active bvd_active io8 io16 irqlevel
ne0 at pcmcia0 function 0 port 0x340-0x34f port 0x350-0x35f
ne0: Compex LinkPort ENET-B Ethernet
ne0: Ethernet address 01:03:dc:00:ff:17
pcmcia0: card irq 5

Any comments, hints, etc welcome.

Regards
    Ingolf