From patchwork Sun Jan 1 18:11:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philippe Reynes X-Patchwork-Id: 9492949 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B3F0462AB3 for ; Sun, 1 Jan 2017 18:11:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9C84520007 for ; Sun, 1 Jan 2017 18:11:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7DB3A22376; Sun, 1 Jan 2017 18:11:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 042CD20007 for ; Sun, 1 Jan 2017 18:11:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932266AbdAASLY (ORCPT ); Sun, 1 Jan 2017 13:11:24 -0500 Received: from mail-wm0-f68.google.com ([74.125.82.68]:34571 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932183AbdAASLX (ORCPT ); Sun, 1 Jan 2017 13:11:23 -0500 Received: by mail-wm0-f68.google.com with SMTP id c85so40963733wmi.1; Sun, 01 Jan 2017 10:11:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=hqbC4e2g+N7xeKoHkILSHYZKjKMuxTX04Eo3kHo/G8o=; b=IceU6DMGhBatNLXGFFwF85LHm2AVvJbagie/a/CXnNKtoDaRa0wckKYYF0yC6Yd0Na 1oe0Ok6z+kGG8lyHya7Xd+t+X5DBYL2o7CR0s9qk0I/br/dNn5U9+H/xDHsQrzykEFWS BPhuU2J+37UCyi6PPcDuN8R/Cv4Bjil2IBmfBv36/1+Od5pSqhIEQxQc+ziz05YtSs9m dTAJ2qavGSUPNsBlnH9ld8DXadxoVkM8BJO2Maz12fHKxo3dzcly75jczLDIUdc4arJk F36I1U7Z3c/8ExOFBdf+BBa8FKEX3nT/+SKk1sJiAbEH/wPgtakFHXa8eQOhnMIg4X/a Q9aw== 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=hqbC4e2g+N7xeKoHkILSHYZKjKMuxTX04Eo3kHo/G8o=; b=FQBZ6VDCG1T+JLgosgyznLq9MRhAjtNKAw/j9WbTIx/UAl56Jd1ArcQqRDsGUsmiGS cJ36ZZ6Iw69wG1jx8oivDnqiYARaOo9fPNLbeDLoYIffMOPsYCC1dlUPzDIM0qQzufAd +BNC4Oc2VGRd83abjf4iu872EMbj+5QyJg5CX/AESj3dkm6+lDdP9/8h4BYVeyokBTCD EcC4bgm546n4ErW1/BYgf7tJ1NNr4yy9+Rh5VuQ9ABFBWSOPXgPJDLqii+zTwJ8hMY0Y JMQDtR/HaPrbG+ucxOQ8a9C5nTNDF2tFT5g9U2GlhhL2HKXmQCNTUrjggvYH3c04Prwm QtzA== X-Gm-Message-State: AIkVDXJ7Y9tihOTovPOXByupwPI0JenlkljAmurJYqQYG5CpFv6OWQnIJQvSGuXCfWsmBQ== X-Received: by 10.28.48.145 with SMTP id w139mr51037135wmw.113.1483294281344; Sun, 01 Jan 2017 10:11:21 -0800 (PST) Received: from localhost.localdomain (bny93-7-88-161-33-221.fbx.proxad.net. [88.161.33.221]) by smtp.gmail.com with ESMTPSA id i15sm83759214wjs.16.2017.01.01.10.11.20 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 01 Jan 2017 10:11:20 -0800 (PST) From: Philippe Reynes To: davem@davemloft.net, mugunthanvnm@ti.com, a@unstable.cc, fw@strlen.de, jarod@redhat.com Cc: netdev@vger.kernel.org, linux-parisc@vger.kernel.org, linux-kernel@vger.kernel.org, Philippe Reynes Subject: [PATCH] net: dec: uli526x: use new api ethtool_{get|set}_link_ksettings Date: Sun, 1 Jan 2017 19:11:06 +0100 Message-Id: <1483294266-6222-1-git-send-email-tremyfr@gmail.com> X-Mailer: git-send-email 1.7.4.4 Sender: linux-parisc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The ethtool api {get|set}_settings is deprecated. We move this driver to new api {get|set}_link_ksettings. Signed-off-by: Philippe Reynes --- drivers/net/ethernet/dec/tulip/uli526x.c | 41 +++++++++++++++++------------ 1 files changed, 24 insertions(+), 17 deletions(-) diff --git a/drivers/net/ethernet/dec/tulip/uli526x.c b/drivers/net/ethernet/dec/tulip/uli526x.c index f82ebe5..8d98b259 100644 --- a/drivers/net/ethernet/dec/tulip/uli526x.c +++ b/drivers/net/ethernet/dec/tulip/uli526x.c @@ -926,48 +926,53 @@ static void uli526x_set_filter_mode(struct net_device * dev) } static void -ULi_ethtool_gset(struct uli526x_board_info *db, struct ethtool_cmd *ecmd) +ULi_ethtool_get_link_ksettings(struct uli526x_board_info *db, + struct ethtool_link_ksettings *cmd) { - ecmd->supported = (SUPPORTED_10baseT_Half | + u32 supported, advertising; + + supported = (SUPPORTED_10baseT_Half | SUPPORTED_10baseT_Full | SUPPORTED_100baseT_Half | SUPPORTED_100baseT_Full | SUPPORTED_Autoneg | SUPPORTED_MII); - ecmd->advertising = (ADVERTISED_10baseT_Half | + advertising = (ADVERTISED_10baseT_Half | ADVERTISED_10baseT_Full | ADVERTISED_100baseT_Half | ADVERTISED_100baseT_Full | ADVERTISED_Autoneg | ADVERTISED_MII); + ethtool_convert_legacy_u32_to_link_mode(cmd->link_modes.supported, + supported); + ethtool_convert_legacy_u32_to_link_mode(cmd->link_modes.advertising, + advertising); - ecmd->port = PORT_MII; - ecmd->phy_address = db->phy_addr; - - ecmd->transceiver = XCVR_EXTERNAL; + cmd->base.port = PORT_MII; + cmd->base.phy_address = db->phy_addr; - ethtool_cmd_speed_set(ecmd, SPEED_10); - ecmd->duplex = DUPLEX_HALF; + cmd->base.speed = SPEED_10; + cmd->base.duplex = DUPLEX_HALF; if(db->op_mode==ULI526X_100MHF || db->op_mode==ULI526X_100MFD) { - ethtool_cmd_speed_set(ecmd, SPEED_100); + cmd->base.speed = SPEED_100; } if(db->op_mode==ULI526X_10MFD || db->op_mode==ULI526X_100MFD) { - ecmd->duplex = DUPLEX_FULL; + cmd->base.duplex = DUPLEX_FULL; } if(db->link_failed) { - ethtool_cmd_speed_set(ecmd, SPEED_UNKNOWN); - ecmd->duplex = DUPLEX_UNKNOWN; + cmd->base.speed = SPEED_UNKNOWN; + cmd->base.duplex = DUPLEX_UNKNOWN; } if (db->media_mode & ULI526X_AUTO) { - ecmd->autoneg = AUTONEG_ENABLE; + cmd->base.autoneg = AUTONEG_ENABLE; } } @@ -981,10 +986,12 @@ static void netdev_get_drvinfo(struct net_device *dev, strlcpy(info->bus_info, pci_name(np->pdev), sizeof(info->bus_info)); } -static int netdev_get_settings(struct net_device *dev, struct ethtool_cmd *cmd) { +static int netdev_get_link_ksettings(struct net_device *dev, + struct ethtool_link_ksettings *cmd) +{ struct uli526x_board_info *np = netdev_priv(dev); - ULi_ethtool_gset(np, cmd); + ULi_ethtool_get_link_ksettings(np, cmd); return 0; } @@ -1006,9 +1013,9 @@ static void uli526x_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol) static const struct ethtool_ops netdev_ethtool_ops = { .get_drvinfo = netdev_get_drvinfo, - .get_settings = netdev_get_settings, .get_link = netdev_get_link, .get_wol = uli526x_get_wol, + .get_link_ksettings = netdev_get_link_ksettings, }; /*