Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/725081/?format=api
{ "id": 725081, "url": "http://patchwork.ozlabs.org/api/patches/725081/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/1486468070-14596-1-git-send-email-tremyfr@gmail.com/", "project": { "id": 46, "url": "http://patchwork.ozlabs.org/api/projects/46/?format=api", "name": "Intel Wired Ethernet development", "link_name": "intel-wired-lan", "list_id": "intel-wired-lan.osuosl.org", "list_email": "intel-wired-lan@osuosl.org", "web_url": "", "scm_url": "", "webscm_url": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<1486468070-14596-1-git-send-email-tremyfr@gmail.com>", "list_archive_url": null, "date": "2017-02-07T11:47:50", "name": "net: intel: ixgbe: use new api ethtool_{get|set}_link_ksettings", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "38507735304f8a5c3373f635edccf87d4eb80735", "submitter": { "id": 65172, "url": "http://patchwork.ozlabs.org/api/people/65172/?format=api", "name": "Philippe Reynes", "email": "tremyfr@gmail.com" }, "delegate": { "id": 68, "url": "http://patchwork.ozlabs.org/api/users/68/?format=api", "username": "jtkirshe", "first_name": "Jeff", "last_name": "Kirsher", "email": "jeffrey.t.kirsher@intel.com" }, "mbox": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/1486468070-14596-1-git-send-email-tremyfr@gmail.com/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/725081/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/725081/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<intel-wired-lan-bounces@lists.osuosl.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "intel-wired-lan@lists.osuosl.org" ], "Delivered-To": [ "patchwork-incoming@bilbo.ozlabs.org", "intel-wired-lan@lists.osuosl.org" ], "Received": [ "from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3vHjJj6Vwwz9s7f\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 7 Feb 2017 22:48:04 +1100 (AEDT)", "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id B0AA28A3A8;\n\tTue, 7 Feb 2017 11:48:02 +0000 (UTC)", "from hemlock.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id TVfpdSQH1Q+Q; Tue, 7 Feb 2017 11:48:01 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 54B5A8A302;\n\tTue, 7 Feb 2017 11:48:01 +0000 (UTC)", "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\tby ash.osuosl.org (Postfix) with ESMTP id 9069C1BFE43\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 7 Feb 2017 11:48:00 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 88F0B8756B\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 7 Feb 2017 11:48:00 +0000 (UTC)", "from fraxinus.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id CwBmOtACJP4Z for <intel-wired-lan@lists.osuosl.org>;\n\tTue, 7 Feb 2017 11:47:59 +0000 (UTC)", "from mail-wm0-f65.google.com (mail-wm0-f65.google.com\n\t[74.125.82.65])\n\tby fraxinus.osuosl.org (Postfix) with ESMTPS id 4935287526\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 7 Feb 2017 11:47:59 +0000 (UTC)", "by mail-wm0-f65.google.com with SMTP id u63so27804405wmu.2\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 07 Feb 2017 03:47:59 -0800 (PST)", "from localhost.localdomain (bny93-7-88-161-33-221.fbx.proxad.net.\n\t[88.161.33.221]) by smtp.gmail.com with ESMTPSA id\n\tr6sm18377729wmd.4.2017.02.07.03.47.56\n\t(version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128);\n\tTue, 07 Feb 2017 03:47:56 -0800 (PST)" ], "Authentication-Results": "ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"CHcF9mGi\"; dkim-atps=neutral", "X-Virus-Scanned": [ "amavisd-new at osuosl.org", "amavisd-new at osuosl.org" ], "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=from:to:cc:subject:date:message-id;\n\tbh=i0un7BcsPeiR651NedNEcDbNOZq1IET3p0Af+/Mf2PQ=;\n\tb=CHcF9mGiGK5VF52lQyMc297Cy7ePolk5g1WEQYpbjVjJ0b+ILu/BDJkfp8su3KAHMX\n\tCXGCAcAS4y7E9ERhIWDZdApjZlFc9zQlheP7aBHwgdscMTDpl5nylZPx2Rq/90sObHK/\n\t+xCyTr51K8Rwg9Hn8mdZSr7CXvNa/7NmThg8Z5+zPfwd01lBU189IIDMTMPRr6MXWzV9\n\tSEc8RSkVD+hT4miEHPvpH7cCwLEZZKIVhIuAF80XAOHAyM6o9TK2Ipl2pzKGG+8ZQUtz\n\tAMd0bmz/21bp0/MIuh4RWKdneZoZywVWiWTv+GknEcwNbuTWen5uHNl4nhmALLJ7qlIy\n\tDP0w==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id;\n\tbh=i0un7BcsPeiR651NedNEcDbNOZq1IET3p0Af+/Mf2PQ=;\n\tb=E9J6OtKSIg2XjK6vW2Ovq+aHPnCSHyXOa1RQ8UqrCRKKn94gDVLj1zRNxGIL8Ju5z0\n\tXvJvMf1vMTmnbL4yQNScAyjrEqG1WBOu6CWoUWDq+pK8PMKg13qBIuJzmssPNUKSUZ+A\n\tXuTw08t/MwSOyW9FXgemmMFSgZUkwWVFsDsC+S1Nlk+amTmVAPR6jel1JxufHCBTTSm6\n\te1SSjAHh8I1bPJQQE2trfCdyNeCCmlCKuh+OWtnCofSLj7t94lkQdTbAXaOa7O2tbPc8\n\tc0IqdKtgccCY4aCdVZi+OOY4Sbs4UVYHRnwDTRyDDwXsJE95voOoyKqAQTAhPpD2HgzM\n\tC9Dw==", "X-Gm-Message-State": "AMke39kQOoRBwqYaPpG49H9yIN/M9lfDE+0Y5Q7ViOi92wEdbQMMf2UqTRnfnTHlEEySAA==", "X-Received": "by 10.28.65.196 with SMTP id o187mr11837824wma.37.1486468077443; \n\tTue, 07 Feb 2017 03:47:57 -0800 (PST)", "From": "Philippe Reynes <tremyfr@gmail.com>", "To": "jeffrey.t.kirsher@intel.com,\n\tdavem@davemloft.net", "Date": "Tue, 7 Feb 2017 12:47:50 +0100", "Message-Id": "<1486468070-14596-1-git-send-email-tremyfr@gmail.com>", "X-Mailer": "git-send-email 1.7.4.4", "Cc": "netdev@vger.kernel.org, intel-wired-lan@lists.osuosl.org,\n\tlinux-kernel@vger.kernel.org, Philippe Reynes <tremyfr@gmail.com>", "Subject": "[Intel-wired-lan] [PATCH] net: intel: ixgbe: use new api\n\tethtool_{get|set}_link_ksettings", "X-BeenThere": "intel-wired-lan@lists.osuosl.org", "X-Mailman-Version": "2.1.18-1", "Precedence": "list", "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n\t<intel-wired-lan.lists.osuosl.org>", "List-Unsubscribe": "<http://lists.osuosl.org/mailman/options/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@lists.osuosl.org?subject=unsubscribe>", "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>", "List-Post": "<mailto:intel-wired-lan@lists.osuosl.org>", "List-Help": "<mailto:intel-wired-lan-request@lists.osuosl.org?subject=help>", "List-Subscribe": "<http://lists.osuosl.org/mailman/listinfo/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@lists.osuosl.org?subject=subscribe>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=\"us-ascii\"", "Content-Transfer-Encoding": "7bit", "Errors-To": "intel-wired-lan-bounces@lists.osuosl.org", "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@lists.osuosl.org>" }, "content": "The ethtool api {get|set}_settings is deprecated.\nWe move this driver to new api {get|set}_link_ksettings.\n\nAs I don't have the hardware, I'd be very pleased if\nsomeone may test this patch.\n\nSigned-off-by: Philippe Reynes <tremyfr@gmail.com>\n---\n drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c | 166 ++++++++++++----------\n 1 files changed, 90 insertions(+), 76 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c\nindex ee28e54..77b3126 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c\n@@ -179,60 +179,62 @@ static u32 ixgbe_get_supported_10gtypes(struct ixgbe_hw *hw)\n \t}\n }\n \n-static int ixgbe_get_settings(struct net_device *netdev,\n-\t\t\t struct ethtool_cmd *ecmd)\n+static int ixgbe_get_link_ksettings(struct net_device *netdev,\n+\t\t\t\t struct ethtool_link_ksettings *cmd)\n {\n \tstruct ixgbe_adapter *adapter = netdev_priv(netdev);\n \tstruct ixgbe_hw *hw = &adapter->hw;\n \tixgbe_link_speed supported_link;\n \tbool autoneg = false;\n+\tu32 supported, advertising;\n+\n+\tethtool_convert_link_mode_to_legacy_u32(&supported,\n+\t\t\t\t\t\tcmd->link_modes.supported);\n \n \thw->mac.ops.get_link_capabilities(hw, &supported_link, &autoneg);\n \n \t/* set the supported link speeds */\n \tif (supported_link & IXGBE_LINK_SPEED_10GB_FULL)\n-\t\tecmd->supported |= ixgbe_get_supported_10gtypes(hw);\n+\t\tsupported |= ixgbe_get_supported_10gtypes(hw);\n \tif (supported_link & IXGBE_LINK_SPEED_1GB_FULL)\n-\t\tecmd->supported |= (ixgbe_isbackplane(hw->phy.media_type)) ?\n+\t\tsupported |= (ixgbe_isbackplane(hw->phy.media_type)) ?\n \t\t\t\t SUPPORTED_1000baseKX_Full :\n \t\t\t\t SUPPORTED_1000baseT_Full;\n \tif (supported_link & IXGBE_LINK_SPEED_100_FULL)\n-\t\tecmd->supported |= SUPPORTED_100baseT_Full;\n+\t\tsupported |= SUPPORTED_100baseT_Full;\n \tif (supported_link & IXGBE_LINK_SPEED_10_FULL)\n-\t\tecmd->supported |= SUPPORTED_10baseT_Full;\n+\t\tsupported |= SUPPORTED_10baseT_Full;\n \n \t/* default advertised speed if phy.autoneg_advertised isn't set */\n-\tecmd->advertising = ecmd->supported;\n+\tadvertising = supported;\n \t/* set the advertised speeds */\n \tif (hw->phy.autoneg_advertised) {\n-\t\tecmd->advertising = 0;\n+\t\tadvertising = 0;\n \t\tif (hw->phy.autoneg_advertised & IXGBE_LINK_SPEED_10_FULL)\n-\t\t\tecmd->advertising |= ADVERTISED_10baseT_Full;\n+\t\t\tadvertising |= ADVERTISED_10baseT_Full;\n \t\tif (hw->phy.autoneg_advertised & IXGBE_LINK_SPEED_100_FULL)\n-\t\t\tecmd->advertising |= ADVERTISED_100baseT_Full;\n+\t\t\tadvertising |= ADVERTISED_100baseT_Full;\n \t\tif (hw->phy.autoneg_advertised & IXGBE_LINK_SPEED_10GB_FULL)\n-\t\t\tecmd->advertising |= ecmd->supported & ADVRTSD_MSK_10G;\n+\t\t\tadvertising |= supported & ADVRTSD_MSK_10G;\n \t\tif (hw->phy.autoneg_advertised & IXGBE_LINK_SPEED_1GB_FULL) {\n-\t\t\tif (ecmd->supported & SUPPORTED_1000baseKX_Full)\n-\t\t\t\tecmd->advertising |= ADVERTISED_1000baseKX_Full;\n+\t\t\tif (supported & SUPPORTED_1000baseKX_Full)\n+\t\t\t\tadvertising |= ADVERTISED_1000baseKX_Full;\n \t\t\telse\n-\t\t\t\tecmd->advertising |= ADVERTISED_1000baseT_Full;\n+\t\t\t\tadvertising |= ADVERTISED_1000baseT_Full;\n \t\t}\n \t} else {\n \t\tif (hw->phy.multispeed_fiber && !autoneg) {\n \t\t\tif (supported_link & IXGBE_LINK_SPEED_10GB_FULL)\n-\t\t\t\tecmd->advertising = ADVERTISED_10000baseT_Full;\n+\t\t\t\tadvertising = ADVERTISED_10000baseT_Full;\n \t\t}\n \t}\n \n \tif (autoneg) {\n-\t\tecmd->supported |= SUPPORTED_Autoneg;\n-\t\tecmd->advertising |= ADVERTISED_Autoneg;\n-\t\tecmd->autoneg = AUTONEG_ENABLE;\n+\t\tsupported |= SUPPORTED_Autoneg;\n+\t\tadvertising |= ADVERTISED_Autoneg;\n+\t\tcmd->base.autoneg = AUTONEG_ENABLE;\n \t} else\n-\t\tecmd->autoneg = AUTONEG_DISABLE;\n-\n-\tecmd->transceiver = XCVR_EXTERNAL;\n+\t\tcmd->base.autoneg = AUTONEG_DISABLE;\n \n \t/* Determine the remaining settings based on the PHY type. */\n \tswitch (adapter->hw.phy.type) {\n@@ -241,14 +243,14 @@ static int ixgbe_get_settings(struct net_device *netdev,\n \tcase ixgbe_phy_x550em_ext_t:\n \tcase ixgbe_phy_fw:\n \tcase ixgbe_phy_cu_unknown:\n-\t\tecmd->supported |= SUPPORTED_TP;\n-\t\tecmd->advertising |= ADVERTISED_TP;\n-\t\tecmd->port = PORT_TP;\n+\t\tsupported |= SUPPORTED_TP;\n+\t\tadvertising |= ADVERTISED_TP;\n+\t\tcmd->base.port = PORT_TP;\n \t\tbreak;\n \tcase ixgbe_phy_qt:\n-\t\tecmd->supported |= SUPPORTED_FIBRE;\n-\t\tecmd->advertising |= ADVERTISED_FIBRE;\n-\t\tecmd->port = PORT_FIBRE;\n+\t\tsupported |= SUPPORTED_FIBRE;\n+\t\tadvertising |= ADVERTISED_FIBRE;\n+\t\tcmd->base.port = PORT_FIBRE;\n \t\tbreak;\n \tcase ixgbe_phy_nl:\n \tcase ixgbe_phy_sfp_passive_tyco:\n@@ -266,9 +268,9 @@ static int ixgbe_get_settings(struct net_device *netdev,\n \t\tcase ixgbe_sfp_type_da_cu:\n \t\tcase ixgbe_sfp_type_da_cu_core0:\n \t\tcase ixgbe_sfp_type_da_cu_core1:\n-\t\t\tecmd->supported |= SUPPORTED_FIBRE;\n-\t\t\tecmd->advertising |= ADVERTISED_FIBRE;\n-\t\t\tecmd->port = PORT_DA;\n+\t\t\tsupported |= SUPPORTED_FIBRE;\n+\t\t\tadvertising |= ADVERTISED_FIBRE;\n+\t\t\tcmd->base.port = PORT_DA;\n \t\t\tbreak;\n \t\tcase ixgbe_sfp_type_sr:\n \t\tcase ixgbe_sfp_type_lr:\n@@ -278,99 +280,110 @@ static int ixgbe_get_settings(struct net_device *netdev,\n \t\tcase ixgbe_sfp_type_1g_sx_core1:\n \t\tcase ixgbe_sfp_type_1g_lx_core0:\n \t\tcase ixgbe_sfp_type_1g_lx_core1:\n-\t\t\tecmd->supported |= SUPPORTED_FIBRE;\n-\t\t\tecmd->advertising |= ADVERTISED_FIBRE;\n-\t\t\tecmd->port = PORT_FIBRE;\n+\t\t\tsupported |= SUPPORTED_FIBRE;\n+\t\t\tadvertising |= ADVERTISED_FIBRE;\n+\t\t\tcmd->base.port = PORT_FIBRE;\n \t\t\tbreak;\n \t\tcase ixgbe_sfp_type_not_present:\n-\t\t\tecmd->supported |= SUPPORTED_FIBRE;\n-\t\t\tecmd->advertising |= ADVERTISED_FIBRE;\n-\t\t\tecmd->port = PORT_NONE;\n+\t\t\tsupported |= SUPPORTED_FIBRE;\n+\t\t\tadvertising |= ADVERTISED_FIBRE;\n+\t\t\tcmd->base.port = PORT_NONE;\n \t\t\tbreak;\n \t\tcase ixgbe_sfp_type_1g_cu_core0:\n \t\tcase ixgbe_sfp_type_1g_cu_core1:\n-\t\t\tecmd->supported |= SUPPORTED_TP;\n-\t\t\tecmd->advertising |= ADVERTISED_TP;\n-\t\t\tecmd->port = PORT_TP;\n+\t\t\tsupported |= SUPPORTED_TP;\n+\t\t\tadvertising |= ADVERTISED_TP;\n+\t\t\tcmd->base.port = PORT_TP;\n \t\t\tbreak;\n \t\tcase ixgbe_sfp_type_unknown:\n \t\tdefault:\n-\t\t\tecmd->supported |= SUPPORTED_FIBRE;\n-\t\t\tecmd->advertising |= ADVERTISED_FIBRE;\n-\t\t\tecmd->port = PORT_OTHER;\n+\t\t\tsupported |= SUPPORTED_FIBRE;\n+\t\t\tadvertising |= ADVERTISED_FIBRE;\n+\t\t\tcmd->base.port = PORT_OTHER;\n \t\t\tbreak;\n \t\t}\n \t\tbreak;\n \tcase ixgbe_phy_xaui:\n-\t\tecmd->supported |= SUPPORTED_FIBRE;\n-\t\tecmd->advertising |= ADVERTISED_FIBRE;\n-\t\tecmd->port = PORT_NONE;\n+\t\tsupported |= SUPPORTED_FIBRE;\n+\t\tadvertising |= ADVERTISED_FIBRE;\n+\t\tcmd->base.port = PORT_NONE;\n \t\tbreak;\n \tcase ixgbe_phy_unknown:\n \tcase ixgbe_phy_generic:\n \tcase ixgbe_phy_sfp_unsupported:\n \tdefault:\n-\t\tecmd->supported |= SUPPORTED_FIBRE;\n-\t\tecmd->advertising |= ADVERTISED_FIBRE;\n-\t\tecmd->port = PORT_OTHER;\n+\t\tsupported |= SUPPORTED_FIBRE;\n+\t\tadvertising |= ADVERTISED_FIBRE;\n+\t\tcmd->base.port = PORT_OTHER;\n \t\tbreak;\n \t}\n \n \t/* Indicate pause support */\n-\tecmd->supported |= SUPPORTED_Pause;\n+\tsupported |= SUPPORTED_Pause;\n \n \tswitch (hw->fc.requested_mode) {\n \tcase ixgbe_fc_full:\n-\t\tecmd->advertising |= ADVERTISED_Pause;\n+\t\tadvertising |= ADVERTISED_Pause;\n \t\tbreak;\n \tcase ixgbe_fc_rx_pause:\n-\t\tecmd->advertising |= ADVERTISED_Pause |\n+\t\tadvertising |= ADVERTISED_Pause |\n \t\t\t\t ADVERTISED_Asym_Pause;\n \t\tbreak;\n \tcase ixgbe_fc_tx_pause:\n-\t\tecmd->advertising |= ADVERTISED_Asym_Pause;\n+\t\tadvertising |= ADVERTISED_Asym_Pause;\n \t\tbreak;\n \tdefault:\n-\t\tecmd->advertising &= ~(ADVERTISED_Pause |\n+\t\tadvertising &= ~(ADVERTISED_Pause |\n \t\t\t\t ADVERTISED_Asym_Pause);\n \t}\n \n \tif (netif_carrier_ok(netdev)) {\n \t\tswitch (adapter->link_speed) {\n \t\tcase IXGBE_LINK_SPEED_10GB_FULL:\n-\t\t\tethtool_cmd_speed_set(ecmd, SPEED_10000);\n+\t\t\tcmd->base.speed = SPEED_10000;\n \t\t\tbreak;\n \t\tcase IXGBE_LINK_SPEED_2_5GB_FULL:\n-\t\t\tethtool_cmd_speed_set(ecmd, SPEED_2500);\n+\t\t\tcmd->base.speed = SPEED_2500;\n \t\t\tbreak;\n \t\tcase IXGBE_LINK_SPEED_1GB_FULL:\n-\t\t\tethtool_cmd_speed_set(ecmd, SPEED_1000);\n+\t\t\tcmd->base.speed = SPEED_1000;\n \t\t\tbreak;\n \t\tcase IXGBE_LINK_SPEED_100_FULL:\n-\t\t\tethtool_cmd_speed_set(ecmd, SPEED_100);\n+\t\t\tcmd->base.speed = SPEED_100;\n \t\t\tbreak;\n \t\tcase IXGBE_LINK_SPEED_10_FULL:\n-\t\t\tethtool_cmd_speed_set(ecmd, SPEED_10);\n+\t\t\tcmd->base.speed = SPEED_10;\n \t\t\tbreak;\n \t\tdefault:\n \t\t\tbreak;\n \t\t}\n-\t\tecmd->duplex = DUPLEX_FULL;\n+\t\tcmd->base.duplex = DUPLEX_FULL;\n \t} else {\n-\t\tethtool_cmd_speed_set(ecmd, SPEED_UNKNOWN);\n-\t\tecmd->duplex = DUPLEX_UNKNOWN;\n+\t\tcmd->base.speed = SPEED_UNKNOWN;\n+\t\tcmd->base.duplex = DUPLEX_UNKNOWN;\n \t}\n \n+\tethtool_convert_legacy_u32_to_link_mode(cmd->link_modes.supported,\n+\t\t\t\t\t\tsupported);\n+\tethtool_convert_legacy_u32_to_link_mode(cmd->link_modes.advertising,\n+\t\t\t\t\t\tadvertising);\n+\n \treturn 0;\n }\n \n-static int ixgbe_set_settings(struct net_device *netdev,\n-\t\t\t struct ethtool_cmd *ecmd)\n+static int ixgbe_set_link_ksettings(struct net_device *netdev,\n+\t\t\t\t const struct ethtool_link_ksettings *cmd)\n {\n \tstruct ixgbe_adapter *adapter = netdev_priv(netdev);\n \tstruct ixgbe_hw *hw = &adapter->hw;\n \tu32 advertised, old;\n \ts32 err = 0;\n+\tu32 supported, advertising;\n+\n+\tethtool_convert_link_mode_to_legacy_u32(&supported,\n+\t\t\t\t\t\tcmd->link_modes.supported);\n+\tethtool_convert_link_mode_to_legacy_u32(&advertising,\n+\t\t\t\t\t\tcmd->link_modes.advertising);\n \n \tif ((hw->phy.media_type == ixgbe_media_type_copper) ||\n \t (hw->phy.multispeed_fiber)) {\n@@ -378,12 +391,12 @@ static int ixgbe_set_settings(struct net_device *netdev,\n \t\t * this function does not support duplex forcing, but can\n \t\t * limit the advertising of the adapter to the specified speed\n \t\t */\n-\t\tif (ecmd->advertising & ~ecmd->supported)\n+\t\tif (advertising & ~supported)\n \t\t\treturn -EINVAL;\n \n \t\t/* only allow one speed at a time if no autoneg */\n-\t\tif (!ecmd->autoneg && hw->phy.multispeed_fiber) {\n-\t\t\tif (ecmd->advertising ==\n+\t\tif (!cmd->base.autoneg && hw->phy.multispeed_fiber) {\n+\t\t\tif (advertising ==\n \t\t\t (ADVERTISED_10000baseT_Full |\n \t\t\t ADVERTISED_1000baseT_Full))\n \t\t\t\treturn -EINVAL;\n@@ -391,16 +404,16 @@ static int ixgbe_set_settings(struct net_device *netdev,\n \n \t\told = hw->phy.autoneg_advertised;\n \t\tadvertised = 0;\n-\t\tif (ecmd->advertising & ADVERTISED_10000baseT_Full)\n+\t\tif (advertising & ADVERTISED_10000baseT_Full)\n \t\t\tadvertised |= IXGBE_LINK_SPEED_10GB_FULL;\n \n-\t\tif (ecmd->advertising & ADVERTISED_1000baseT_Full)\n+\t\tif (advertising & ADVERTISED_1000baseT_Full)\n \t\t\tadvertised |= IXGBE_LINK_SPEED_1GB_FULL;\n \n-\t\tif (ecmd->advertising & ADVERTISED_100baseT_Full)\n+\t\tif (advertising & ADVERTISED_100baseT_Full)\n \t\t\tadvertised |= IXGBE_LINK_SPEED_100_FULL;\n \n-\t\tif (ecmd->advertising & ADVERTISED_10baseT_Full)\n+\t\tif (advertising & ADVERTISED_10baseT_Full)\n \t\t\tadvertised |= IXGBE_LINK_SPEED_10_FULL;\n \n \t\tif (old == advertised)\n@@ -418,10 +431,11 @@ static int ixgbe_set_settings(struct net_device *netdev,\n \t\tclear_bit(__IXGBE_IN_SFP_INIT, &adapter->state);\n \t} else {\n \t\t/* in this case we currently only support 10Gb/FULL */\n-\t\tu32 speed = ethtool_cmd_speed(ecmd);\n-\t\tif ((ecmd->autoneg == AUTONEG_ENABLE) ||\n-\t\t (ecmd->advertising != ADVERTISED_10000baseT_Full) ||\n-\t\t (speed + ecmd->duplex != SPEED_10000 + DUPLEX_FULL))\n+\t\tu32 speed = cmd->base.speed;\n+\n+\t\tif ((cmd->base.autoneg == AUTONEG_ENABLE) ||\n+\t\t (advertising != ADVERTISED_10000baseT_Full) ||\n+\t\t (speed + cmd->base.duplex != SPEED_10000 + DUPLEX_FULL))\n \t\t\treturn -EINVAL;\n \t}\n \n@@ -3343,8 +3357,6 @@ static int ixgbe_set_eee(struct net_device *netdev, struct ethtool_eee *edata)\n }\n \n static const struct ethtool_ops ixgbe_ethtool_ops = {\n-\t.get_settings = ixgbe_get_settings,\n-\t.set_settings = ixgbe_set_settings,\n \t.get_drvinfo = ixgbe_get_drvinfo,\n \t.get_regs_len = ixgbe_get_regs_len,\n \t.get_regs = ixgbe_get_regs,\n@@ -3381,6 +3393,8 @@ static int ixgbe_set_eee(struct net_device *netdev, struct ethtool_eee *edata)\n \t.get_ts_info\t\t= ixgbe_get_ts_info,\n \t.get_module_info\t= ixgbe_get_module_info,\n \t.get_module_eeprom\t= ixgbe_get_module_eeprom,\n+\t.get_link_ksettings = ixgbe_get_link_ksettings,\n+\t.set_link_ksettings = ixgbe_set_link_ksettings,\n };\n \n void ixgbe_set_ethtool_ops(struct net_device *netdev)\n", "prefixes": [] }