Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 11 Oct 1997 02:12:44 -0700
From:      Andrew McRae <amcrae@cisco.com>
To:        phk@critter.freebsd.dk
Cc:        hackers@freebsd.org
Subject:   Re: pccard driver questions (FreeBSD 2.2.2-RELEASE + PAO-970616)
Message-ID:  <199710110912.CAA06638@doberman.cisco.com>

next in thread | raw e-mail | index | archive | help
phk@critter.freebsd.dk (Poul-Henning Kamp):
>>The only other driver I've seen in the FreeBSD source pool which seems
>>to want to play with 'uiomove()' and window mappings like this is
>>sys/i386/isa/scc.c, but the driver is rife with comments of the form:
>>"bad things will happen if you pull the card out while the system is
>>running"
> 
> This you can write above any instruction which accesses a pccard.  
> With the "surprise style" (as opposed to "VCR-style") eject mechanism
> the hardware may be gone without notice from one instruction to the
> next.  Nothing you can do about it.

This, unfortunately, is one of the downsides of the random
hot-swap PC-Card technology. However, PC-Cards do have some
protection here; the socket has slightly shorter pins
for the card detection, so that you get a small (indeterminate?)
delay between the detection of the eject, and the power
being removed from the card. If your accesses are short enough, and
you are not spending inordinate amounts of time in your ISR,
then you should be fairly safe (ie we can't tell you how thin
the ice).

>>My second question has to do with the way slot controller chips are
>>probed. From looking at 'pcic_probe()' in sys/pccard/pcic.c, it looks
>>for all the world to me that only a single slot controller chip is
>>supported (i.e., there are no unit numbers, and there is only one
>>statically-allocated "slot_ctrl" struct). Is it true that FreeBSD
>>currently only supports one slot controller chip (which controls two
>>slots), or am I missing something? (I'm hoping the folks working on
>>-current might have some knowledge on this...)
> 
> Well, the overall framework does support it, the actual code may not.
> I should be a minor thing to get it fixed, give a little bit of 
> hardware and time.

The architecture should allow multiple slot controllers,
theoretically - at the time, it was a not a high priority.
> 
> I don't actually know if we have the necessary callbacks into the 
> pcic driver to modify the memory windows on the fly.  If not we
> will need to add them.
> --
> Poul-Henning Kamp             FreeBSD coreteam member
> phk@FreeBSD.ORG               "Real hackers run -current on their laptop."

When I did the original PC-Card stuff, the intention was to allow
processes to map the memory windows as desired, and then use the
usual device I/O to read or write the memory. The pccard daemon
does this to read the card configuration. Is this
sufficient for this application?

Cheers,
Andrew McRae.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199710110912.CAA06638>