netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Philippe Reynes <tremyfr@gmail.com>
Cc: davem@davemloft.net, edumazet@google.com, pabeni@redhat.com,
	fgao@48lvckh6395k16k5.yundunddos.com,
	elfring@users.sourceforge.net, jarno@ovn.org,
	rppt@linux.vnet.ibm.com, jarod@redhat.com,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net: tun: use new api ethtool_{get|set}_link_ksettings
Date: Fri, 10 Mar 2017 23:57:41 +0200	[thread overview]
Message-ID: <20170310235719-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <1489180687-19623-1-git-send-email-tremyfr@gmail.com>

On Fri, Mar 10, 2017 at 10:18:07PM +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,

What kind of hardware?

> I'd be very pleased if
> someone may test this patch.
> 
> Signed-off-by: Philippe Reynes <tremyfr@gmail.com>
> ---
>  drivers/net/tun.c |   24 +++++++++++-------------
>  1 files changed, 11 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/net/tun.c b/drivers/net/tun.c
> index dc1b1dd..c418f0a 100644
> --- a/drivers/net/tun.c
> +++ b/drivers/net/tun.c
> @@ -2430,18 +2430,16 @@ static void tun_chr_show_fdinfo(struct seq_file *m, struct file *f)
>  
>  /* ethtool interface */
>  
> -static int tun_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
> -{
> -	cmd->supported		= 0;
> -	cmd->advertising	= 0;
> -	ethtool_cmd_speed_set(cmd, SPEED_10);
> -	cmd->duplex		= DUPLEX_FULL;
> -	cmd->port		= PORT_TP;
> -	cmd->phy_address	= 0;
> -	cmd->transceiver	= XCVR_INTERNAL;
> -	cmd->autoneg		= AUTONEG_DISABLE;
> -	cmd->maxtxpkt		= 0;
> -	cmd->maxrxpkt		= 0;
> +static int tun_get_link_ksettings(struct net_device *dev,
> +				  struct ethtool_link_ksettings *cmd)
> +{
> +	ethtool_link_ksettings_zero_link_mode(cmd, supported);
> +	ethtool_link_ksettings_zero_link_mode(cmd, advertising);
> +	cmd->base.speed		= SPEED_10;
> +	cmd->base.duplex	= DUPLEX_FULL;
> +	cmd->base.port		= PORT_TP;
> +	cmd->base.phy_address	= 0;
> +	cmd->base.autoneg	= AUTONEG_DISABLE;
>  	return 0;
>  }
>  
> @@ -2504,7 +2502,6 @@ static int tun_set_coalesce(struct net_device *dev,
>  }
>  
>  static const struct ethtool_ops tun_ethtool_ops = {
> -	.get_settings	= tun_get_settings,
>  	.get_drvinfo	= tun_get_drvinfo,
>  	.get_msglevel	= tun_get_msglevel,
>  	.set_msglevel	= tun_set_msglevel,
> @@ -2512,6 +2509,7 @@ static int tun_set_coalesce(struct net_device *dev,
>  	.get_ts_info	= ethtool_op_get_ts_info,
>  	.get_coalesce   = tun_get_coalesce,
>  	.set_coalesce   = tun_set_coalesce,
> +	.get_link_ksettings = tun_get_link_ksettings,
>  };
>  
>  static int tun_queue_resize(struct tun_struct *tun)
> -- 
> 1.7.4.4

  reply	other threads:[~2017-03-10 21:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-10 21:18 [PATCH] net: tun: use new api ethtool_{get|set}_link_ksettings Philippe Reynes
2017-03-10 21:57 ` Michael S. Tsirkin [this message]
2017-03-10 22:46   ` Eric Dumazet

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=20170310235719-mutt-send-email-mst@kernel.org \
    --to=mst@redhat.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=elfring@users.sourceforge.net \
    --cc=fgao@48lvckh6395k16k5.yundunddos.com \
    --cc=jarno@ovn.org \
    --cc=jarod@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=rppt@linux.vnet.ibm.com \
    --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).