kernels/linux-2.4.0/drivers/net/am79c961a.c
/*
 * Update stats for the transmitted packet
 */
Update stats for the transmitted packet
Update stats for the transmitted packet
static void
am79c961_tx(struct net_device *dev, struct dev_priv *priv)
{
	do {
		u_int hdraddr;
		u_int status;
int bufnum;
bufnum = priv->txtail;
		hdraddr = priv->txhdr + (priv->txtail << 3);
		status = am_readword (dev, hdraddr + 2);
		if (status & TMD_OWN)
			break;
		priv->txtail ++;
		if (priv->txtail >= TX_BUFFERS)
			priv->txtail = 0;
		if (status & TMD_ERR) {
			u_int status2;
			priv->stats.tx_errors ++;
			status2 = am_readword (dev, hdraddr + 6);
			am_writeword (dev, hdraddr + 6, 0);
			if (status2 & TST_RTRY)
				priv->stats.collisions += 16;
			if (status2 & TST_LCOL)
				priv->stats.tx_window_errors ++;
			if (status2 & TST_LCAR)
				priv->stats.tx_carrier_errors ++;
			if (status2 & TST_UFLO)
				priv->stats.tx_fifo_errors ++;
			continue;
		}
		priv->stats.tx_packets ++;
	} while (priv->txtail != priv->txhead);
	netif_wake_queue(dev);
}
static void am79c961_tx ( struct net_device * dev , struct dev_priv * priv ) { do { u_int hdraddr ; u_int status ; int bufnum ; bufnum = priv -> txtail ; hdraddr = priv -> txhdr + ( priv -> txtail << 3 ) ; status = am_readword ( dev , hdraddr + 2 ) ; if ( status & TMD_OWN ) break ; priv -> txtail ++ ; if ( priv -> txtail >= TX_BUFFERS ) priv -> txtail = 0 ; if ( status & TMD_ERR ) { u_int status2 ; priv -> stats . tx_errors ++ ; status2 = am_readword ( dev , hdraddr + 6 ) ; am_writeword ( dev , hdraddr + 6 , 0 ) ; if ( status2 & TST_RTRY ) priv -> stats . collisions += 16 ; if ( status2 & TST_LCOL ) priv -> stats . tx_window_errors ++ ; if ( status2 & TST_LCAR ) priv -> stats . tx_carrier_errors ++ ; if ( status2 & TST_UFLO ) priv -> stats . tx_fifo_errors ++ ; continue ; } priv -> stats . tx_packets ++ ; } while ( priv -> txtail != priv -> txhead ) ; netif_wake_queue ( dev ) ; }
Update stats for the transmitted packet
Update stats for the transmitted packet
/*
			 * Clear the error byte
			 */