struct DEVICE *dev = (struct DEVICE *) data; 
struct net_device *dev = (struct net_device *) data; 
static void uli526x_timer(unsigned long data){	u32 tmp_cr8;	unsigned char tmp_cr12=0;	struct DEVICE *dev = (struct DEVICE *) data;	struct uli526x_board_info *db = netdev_priv(dev); 	unsigned long flags;	u8 TmpSpeed=10;		//ULI526X_DBUG(0, "uli526x_timer()", 0);	spin_lock_irqsave(&db->lock, flags);		/* Dynamic reset ULI526X : system error or transmit time-out */	tmp_cr8 = inl(db->ioaddr + DCR8);	if ( (db->interval_rx_cnt==0) && (tmp_cr8) ) {		db->reset_cr8++;		db->wait_reset = 1;	}	db->interval_rx_cnt = 0;	/* TX polling kick monitor */	if ( db->tx_packet_cnt &&	     time_after(jiffies, dev->trans_start + ULI526X_TX_KICK) ) {		outl(0x1, dev->base_addr + DCR1);   // Tx polling again 		// TX Timeout 		if ( time_after(jiffies, dev->trans_start + ULI526X_TX_TIMEOUT) ) {			db->reset_TXtimeout++;			db->wait_reset = 1;			printk( "%s: Tx timeout - resetting\n",			       dev->name);		}	}	if (db->wait_reset) {		ULI526X_DBUG(0, "Dynamic Reset device", db->tx_packet_cnt);		db->reset_count++;		uli526x_dynamic_reset(dev);		db->timer.expires = ULI526X_TIMER_WUT;		add_timer(&db->timer);		spin_unlock_irqrestore(&db->lock, flags);		return;	}	/* Link status check, Dynamic media type change */	if((phy_read(db->ioaddr, db->phy_addr, 5, db->chip_id) & 0x01e0)!=0)		tmp_cr12 = 3;	if ( !(tmp_cr12 & 0x3) && !db->link_failed ) {		/* Link Failed */		ULI526X_DBUG(0, "Link Failed", tmp_cr12);		netif_carrier_off(dev);		printk(KERN_INFO "uli526x: %s NIC Link is Down\n",dev->name);		db->link_failed = 1;		/* For Force 10/100M Half/Full mode: Enable Auto-Nego mode */		/* AUTO don't need */		if ( !(db->media_mode & 0x8) )			phy_write(db->ioaddr, db->phy_addr, 0, 0x1000, db->chip_id);		/* AUTO mode, if INT phyxcer link failed, select EXT device */		if (db->media_mode & ULI526X_AUTO) {			db->cr6_data&=~0x00000200;	/* bit9=0, HD mode */			update_cr6(db->cr6_data, db->ioaddr);		}	} else		if ((tmp_cr12 & 0x3) && db->link_failed) {			ULI526X_DBUG(0, "Link link OK", tmp_cr12);			db->link_failed = 0;			/* Auto Sense Speed */			if ( (db->media_mode & ULI526X_AUTO) &&				uli526x_sense_speed(db) )				db->link_failed = 1;			uli526x_process_mode(db);						if(db->link_failed==0)			{				if(db->op_mode==ULI526X_100MHF || db->op_mode==ULI526X_100MFD)				{					TmpSpeed = 100;				}				if(db->op_mode==ULI526X_10MFD || db->op_mode==ULI526X_100MFD)				{					printk(KERN_INFO "uli526x: %s NIC Link is Up %d Mbps Full duplex\n",dev->name,TmpSpeed);				}				else				{					printk(KERN_INFO "uli526x: %s NIC Link is Up %d Mbps Half duplex\n",dev->name,TmpSpeed);				}				netif_carrier_on(dev);			}			/* SHOW_MEDIA_TYPE(db->op_mode); */		}		else if(!(tmp_cr12 & 0x3) && db->link_failed)		{			if(db->init==1)			{				printk(KERN_INFO "uli526x: %s NIC Link is Down\n",dev->name);				netif_carrier_off(dev);			}		}		db->init=0;	/* Timer active again */	db->timer.expires = ULI526X_TIMER_WUT;	add_timer(&db->timer);	spin_unlock_irqrestore(&db->lock, flags);}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/945a787675cc5ba362f5d4ce135d2a2c20be5985/uli526x.c/buggy/drivers/net/tulip/uli526x.c