Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/613267/?format=api
{ "id": 613267, "url": "http://patchwork.ozlabs.org/api/patches/613267/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20160421183712.21311.37417.stgit@localhost6.localdomain6/", "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": "<20160421183712.21311.37417.stgit@localhost6.localdomain6>", "list_archive_url": null, "date": "2016-04-21T18:37:12", "name": "[2/2] ixgbe: check EEPROM for WOL support for X540 and above", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "1f835ef9e294c38b92450f172fd97070cab18aba", "submitter": { "id": 1670, "url": "http://patchwork.ozlabs.org/api/people/1670/?format=api", "name": "Tantilov, Emil S", "email": "emil.s.tantilov@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/20160421183712.21311.37417.stgit@localhost6.localdomain6/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/613267/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/613267/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 fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\tby ozlabs.org (Postfix) with ESMTP id 3qrSBW4l8Cz9sf9\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 22 Apr 2016 04:36:19 +1000 (AEST)", "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id EBE08C061E;\n\tThu, 21 Apr 2016 18:36:18 +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 eA04KuLiKNa1; Thu, 21 Apr 2016 18:36:18 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 7289BC05ED;\n\tThu, 21 Apr 2016 18:36:18 +0000 (UTC)", "from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n\tby ash.osuosl.org (Postfix) with ESMTP id 48EBF1C1064\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 21 Apr 2016 18:36:17 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 4454796560\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 21 Apr 2016 18:36:17 +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 vS-x7xwjaeAq for <intel-wired-lan@lists.osuosl.org>;\n\tThu, 21 Apr 2016 18:36:15 +0000 (UTC)", "from mga14.intel.com (mga14.intel.com [192.55.52.115])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 8152C9655A\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 21 Apr 2016 18:36:15 +0000 (UTC)", "from orsmga001.jf.intel.com ([10.7.209.18])\n\tby fmsmga103.fm.intel.com with ESMTP; 21 Apr 2016 11:36:14 -0700", "from estantil-desk3.jf.intel.com (HELO localhost6.localdomain6)\n\t([134.134.3.186])\n\tby orsmga001.jf.intel.com with ESMTP; 21 Apr 2016 11:36:14 -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,513,1455004800\"; d=\"scan'208\";a=\"937445900\"", "From": "Emil Tantilov <emil.s.tantilov@intel.com>", "To": "intel-wired-lan@lists.osuosl.org", "Date": "Thu, 21 Apr 2016 11:37:12 -0700", "Message-ID": "<20160421183712.21311.37417.stgit@localhost6.localdomain6>", "In-Reply-To": "<20160421183706.21311.93388.stgit@localhost6.localdomain6>", "References": "<20160421183706.21311.93388.stgit@localhost6.localdomain6>", "User-Agent": "StGit/0.17.1-4-g4a0c1-dirty", "MIME-Version": "1.0", "Subject": "[Intel-wired-lan] [PATCH 2/2] ixgbe: check EEPROM for WOL support\n\tfor X540 and above", "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>", "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": "This change aims to simplify the logic we use to determine WOL\nsupport by reading the EEPROM bits for MACs X540 and newer.\n\nAlso some cleanups in ixgbe_wol_supported() - changed return type to\nbool and removed redundant return variable by simply using return after\nthe checks.\n\n\nSigned-off-by: Emil Tantilov <emil.s.tantilov@intel.com>\n---\n drivers/net/ethernet/intel/ixgbe/ixgbe.h | 4 +-\n drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 49 ++++++++++++-------------\n 2 files changed, 25 insertions(+), 28 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe.h b/drivers/net/ethernet/intel/ixgbe/ixgbe.h\nindex 515c3dc..e216a3d 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe.h\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe.h\n@@ -895,8 +895,8 @@ void ixgbe_configure_tx_ring(struct ixgbe_adapter *, struct ixgbe_ring *);\n void ixgbe_disable_rx_queue(struct ixgbe_adapter *adapter, struct ixgbe_ring *);\n void ixgbe_update_stats(struct ixgbe_adapter *adapter);\n int ixgbe_init_interrupt_scheme(struct ixgbe_adapter *adapter);\n-int ixgbe_wol_supported(struct ixgbe_adapter *adapter, u16 device_id,\n-\t\t\t u16 subdevice_id);\n+bool ixgbe_wol_supported(struct ixgbe_adapter *adapter, u16 device_id,\n+\t\t\t u16 subdevice_id);\n #ifdef CONFIG_PCI_IOV\n void ixgbe_full_sync_mac_table(struct ixgbe_adapter *adapter);\n #endif\ndiff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\nindex 5f621ab..2c04771 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\n@@ -9183,7 +9183,7 @@ static inline int ixgbe_enumerate_functions(struct ixgbe_adapter *adapter)\n \n /**\n * ixgbe_wol_supported - Check whether device supports WoL\n- * @hw: hw specific details\n+ * @adapter: the adapter private structure\n * @device_id: the device ID\n * @subdev_id: the subsystem device ID\n *\n@@ -9191,13 +9191,25 @@ static inline int ixgbe_enumerate_functions(struct ixgbe_adapter *adapter)\n * which devices have WoL support\n *\n **/\n-int ixgbe_wol_supported(struct ixgbe_adapter *adapter, u16 device_id,\n-\t\t\tu16 subdevice_id)\n+bool ixgbe_wol_supported(struct ixgbe_adapter *adapter, u16 device_id,\n+\t\t\t u16 subdevice_id)\n {\n \tstruct ixgbe_hw *hw = &adapter->hw;\n \tu16 wol_cap = adapter->eeprom_cap & IXGBE_DEVICE_CAPS_WOL_MASK;\n-\tint is_wol_supported = 0;\n \n+\t/* WOL not supported on 82598 */\n+\tif (hw->mac.type == ixgbe_mac_82598EB)\n+\t\treturn false;\n+\n+\t/* check eeprom to see if WOL is enabled for X540 and newer */\n+\tif (hw->mac.type >= ixgbe_mac_X540) {\n+\t\tif ((wol_cap == IXGBE_DEVICE_CAPS_WOL_PORT0_1) ||\n+\t\t ((wol_cap == IXGBE_DEVICE_CAPS_WOL_PORT0) &&\n+\t\t (hw->bus.func == 0)))\n+\t\t\treturn true;\n+\t}\n+\n+\t/* WOL is determined based on device IDs for 82599 MACs */\n \tswitch (device_id) {\n \tcase IXGBE_DEV_ID_82599_SFP:\n \t\t/* Only these subdevices could supports WOL */\n@@ -9216,43 +9228,28 @@ int ixgbe_wol_supported(struct ixgbe_adapter *adapter, u16 device_id,\n \t\tcase IXGBE_SUBDEV_ID_82599_SFP_1OCP:\n \t\tcase IXGBE_SUBDEV_ID_82599_SFP_LOM_OEM1:\n \t\tcase IXGBE_SUBDEV_ID_82599_SFP_LOM_OEM2:\n-\t\t\tis_wol_supported = 1;\n-\t\t\tbreak;\n+\t\t\treturn true;\n \t\t}\n \t\tbreak;\n \tcase IXGBE_DEV_ID_82599EN_SFP:\n-\t\t/* Only this subdevice supports WOL */\n+\t\t/* Only these subdevices support WOL */\n \t\tswitch (subdevice_id) {\n \t\tcase IXGBE_SUBDEV_ID_82599EN_SFP_OCP1:\n-\t\t\tis_wol_supported = 1;\n-\t\t\tbreak;\n+\t\t\treturn true;\n \t\t}\n \t\tbreak;\n \tcase IXGBE_DEV_ID_82599_COMBO_BACKPLANE:\n \t\t/* All except this subdevice support WOL */\n \t\tif (subdevice_id != IXGBE_SUBDEV_ID_82599_KX4_KR_MEZZ)\n-\t\t\tis_wol_supported = 1;\n+\t\t\treturn true;\n \t\tbreak;\n \tcase IXGBE_DEV_ID_82599_KX4:\n-\t\tis_wol_supported = 1;\n-\t\tbreak;\n-\tcase IXGBE_DEV_ID_X540T:\n-\tcase IXGBE_DEV_ID_X540T1:\n-\tcase IXGBE_DEV_ID_X550T:\n-\tcase IXGBE_DEV_ID_X550T1:\n-\tcase IXGBE_DEV_ID_X550EM_X_KX4:\n-\tcase IXGBE_DEV_ID_X550EM_X_KR:\n-\tcase IXGBE_DEV_ID_X550EM_X_10G_T:\n-\t\t/* check eeprom to see if enabled wol */\n-\t\tif ((wol_cap == IXGBE_DEVICE_CAPS_WOL_PORT0_1) ||\n-\t\t ((wol_cap == IXGBE_DEVICE_CAPS_WOL_PORT0) &&\n-\t\t (hw->bus.func == 0))) {\n-\t\t\tis_wol_supported = 1;\n-\t\t}\n+\t\treturn true;\n+\tdefault:\n \t\tbreak;\n \t}\n \n-\treturn is_wol_supported;\n+\treturn false;\n }\n \n /**\n", "prefixes": [ "2/2" ] }