diff options
author | Andy Gospodarek <andy@greyhouse.net> | 2009-10-02 09:26:12 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-10-05 00:43:35 -0700 |
commit | d519e17e2d01a0ee9abe083019532061b4438065 (patch) | |
tree | 3f90e369fe65ff84dc46ec513f758b51a2834559 /drivers | |
parent | 053a93dd126f68ba37973f95f00af6045fa7c957 (diff) | |
download | kernel_samsung_tuna-d519e17e2d01a0ee9abe083019532061b4438065.zip kernel_samsung_tuna-d519e17e2d01a0ee9abe083019532061b4438065.tar.gz kernel_samsung_tuna-d519e17e2d01a0ee9abe083019532061b4438065.tar.bz2 |
net: export device speed and duplex via sysfs
This patch exports the link-speed (in Mbps) and duplex of an interface
via sysfs. This eliminates the need to use ethtool just to check the
link-speed. Not requiring 'ethtool' and not relying on the SIOCETHTOOL
ioctl should be helpful in an embedded environment where space is at a
premium as well.
NOTE: This patch also intentionally allows non-root users to check the link
speed and duplex -- something not possible with ethtool.
Here's some sample output:
# cat /sys/class/net/eth0/speed
100
# cat /sys/class/net/eth0/duplex
half
# ethtool eth0
Settings for eth0:
Supported ports: [ TP ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Supports auto-negotiation: Yes
Advertised link modes: Not reported
Advertised auto-negotiation: No
Speed: 100Mb/s
Duplex: Half
Port: Twisted Pair
PHYAD: 1
Transceiver: internal
Auto-negotiation: off
Supports Wake-on: g
Wake-on: g
Current message level: 0x000000ff (255)
Link detected: yes
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
0 files changed, 0 insertions, 0 deletions