get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/618191/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 618191,
    "url": "http://patchwork.ozlabs.org/api/patches/618191/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/1462313600-3123-7-git-send-email-bimmy.pujari@intel.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": "<1462313600-3123-7-git-send-email-bimmy.pujari@intel.com>",
    "list_archive_url": null,
    "date": "2016-05-03T22:13:14",
    "name": "[next,S36,06/12] i40e: Refactor ethtool get_settings",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "f2967050e37f3417ec1b0bba6a1b7cff20a89ce8",
    "submitter": {
        "id": 68919,
        "url": "http://patchwork.ozlabs.org/api/people/68919/?format=api",
        "name": "Pujari, Bimmy",
        "email": "bimmy.pujari@intel.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/1462313600-3123-7-git-send-email-bimmy.pujari@intel.com/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/618191/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/618191/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\tby ozlabs.org (Postfix) with ESMTP id 3qzxkt5KnTz9t69\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed,  4 May 2016 09:11:50 +1000 (AEST)",
            "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 161AA8739B;\n\tTue,  3 May 2016 23:11:50 +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 yZ-ONyGUaZ16; Tue,  3 May 2016 23:11:48 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id EB06987925;\n\tTue,  3 May 2016 23:11:47 +0000 (UTC)",
            "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\tby ash.osuosl.org (Postfix) with ESMTP id CE8971C0E66\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue,  3 May 2016 23:11:41 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id C93B5885B8\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue,  3 May 2016 23:11:41 +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 CXo6W8twKdEk for <intel-wired-lan@lists.osuosl.org>;\n\tTue,  3 May 2016 23:11:38 +0000 (UTC)",
            "from mga04.intel.com (mga04.intel.com [192.55.52.120])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 21933896D8\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue,  3 May 2016 23:11:38 +0000 (UTC)",
            "from orsmga002.jf.intel.com ([10.7.209.21])\n\tby fmsmga104.fm.intel.com with ESMTP; 03 May 2016 16:11:20 -0700",
            "from bimmy.jf.intel.com (HELO bimmy.linux1.jf.intel.com)\n\t([134.134.2.117])\n\tby orsmga002.jf.intel.com with ESMTP; 03 May 2016 16:11:20 -0700"
        ],
        "X-Virus-Scanned": [
            "amavisd-new at osuosl.org",
            "amavisd-new at osuosl.org"
        ],
        "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.24,574,1455004800\"; d=\"scan'208\";a=\"968055128\"",
        "From": "Bimmy Pujari <bimmy.pujari@intel.com>",
        "To": "intel-wired-lan@lists.osuosl.org",
        "Date": "Tue,  3 May 2016 15:13:14 -0700",
        "Message-Id": "<1462313600-3123-7-git-send-email-bimmy.pujari@intel.com>",
        "X-Mailer": "git-send-email 2.4.11",
        "In-Reply-To": "<1462313600-3123-1-git-send-email-bimmy.pujari@intel.com>",
        "References": "<1462313600-3123-1-git-send-email-bimmy.pujari@intel.com>",
        "Subject": "[Intel-wired-lan] [next PATCH S36 06/12] i40e: Refactor ethtool\n\tget_settings",
        "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": "From: Catherine Sullivan <catherine.sullivan@intel.com>\n\nPreviously we were only looking at the FW supported phy types if link\nwas down, because we want to be more specific when link is up. This\nrefactor changes this. When link is down, we still rely on the FW\nsupported phy types, but when link is up, we select the possible\nsupported link modes from what we know about the current phy type, and\nAND that with the FW supported phy types.\n\nSigned-off-by: Catherine Sullivan <catherine.sullivan@intel.com>\nChange-ID: Ice5dad83f2a17932b0b8b59f07439696ad6aa013\n---\nTesting Hints:\nMake sure that various cables and cards report the\ncorrect supported/advertised link settings with ethtool.\n\n drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 258 +++++++++++++------------\n 1 file changed, 135 insertions(+), 123 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c\nindex a9ff781..dce812e 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c\n@@ -262,6 +262,110 @@ static void i40e_partition_setting_complaint(struct i40e_pf *pf)\n }\n \n /**\n+ * i40e_phy_type_to_ethtool - convert the phy_types to ethtool link modes\n+ * @phy_types: phy types to convert\n+ * @supported: pointer to the ethtool supported variable to fill in\n+ * @advertising: pointer to the ethtool advertising variable to fill in\n+ *\n+ **/\n+static void i40e_phy_type_to_ethtool(struct i40e_pf *pf, u32 *supported,\n+\t\t\t\t     u32 *advertising)\n+{\n+\tenum i40e_aq_capabilities_phy_type phy_types = pf->hw.phy.phy_types;\n+\n+\t*supported = 0x0;\n+\t*advertising = 0x0;\n+\n+\tif (phy_types & I40E_CAP_PHY_TYPE_SGMII) {\n+\t\t*supported |= SUPPORTED_Autoneg |\n+\t\t\t     SUPPORTED_1000baseT_Full;\n+\t\t*advertising |= ADVERTISED_Autoneg |\n+\t\t\t       ADVERTISED_1000baseT_Full;\n+\t\tif (pf->flags & I40E_FLAG_100M_SGMII_CAPABLE) {\n+\t\t\t*supported |= SUPPORTED_100baseT_Full;\n+\t\t\t*advertising |= ADVERTISED_100baseT_Full;\n+\t\t}\n+\t}\n+\tif (phy_types & I40E_CAP_PHY_TYPE_XAUI ||\n+\t    phy_types & I40E_CAP_PHY_TYPE_XFI ||\n+\t    phy_types & I40E_CAP_PHY_TYPE_SFI ||\n+\t    phy_types & I40E_CAP_PHY_TYPE_10GBASE_SFPP_CU ||\n+\t    phy_types & I40E_CAP_PHY_TYPE_10GBASE_AOC)\n+\t\t*supported |= SUPPORTED_10000baseT_Full;\n+\tif (phy_types & I40E_CAP_PHY_TYPE_10GBASE_CR1_CU ||\n+\t    phy_types & I40E_CAP_PHY_TYPE_10GBASE_CR1 ||\n+\t    phy_types & I40E_CAP_PHY_TYPE_10GBASE_T ||\n+\t    phy_types & I40E_CAP_PHY_TYPE_10GBASE_SR ||\n+\t    phy_types & I40E_CAP_PHY_TYPE_10GBASE_LR) {\n+\t\t*supported |= SUPPORTED_Autoneg |\n+\t\t\t     SUPPORTED_10000baseT_Full;\n+\t\t*advertising |= ADVERTISED_Autoneg |\n+\t\t\t       ADVERTISED_10000baseT_Full;\n+\t}\n+\tif (phy_types & I40E_CAP_PHY_TYPE_XLAUI ||\n+\t    phy_types & I40E_CAP_PHY_TYPE_XLPPI ||\n+\t    phy_types & I40E_CAP_PHY_TYPE_40GBASE_AOC)\n+\t\t*supported |= SUPPORTED_40000baseCR4_Full;\n+\tif (phy_types & I40E_CAP_PHY_TYPE_40GBASE_CR4_CU ||\n+\t    phy_types & I40E_CAP_PHY_TYPE_40GBASE_CR4) {\n+\t\t*supported |= SUPPORTED_Autoneg |\n+\t\t\t     SUPPORTED_40000baseCR4_Full;\n+\t\t*advertising |= ADVERTISED_Autoneg |\n+\t\t\t       ADVERTISED_40000baseCR4_Full;\n+\t}\n+\tif ((phy_types & I40E_CAP_PHY_TYPE_100BASE_TX) &&\n+\t    !(phy_types & I40E_CAP_PHY_TYPE_1000BASE_T)) {\n+\t\t*supported |= SUPPORTED_Autoneg |\n+\t\t\t     SUPPORTED_100baseT_Full;\n+\t\t*advertising |= ADVERTISED_Autoneg |\n+\t\t\t       ADVERTISED_100baseT_Full;\n+\t}\n+\tif (phy_types & I40E_CAP_PHY_TYPE_1000BASE_T ||\n+\t    phy_types & I40E_CAP_PHY_TYPE_1000BASE_SX ||\n+\t    phy_types & I40E_CAP_PHY_TYPE_1000BASE_LX ||\n+\t    phy_types & I40E_CAP_PHY_TYPE_1000BASE_T_OPTICAL) {\n+\t\t*supported |= SUPPORTED_Autoneg |\n+\t\t\t     SUPPORTED_1000baseT_Full;\n+\t\t*advertising |= ADVERTISED_Autoneg |\n+\t\t\t       ADVERTISED_1000baseT_Full;\n+\t}\n+\tif (phy_types & I40E_CAP_PHY_TYPE_40GBASE_SR4)\n+\t\t*supported |= SUPPORTED_40000baseSR4_Full;\n+\tif (phy_types & I40E_CAP_PHY_TYPE_40GBASE_LR4)\n+\t\t*supported |= SUPPORTED_40000baseLR4_Full;\n+\tif (phy_types & I40E_CAP_PHY_TYPE_40GBASE_KR4) {\n+\t\t*supported |= SUPPORTED_40000baseKR4_Full |\n+\t\t\t     SUPPORTED_Autoneg;\n+\t\t*advertising |= ADVERTISED_40000baseKR4_Full |\n+\t\t\t       ADVERTISED_Autoneg;\n+\t}\n+\tif (phy_types & I40E_CAP_PHY_TYPE_20GBASE_KR2) {\n+\t\t*supported |= SUPPORTED_20000baseKR2_Full |\n+\t\t\t     SUPPORTED_Autoneg;\n+\t\t*advertising |= ADVERTISED_20000baseKR2_Full |\n+\t\t\t       ADVERTISED_Autoneg;\n+\t}\n+\tif (phy_types & I40E_CAP_PHY_TYPE_10GBASE_KR) {\n+\t\t*supported |= SUPPORTED_10000baseKR_Full |\n+\t\t\t     SUPPORTED_Autoneg;\n+\t\t*advertising |= ADVERTISED_10000baseKR_Full |\n+\t\t\t       ADVERTISED_Autoneg;\n+\t}\n+\tif (phy_types & I40E_CAP_PHY_TYPE_10GBASE_KX4) {\n+\t\t*supported |= SUPPORTED_10000baseKX4_Full |\n+\t\t\t     SUPPORTED_Autoneg;\n+\t\t*advertising |= ADVERTISED_10000baseKX4_Full |\n+\t\t\t       ADVERTISED_Autoneg;\n+\t}\n+\tif (phy_types & I40E_CAP_PHY_TYPE_1000BASE_KX) {\n+\t\t*supported |= SUPPORTED_1000baseKX_Full |\n+\t\t\t     SUPPORTED_Autoneg;\n+\t\t*advertising |= ADVERTISED_1000baseKX_Full |\n+\t\t\t       ADVERTISED_Autoneg;\n+\t}\n+}\n+\n+/**\n  * i40e_get_settings_link_up - Get the Link settings for when link is up\n  * @hw: hw structure\n  * @ecmd: ethtool command to fill in\n@@ -275,6 +379,8 @@ static void i40e_get_settings_link_up(struct i40e_hw *hw,\n {\n \tstruct i40e_link_status *hw_link_info = &hw->phy.link_info;\n \tu32 link_speed = hw_link_info->link_speed;\n+\tu32 e_advertising = 0x0;\n+\tu32 e_supported = 0x0;\n \n \t/* Initialize supported and advertised settings based on phy settings */\n \tswitch (hw_link_info->phy_type) {\n@@ -315,21 +421,18 @@ static void i40e_get_settings_link_up(struct i40e_hw *hw,\n \t\tbreak;\n \tcase I40E_PHY_TYPE_10GBASE_T:\n \tcase I40E_PHY_TYPE_1000BASE_T:\n+\tcase I40E_PHY_TYPE_100BASE_TX:\n \t\tecmd->supported = SUPPORTED_Autoneg |\n \t\t\t\t  SUPPORTED_10000baseT_Full |\n-\t\t\t\t  SUPPORTED_1000baseT_Full;\n+\t\t\t\t  SUPPORTED_1000baseT_Full |\n+\t\t\t\t  SUPPORTED_100baseT_Full;\n \t\tecmd->advertising = ADVERTISED_Autoneg;\n \t\tif (hw_link_info->requested_speeds & I40E_LINK_SPEED_10GB)\n \t\t\tecmd->advertising |= ADVERTISED_10000baseT_Full;\n \t\tif (hw_link_info->requested_speeds & I40E_LINK_SPEED_1GB)\n \t\t\tecmd->advertising |= ADVERTISED_1000baseT_Full;\n-\t\t/* adding 100baseT support for 10GBASET_PHY */\n-\t\tif (pf->flags & I40E_FLAG_HAVE_10GBASET_PHY) {\n-\t\t\tecmd->supported |= SUPPORTED_100baseT_Full;\n-\t\t\tecmd->advertising |= ADVERTISED_100baseT_Full |\n-\t\t\t\t\t     ADVERTISED_1000baseT_Full |\n-\t\t\t\t\t     ADVERTISED_10000baseT_Full;\n-\t\t}\n+\t\tif (hw_link_info->requested_speeds & I40E_LINK_SPEED_100MB)\n+\t\t\tecmd->advertising |= ADVERTISED_100baseT_Full;\n \t\tbreak;\n \tcase I40E_PHY_TYPE_1000BASE_T_OPTICAL:\n \t\tecmd->supported = SUPPORTED_Autoneg |\n@@ -337,21 +440,6 @@ static void i40e_get_settings_link_up(struct i40e_hw *hw,\n \t\tecmd->advertising = ADVERTISED_Autoneg |\n \t\t\t\t    ADVERTISED_1000baseT_Full;\n \t\tbreak;\n-\tcase I40E_PHY_TYPE_100BASE_TX:\n-\t\tecmd->supported = SUPPORTED_Autoneg |\n-\t\t\t\t  SUPPORTED_100baseT_Full;\n-\t\tif (hw_link_info->requested_speeds & I40E_LINK_SPEED_100MB)\n-\t\t\tecmd->advertising |= ADVERTISED_100baseT_Full;\n-\t\t/* firmware detects 10G phy as 100M phy at 100M speed */\n-\t\tif (pf->flags & I40E_FLAG_HAVE_10GBASET_PHY) {\n-\t\t\tecmd->supported |= SUPPORTED_10000baseT_Full |\n-\t\t\t\t\t   SUPPORTED_1000baseT_Full;\n-\t\t\tecmd->advertising |= ADVERTISED_Autoneg |\n-\t\t\t\t\t     ADVERTISED_100baseT_Full |\n-\t\t\t\t\t     ADVERTISED_1000baseT_Full |\n-\t\t\t\t\t     ADVERTISED_10000baseT_Full;\n-\t\t}\n-\t\tbreak;\n \tcase I40E_PHY_TYPE_10GBASE_CR1_CU:\n \tcase I40E_PHY_TYPE_10GBASE_CR1:\n \t\tecmd->supported = SUPPORTED_Autoneg |\n@@ -378,14 +466,23 @@ static void i40e_get_settings_link_up(struct i40e_hw *hw,\n \t\t\t\tecmd->advertising |= ADVERTISED_100baseT_Full;\n \t\t}\n \t\tbreak;\n-\t/* Backplane is set based on supported phy types in get_settings\n-\t * so don't set anything here but don't warn either\n-\t */\n \tcase I40E_PHY_TYPE_40GBASE_KR4:\n \tcase I40E_PHY_TYPE_20GBASE_KR2:\n \tcase I40E_PHY_TYPE_10GBASE_KR:\n \tcase I40E_PHY_TYPE_10GBASE_KX4:\n \tcase I40E_PHY_TYPE_1000BASE_KX:\n+\t\tecmd->supported |= SUPPORTED_40000baseKR4_Full |\n+\t\t\t\t   SUPPORTED_20000baseKR2_Full |\n+\t\t\t\t   SUPPORTED_10000baseKR_Full |\n+\t\t\t\t   SUPPORTED_10000baseKX4_Full |\n+\t\t\t\t   SUPPORTED_1000baseKX_Full |\n+\t\t\t\t   SUPPORTED_Autoneg;\n+\t\tecmd->advertising |= ADVERTISED_40000baseKR4_Full |\n+\t\t\t\t     ADVERTISED_20000baseKR2_Full |\n+\t\t\t\t     ADVERTISED_10000baseKR_Full |\n+\t\t\t\t     ADVERTISED_10000baseKX4_Full |\n+\t\t\t\t     ADVERTISED_1000baseKX_Full |\n+\t\t\t\t     ADVERTISED_Autoneg;\n \t\tbreak;\n \tdefault:\n \t\t/* if we got here and link is up something bad is afoot */\n@@ -393,6 +490,16 @@ static void i40e_get_settings_link_up(struct i40e_hw *hw,\n \t\t\t    hw_link_info->phy_type);\n \t}\n \n+\t/* Now that we've worked out everything that could be supported by the\n+\t * current phy type, get what is supported by the NVM and and them to\n+\t * get what is truly supported\n+\t */\n+\ti40e_phy_type_to_ethtool(pf, &e_supported,\n+\t\t\t\t &e_advertising);\n+\n+\tecmd->supported = ecmd->supported & e_supported;\n+\tecmd->advertising = ecmd->advertising & e_advertising;\n+\n \t/* Set speed and duplex */\n \tswitch (link_speed) {\n \tcase I40E_LINK_SPEED_40GB:\n@@ -427,74 +534,11 @@ static void i40e_get_settings_link_down(struct i40e_hw *hw,\n \t\t\t\t\tstruct ethtool_cmd *ecmd,\n \t\t\t\t\tstruct i40e_pf *pf)\n {\n-\tenum i40e_aq_capabilities_phy_type phy_types = hw->phy.phy_types;\n-\n \t/* link is down and the driver needs to fall back on\n \t * supported phy types to figure out what info to display\n \t */\n-\tecmd->supported = 0x0;\n-\tecmd->advertising = 0x0;\n-\tif (phy_types & I40E_CAP_PHY_TYPE_SGMII) {\n-\t\tecmd->supported |= SUPPORTED_Autoneg |\n-\t\t\t\t   SUPPORTED_1000baseT_Full;\n-\t\tecmd->advertising |= ADVERTISED_Autoneg |\n-\t\t\t\t     ADVERTISED_1000baseT_Full;\n-\t\tif (pf->hw.mac.type == I40E_MAC_X722) {\n-\t\t\tecmd->supported |= SUPPORTED_100baseT_Full;\n-\t\t\tecmd->advertising |= ADVERTISED_100baseT_Full;\n-\t\t\tif (pf->flags & I40E_FLAG_100M_SGMII_CAPABLE) {\n-\t\t\t\tecmd->supported |= SUPPORTED_100baseT_Full;\n-\t\t\t\tecmd->advertising |= ADVERTISED_100baseT_Full;\n-\t\t\t}\n-\t\t}\n-\t}\n-\tif (phy_types & I40E_CAP_PHY_TYPE_XAUI ||\n-\t    phy_types & I40E_CAP_PHY_TYPE_XFI ||\n-\t    phy_types & I40E_CAP_PHY_TYPE_SFI ||\n-\t    phy_types & I40E_CAP_PHY_TYPE_10GBASE_SFPP_CU ||\n-\t    phy_types & I40E_CAP_PHY_TYPE_10GBASE_AOC)\n-\t\tecmd->supported |= SUPPORTED_10000baseT_Full;\n-\tif (phy_types & I40E_CAP_PHY_TYPE_10GBASE_CR1_CU ||\n-\t    phy_types & I40E_CAP_PHY_TYPE_10GBASE_CR1 ||\n-\t    phy_types & I40E_CAP_PHY_TYPE_10GBASE_T ||\n-\t    phy_types & I40E_CAP_PHY_TYPE_10GBASE_SR ||\n-\t    phy_types & I40E_CAP_PHY_TYPE_10GBASE_LR) {\n-\t\tecmd->supported |= SUPPORTED_Autoneg |\n-\t\t\t\t   SUPPORTED_10000baseT_Full;\n-\t\tecmd->advertising |= ADVERTISED_Autoneg |\n-\t\t\t\t     ADVERTISED_10000baseT_Full;\n-\t}\n-\tif (phy_types & I40E_CAP_PHY_TYPE_XLAUI ||\n-\t    phy_types & I40E_CAP_PHY_TYPE_XLPPI ||\n-\t    phy_types & I40E_CAP_PHY_TYPE_40GBASE_AOC)\n-\t\tecmd->supported |= SUPPORTED_40000baseCR4_Full;\n-\tif (phy_types & I40E_CAP_PHY_TYPE_40GBASE_CR4_CU ||\n-\t    phy_types & I40E_CAP_PHY_TYPE_40GBASE_CR4) {\n-\t\tecmd->supported |= SUPPORTED_Autoneg |\n-\t\t\t\t  SUPPORTED_40000baseCR4_Full;\n-\t\tecmd->advertising |= ADVERTISED_Autoneg |\n-\t\t\t\t    ADVERTISED_40000baseCR4_Full;\n-\t}\n-\tif ((phy_types & I40E_CAP_PHY_TYPE_100BASE_TX) &&\n-\t    !(phy_types & I40E_CAP_PHY_TYPE_1000BASE_T)) {\n-\t\tecmd->supported |= SUPPORTED_Autoneg |\n-\t\t\t\t   SUPPORTED_100baseT_Full;\n-\t\tecmd->advertising |= ADVERTISED_Autoneg |\n-\t\t\t\t     ADVERTISED_100baseT_Full;\n-\t}\n-\tif (phy_types & I40E_CAP_PHY_TYPE_1000BASE_T ||\n-\t    phy_types & I40E_CAP_PHY_TYPE_1000BASE_SX ||\n-\t    phy_types & I40E_CAP_PHY_TYPE_1000BASE_LX ||\n-\t    phy_types & I40E_CAP_PHY_TYPE_1000BASE_T_OPTICAL) {\n-\t\tecmd->supported |= SUPPORTED_Autoneg |\n-\t\t\t\t   SUPPORTED_1000baseT_Full;\n-\t\tecmd->advertising |= ADVERTISED_Autoneg |\n-\t\t\t\t     ADVERTISED_1000baseT_Full;\n-\t}\n-\tif (phy_types & I40E_CAP_PHY_TYPE_40GBASE_SR4)\n-\t\tecmd->supported |= SUPPORTED_40000baseSR4_Full;\n-\tif (phy_types & I40E_CAP_PHY_TYPE_40GBASE_LR4)\n-\t\tecmd->supported |= SUPPORTED_40000baseLR4_Full;\n+\ti40e_phy_type_to_ethtool(pf, &ecmd->supported,\n+\t\t\t\t &ecmd->advertising);\n \n \t/* With no link speed and duplex are unknown */\n \tethtool_cmd_speed_set(ecmd, SPEED_UNKNOWN);\n@@ -523,38 +567,6 @@ static int i40e_get_settings(struct net_device *netdev,\n \t\ti40e_get_settings_link_down(hw, ecmd, pf);\n \n \t/* Now set the settings that don't rely on link being up/down */\n-\n-\t/* For backplane, supported and advertised are only reliant on the\n-\t * phy types the NVM specifies are supported.\n-\t */\n-\tif (hw->device_id == I40E_DEV_ID_KX_B ||\n-\t    hw->device_id == I40E_DEV_ID_KX_C ||\n-\t    hw->device_id == I40E_DEV_ID_20G_KR2 ||\n-\t    hw->device_id ==  I40E_DEV_ID_20G_KR2_A) {\n-\t\tecmd->supported = SUPPORTED_Autoneg;\n-\t\tecmd->advertising = ADVERTISED_Autoneg;\n-\t\tif (hw->phy.phy_types & I40E_CAP_PHY_TYPE_40GBASE_KR4) {\n-\t\t\tecmd->supported |= SUPPORTED_40000baseKR4_Full;\n-\t\t\tecmd->advertising |= ADVERTISED_40000baseKR4_Full;\n-\t\t}\n-\t\tif (hw->phy.phy_types & I40E_CAP_PHY_TYPE_20GBASE_KR2) {\n-\t\t\tecmd->supported |= SUPPORTED_20000baseKR2_Full;\n-\t\t\tecmd->advertising |= ADVERTISED_20000baseKR2_Full;\n-\t\t}\n-\t\tif (hw->phy.phy_types & I40E_CAP_PHY_TYPE_10GBASE_KR) {\n-\t\t\tecmd->supported |= SUPPORTED_10000baseKR_Full;\n-\t\t\tecmd->advertising |= ADVERTISED_10000baseKR_Full;\n-\t\t}\n-\t\tif (hw->phy.phy_types & I40E_CAP_PHY_TYPE_10GBASE_KX4) {\n-\t\t\tecmd->supported |= SUPPORTED_10000baseKX4_Full;\n-\t\t\tecmd->advertising |= ADVERTISED_10000baseKX4_Full;\n-\t\t}\n-\t\tif (hw->phy.phy_types & I40E_CAP_PHY_TYPE_1000BASE_KX) {\n-\t\t\tecmd->supported |= SUPPORTED_1000baseKX_Full;\n-\t\t\tecmd->advertising |= ADVERTISED_1000baseKX_Full;\n-\t\t}\n-\t}\n-\n \t/* Set autoneg settings */\n \tecmd->autoneg = ((hw_link_info->an_info & I40E_AQ_AN_COMPLETED) ?\n \t\t\t  AUTONEG_ENABLE : AUTONEG_DISABLE);\n",
    "prefixes": [
        "next",
        "S36",
        "06/12"
    ]
}