From: Simon Stewart (sms@lateral.net)
Date: Mon Jan 21 2002 - 12:56:25 EST

I've recently started hankering for a simple way to get some
information about the physical state of my NICSs from the kernel, and
there doesn't appear to be one, yet. I'd like information such as:

* Link status (connected? disconnected?)

* Physical connector type (BNC, RJ45?)

* Connection speed (10/100/1000Mbps? Was this determined by

* Full or half duplex?

In addition, it would be handy to be able to force some of these
settings (such as connection speed) should I need to. There are tools
such as mii-diag out there, but these appear to be specific to each
net device driver, and are therefore wholly unsuitable for automated
testing (such as by a generic script run from a cron-job)

I picture a /proc/net/devices directory, populated with subdirectories
for each of the available interfaces detected in the machine. Within
these directories would be plain ASCII files that can be read to
determine the state of the interface, and written to in order to force
certain characteristics. However, in order to do this, there will need
to be some fairly major changes to the net_device struct[1] Since this
has comments indicating that it's in need of an overhaul (at least in
the 2.4) I don't see that as a massive problem.

What would be added? Function pointers that can be used to read or
write the 4 things above (ie. at least 8 pointers) If the pointer is
NULL, then obviously, the NIC doesn't support that behaviour, but if
it does, then I would expect the result to be consistant (for example,
linux/netdevice.h has an enum for the "media selection options", which
is often ignored for driver specific varients)

Hopefully, I'll be able to manufacture some time in order to try and
hack a preliminary version of this together in the near future, but
firstly, what do you lot think of the idea, and secondly, how
practical is it?



[1] I believe that this is the most suitable struct, since it appears
    to deal with the physical characteristics of a NIC.

When C++ is your hammer, everything looks like a thumb
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

This archive was generated by hypermail 2b29 : Wed Jan 23 2002 - 21:01:13 EST