aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/ethtool.c
diff options
context:
space:
mode:
authorRaju Lakkaraju <Raju.Lakkaraju@microsemi.com>2016-11-17 13:07:23 +0100
committerDavid S. Miller <davem@davemloft.net>2016-11-18 12:12:14 -0500
commit65feddd5b91ba093e47eef026358e0823beedb9c (patch)
tree24a58c05295d6b97e777cdb418d8f50a729e31e5 /net/core/ethtool.c
parentethtool: (uapi) Add ETHTOOL_PHY_DOWNSHIFT to PHY tunables (diff)
downloadlinux-dev-65feddd5b91ba093e47eef026358e0823beedb9c.tar.xz
linux-dev-65feddd5b91ba093e47eef026358e0823beedb9c.zip
ethtool: Core impl for ETHTOOL_PHY_DOWNSHIFT tunable
Adding validation support for the ETHTOOL_PHY_DOWNSHIFT. Functional implementation needs to be done in the individual PHY drivers. Signed-off-by: Raju Lakkaraju <Raju.Lakkaraju@microsemi.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Allan W. Nielsen <allan.nielsen@microsemi.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/ethtool.c')
-rw-r--r--net/core/ethtool.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/net/core/ethtool.c b/net/core/ethtool.c
index 61aebdf9c61b..e9b4556751ff 100644
--- a/net/core/ethtool.c
+++ b/net/core/ethtool.c
@@ -122,6 +122,7 @@ tunable_strings[__ETHTOOL_TUNABLE_COUNT][ETH_GSTRING_LEN] = {
static const char
phy_tunable_strings[__ETHTOOL_PHY_TUNABLE_COUNT][ETH_GSTRING_LEN] = {
[ETHTOOL_ID_UNSPEC] = "Unspec",
+ [ETHTOOL_PHY_DOWNSHIFT] = "phy-downshift",
};
static int ethtool_get_features(struct net_device *dev, void __user *useraddr)
@@ -2435,6 +2436,11 @@ static int ethtool_set_per_queue(struct net_device *dev, void __user *useraddr)
static int ethtool_phy_tunable_valid(const struct ethtool_tunable *tuna)
{
switch (tuna->id) {
+ case ETHTOOL_PHY_DOWNSHIFT:
+ if (tuna->len != sizeof(u8) ||
+ tuna->type_id != ETHTOOL_TUNABLE_U8)
+ return -EINVAL;
+ break;
default:
return -EINVAL;
}