ethtool: Report link-down while interface is down
authorBen Hutchings <bhutchings@solarflare.com>
Thu, 9 Dec 2010 12:08:35 +0000 (12:08 +0000)
committerWilly Tarreau <w@1wt.eu>
Wed, 18 Jun 2014 22:25:56 +0000 (00:25 +0200)
commitd100b2748ac930237a97646ae9a4721a7f62acc1
tree5fcee71d7e62fbbc17c01227e5cabbbd9d2cd46d
parent7f62be2f53a2353a7e5c124075ec22a4344e8d57
ethtool: Report link-down while interface is down

While an interface is down, many implementations of
ethtool_ops::get_link, including the default, ethtool_op_get_link(),
will report the last link state seen while the interface was up.  In
general the current physical link state is not available if the
interface is down.

Define ETHTOOL_GLINK to reflect whether the interface *and* any
physical port have a working link, and consistently return 0 when the
interface is down.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit e596e6e4d578f2639416e620d367a3af34814a40)
Cc: Wang Weidong <wangweidong1@huawei.com>
Signed-off-by: Willy Tarreau <w@1wt.eu>
include/linux/ethtool.h
net/core/ethtool.c