mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-24 05:01:03 +02:00
ethtool: provide link state with LINKSTATE_GET request
Implement LINKSTATE_GET netlink request to get link state information. At the moment, only link up flag as provided by ETHTOOL_GLINK ioctl command is returned. LINKSTATE_GET request can be used with NLM_F_DUMP (without device identification) to request the information for all devices in current network namespace providing the data. Signed-off-by: Michal Kubecek <mkubecek@suse.cz> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
1b1b1847c8
commit
3d2b847fb9
@@ -217,3 +217,11 @@ convert_legacy_settings_to_link_ksettings(
|
||||
= legacy_settings->eth_tp_mdix_ctrl;
|
||||
return retval;
|
||||
}
|
||||
|
||||
int __ethtool_get_link(struct net_device *dev)
|
||||
{
|
||||
if (!dev->ethtool_ops->get_link)
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
return netif_running(dev) && dev->ethtool_ops->get_link(dev);
|
||||
}
|
||||
|
Reference in New Issue
Block a user