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

Grant Edwards grante@visi.com
Wed Dec 17 20:09:00 GMT 2008

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.

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

I just need to add a couple lines of code to our Ethernet
driver to fill in a few more fields in the return struct.  Right
now all it fills in are the p->description and p->snmp_chipset
fields.  I'm not exactly sure why -- it could be that it was
that way in the driver that we used as a starting point, or it
could be due to the fact that on our early platforms link
status info wasn't available.

Grant Edwards                   grante             Yow! Everybody is going
                                  at               somewhere!!  It's probably
                               visi.com            a garage sale or a disaster

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