Subject: Re: CardBus, anyone?
To: Chris G. Demetriou <cgd@netbsd.org>
From: Ken Hornstein <kenh@cmf.nrl.navy.mil>
List: tech-kern
Date: 08/17/1998 13:19:11
>The CardBus _controller_ hardware is generally a superset of the
>PCMCIA hardware.  (I'm not sure if it's required that it be a
>superset, but i don't think i've seen a cardbus implementation which
>doesn't support the ExCA registers.)  The CardBus _card_ hardware, on
>the other hand, may be entirely different.  I mean, why build a
>cardbus card unless you want DMA, etc.

That's what I've seen as well.  This brings up another point ... I've
seen references to a standard "register set" for CardBus bridges
called Yenta (I believe the full name is "PCI to PCMCIA CardBus Bridge
Register Specification").  However, I can't _find_ this specification
anywhere (it's not in the official 13 volume "PC Card Standard" books
that I just bought).  Anyway, since CardBus bridge chip manufacturers
seem to be writing to the "Yenta Specification", it would be easier
to write toward _that_ than a specific chip.

>There are also "interesting" differences in the way the cards need to
>be configured, in the way that CIS is accessed, and in several other
>areas.

Right, I don't understand that yet, but I'm working on it :-/

>Right now, things basically look like:
>
>	ctlr* at parentbus? ...
>	pcmcia* at ctlr? ... slot ?
>	ep* at pcmcia? ...
>
>where, if i recall, 'pcmcia' is a statically configured representation
>of that slot, configured by virtue of the fact that the controller driver
>knows that there's a card slot there.

Okay, I see .... so there's one pcmcia "bus" per slot.

>What I think you want is:
>
>	ctlr* at parentbus? ...
>	pcmcia* at ctlr? ... slot ?
>	cardbus* at ctlr? ... slot ?
>
>	ep* at pccard? ...		# 3com elink3 PCMCIA
>	ewhatever* at cardbus? ...	# 3com cardbus ethernet
>
>where the 'pcmcia' and 'cardbus' nodes are _dynamic_ representations
>of the card in the slot.

Okay, I think I see.  Because you can have either a pcmcia or cardbus
card in a slot, you'd want to do the "bus attachment" _after_ you've
figured out what kind of card you have.

>In terms of source organization, you basically have three classes of code:
>	* pcmcia-specific code (including pcmcia driver attachments)
>	* cardbus-specific code (including cardbus driver attachments)
>	* common code shared by both.
>
>You could split the first two into separate directories, but there'd
>be some common code that would have to live somewhere, which probably
>isn't large enough to deserve its own directory and would be annoying
>to name.  Or, i suppose, you could just dump it all into the pcmcia
>directory.

Other OSs just lump it in with pcmcia; maybe that's the best thing
to do.  I'll think about it some more.

--Ken