int startup = ! ((tp->chip_id == DC21143 && tp->revision == 65));
int startup = ! ((tp->chip_id == DC21143 && (tp->revision == 48 || tp->revision == 65)));
void t21142_lnk_change(struct net_device *dev, int csr5){	struct tulip_private *tp = netdev_priv(dev);	void __iomem *ioaddr = tp->base_addr;	int csr12 = ioread32(ioaddr + CSR12);	if (tulip_debug > 1)		printk(KERN_INFO"%s: 21143 link status interrupt %8.8x, CSR5 %x, "			   "%8.8x.\n", dev->name, csr12, csr5, ioread32(ioaddr + CSR14));	/* If NWay finished and we have a negotiated partner capability. */	if (tp->nway  &&  !tp->nwayset  &&  (csr12 & 0x7000) == 0x5000) {		int setup_done = 0;		int negotiated = tp->sym_advertise & (csr12 >> 16);		tp->lpar = csr12 >> 16;		tp->nwayset = 1;		if (negotiated & 0x0100)		dev->if_port = 5;		else if (negotiated & 0x0080)	dev->if_port = 3;		else if (negotiated & 0x0040)	dev->if_port = 4;		else if (negotiated & 0x0020)	dev->if_port = 0;		else {			tp->nwayset = 0;			if ((csr12 & 2) == 0  &&  (tp->sym_advertise & 0x0180))				dev->if_port = 3;		}		tp->full_duplex = (tulip_media_cap[dev->if_port] & MediaAlwaysFD) ? 1:0;		if (tulip_debug > 1) {			if (tp->nwayset)				printk(KERN_INFO "%s: Switching to %s based on link "					   "negotiation %4.4x & %4.4x = %4.4x.\n",					   dev->name, medianame[dev->if_port], tp->sym_advertise,					   tp->lpar, negotiated);			else				printk(KERN_INFO "%s: Autonegotiation failed, using %s,"					   " link beat status %4.4x.\n",					   dev->name, medianame[dev->if_port], csr12);		}		if (tp->mtable) {			int i;			for (i = 0; i < tp->mtable->leafcount; i++)				if (tp->mtable->mleaf[i].media == dev->if_port) {					int startup = ! ((tp->chip_id == DC21143 && tp->revision == 65));					tp->cur_index = i;					tulip_select_media(dev, startup);					setup_done = 1;					break;				}		}		if ( ! setup_done) {			tp->csr6 = (dev->if_port & 1 ? 0x838E0000 : 0x82420000) | (tp->csr6 & 0x20ff);			if (tp->full_duplex)				tp->csr6 |= 0x0200;			iowrite32(1, ioaddr + CSR13);		}#if 0							/* Restart shouldn't be needed. */		iowrite32(tp->csr6 | RxOn, ioaddr + CSR6);		if (tulip_debug > 2)			printk(KERN_DEBUG "%s:  Restarting Tx and Rx, CSR5 is %8.8x.\n",				   dev->name, ioread32(ioaddr + CSR5));#endif		tulip_start_rxtx(tp);		if (tulip_debug > 2)			printk(KERN_DEBUG "%s:  Setting CSR6 %8.8x/%x CSR12 %8.8x.\n",				   dev->name, tp->csr6, ioread32(ioaddr + CSR6),				   ioread32(ioaddr + CSR12));	} else if ((tp->nwayset  &&  (csr5 & 0x08000000)				&& (dev->if_port == 3  ||  dev->if_port == 5)				&& (csr12 & 2) == 2) ||			   (tp->nway && (csr5 & (TPLnkFail)))) {		/* Link blew? Maybe restart NWay. */		del_timer_sync(&tp->timer);		t21142_start_nway(dev);		tp->timer.expires = RUN_AT(3*HZ);		add_timer(&tp->timer);	} else if (dev->if_port == 3  ||  dev->if_port == 5) {		if (tulip_debug > 1)			printk(KERN_INFO"%s: 21143 %s link beat %s.\n",				   dev->name, medianame[dev->if_port],				   (csr12 & 2) ? "failed" : "good");		if ((csr12 & 2)  &&  ! tp->medialock) {			del_timer_sync(&tp->timer);			t21142_start_nway(dev);			tp->timer.expires = RUN_AT(3*HZ);			add_timer(&tp->timer);		} else if (dev->if_port == 5)			iowrite32(ioread32(ioaddr + CSR14) & ~0x080, ioaddr + CSR14);	} else if (dev->if_port == 0  ||  dev->if_port == 4) {		if ((csr12 & 4) == 0)			printk(KERN_INFO"%s: 21143 10baseT link beat good.\n",				   dev->name);	} else if (!(csr12 & 4)) {		/* 10mbps link beat good. */		if (tulip_debug)			printk(KERN_INFO"%s: 21143 10mbps sensed media.\n",				   dev->name);		dev->if_port = 0;	} else if (tp->nwayset) {		if (tulip_debug)			printk(KERN_INFO"%s: 21143 using NWay-set %s, csr6 %8.8x.\n",				   dev->name, medianame[dev->if_port], tp->csr6);	} else {		/* 100mbps link beat good. */		if (tulip_debug)			printk(KERN_INFO"%s: 21143 100baseTx sensed media.\n",				   dev->name);		dev->if_port = 3;		tp->csr6 = 0x838E0000 | (tp->csr6 & 0x20ff);		iowrite32(0x0003FF7F, ioaddr + CSR14);		iowrite32(0x0301, ioaddr + CSR12);		tulip_restart_rxtx(tp);	}}