public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Joe Perches <joe@perches.com>
Cc: Florian Fainelli <f.fainelli@gmail.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] phy/ethtool: Add missing SPEED_<foo> strings
Date: Sun, 2 Apr 2017 23:40:31 +0200	[thread overview]
Message-ID: <20170402214031.GH5189@lunn.ch> (raw)
In-Reply-To: <7a10ea1f8a35c40fd721e15f3643c99d98cca7d8.1491168585.git.joe@perches.com>

On Sun, Apr 02, 2017 at 02:30:06PM -0700, Joe Perches wrote:
> Add all the currently available SPEED_<foo> strings.
> 
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
>  drivers/net/phy/phy.c        | 14 ++++++++++++++
>  include/uapi/linux/ethtool.h |  1 +
>  2 files changed, 15 insertions(+)
> 
> diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
> index d019bbf42c31..e7d0367a1455 100644
> --- a/drivers/net/phy/phy.c
> +++ b/drivers/net/phy/phy.c
> @@ -50,8 +50,22 @@ static const char *phy_speed_to_str(int speed)
>  		return "1Gbps";
>  	case SPEED_2500:
>  		return "2.5Gbps";
> +	case SPEED_5000:
> +		return "5Gbps";
>  	case SPEED_10000:
>  		return "10Gbps";
> +	case SPEED_20000:
> +		return "20Gbps";
> +	case SPEED_25000:
> +		return "25Gbps";
> +	case SPEED_40000:
> +		return "40Gbps";
> +	case SPEED_50000:
> +		return "50Gbps";
> +	case SPEED_56000:
> +		return "56Gbps";
> +	case SPEED_100000:
> +		return "100Gbps";
>  	case SPEED_UNKNOWN:
>  		return "Unknown";
>  	default:
> diff --git a/include/uapi/linux/ethtool.h b/include/uapi/linux/ethtool.h
> index 3dc91a46e8b8..5f4ea28eabe4 100644
> --- a/include/uapi/linux/ethtool.h
> +++ b/include/uapi/linux/ethtool.h
> @@ -1487,6 +1487,7 @@ enum ethtool_link_mode_bit_indices {
>   */
>  
>  /* The forced speed, in units of 1Mb. All values 0 to INT_MAX are legal. */

Hi Joe

Given that this list is getting longer and longer, and the comment
that 0..INT_MAX are legal, is it time to replace this with something
dynamic?

	Andrew

  reply	other threads:[~2017-04-02 21:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-02 21:30 [PATCH] phy/ethtool: Add missing SPEED_<foo> strings Joe Perches
2017-04-02 21:40 ` Andrew Lunn [this message]
2017-04-02 21:49   ` Joe Perches
2017-04-02 22:29 ` Florian Fainelli
2017-04-03  2:44   ` Joe Perches
2017-04-05 13:36 ` David Miller

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=20170402214031.GH5189@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=f.fainelli@gmail.com \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /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