[ECOS] Re: How to get Ethernet link status?

Grant Edwards grante@visi.com
Fri Dec 19 16:57:00 GMT 2008


On 2008-12-17, Grant Edwards <grante@visi.com> wrote:
> On 2008-12-17, Jay Foster <jay@systech.com> wrote:
>
>> You may also be able to use the SIOCGIFSTATS socket ioctl to retrieve the
>> eth_stats (struct ether_drv_stats) structure.  You can get the speed from
>> the speed member and the duplex from the duplex member.  Not all ethernet
>> drivers support the SIOCGIFSTATS ioctl.

I can't figure out what you mean by "ethernet drivers support
the SIOCGIFSTATS ioctl".  My driver suports the
ETH_DRV_GET_IF_STATS control call, but that doesn't seem to be
getting called.  I did find code in the snmp agent that appears
to be using SIOCGIFSTATS, but I have no idea if it actually
works or not  (I still haven't been able to figure out how it's
being used in the SNMP code -- talk about a mess...).

> Bingo! That's what I was looking for. I thought there must be
> an official way to request that info from the driver.

Except I can't get it to work.

I haven't been able to find any real examples or documentation
for SIOCGIFSTATS, nor can I find any connection in the
networking source code between SIOCGIFSTATS and ETH_DRV_GET_IF_STATS.

-- 
Grant Edwards                   grante             Yow! My polyvinyl cowboy
                                  at               wallet was made in Hong
                               visi.com            Kong by Montgomery Clift!


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss



More information about the Ecos-discuss mailing list