v0.91 driver released for testing

Donald Becker becker@cesdis1.gsfc.nasa.gov
Sun Apr 18 02:19:52 1999


On Sun, 18 Apr 1999, Shigehiro Nomura wrote:

> I use tulip.c v0.91.  Thank you!
>  LAN card is "TDK LAK-CB100AX".
>    This is CardBus card and the controller is DS21143.
>  PC is Toshiba "Libretto 100".
>    This is a laptop and PCIC is ToPIC95-B(CardBus).
>  OS is Linux-2.2.5 + pcmcia-cs-3.0.9

Thanks for the report.

> But I found some problems during setup tulip driver.
> (v0.91 and v0.90z)

Excellent work!

> 1. MAC address is wrong when chip_rev is 65
>   My LAN card is "TDK LAK-CB100AX"(CardBus).
>   According to the messages from tulip driver, the controller of this
>   card is DS21143 revision 65.
>   In tulip.c v0.91, EEPROM_ADDRLEN is 8 only when chip_rev is 65 and
>   it is cardbus.
>   
>   But, in my system, I got a wrong MAC address when EEPROM_ADDRLEN
>   is 8.  If I set EEPROM_ADDRLEN to 6, I can get right MAC address.
>   I think that EEPROM_ADDRLEN depends on the size of the serial ROM.

OK, my assumption was wrong.
The issue is that the 21143-TD chip (revision 65 is the "-TD" chip) can
optionally use a larger EEPROM and store the CardBus CIS in it.  This saves
having a seperate memory for the CIS.

I haven't figured out a reliable way to detect this larger EEPROM type, and
so just assumed that all -TD CardBus cards would have it.
I would like to clean up this code, since it's the only code that prevents
the driver from supporting both CardBus and PCI devices.

The tulip-diag program uses the following code to detect the larger EEPROM,
but I don't consider it reliable:

	u16 *eew = (u16 *)eeprom_contents;
	u16 andsum = 0xffff;
	addr_size = 6;
	for (i = 0; i < EEPROM_SIZE/2; i++)
		 andsum &= (eew[i] = read_eeprom(ioaddr, i));
 	if (andsum == 0x8000) { /* Try again with the larger size. */
		addr_size = 8;
		for (i = 0; i < EEPROM_SIZE/2; i++)
			andsum &= (eew[i] = read_eeprom(ioaddr, i));
	}

> 2. tulip_resume() calls tulip_open().
>   It seems that request_irq(), MOD_INC_USE_COUNT and init_timer() are
>   executed at every resume event.
>   Is it OK ?

No.  I changed it recently and it's wrong.
Not that it was always correct before -- it lost count when a card was
removed while suspended.
But at least it did do...

>   When I suspend PC and then resume PC, PC hangs up sometimes.
>   At this time, t21142_timer() interrupt routine is continuously
>   called as if there is no interval between interrupts.
> 
>   I think that tulip_resume() needs to call tulip_restart() which is
>   almost same as tulip_open() except request_irq(), MOD_INC_USE_COUNT
>   and init_timer().
> 
> Are these my misunderstanding ?

This is correct.  Excellent work.
A better approach might be to put back the call to tulip_close() on suspend,
and handle the eject-while-suspended case.  I'll check into this.

Donald Becker					  becker@cesdis.gsfc.nasa.gov
USRA-CESDIS, Center of Excellence in Space Data and Information Sciences.
Code 930.5, Goddard Space Flight Center,  Greenbelt, MD.  20771
301-286-0882	     http://cesdis.gsfc.nasa.gov/people/becker/whoiam.html