From: Andrew Lunn <andrew@lunn.ch>
To: Marek Vasut <marex@denx.de>
Cc: netdev@vger.kernel.org, o.rempel@pengutronix.de,
Florian Fainelli <f.fainelli@gmail.com>,
Guenter Roeck <linux@roeck-us.net>,
Heiner Kallweit <hkallweit1@gmail.com>,
Jean Delvare <jdelvare@suse.com>
Subject: Re: [RFC][PATCH 1/2] ethtool: Add BroadRReach Master/Slave PHY tunable
Date: Wed, 25 Mar 2020 14:43:30 +0100 [thread overview]
Message-ID: <20200325134330.GD3819@lunn.ch> (raw)
In-Reply-To: <20200325101736.2100-1-marex@denx.de>
On Wed, Mar 25, 2020 at 11:17:35AM +0100, Marek Vasut wrote:
> Add a PHY tunable to select BroadRReach PHY Master/Slave mode.
>
> Signed-off-by: Marek Vasut <marex@denx.de>
> Cc: Andrew Lunn <andrew@lunn.ch>
> Cc: Florian Fainelli <f.fainelli@gmail.com>
> Cc: Guenter Roeck <linux@roeck-us.net>
> Cc: Heiner Kallweit <hkallweit1@gmail.com>
> Cc: Jean Delvare <jdelvare@suse.com>
> Cc: netdev@vger.kernel.org
> ---
> include/uapi/linux/ethtool.h | 1 +
> net/core/ethtool.c | 2 ++
> 2 files changed, 3 insertions(+)
>
> diff --git a/include/uapi/linux/ethtool.h b/include/uapi/linux/ethtool.h
> index dc69391d2bba..ebe658804ef1 100644
> --- a/include/uapi/linux/ethtool.h
> +++ b/include/uapi/linux/ethtool.h
> @@ -259,6 +259,7 @@ struct ethtool_tunable {
> enum phy_tunable_id {
> ETHTOOL_PHY_ID_UNSPEC,
> ETHTOOL_PHY_DOWNSHIFT,
> + ETHTOOL_PHY_BRR_MODE,
> /*
> * Add your fresh new phy tunable attribute above and remember to update
> * phy_tunable_strings[] in net/core/ethtool.c
> diff --git a/net/core/ethtool.c b/net/core/ethtool.c
> index 09d828a6a173..553f3d0e2624 100644
> --- a/net/core/ethtool.c
> +++ b/net/core/ethtool.c
> @@ -133,6 +133,7 @@ static const char
> phy_tunable_strings[__ETHTOOL_PHY_TUNABLE_COUNT][ETH_GSTRING_LEN] = {
> [ETHTOOL_ID_UNSPEC] = "Unspec",
> [ETHTOOL_PHY_DOWNSHIFT] = "phy-downshift",
> + [ETHTOOL_PHY_BRR_MODE] = "phy-broadrreach-mode",
> };
>
> static int ethtool_get_features(struct net_device *dev, void __user *useraddr)
> @@ -2524,6 +2525,7 @@ static int ethtool_phy_tunable_valid(const struct ethtool_tunable *tuna)
> {
> switch (tuna->id) {
> case ETHTOOL_PHY_DOWNSHIFT:
> + case ETHTOOL_PHY_BRR_MODE:
> if (tuna->len != sizeof(u8) ||
> tuna->type_id != ETHTOOL_TUNABLE_U8)
> return -EINVAL;
Hi Marek
As far as i understand, there are only two settings. Master and
Slave. So you can make the validation here more specific.
I would also add some #defines for this in
include/uapi/linux/ethtool.h so it is clear what value represents
master and what is slave.
Andrew
next prev parent reply other threads:[~2020-03-25 13:43 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-25 10:17 [RFC][PATCH 1/2] ethtool: Add BroadRReach Master/Slave PHY tunable Marek Vasut
2020-03-25 10:17 ` [RFC][PATCH 2/2] net: phy: tja11xx: Add BroadRReach Master/Slave support into TJA11xx PHY driver Marek Vasut
2020-03-25 13:47 ` Andrew Lunn
2020-03-25 13:43 ` Andrew Lunn [this message]
2020-03-25 13:51 ` [RFC][PATCH 1/2] ethtool: Add BroadRReach Master/Slave PHY tunable Marek Vasut
2020-03-25 16:49 ` RFC: future of ethtool tunables (Re: [RFC][PATCH 1/2] ethtool: Add BroadRReach Master/Slave PHY tunable) Michal Kubecek
2020-03-25 21:55 ` Andrew Lunn
2020-03-25 22:04 ` Florian Fainelli
2020-03-25 23:42 ` Michal Kubecek
2020-03-26 9:05 ` Oleksij Rempel
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=20200325134330.GD3819@lunn.ch \
--to=andrew@lunn.ch \
--cc=f.fainelli@gmail.com \
--cc=hkallweit1@gmail.com \
--cc=jdelvare@suse.com \
--cc=linux@roeck-us.net \
--cc=marex@denx.de \
--cc=netdev@vger.kernel.org \
--cc=o.rempel@pengutronix.de \
/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).