Re: [PATCH] aironet4500_cs.c kmalloc checking

From: Elmer Joandi (elmer@ylenurme.ee)
Date: Wed Aug 09 2000 - 17:24:04 EST


David Hinds wrote:

> Most of the pcmcia drivers have similarly structured initialization
> and cleanup code, but if you look closer, you'll see that it is not
> the same.

yes, I looked them somewhat. The bottom line is that most of this code IS
not needed there - could be taken one level up.

> > 2. What all of those structures/functions mean and under what circumstances
> > may be called and so on ?
> You did write this driver, right?

I wrote driver, but initialization routines I just copied for PCMCIA, because
it was just too much to fit into my small head.
There is the core and then PCI,PNP,ISA, I365(from 2.2 times, to be deleted) and
PCMCIA initializations.

> The Linux PCMCIA web site (pcmcia-cs.sourceforge.net), and every
> distribution of the pcmcia-cs package, includes the Linux PCMCIA
> Programmer's Guide, which is 72 pages of API documentation,

a year ago, when I looked, it wasnt complete. Major problem is that
it is(was) not encapsulated in OO sense, i.e. I have to operate with structures,

when I would like to operate only with functions.
which is general problem with driver-level extentsions, net_device->priv
isnt just enough.
now, I was "porting" my driver to 5 api's - ISA, PCMCIA, old PCI, PNP, new PCI
and really can not understand why I need to go trough all that pain and
crap to get 3 basic things - to know irq, io and to get netdevice registered.

> including
> a walk-through of all the components of a PCMCIA client driver. The
> PCMCIA package also includes a heavily commented skeleton driver
> (dummy_cs).

well, it would be nice to delete that, then people would stop copying that...

> > could I get pcmcia network card initalized with same amount of codelines
> > as ISA and PCI ?
> No, you can't.

I dont believe. Look at eepro100.c , it(the new PCI manager<->driver interface)
has the same logic as PCMCIA but way less crap code than average _cs.c

> There is a hot plug PCI interface in
> 2.4, that also works for CardBus cards, but so far only a few drivers
> use it.

Yes, yes, that I was talking about.Looked yesterday, very nice.
So i82365 does not operate with that interface ?

> And the problems are still being sifted out of that. For
> 16-bit PCMCIA cards, configuration is a lot more complicated than for
> PCI devices.

But can be taken down to very simple one on average case.
Maybe a virtual+fake PCI bus for ISA(made up with probes before PNP enable and
duplicate bad PNP behaviour devices removed after ), PNP,PCMCIA as there is now
nice general pci_* interface.
 I dont believe that most of _cs.c drivers use more specific functionality than
eepro100.c gets from pci_* interface.

elmer.

-
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 : Tue Aug 15 2000 - 21:00:19 EST