Linksys Cardbus and .90k

Bruce Lowekamp lowekamp@poconos.cmcl.cs.cmu.edu
Fri Feb 19 16:55:16 1999


> As per some prior messages on this list, 00:80:00:80:00:80 is caused by
> the EEPROM_SIZE pre-processor macro being set to "6" instead of "8".
> I can only assume that either you forgot the "-DCARDBUS" option when
> compiling,

I mistakenly assumed that the "unintialized reference" messages were
ignorable.  (as I've sometimes seen in beta drivers, but not this
time).

Once I fixed the EEPROM_SIZE and ADDRLEN problems, it started
working.  But, I don't get any performance at all.  I can only pull
15-20Kbps through an ftp.  By contrast, DOS can pull 400Kbps on the
same link and another linux machine on the same hub can pull 500Kbps.
So I suspect there's still a problem here somewhere, although I'm not
sure where.

Following is a patch I made to the code that I suspect may allow the
same code to work with both types of cardbus as well as with regular
PCI cards, but I haven't tested it with anything other than mine, of
course.  I hope that Donald has an idea how to fix the problem more
elegantly, but this takes care of it.

If anyone has any ideas about the performance, please let me know.

Thanks,
Bruce
-- 
Bruce Lowekamp				lowekamp@cs.cmu.edu
http://www.cs.cmu.edu/People/lowekamp/home.html


-------------
*** tulip.c.90p	Fri Feb 19 10:54:14 1999
--- tulip.c	Fri Feb 19 16:38:44 1999
***************
*** 418,428 ****
  #define DESC_RING_WRAP 0x02000000
  
  #ifdef CARDBUS
! #define EEPROM_ADDRLEN (tp->revision == 65 ? 8 : 6)
  #else
  #define EEPROM_ADDRLEN 6
- #endif
  #define EEPROM_SIZE 128 	/* 2 << EEPROM_ADDRLEN */
  
  struct medialeaf {
  	u8 type;
--- 418,431 ----
  #define DESC_RING_WRAP 0x02000000
  
  #ifdef CARDBUS
! #define EEPROM_ADDRLEN (chip_rev == 65 ? 8 : 6)
! #define EEPROM_SIZE (2 << EEPROM_ADDRLEN)
! #define EEPROM_MAX  512
  #else
  #define EEPROM_ADDRLEN 6
  #define EEPROM_SIZE 128 	/* 2 << EEPROM_ADDRLEN */
+ #define EEPROM_MAX  128
+ #endif
  
  struct medialeaf {
  	u8 type;
***************
*** 477,483 ****
  	unsigned int nway:1;				/* 21143 internal NWay. */
  	unsigned int csr0;					/* CSR0 setting. */
  	unsigned int csr6;					/* Current CSR6 control settings. */
! 	unsigned char eeprom[EEPROM_SIZE];	/* Serial EEPROM contents. */
  	u16 to_advertise;					/* NWay capabilities advertised.  */
  	u16 advertising[4];
  	signed char phys[4], mii_cnt;		/* MII device addresses. */
--- 480,486 ----
  	unsigned int nway:1;				/* 21143 internal NWay. */
  	unsigned int csr0;					/* CSR0 setting. */
  	unsigned int csr6;					/* Current CSR6 control settings. */
! 	unsigned char eeprom[EEPROM_MAX];	/* Serial EEPROM contents. */
  	u16 to_advertise;					/* NWay capabilities advertised.  */
  	u16 advertising[4];
  	signed char phys[4], mii_cnt;		/* MII device addresses. */
***************
*** 488,494 ****
  	int pad0, pad1;						/* Used for 8-byte alignment */
  };
  
! static void parse_eeprom(struct device *dev);
  static int read_eeprom(long ioaddr, int location, int addr_len);
  static int mdio_read(struct device *dev, int phy_id, int location);
  static void mdio_write(struct device *dev, int phy_id, int location, int value);
--- 491,497 ----
  	int pad0, pad1;						/* Used for 8-byte alignment */
  };
  
! static void parse_eeprom(struct device *dev, u8 chip_rev);
  static int read_eeprom(long ioaddr, int location, int addr_len);
  static int mdio_read(struct device *dev, int phy_id, int location);
  static void mdio_write(struct device *dev, int phy_id, int location, int value);
***************
*** 779,785 ****
  
  	/* This is logically part of probe1(), but too complex to write inline. */
  	if (tulip_tbl[chip_idx].flags & HAS_MEDIA_TABLE)
! 		parse_eeprom(dev);
  
  	if (media_cap[tp->default_port] & MediaIsMII) {
  		u16 media2advert[] = { 0x20, 0x40, 0x03e0, 0x60, 0x80, 0x100, 0x200 };
--- 782,788 ----
  
  	/* This is logically part of probe1(), but too complex to write inline. */
  	if (tulip_tbl[chip_idx].flags & HAS_MEDIA_TABLE)
! 		parse_eeprom(dev, chip_rev);
  
  	if (media_cap[tp->default_port] & MediaIsMII) {
  		u16 media2advert[] = { 0x20, 0x40, 0x03e0, 0x60, 0x80, 0x100, 0x200 };
***************
*** 941,947 ****
  #define get_u16(ptr) (((u8*)(ptr))[0] + (((u8*)(ptr))[1]<<8))
  #endif
  
! static void parse_eeprom(struct device *dev)
  {
  	/* The last media info list parsed, for multiport boards.  */
  	static struct mediatable *last_mediatable = NULL;
--- 944,950 ----
  #define get_u16(ptr) (((u8*)(ptr))[0] + (((u8*)(ptr))[1]<<8))
  #endif
  
! static void parse_eeprom(struct device *dev, u8 chip_rev)
  {
  	/* The last media info list parsed, for multiport boards.  */
  	static struct mediatable *last_mediatable = NULL;