[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1478255742-25693-5-git-send-email-allan.nielsen@microsemi.com>
Date: Fri, 4 Nov 2016 11:35:41 +0100
From: "Allan W. Nielsen" <allan.nielsen@...rosemi.com>
To: <netdev@...r.kernel.org>
CC: <andrew@...n.ch>, <f.fainelli@...il.com>,
<raju.lakkaraju@...rosemi.com>, <allan.nielsen@...rosemi.com>,
<cphealy@...il.com>, <robh@...nel.org>,
"Raju Lakkaraju" <Raju.Lakkaraju@...rosemi.com>
Subject: [PATCH net-next 4/5] ethtool: Core impl for ETHTOOL_PHY_DOWNSHIFT tunable
From: Raju Lakkaraju <Raju.Lakkaraju@...rosemi.com>
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@...rosemi.com>
Signed-off-by: Allan W. Nielsen <allan.nielsen@...rosemi.com>
---
net/core/ethtool.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/net/core/ethtool.c b/net/core/ethtool.c
index 75f19ab..1a66faa 100644
--- a/net/core/ethtool.c
+++ b/net/core/ethtool.c
@@ -2425,6 +2425,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;
}
--
2.7.3
Powered by blists - more mailing lists