linux-2.6.0/drivers/net/3c509.c
/*  Update statistics.  We change to register window 6, so this should be run
	single-threaded if the device is active. This is expected to be a rare
	operation, and it's simpler for the rest of the driver to assume that
	window 1 is always valid rather than use a special window-state variable.
	*/
Update statistics.  We change to register window 6, so this should be run
single-threaded if the device is active. This is expected to be a rare
operation, and it's simpler for the rest of the driver to assume that
window 1 is always valid rather than use a special window-state variable.
Update statistics . We change to register window 6 so this should be run single - threaded if the device is active . This is expected to be a rare operation and it ' s simpler for the rest of the driver to assume that window 1 is always valid rather than use a special window - state variable .
static void update_stats(struct net_device *dev)
{
	struct el3_private *lp = (struct el3_private *)dev->priv;
	int ioaddr = dev->base_addr;
	if (el3_debug > 5)
		printk("   Updating the statistics.\n");
	outw(StatsDisable, ioaddr + EL3_CMD);
	EL3WINDOW(6);
	lp->stats.tx_carrier_errors 	+= inb(ioaddr + 0);
	lp->stats.tx_heartbeat_errors	+= inb(ioaddr + 1);
		   inb(ioaddr + 2);
	lp->stats.collisions		+= inb(ioaddr + 3);
	lp->stats.tx_window_errors	+= inb(ioaddr + 4);
	lp->stats.rx_fifo_errors	+= inb(ioaddr + 5);
	lp->stats.tx_packets		+= inb(ioaddr + 6);
			   inb(ioaddr + 7);
			   inb(ioaddr + 8);
	inw(ioaddr + 10);	
	inw(ioaddr + 12);
	EL3WINDOW(1);
	outw(StatsEnable, ioaddr + EL3_CMD);
	return;
}
static void update_stats ( struct net_device * dev ) { struct el3_private * lp = ( struct el3_private * ) dev -> priv ; int ioaddr = dev -> base_addr ; if ( el3_debug > 5 ) printk ( " \n " ) ; outw ( StatsDisable , ioaddr + EL3_CMD ) ; EL3WINDOW ( 6 ) ; lp -> stats . tx_carrier_errors += inb ( ioaddr + 0 ) ; lp -> stats . tx_heartbeat_errors += inb ( ioaddr + 1 ) ; inb ( ioaddr + 2 ) ; lp -> stats . collisions += inb ( ioaddr + 3 ) ; lp -> stats . tx_window_errors += inb ( ioaddr + 4 ) ; lp -> stats . rx_fifo_errors += inb ( ioaddr + 5 ) ; lp -> stats . tx_packets += inb ( ioaddr + 6 ) ; inb ( ioaddr + 7 ) ; inb ( ioaddr + 8 ) ; inw ( ioaddr + 10 ) ; inw ( ioaddr + 12 ) ; EL3WINDOW ( 1 ) ; outw ( StatsEnable , ioaddr + EL3_CMD ) ; return ; }
Update statistics.
Update statistics .
/* Turn off statistics updates while reading. */ /* Switch to the stats window, and read everything. */ /* Multiple collisions. */ /* Rx packets	*/ /* Tx deferrals */ /* Total Rx and Tx octets. */ /* Back to window 1, and turn statistics back on. */