Subject: Re: PCMCIA support for D-Link DE-650
To: Eric S. Hvozda <hvozda@netcom.com>
From: Jason Thorpe <thorpej@nas.nasa.gov>
List: current-users
Date: 11/07/1997 10:47:45
On Thu, 06 Nov 1997 23:00:50 -0500 
 "Eric S. Hvozda" <hvozda@netcom.com> wrote:

 > I see that ne has been broken out from ed.  Further I see the new
 > PCMCIA system uses the CIS to obtain valid iospaces.  This is a
 > Good Thing.

Actually, it's not.  The "valid i/o spaces" exist for one reason, and
one reason only: to hint less clever operating systems where the device
should be places so that a regular ISA driver will work.

PCMCIA cards decode only the lower few address bits, and can be placed
anywhere in i/o space, really.  The top bits of the address are decoded
by the PCMCIA controller chip, providing the card with an "i/o window".

 > However, why does it insist on using 0x400 when it's not listed
 > as a valid iospace?  

The reason for using 0x400 is that it is Very Unlikely that it will
conflict with legacy ISA devices.  However, the problem is that several
laptops only wire up the PCIC with 10 address bits.  This means that
the PCMCIA cards can only have 0x300->0x3ff addresses.  The main problem
here is that there are some laptops that have 12-bit addresses for 
PCMCIA cards that _really_ don't like it when cards are placed in
the 0x300->0x31f range.  My NEC Versa 6030X is one such machine.

This means that if I use the "valid i/o space" listed in an NE2000 clone's
CIS, the machine hangs.  "Ick."

 > This particular card worked fine under jtk's work; I'm a bit surprised
 > it doesn't now.  If I build a 1.2.1 kernel and try to use 0x400
 > as the iospace, it fails as well.

The reason for that is the probe to detect PCICs with only 10 address
bits is not very robust.  As far as I can tell, it only works for one
particular laptop.

I did recently address this issue, however.  I changed the code to
use 0x330 -> 0x3ff instead of 0x400 -> 0xfff in the "12-bit" case,
because the test for 12-bit returned too many false positives, and
the laptops which were known to fail with 0x300->0x3ff seem to work
OK with 0x330->0x3ff.

In other words, "update your sources"  :-)

Jason R. Thorpe                                       thorpej@nas.nasa.gov
NASA Ames Research Center                            Home: +1 408 866 1912
NAS: M/S 258-6                                       Work: +1 650 604 0935
Moffett Field, CA 94035                             Pager: +1 415 428 6939