From patchwork Thu Mar 30 21:01:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philippe Reynes X-Patchwork-Id: 16982 X-Patchwork-Delegate: sven@narfation.org Return-Path: X-Original-To: patchwork@open-mesh.org Delivered-To: patchwork@open-mesh.org Received: from open-mesh.org (localhost [IPv6:::1]) by open-mesh.org (Postfix) with ESMTP id 780E683210; Fri, 31 Mar 2017 08:12:20 +0200 (CEST) Authentication-Results: open-mesh.org; dmarc=none header.from=gmail.com Authentication-Results: open-mesh.org; dkim=fail reason="verification failed; unprotected key" header.d=gmail.com header.i=@gmail.com header.b=XrbGF0bk; dkim-adsp=none (unprotected policy); dkim-atps=neutral Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:400c:c0c::241; helo=mail-wr0-x241.google.com; envelope-from=tremyfr@gmail.com; receiver=b.a.t.m.a.n@lists.open-mesh.org Authentication-Results: open-mesh.org; dmarc=pass header.from=gmail.com Received: from mail-wr0-x241.google.com (mail-wr0-x241.google.com [IPv6:2a00:1450:400c:c0c::241]) by open-mesh.org (Postfix) with ESMTPS id 0FDD580D51 for ; Thu, 30 Mar 2017 23:01:33 +0200 (CEST) Received: by mail-wr0-x241.google.com with SMTP id w43so15411886wrb.1 for ; Thu, 30 Mar 2017 14:01:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=rgY9lLyYwu+w99fCRKi62JFkxfmDeX49vy1e8HdBgwk=; b=XrbGF0bk34W8tJN+MlsvZEY+quF/irT5pYKcc/UtqzSJB/zXXlq2rYh311RRS4jvc2 4kZFOhllLl5cfNkgBadZOj7v1QMrzTOtKw2ug3R0OPjtqFvc269nocFWk/Iel8yOo4T6 bX5ZN2/VQwbfNx9KoC1KZxcyAAEDHVz+4UIhOq1nYB6yORBtSTD/L8+cPkxjhf1jgaUC /+mj4dEOPYl6p2X2oXX8wg3Gj/K21PHIpOBYcJKrbrevRmY26wWIBMjSaYkiCzla3QgZ HSg5WTjbmB31w7f2ZKd6BO/YGXTSCL4u7rDH4zVJGKLhxZS0Zgxt5zKu5zUl7KGoaNRr mYFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=rgY9lLyYwu+w99fCRKi62JFkxfmDeX49vy1e8HdBgwk=; b=EtUVaHDOGJo8hlebN7zXotWticyK4OMYnjLzlcUk0ElNUa9KYN9odfeGb+JX2lmcLz C1cBkTmPVCpicLnFjy7vN9FgRgL2ofC4HL2fcfyN6Vcmvl+UvKkMT7SLLsYO6s5J50AZ pFWl+MRJk7KvVtTelFAnXWNGxEkjEJneL7CrNlcLL7qQpHn0+1jPRoODFEFTfl5z2XVs pAfB25oJysAFgSk3680SWFXO4Gci5Mz4C2V9bz623Zb4eqcmPRiddVuD/UrGqGQMrfBT QFywZTGxd/9dZs+VqP1wf9Mp6FRz3BLz1HZtACJKhgBRogF/Ty9/yXBO3ZU/mf6cacXh 3Twg== X-Gm-Message-State: AFeK/H0nc8JtZZ0U17IMHgGXaJRg93WGQHFSdiq2Q12ygLbnBiKteAfFKKt0T97YzY1Xpg== X-Received: by 10.28.54.66 with SMTP id d63mr134895wma.103.1490907693641; Thu, 30 Mar 2017 14:01:33 -0700 (PDT) Received: from localhost.localdomain (bny93-7-88-161-33-221.fbx.proxad.net. [88.161.33.221]) by smtp.gmail.com with ESMTPSA id k128sm301753wmf.16.2017.03.30.14.01.31 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 30 Mar 2017 14:01:32 -0700 (PDT) From: Philippe Reynes To: mareklindner@neomailbox.ch, sw@simonwunderlich.de, a@unstable.cc, davem@davemloft.net Date: Thu, 30 Mar 2017 23:01:27 +0200 Message-Id: <1490907687-11784-1-git-send-email-tremyfr@gmail.com> X-Mailer: git-send-email 1.7.4.4 X-Mailman-Approved-At: Fri, 31 Mar 2017 08:12:17 +0200 Cc: netdev@vger.kernel.org, b.a.t.m.a.n@lists.open-mesh.org, linux-kernel@vger.kernel.org, Philippe Reynes Subject: [B.A.T.M.A.N.] [PATCH] net: batman-adv: use new api ethtool_{get|set}_link_ksettings X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking Errors-To: b.a.t.m.a.n-bounces@lists.open-mesh.org Sender: "B.A.T.M.A.N" 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 --- 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; }