Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1614828

Re: [PATCH] phy/ethtool: Add missing SPEED_<foo> strings

From Andrew Lunn <andrew@lunn.ch>
Newsgroups linux.kernel
Subject Re: [PATCH] phy/ethtool: Add missing SPEED_<foo> strings
Date 2017-04-02 23:50 +0200
Message-ID <trVxM-6aX-5@gated-at.bofh.it> (permalink)
References <trVo5-64y-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] phy/ethtool: Add missing SPEED_<foo> strings Joe Perches <joe@perches.com> - 2017-04-02 23:40 +0200
  Re: [PATCH] phy/ethtool: Add missing SPEED_<foo> strings Joe Perches <joe@perches.com> - 2017-04-02 23:50 +0200
  Re: [PATCH] phy/ethtool: Add missing SPEED_<foo> strings Andrew Lunn <andrew@lunn.ch> - 2017-04-02 23:50 +0200
  Re: [PATCH] phy/ethtool: Add missing SPEED_<foo> strings Florian Fainelli <f.fainelli@gmail.com> - 2017-04-03 00:40 +0200
    Re: [PATCH] phy/ethtool: Add missing SPEED_<foo> strings Joe Perches <joe@perches.com> - 2017-04-03 04:50 +0200
  Re: [PATCH] phy/ethtool: Add missing SPEED_<foo> strings David Miller <davem@davemloft.net> - 2017-04-05 15:50 +0200

csiph-web