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


Groups > linux.kernel > #1613470 > unrolled thread

[PATCH] net: batman-adv: use new api ethtool_{get|set}_link_ksettings

Started byPhilippe Reynes <tremyfr@gmail.com>
First post2017-03-30 23:10 +0200
Last post2017-04-03 19:10 +0200
Articles 5 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] net: batman-adv: use new api ethtool_{get|set}_link_ksettings Philippe Reynes <tremyfr@gmail.com> - 2017-03-30 23:10 +0200
    Re: [B.A.T.M.A.N.] [PATCH] net: batman-adv: use new api ethtool_{get|set}_link_ksettings Sven Eckelmann <sven@narfation.org> - 2017-03-31 09:00 +0200
      Re: [B.A.T.M.A.N.] [PATCH] net: batman-adv: use new api ethtool_{get|set}_link_ksettings Philippe Reynes <tremyfr@gmail.com> - 2017-03-31 22:40 +0200
        Re: [B.A.T.M.A.N.] [PATCH] net: batman-adv: use new api ethtool_{get|set}_link_ksettings Sven Eckelmann <sven@narfation.org> - 2017-04-01 08:50 +0200
          Re: [B.A.T.M.A.N.] [PATCH] net: batman-adv: use new api ethtool_{get|set}_link_ksettings Sven Eckelmann <sven@narfation.org> - 2017-04-03 19:10 +0200

#1613470 — [PATCH] net: batman-adv: use new api ethtool_{get|set}_link_ksettings

FromPhilippe Reynes <tremyfr@gmail.com>
Date2017-03-30 23:10 +0200
Subject[PATCH] net: batman-adv: use new api ethtool_{get|set}_link_ksettings
Message-ID<tqPup-3KZ-5@gated-at.bofh.it>
The ethtool api {get|set}_settings is deprecated.
We move this driver to new api {get|set}_link_ksettings.

I've only compiled this change. If someone may test it,
it would be very nice.

Signed-off-by: Philippe Reynes <tremyfr@gmail.com>
---
 net/batman-adv/soft-interface.c |   25 ++++++++++++-------------
 1 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c
index d042c99..07f6627 100644
--- a/net/batman-adv/soft-interface.c
+++ b/net/batman-adv/soft-interface.c
@@ -64,7 +64,8 @@
 #include "sysfs.h"
 #include "translation-table.h"
 
-static int batadv_get_settings(struct net_device *dev, struct ethtool_cmd *cmd);
+static int batadv_get_link_ksettings(struct net_device *dev,
+				     struct ethtool_link_ksettings *cmd);
 static void batadv_get_drvinfo(struct net_device *dev,
 			       struct ethtool_drvinfo *info);
 static u32 batadv_get_msglevel(struct net_device *dev);
@@ -76,7 +77,6 @@ static void batadv_get_ethtool_stats(struct net_device *dev,
 static int batadv_get_sset_count(struct net_device *dev, int stringset);
 
 static const struct ethtool_ops batadv_ethtool_ops = {
-	.get_settings = batadv_get_settings,
 	.get_drvinfo = batadv_get_drvinfo,
 	.get_msglevel = batadv_get_msglevel,
 	.set_msglevel = batadv_set_msglevel,
@@ -84,6 +84,7 @@ static void batadv_get_ethtool_stats(struct net_device *dev,
 	.get_strings = batadv_get_strings,
 	.get_ethtool_stats = batadv_get_ethtool_stats,
 	.get_sset_count = batadv_get_sset_count,
+	.get_link_ksettings = batadv_get_link_ksettings,
 };
 
 int batadv_skb_head_push(struct sk_buff *skb, unsigned int len)
@@ -1085,18 +1086,16 @@ struct rtnl_link_ops batadv_link_ops __read_mostly = {
 };
 
 /* ethtool */
-static int batadv_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
+static int batadv_get_link_ksettings(struct net_device *dev,
+				     struct ethtool_link_ksettings *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;
+	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;
 }
-- 
1.7.4.4

[toc] | [next] | [standalone]


#1613672 — Re: [B.A.T.M.A.N.] [PATCH] net: batman-adv: use new api ethtool_{get|set}_link_ksettings

FromSven Eckelmann <sven@narfation.org>
Date2017-03-31 09:00 +0200
SubjectRe: [B.A.T.M.A.N.] [PATCH] net: batman-adv: use new api ethtool_{get|set}_link_ksettings
Message-ID<tqYHo-14f-5@gated-at.bofh.it>
In reply to#1613470

[Multipart message — attachments visible in raw view] — view raw

On Donnerstag, 30. März 2017 23:01:27 CEST Philippe Reynes wrote:
> The ethtool api {get|set}_settings is deprecated.
> We move this driver to new api {get|set}_link_ksettings.
> 
> I've only compiled this change. If someone may test it,
> it would be very nice.
> 
> Signed-off-by: Philippe Reynes <tremyfr@gmail.com>
> ---
>  net/batman-adv/soft-interface.c |   25 ++++++++++++-------------
>  1 files changed, 12 insertions(+), 13 deletions(-)

Do you know if anyone already prepared the get_link_ksettings support for
kernels older than 4.6 for backports.git?

Kind regards,
	Sven

[toc] | [prev] | [next] | [standalone]


#1614281 — Re: [B.A.T.M.A.N.] [PATCH] net: batman-adv: use new api ethtool_{get|set}_link_ksettings

FromPhilippe Reynes <tremyfr@gmail.com>
Date2017-03-31 22:40 +0200
SubjectRe: [B.A.T.M.A.N.] [PATCH] net: batman-adv: use new api ethtool_{get|set}_link_ksettings
Message-ID<trbuV-12o-3@gated-at.bofh.it>
In reply to#1613672
Hi Sven,

On 3/31/17, Sven Eckelmann <sven@narfation.org> wrote:
> On Donnerstag, 30. März 2017 23:01:27 CEST Philippe Reynes wrote:
>> The ethtool api {get|set}_settings is deprecated.
>> We move this driver to new api {get|set}_link_ksettings.
>>
>> I've only compiled this change. If someone may test it,
>> it would be very nice.
>>
>> Signed-off-by: Philippe Reynes <tremyfr@gmail.com>
>> ---
>>  net/batman-adv/soft-interface.c |   25 ++++++++++++-------------
>>  1 files changed, 12 insertions(+), 13 deletions(-)
>
> Do you know if anyone already prepared the get_link_ksettings support for
> kernels older than 4.6 for backports.git?

Sorry, I don't know this repo. Do you have an url please ?
But I suppose that nobody works on such backport.

> Kind regards,
> 	Sven

Regards,
Philippe

[toc] | [prev] | [next] | [standalone]


#1614403 — Re: [B.A.T.M.A.N.] [PATCH] net: batman-adv: use new api ethtool_{get|set}_link_ksettings

FromSven Eckelmann <sven@narfation.org>
Date2017-04-01 08:50 +0200
SubjectRe: [B.A.T.M.A.N.] [PATCH] net: batman-adv: use new api ethtool_{get|set}_link_ksettings
Message-ID<trl1f-7rF-3@gated-at.bofh.it>
In reply to#1614281

[Multipart message — attachments visible in raw view] — view raw

On Freitag, 31. März 2017 22:33:34 CEST Philippe Reynes wrote:
> > Do you know if anyone already prepared the get_link_ksettings support for
> > kernels older than 4.6 for backports.git?
> 
> Sorry, I don't know this repo. Do you have an url please ?
> But I suppose that nobody works on such backport.

More information about it can be found at https://backports.wiki.kernel.org 
and https://git.kernel.org/pub/scm/linux/kernel/git/backports/backports.git/

Btw. the code you are modifying will most likely be dropped. Your patch will 
get rejected because of this. But thanks for submitting the api conversion 
patch (even when it will be rejected).

Kind regards,
	Sven

[toc] | [prev] | [next] | [standalone]


#1615429 — Re: [B.A.T.M.A.N.] [PATCH] net: batman-adv: use new api ethtool_{get|set}_link_ksettings

FromSven Eckelmann <sven@narfation.org>
Date2017-04-03 19:10 +0200
SubjectRe: [B.A.T.M.A.N.] [PATCH] net: batman-adv: use new api ethtool_{get|set}_link_ksettings
Message-ID<tsdEm-1ir-19@gated-at.bofh.it>
In reply to#1614403

[Multipart message — attachments visible in raw view] — view raw

On Samstag, 1. April 2017 08:40:54 CEST Sven Eckelmann wrote:
[...]
> Btw. the code you are modifying will most likely be dropped. Your patch will 
> get rejected because of this. But thanks for submitting the api conversion 
> patch (even when it will be rejected).

The patch was now marked as rejected because a conflicting patch [1]
was applied. The code, which your patch modified, doesn't exist anymore.

Kind regards,
	Sven

[1] https://git.open-mesh.org/linux-merge.git/commit/e2790a4b275d52e332e0ad71b5f2eff53fe21805

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web