Le jeudi 16 décembre 2010 à 10:31 -0200, Flavio Leitner a écrit :
> -static struct net_device_stats *e1000_get_stats(struct net_device *netdev)
> +struct rtnl_link_stats64 *e1000e_get_stats64(struct net_device *netdev,
> + struct rtnl_link_stats64
> *stats)
> {
> - /* only return the current stats */
> - return &netdev->stats;
> + struct e1000_adapter *adapter = netdev_priv(netdev);
> +
> + memset(stats, 0, sizeof(struct rtnl_link_stats64));
You dont need this memset(), stats is cleared by caller (dev_get_stats()
in net/core/dev.c), as this was always done ;)
> + spin_lock(&adapter->stats64_lock);
> + e1000e_update_stats(adapter);
> + /* Fill out the OS statistics structure */
> + stats->rx_bytes = adapter->stats.gorc;
> + stats->rx_packets = adapter->stats.gprc;
> + stats->tx_bytes = adapter->stats.gotc;
> + stats->tx_packets = adapter->stats.gptc;
> + stats->multicast = adapter->stats.mprc;
> + stats->collisions = adapter->stats.colc;
> +
------------------------------------------------------------------------------
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
_______________________________________________
E1000-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel® Ethernet, visit
http://communities.intel.com/community/wired