> -----Original Message-----
> From: [email protected] [mailto:kernelnewbies-
> [email protected]] On Behalf Of Tushar Dadlani
> Sent: Monday, September 13, 2010 8:56 PM
> To: [email protected]
> Subject: Struct net_device
>
> Hi ,
>
> I wanted to know how do I use eth0 from kernel space. How do i get
> the
> information of running struct net_device references??
>
> I wanted to capture the stats on eth0 from kernel space.
>
I am really not sure what is required here. Please see if below info.
helps (not an expert comment, though :)).
You can get the netdev struct of the interface by name:
struct net_device *netdev = dev_get_by_name("eth0"); // when
netdev->name is eth0.
struct e1000_adapter *adapter = netdev_priv(netdev); // obtain the
adapter.
And you also can take a look at e1000_ethtool.c to obtain the stats for
each interface using the adapter.
Hope it helps.
> --
> Tushar Dadlani
> Manipal Institute of Technology
> +919986292434
>
--
Thanks,
Nilesh
--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to [email protected]
Please read the FAQ at http://kernelnewbies.org/FAQ