/* Get network statistics from device. The device driver may provide its own method by setting dev->netdev_ops->get_stats; otherwise the internal statistics structure is used.  */
const struct net_device_stats* dev_get_stats(struct net_device *dev)
/* Get network statistics from device. The device driver may provide its own method by setting dev->netdev_ops->get_stats; otherwise the internal statistics structure is used.  */
const struct net_device_stats* dev_get_stats(struct net_device *dev)
{
	const struct net_device_ops *ops = dev->netdev_ops;
	if (ops->ndo_get_stats)
		return ops->ndo_get_stats(dev);
	dev_txq_stats_fold(dev, &dev->stats);
	return &dev->stats;
}