From: yegorslists@googlemail.com
To: netdev@vger.kernel.org
Cc: linux-omap@vger.kernel.org, grygorii.strashko@ti.com,
mugunthanvnm@ti.com, roszenrami@gmail.com,
Yegor Yefremov <yegorslists@googlemail.com>
Subject: [PATCH v2] cpsw: ethtool: add support for getting/setting EEE registers
Date: Wed, 23 Nov 2016 15:38:33 +0100 [thread overview]
Message-ID: <1479911913-1761-1-git-send-email-yegorslists@googlemail.com> (raw)
From: Yegor Yefremov <yegorslists@googlemail.com>
Add the ability to query and set Energy Efficient Ethernet parameters
via ethtool for applicable devices.
Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
---
Changes:
v2: make routines static (Rami Rosen)
drivers/net/ethernet/ti/cpsw.c | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
index c6cff3d..c706540 100644
--- a/drivers/net/ethernet/ti/cpsw.c
+++ b/drivers/net/ethernet/ti/cpsw.c
@@ -2239,6 +2239,30 @@ static int cpsw_set_channels(struct net_device *ndev,
return ret;
}
+static int cpsw_get_eee(struct net_device *ndev, struct ethtool_eee *edata)
+{
+ struct cpsw_priv *priv = netdev_priv(ndev);
+ struct cpsw_common *cpsw = priv->cpsw;
+ int slave_no = cpsw_slave_index(cpsw, priv);
+
+ if (cpsw->slaves[slave_no].phy)
+ return phy_ethtool_get_eee(cpsw->slaves[slave_no].phy, edata);
+ else
+ return -EOPNOTSUPP;
+}
+
+static int cpsw_set_eee(struct net_device *ndev, struct ethtool_eee *edata)
+{
+ struct cpsw_priv *priv = netdev_priv(ndev);
+ struct cpsw_common *cpsw = priv->cpsw;
+ int slave_no = cpsw_slave_index(cpsw, priv);
+
+ if (cpsw->slaves[slave_no].phy)
+ return phy_ethtool_set_eee(cpsw->slaves[slave_no].phy, edata);
+ else
+ return -EOPNOTSUPP;
+}
+
static const struct ethtool_ops cpsw_ethtool_ops = {
.get_drvinfo = cpsw_get_drvinfo,
.get_msglevel = cpsw_get_msglevel,
@@ -2262,6 +2286,8 @@ static const struct ethtool_ops cpsw_ethtool_ops = {
.complete = cpsw_ethtool_op_complete,
.get_channels = cpsw_get_channels,
.set_channels = cpsw_set_channels,
+ .get_eee = cpsw_get_eee,
+ .set_eee = cpsw_set_eee,
};
static void cpsw_slave_init(struct cpsw_slave *slave, struct cpsw_common *cpsw,
--
2.1.4
next reply other threads:[~2016-11-23 14:38 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-23 14:38 yegorslists [this message]
2016-11-23 14:47 ` [PATCH v2] cpsw: ethtool: add support for getting/setting EEE registers Rami Rosen
2016-11-23 17:33 ` Florian Fainelli
2016-11-23 20:08 ` Yegor Yefremov
2016-11-23 20:15 ` Florian Fainelli
2016-11-24 9:25 ` Yegor Yefremov
2016-11-24 15:38 ` Andrew Lunn
2016-11-24 18:23 ` Florian Fainelli
2016-12-02 9:11 ` Giuseppe CAVALLARO
2016-12-02 17:48 ` Florian Fainelli
2017-01-04 14:33 ` Florian Fainelli
2017-04-18 13:23 ` Niklas Cassel
2017-04-18 16:40 ` Florian Fainelli
2017-04-25 9:06 ` Niklas Cassel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1479911913-1761-1-git-send-email-yegorslists@googlemail.com \
--to=yegorslists@googlemail.com \
--cc=grygorii.strashko@ti.com \
--cc=linux-omap@vger.kernel.org \
--cc=mugunthanvnm@ti.com \
--cc=netdev@vger.kernel.org \
--cc=roszenrami@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).