2001-10-25 16:54:54

by John Weber

[permalink] [raw]
Subject: Kernel PCMCIA

I posted a while ago, and a got a partial answer so I've decided to be
more specific in my query.

Why are hotplug and cardmgr needed? As I understand it, cardbus uses
hotplug for config/init, and other pcmcia cards use cardmgr for init and
/etc/pcmcia/* for config. This seems like a big, smelly mess.

The only documentation I've found (on sourceforge) is a bit dated. Can
anyone point me to some recent documentation?

Also is anyone working on putting the "cardmgr/hotplug" functionality in
the kernel? In my VERY HUMBLE opinion, putting this in the kernel is
akin to having PCI (or some other bus) init code in the kernel, so why
isn't this done?
What's the deal with hotplug vs. kernel-pcmcia-cs?

I don't use modules, so I don't use cardmgr for anything except to tell
the kernel that there is a card in the socket.

I really need a good architectural overview of this in Linux. Any
pointers?


2001-10-25 17:08:36

by Alan

[permalink] [raw]
Subject: Re: Kernel PCMCIA

> Why are hotplug and cardmgr needed? As I understand it, cardbus uses
> hotplug for config/init, and other pcmcia cards use cardmgr for init and
> /etc/pcmcia/* for config. This seems like a big, smelly mess.

It is in user space because
o It is possible to put it in user space
o The mappings can be complex and are best done in userspace
o User space is best positioned to make further complex
decisions
o User space is best positioned to run scripts/tools as needed
on a hot plug event

2001-10-25 17:12:14

by Linus Torvalds

[permalink] [raw]
Subject: Re: Kernel PCMCIA

In article <[email protected]>,
John Weber <[email protected]> wrote:
>
>Why are hotplug and cardmgr needed? As I understand it, cardbus uses
>hotplug for config/init, and other pcmcia cards use cardmgr for init and
>/etc/pcmcia/* for config. This seems like a big, smelly mess.

I'd personally love to get rid of cardmgr, and in fact you do not need
it with true 32-bit cards and proper PCI drivers, because the drivers
have sane plug/unplug semantics.

In fact, with CardBus cards, you don't strictly need /sbin/hotplug
either: /sbin/hotplug is nothing but a _notification_ thing, and as such
you can easily for example just compile the proper PCI driver into the
kernel, and the driver will automatically find and configure the card,
and if you don't insert/remove it at run-time you can consider the
CardBus slot just another PCI slot.

So the "/sbin/hotplug" is really not a cardbus thing at all: it's just
the kernels way of telling user space that "hey, you might want to load
a driver" (if the kernel didn't find one pre-loaded) or "hey, I just got
a new network card, maybe you should set up routing etc?"

In fact /sbin/hotplug works well for non-CardBus events too, like USB.

Now comes the ugly part.

When I wrote the new CardBus code I didn't want to know about how 16-bit
PCMCIA works (I still mostly don't, but the pain of having to have
cardmgr might some day push me over the edge), so 16-bit PCMCIA cards
are handled with all the old legacy stuff, and they don't understand
about /sbin/hotplug and friends.

If somebody who knows 16-bit PCMCIA wants to change the "hey, I need a
driver" code to use /sbin/hotplug and not need cardmgr, I'd be thrilled.

>I don't use modules, so I don't use cardmgr for anything except to tell
>the kernel that there is a card in the socket.

You shouldn't even need that, if the 16-bit PCMCIA drivers weren't too
damn helpless..

Linus