Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1611611 > unrolled thread
| Started by | Philippe Reynes <tremyfr@gmail.com> |
|---|---|
| First post | 2017-03-29 08:30 +0200 |
| Last post | 2017-03-29 23:10 +0200 |
| Articles | 3 — 3 participants |
Back to article view | Back to linux.kernel
[PATCH v2] net: veth: use new api ethtool_{get|set}_link_ksettings Philippe Reynes <tremyfr@gmail.com> - 2017-03-29 08:30 +0200
Re: [PATCH v2] net: veth: use new api ethtool_{get|set}_link_ksettings Xin Long <lucien.xin@gmail.com> - 2017-03-29 13:20 +0200
Re: [PATCH v2] net: veth: use new api ethtool_{get|set}_link_ksettings David Miller <davem@davemloft.net> - 2017-03-29 23:10 +0200
| From | Philippe Reynes <tremyfr@gmail.com> |
|---|---|
| Date | 2017-03-29 08:30 +0200 |
| Subject | [PATCH v2] net: veth: use new api ethtool_{get|set}_link_ksettings |
| Message-ID | <tqfhf-2UO-1@gated-at.bofh.it> |
The ethtool api {get|set}_settings is deprecated.
We move this driver to new api {get|set}_link_ksettings.
Signed-off-by: Philippe Reynes <tremyfr@gmail.com>
---
Changelog:
v2:
- avoid useless initiazation to zero (thanks Xin Long)
drivers/net/veth.c | 19 +++++++------------
1 files changed, 7 insertions(+), 12 deletions(-)
diff --git a/drivers/net/veth.c b/drivers/net/veth.c
index 8c39d6d..3171036 100644
--- a/drivers/net/veth.c
+++ b/drivers/net/veth.c
@@ -45,18 +45,13 @@ struct veth_priv {
{ "peer_ifindex" },
};
-static int veth_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
+static int veth_get_link_ksettings(struct net_device *dev,
+ struct ethtool_link_ksettings *cmd)
{
- cmd->supported = 0;
- cmd->advertising = 0;
- ethtool_cmd_speed_set(cmd, SPEED_10000);
- 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;
+ cmd->base.speed = SPEED_10000;
+ cmd->base.duplex = DUPLEX_FULL;
+ cmd->base.port = PORT_TP;
+ cmd->base.autoneg = AUTONEG_DISABLE;
return 0;
}
@@ -95,12 +90,12 @@ static void veth_get_ethtool_stats(struct net_device *dev,
}
static const struct ethtool_ops veth_ethtool_ops = {
- .get_settings = veth_get_settings,
.get_drvinfo = veth_get_drvinfo,
.get_link = ethtool_op_get_link,
.get_strings = veth_get_strings,
.get_sset_count = veth_get_sset_count,
.get_ethtool_stats = veth_get_ethtool_stats,
+ .get_link_ksettings = veth_get_link_ksettings,
};
static netdev_tx_t veth_xmit(struct sk_buff *skb, struct net_device *dev)
--
1.7.4.4
[toc] | [next] | [standalone]
| From | Xin Long <lucien.xin@gmail.com> |
|---|---|
| Date | 2017-03-29 13:20 +0200 |
| Message-ID | <tqjNU-63S-23@gated-at.bofh.it> |
| In reply to | #1611611 |
On Wed, Mar 29, 2017 at 2:24 PM, Philippe Reynes <tremyfr@gmail.com> wrote:
> The ethtool api {get|set}_settings is deprecated.
> We move this driver to new api {get|set}_link_ksettings.
>
> Signed-off-by: Philippe Reynes <tremyfr@gmail.com>
> ---
> Changelog:
> v2:
> - avoid useless initiazation to zero (thanks Xin Long)
>
Reviewed-by: Xin Long <lucien.xin@gmail.com>
> drivers/net/veth.c | 19 +++++++------------
> 1 files changed, 7 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/net/veth.c b/drivers/net/veth.c
> index 8c39d6d..3171036 100644
> --- a/drivers/net/veth.c
> +++ b/drivers/net/veth.c
> @@ -45,18 +45,13 @@ struct veth_priv {
> { "peer_ifindex" },
> };
>
> -static int veth_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
> +static int veth_get_link_ksettings(struct net_device *dev,
> + struct ethtool_link_ksettings *cmd)
> {
> - cmd->supported = 0;
> - cmd->advertising = 0;
> - ethtool_cmd_speed_set(cmd, SPEED_10000);
> - 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;
> + cmd->base.speed = SPEED_10000;
> + cmd->base.duplex = DUPLEX_FULL;
> + cmd->base.port = PORT_TP;
> + cmd->base.autoneg = AUTONEG_DISABLE;
> return 0;
> }
>
> @@ -95,12 +90,12 @@ static void veth_get_ethtool_stats(struct net_device *dev,
> }
>
> static const struct ethtool_ops veth_ethtool_ops = {
> - .get_settings = veth_get_settings,
> .get_drvinfo = veth_get_drvinfo,
> .get_link = ethtool_op_get_link,
> .get_strings = veth_get_strings,
> .get_sset_count = veth_get_sset_count,
> .get_ethtool_stats = veth_get_ethtool_stats,
> + .get_link_ksettings = veth_get_link_ksettings,
> };
>
> static netdev_tx_t veth_xmit(struct sk_buff *skb, struct net_device *dev)
> --
> 1.7.4.4
>
[toc] | [prev] | [next] | [standalone]
| From | David Miller <davem@davemloft.net> |
|---|---|
| Date | 2017-03-29 23:10 +0200 |
| Subject | Re: [PATCH v2] net: veth: use new api ethtool_{get|set}_link_ksettings |
| Message-ID | <tqt0T-4cP-35@gated-at.bofh.it> |
| In reply to | #1611611 |
From: Philippe Reynes <tremyfr@gmail.com>
Date: Wed, 29 Mar 2017 08:24:21 +0200
> The ethtool api {get|set}_settings is deprecated.
> We move this driver to new api {get|set}_link_ksettings.
>
> Signed-off-by: Philippe Reynes <tremyfr@gmail.com>
> ---
> Changelog:
> v2:
> - avoid useless initiazation to zero (thanks Xin Long)
Applied.
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web