I'm writing a driver and I want to get network counters of some device within it. What data structure holds that information and how can I access it?
views:
21answers:
1
+2
A:
First, use dev_get_by_name to get a pointer to the struct net_device of the interface.
Then, the net_device structure has a pointer to the stats function, which is declared as:
struct net_device_stats *(*get_stats)(struct net_device *dev);
The net_device_stats structure contains the information you want.
Matias Valdenegro
2010-06-24 17:38:38