Subject: Re: Help! (NetBSD / PCMCIA)
To: Mathias Engan <engan@sm.luth.se>
From: Simon J. Gerraty <sjg@zen.void.oz.au>
List: port-i386
Date: 09/19/1995 22:28:59
> The problem is that it does not recognize
> our network card -- a 3Com 3C589B.

Ok, I've just been down this path... and thanks to Stefan and David I
have  my 3C589 COMBO card running ok.  So I hope this helps the
general effort.

> I find it odd that it finds a com port on the
> network card though.

I didn't get that...

> If there is anyone out there who has any
> experiences with the PCMCIA framework and
> the 3Com 3C589B card, could you outline what
> you did to get the thing to work?

Well after much effort establishing that David's system that worked
was no different to mine that didn't (as far as source code went), I
build a kernel with a serial console and Stefan helped me track the
problem...

The current theory is that either the 3C589 or possibly my PCMCIA
chipset (I have a Toshiba 2130CT) does not assert READY as expected. 
Anyway the following hack got my card working...

The PRINTF's were just for debugging.  The significant change is to
cut the timeout for PCMCIA_OP_WAIT and ignore the error.

--sjg

*** pcmcia.c.old	Thu Jul 13 06:57:42 1995
--- /sys/dev/pcmcia/pcmcia.c	Thu Sep  7 07:58:40 1995
***************
*** 808,819 ****
  	}
  #endif
  
  	if ((err = PCMCIA_SERVICE(pca, link, PCMCIA_OP_WAIT,
! 				  500000, 0)) != 0)
  		PPRINTF(("failed to initialize %d\n", err));
  error:
  	PCMCIA_MAP_MEM(pca, link, 0, 0, 0, PCMCIA_LAST_WIN | PCMCIA_UNMAP);
  	if (err != 0) {
  		for (i = 0; i < pc_cf->memwin; i++) {
  			PCMCIA_MAP_MEM(pca, link,
  				       (caddr_t) pc_cf->mem[i].start,
--- 814,834 ----
  	}
  #endif
  
+ 
+ 	PPRINTF(("pcmcia_mapcard: about to initialize...\n"));
+ 	
+ 
  	if ((err = PCMCIA_SERVICE(pca, link, PCMCIA_OP_WAIT,
! 				  1000, 0)) != 0)
  		PPRINTF(("failed to initialize %d\n", err));
+ 	err=0;
+ 	PPRINTF(("pcmcia_mapcard: initialize gives %d\n", err));
+ 
  error:
  	PCMCIA_MAP_MEM(pca, link, 0, 0, 0, PCMCIA_LAST_WIN | PCMCIA_UNMAP);
  	if (err != 0) {
+ 		PPRINTF(("pcmcia_mapcard: unmaping\n"));
+ 		
  		for (i = 0; i < pc_cf->memwin; i++) {
  			PCMCIA_MAP_MEM(pca, link,
  				       (caddr_t) pc_cf->mem[i].start,