Problems with Kernel ISAPnP

From: Jens-Uwe Rumstich (rumstich@informatik.hu-berlin.de)
Date: Thu May 04 2000 - 02:40:39 EST


Hello!

When I tried the 2.3.99 pre series I found that my sound card was not
supported with isapnp, and so I decided to do it, just to learn a bit
about the kernel internas.
Anyway, I have a little problem, it allways tells me it is out of
resources. Its a CS4232 ISA-PnP sound card, and here is the code I am
using:

---- cut ----

                cs4232_card = isapnp_find_card(ISAPNP_VENDOR('C', 'S',
'C'),
                                            ISAPNP_DEVICE(0x1a32),
                                            NULL);

                if(cs4232_card == NULL)
                {
                        printk(KERN_INFO LOGNAME "no card found\n");
                        return(-ENODEV);
                }

                printk(KERN_INFO LOGNAME "CS4232 found!!\n");

                cs4232_dev = NULL;
                cs4232_dev = isapnp_find_dev(NULL,
                                             ISAPNP_VENDOR('C', 'S',
'C'),
                                             ISAPNP_FUNCTION(0x0),
                                             NULL);

                
                if(cs4232_dev == NULL)
                {
                        printk(KERN_INFO LOGNAME "no Device found\n");
                        return(-ENODEV);
                }

                printk(KERN_INFO LOGNAME "CS4232, device 0 found!!\n");

                if (cs4232_dev->prepare(cs4232_dev) < 0)
                {
                        printk(KERN_INFO LOGNAME "prepare failed\n");
                        return(-EAGAIN);
                }

                printk(KERN_INFO LOGNAME "prepare successfull!!\n");

                if(!(cs4232_dev->resource[0].flags & IORESOURCE_IO))
                {
                        printk(KERN_INFO LOGNAME "flags failed\n");
                        return(-ENODEV);
                }

                printk(KERN_INFO LOGNAME "flags successfull!!\n");

                if(cs4232_dev->active)
                {
                        printk(KERN_INFO LOGNAME "card already
activated\n");
                }
                else
                {
                    err = cs4232_dev->activate(cs4232_dev);
                    if(err < 0)
                    {
                        printk(KERN_INFO LOGNAME "isapnp configure
failed [%d] (out of resources??)\n", err);
                        cs4232_dev->deactivate(cs4232_dev);

                        return(-ENOMEM);
                    }
                }

---- cut ----

And here is the output this driver gives me when I start the code above:

---- cut ----

CS4232_ISAPNP: CS4232 found!!
CS4232_ISAPNP: CS4232, device 0 found!!
CS4232_ISAPNP: prepare successfull!!
CS4232_ISAPNP: flags successfull!!
CS4232_ISAPNP: isapnp configure failed [-2] (out of resources??)

---- cut ----

So it tells me it is out of ressources. Since this sound card is beside
a graphic card the only extension card I have in my system I somewhat
doubt it REALLY is out of ressources. And is it not the job of ISAPNP to
take care that such nearly never happens? On the other hand, when I
tried to activate device 3 (onboard midi I guess) it works without a
problem at once. Devices 1, 2 and 4 seems to be not available here
(strange).
Below you can find the dump of my /proc/isapnp, which shows that this
card is not really flexible when it comes to ressources, since it offers
exactly one possibility to most of the needed resources.
My question now is, what I can do to make my (and others;) sound card
activated correctly?

Another problem is, that I also have a network card (at the moment not
in my computer). If I install this one, it gets activated BEFORE the
sound card. And even with this network card having LOTs of possible
ports, Murphy makes sure it selects exactly the only one my sound card
has (220 hex). Is there a solution arround this?

Another thing, how good is the probability, that all cs4232 cards are
identifying themself as card "CSC 1a32"?? If all cards to that, the few
lines above should be enough. If not, I would cut'n paste the code from
sb_card.c, which seems to be simple enough and offers good extensibility
:-) Similar interessesting would be the order of the devices, is that
constant?

Please, if you want to answer this mail, send a cc to me, since I am NOT
on this mailing list!

cu
        Jens-Uwe

--- cut ----
/proc/isapnp

Card 1 'CSC1a32:TerraTec Maestro 32/96' PnP version 1.0 Product version
1.0
  Logical device 0 'CSC0000:Maestro 32/96 WSS,4OP+,SBPro'
    Device is not active
    Active DMA 0,0
    Resources 0
      Priority preferred
      Port 0x534-0x534, align 0x0, size 0x4, 10-bit address decoding
      Port 0x388-0x388, align 0x0, size 0x4, 10-bit address decoding
      Port 0x220-0x220, align 0x0, size 0x10, 10-bit address decoding
      IRQ 5 High-Edge
      DMA 1 8-bit master byte-count type-F
      DMA 0 8-bit master byte-count type-F
  Logical device 1 'CSC1a01:Maestro 32/96 GAME Port'
    Device is not active
  Logical device 2 'CSC0010:Maestro 32/96 CTRL Port'
    Device is not active
    Resources 0
      Priority preferred
      Port 0x538-0x538, align 0x0, size 0x8, 10-bit address decoding
  Logical device 3 'CSC1a04:Maestro 32/96 MIDI-2'
    Device is not active
  Logical device 4 'CSC0003:Maestro 32/96 MIDI-1'
    Device is not active
    Active DMA 0
    Resources 0
      Priority preferred
      Port 0x330-0x330, align 0x0, size 0x2, 10-bit address decoding
      IRQ 2/9 High-Edge

---- cut ----

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun May 07 2000 - 21:00:13 EST