/* Callback from the network layer to allow driver statistics to be resynchronized with hardware collected state. In the case of the velocity we need to pull the MIB counters from the hardware into the counters before letting the network layer display them.  */
static struct net_device_stats* velocity_get_stats(struct net_device *dev)
/* Callback from the network layer to allow driver statistics to be resynchronized with hardware collected state. In the case of the velocity we need to pull the MIB counters from the hardware into the counters before letting the network layer display them.  */
static struct net_device_stats* velocity_get_stats(struct net_device *dev)
{
	struct velocity_info *vptr = netdev_priv(dev);
	if (!netif_running(dev))
		return &dev->stats;
	spin_lock_irq(&vptr->lock);
	velocity_update_hw_mibs(vptr);
	spin_unlock_irq(&vptr->lock);
	dev->stats.rx_packets = vptr->mib_counter[HW_MIB_ifRxAllPkts];
	dev->stats.rx_errors = vptr->mib_counter[HW_MIB_ifRxErrorPkts];
	dev->stats.rx_length_errors = vptr->mib_counter[HW_MIB_ifInRangeLengthErrors];
	dev->stats.collisions = vptr->mib_counter[HW_MIB_ifTxEtherCollisions];
	dev->stats.rx_crc_errors = vptr->mib_counter[HW_MIB_ifRxPktCRCE];
	return &dev->stats;
}