Subject: Re: Xircom Cardbus Ethernet
To: None <current-users@netbsd.org>
From: Jason R Thorpe <thorpej@zembu.com>
List: current-users
Date: 04/02/2000 12:42:14
--oyUTqETQ0mS9luUI
Content-Type: text/plain; charset=us-ascii

On Wed, Mar 29, 2000 at 07:35:16PM +0200, Feico Dillema wrote:

Hi folks...

I'm really sorry that it has taken me so long to reply on this thread, but
I have been busy with my new job, and all.

 > It gets recognized but it cannot read its ROM properly to get to the
 > hardware address and such. This is what I got (with some extra
 > debugging enabled) from the driver:

Ok, unlike the other Xircom CardBus cards, this one actually has a
DECchip 21143 in it (the others have a Xircom chip that emulates
the 21143, albeit with a few quirks).

 > tlp0 at cardbus0 dev 0 function 0: DECchip 21143 Ethernet, pass 3.0
 > tlp0: SROM size is 2^6*16 bits (128 bytes)
 > SROM CONTENTS:
 >         0x5d 0x11 0x02 0x00 0x87 0x00 0x00 0x00 
 >         0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 
 >         0xa6 0x00 0x00 0x00 0x00 0x00 0x00 0x00 
 >         0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 
 >         0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 
 >         0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 
 >         0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 
 >         0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 
 >         0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 
 >         0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 
 >         0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 
 >         0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 
 >         0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 
 >         0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 
 >         0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 
 >         0x00 0x00 0x00 0x00 0x00 0x00 0x21 0xe0 
 > tlp0: sorry, unable to handle your board

Right, so the Ethernet address is clearly not in the SROM.  It's probably
located in the CIS (like the other Xircom card; the Xircom chip doesn't
have an SROM at all).

I've attached a patch to try.

-- 
        -- Jason R. Thorpe <thorpej@zembu.com>

--oyUTqETQ0mS9luUI
Content-Type: text/plain; charset=us-ascii
Content-Description: if_tlp_cardbus.c patch
Content-Disposition: attachment; filename=foo

Index: if_tlp_cardbus.c
===================================================================
RCS file: /cvsroot/syssrc/sys/dev/cardbus/if_tlp_cardbus.c,v
retrieving revision 1.22
diff -c -r1.22 if_tlp_cardbus.c
*** if_tlp_cardbus.c	2000/03/22 01:35:14	1.22
--- if_tlp_cardbus.c	2000/04/02 19:43:41
***************
*** 325,335 ****
  			sc->sc_mediasw = &tlp_2114x_isv_mediasw;
  		}
  
! 		/*
! 		 * Bail out now if we can't deal with this board.
! 		 */
! 		if (sc->sc_mediasw == NULL)
! 			goto cant_cope;
  		break;
  
  	case TULIP_CHIP_X3201_3:
--- 325,349 ----
  			sc->sc_mediasw = &tlp_2114x_isv_mediasw;
  		}
  
! 		if (sc->sc_mediasw == NULL) {
! 			/*
! 			 * If there's no MAC address in the CIS, bail out
! 			 * now.
! 			 */
! 			if (ca->ca_cis.funce.network.netid_present == 0)
! 				goto cant_cope;
! 
! 			/* Grab the MAC address from the CIS. */
! 			memcpy(enaddr, ca->ca_cis.funce.network.netid,
! 			    sizeof(enaddr));
! 
! 			/*
! 			 * XXX Assume MII-on-SIO.  Should probably use
! 			 * XXX CIS strings to determine the GPIO reset
! 			 * XXX information.
! 			 */
! 			sc->sc_mediasw = &tlp_sio_mii_mediasw;
! 		}
  		break;
  
  	case TULIP_CHIP_X3201_3:
***************
*** 352,357 ****
--- 366,379 ----
  
  	/* Remember which interrupt line. */
  	csc->sc_intrline = ca->ca_intrline;
+ 
+ 	/*
+ 	 * The CardBus cards will make it to store-and-forward mode as
+ 	 * soon as you put them under any kind of load, so just start
+ 	 * out there.
+ 	 */
+ #define	TXTH_SF		4
+ 	sc->sc_txthresh = TXTH_SF;
  
  	/*
  	 * Finish off the attach.

--oyUTqETQ0mS9luUI--