outw(FakeIntr, ioaddr + EL3_CMD); 
iowrite16(FakeIntr, ioaddr + EL3_CMD); 
vortex_timer(unsigned long data){	struct net_device *dev = (struct net_device *)data;	struct vortex_private *vp = netdev_priv(dev);	long ioaddr = dev->base_addr;	int next_tick = 60*HZ;	int ok = 0;	int media_status, mii_status, old_window;	if (vortex_debug > 2) {		printk(KERN_DEBUG "%s: Media selection timer tick happened, %s.\n",			   dev->name, media_tbl[dev->if_port].name);		printk(KERN_DEBUG "dev->watchdog_timeo=%d\n", dev->watchdog_timeo);	}	if (vp->medialock)		goto leave_media_alone;	disable_irq(dev->irq);	old_window = inw(ioaddr + EL3_CMD) >> 13;	EL3WINDOW(4);	media_status = inw(ioaddr + Wn4_Media);	switch (dev->if_port) {	case XCVR_10baseT:  case XCVR_100baseTx:  case XCVR_100baseFx:		if (media_status & Media_LnkBeat) {			netif_carrier_on(dev);			ok = 1;			if (vortex_debug > 1)				printk(KERN_DEBUG "%s: Media %s has link beat, %x.\n",					   dev->name, media_tbl[dev->if_port].name, media_status);		} else {			netif_carrier_off(dev);			if (vortex_debug > 1) {				printk(KERN_DEBUG "%s: Media %s has no link beat, %x.\n",					   dev->name, media_tbl[dev->if_port].name, media_status);			}		}		break;	case XCVR_MII: case XCVR_NWAY:		{			spin_lock_bh(&vp->lock);			mii_status = mdio_read(dev, vp->phys[0], 1);			mii_status = mdio_read(dev, vp->phys[0], 1);			ok = 1;			if (vortex_debug > 2)				printk(KERN_DEBUG "%s: MII transceiver has status %4.4x.\n",					dev->name, mii_status);			if (mii_status & BMSR_LSTATUS) {				int mii_reg5 = mdio_read(dev, vp->phys[0], 5);				if (! vp->force_fd  &&  mii_reg5 != 0xffff) {					int duplex;					mii_reg5 &= vp->advertising;					duplex = (mii_reg5&0x0100) || (mii_reg5 & 0x01C0) == 0x0040;					if (vp->full_duplex != duplex) {						vp->full_duplex = duplex;						printk(KERN_INFO "%s: Setting %s-duplex based on MII "							"#%d link partner capability of %4.4x.\n",							dev->name, vp->full_duplex ? "full" : "half",							vp->phys[0], mii_reg5);						/* Set the full-duplex bit. */						EL3WINDOW(3);						outw(	(vp->full_duplex ? 0x20 : 0) |								(vp->large_frames ? 0x40 : 0) |								((vp->full_duplex && vp->flow_ctrl && vp->partner_flow_ctrl) ? 0x100 : 0),								ioaddr + Wn3_MAC_Ctrl);						if (vortex_debug > 1)							printk(KERN_DEBUG "Setting duplex in Wn3_MAC_Ctrl\n");						/* AKPM: bug: should reset Tx and Rx after setting Duplex.  Page 180 */					}				}				netif_carrier_on(dev);			} else {				netif_carrier_off(dev);			}			spin_unlock_bh(&vp->lock);		}		break;	  default:					/* Other media types handled by Tx timeouts. */		if (vortex_debug > 1)		  printk(KERN_DEBUG "%s: Media %s has no indication, %x.\n",				 dev->name, media_tbl[dev->if_port].name, media_status);		ok = 1;	}	if ( ! ok) {		unsigned int config;		do {			dev->if_port = media_tbl[dev->if_port].next;		} while ( ! (vp->available_media & media_tbl[dev->if_port].mask));		if (dev->if_port == XCVR_Default) { /* Go back to default. */		  dev->if_port = vp->default_media;		  if (vortex_debug > 1)			printk(KERN_DEBUG "%s: Media selection failing, using default "				   "%s port.\n",				   dev->name, media_tbl[dev->if_port].name);		} else {			if (vortex_debug > 1)				printk(KERN_DEBUG "%s: Media selection failed, now trying "					   "%s port.\n",					   dev->name, media_tbl[dev->if_port].name);			next_tick = media_tbl[dev->if_port].wait;		}		outw((media_status & ~(Media_10TP|Media_SQE)) |			 media_tbl[dev->if_port].media_bits, ioaddr + Wn4_Media);		EL3WINDOW(3);		config = inl(ioaddr + Wn3_Config);		config = BFINS(config, dev->if_port, 20, 4);		outl(config, ioaddr + Wn3_Config);		outw(dev->if_port == XCVR_10base2 ? StartCoax : StopCoax,			 ioaddr + EL3_CMD);		if (vortex_debug > 1)			printk(KERN_DEBUG "wrote 0x%08x to Wn3_Config\n", config);		/* AKPM: FIXME: Should reset Rx & Tx here.  P60 of 3c90xc.pdf */	}	EL3WINDOW(old_window);	enable_irq(dev->irq);leave_media_alone:	if (vortex_debug > 2)	  printk(KERN_DEBUG "%s: Media selection timer finished, %s.\n",			 dev->name, media_tbl[dev->if_port].name);	mod_timer(&vp->timer, RUN_AT(next_tick));	if (vp->deferred)		outw(FakeIntr, ioaddr + EL3_CMD);	return;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/62afe595de7aaac6c140103a34dc8c208afa34e7/3c59x.c/buggy/drivers/net/3c59x.c