netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hyong-Youb Kim <hykim@myri.com>
To: Philippe Reynes <tremyfr@gmail.com>
Cc: <davem@davemloft.net>, <netdev@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] net: myricom: myri10ge: use new api ethtool_{get|set}_link_ksettings
Date: Fri, 10 Feb 2017 12:51:42 +0900	[thread overview]
Message-ID: <20170210035142.GA2520@gtest01.arcus> (raw)
In-Reply-To: <1486678643-13139-1-git-send-email-tremyfr@gmail.com>

On Thu, Feb 09, 2017 at 11:17:23PM +0100, Philippe Reynes wrote:
> The ethtool api {get|set}_settings is deprecated.
> We move this driver to new api {get|set}_link_ksettings.
> 
> As I don't have the hardware, I'd be very pleased if
> someone may test this patch.

Tested using a 2-port NIC. Works fine.

Acked-by: Hyong-Youb Kim <hykim@myri.com>

> 
> Signed-off-by: Philippe Reynes <tremyfr@gmail.com>
> ---
>  drivers/net/ethernet/myricom/myri10ge/myri10ge.c |   23 +++++++++------------
>  1 files changed, 10 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/net/ethernet/myricom/myri10ge/myri10ge.c b/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
> index 1139d18..b171ed2 100644
> --- a/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
> +++ b/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
> @@ -1610,15 +1610,16 @@ static irqreturn_t myri10ge_intr(int irq, void *arg)
>  }
>  
>  static int
> -myri10ge_get_settings(struct net_device *netdev, struct ethtool_cmd *cmd)
> +myri10ge_get_link_ksettings(struct net_device *netdev,
> +			    struct ethtool_link_ksettings *cmd)
>  {
>  	struct myri10ge_priv *mgp = netdev_priv(netdev);
>  	char *ptr;
>  	int i;
>  
> -	cmd->autoneg = AUTONEG_DISABLE;
> -	ethtool_cmd_speed_set(cmd, SPEED_10000);
> -	cmd->duplex = DUPLEX_FULL;
> +	cmd->base.autoneg = AUTONEG_DISABLE;
> +	cmd->base.speed = SPEED_10000;
> +	cmd->base.duplex = DUPLEX_FULL;
>  
>  	/*
>  	 * parse the product code to deterimine the interface type
> @@ -1643,16 +1644,12 @@ static irqreturn_t myri10ge_intr(int irq, void *arg)
>  		ptr++;
>  	if (*ptr == 'R' || *ptr == 'Q' || *ptr == 'S') {
>  		/* We've found either an XFP, quad ribbon fiber, or SFP+ */
> -		cmd->port = PORT_FIBRE;
> -		cmd->supported |= SUPPORTED_FIBRE;
> -		cmd->advertising |= ADVERTISED_FIBRE;
> +		cmd->base.port = PORT_FIBRE;
> +		ethtool_link_ksettings_add_link_mode(cmd, supported, FIBRE);
> +		ethtool_link_ksettings_add_link_mode(cmd, advertising, FIBRE);
>  	} else {
> -		cmd->port = PORT_OTHER;
> +		cmd->base.port = PORT_OTHER;
>  	}
> -	if (*ptr == 'R' || *ptr == 'S')
> -		cmd->transceiver = XCVR_EXTERNAL;
> -	else
> -		cmd->transceiver = XCVR_INTERNAL;
>  
>  	return 0;
>  }
> @@ -1925,7 +1922,6 @@ static int myri10ge_led(struct myri10ge_priv *mgp, int on)
>  }
>  
>  static const struct ethtool_ops myri10ge_ethtool_ops = {
> -	.get_settings = myri10ge_get_settings,
>  	.get_drvinfo = myri10ge_get_drvinfo,
>  	.get_coalesce = myri10ge_get_coalesce,
>  	.set_coalesce = myri10ge_set_coalesce,
> @@ -1939,6 +1935,7 @@ static int myri10ge_led(struct myri10ge_priv *mgp, int on)
>  	.set_msglevel = myri10ge_set_msglevel,
>  	.get_msglevel = myri10ge_get_msglevel,
>  	.set_phys_id = myri10ge_phys_id,
> +	.get_link_ksettings = myri10ge_get_link_ksettings,
>  };
>  
>  static int myri10ge_allocate_rings(struct myri10ge_slice_state *ss)
> -- 
> 1.7.4.4
> 

  reply	other threads:[~2017-02-10  3:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-09 22:17 [PATCH] net: myricom: myri10ge: use new api ethtool_{get|set}_link_ksettings Philippe Reynes
2017-02-10  3:51 ` Hyong-Youb Kim [this message]
2017-02-13  3:34 ` 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=20170210035142.GA2520@gtest01.arcus \
    --to=hykim@myri.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=tremyfr@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).