Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/1232627/?format=api
{ "id": 1232627, "url": "http://patchwork.ozlabs.org/api/patches/1232627/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20200203075520.16976-1-sasha.neftin@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": "<20200203075520.16976-1-sasha.neftin@intel.com>", "list_archive_url": null, "date": "2020-02-03T07:55:20", "name": "[v1,1/1] igc: Add WOL support", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "73c32ced69963bbcec3e428a782a71df8c16d352", "submitter": { "id": 69860, "url": "http://patchwork.ozlabs.org/api/people/69860/?format=api", "name": "Sasha Neftin", "email": "sasha.neftin@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/20200203075520.16976-1-sasha.neftin@intel.com/mbox/", "series": [ { "id": 156431, "url": "http://patchwork.ozlabs.org/api/series/156431/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=156431", "date": "2020-02-03T07:55:20", "name": "[v1,1/1] igc: Add WOL support", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/156431/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/1232627/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/1232627/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<intel-wired-lan-bounces@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" ], "Authentication-Results": [ "ozlabs.org; spf=pass (sender SPF authorized)\n\tsmtp.mailfrom=osuosl.org (client-ip=140.211.166.133;\n\thelo=hemlock.osuosl.org;\n\tenvelope-from=intel-wired-lan-bounces@osuosl.org;\n\treceiver=<UNKNOWN>)", "ozlabs.org;\n\tdmarc=fail (p=none dis=none) header.from=intel.com" ], "Received": [ "from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 48B0Vs6SQpz9sPK\n\tfor <incoming@patchwork.ozlabs.org>;\n\tMon, 3 Feb 2020 18:55:31 +1100 (AEDT)", "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id AA56D8754B;\n\tMon, 3 Feb 2020 07:55:26 +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 BnMFn9lha5wy; Mon, 3 Feb 2020 07:55:25 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 2D70587702;\n\tMon, 3 Feb 2020 07:55:25 +0000 (UTC)", "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\tby ash.osuosl.org (Postfix) with ESMTP id 67CF71BF5DE\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 3 Feb 2020 07:55:24 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 61DA485C98\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 3 Feb 2020 07:55:24 +0000 (UTC)", "from whitealder.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id OlbdWqrNNEFC for <intel-wired-lan@lists.osuosl.org>;\n\tMon, 3 Feb 2020 07:55:22 +0000 (UTC)", "from mga12.intel.com (mga12.intel.com [192.55.52.136])\n\tby whitealder.osuosl.org (Postfix) with ESMTPS id 47C9B85C20\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 3 Feb 2020 07:55:22 +0000 (UTC)", "from orsmga005.jf.intel.com ([10.7.209.41])\n\tby fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t02 Feb 2020 23:55:21 -0800", "from ccdlinuxdev09.iil.intel.com ([143.185.163.21])\n\tby orsmga005.jf.intel.com with ESMTP; 02 Feb 2020 23:55:20 -0800" ], "X-Virus-Scanned": [ "amavisd-new at osuosl.org", "amavisd-new at osuosl.org" ], "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6", "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.70,397,1574150400\"; d=\"scan'208\";a=\"403361745\"", "From": "Sasha Neftin <sasha.neftin@intel.com>", "To": "intel-wired-lan@lists.osuosl.org", "Date": "Mon, 3 Feb 2020 09:55:20 +0200", "Message-Id": "<20200203075520.16976-1-sasha.neftin@intel.com>", "X-Mailer": "git-send-email 2.11.0", "Subject": "[Intel-wired-lan] [PATCH v1 1/1] igc: Add WOL support", "X-BeenThere": "intel-wired-lan@osuosl.org", "X-Mailman-Version": "2.1.29", "Precedence": "list", "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n\t<intel-wired-lan.osuosl.org>", "List-Unsubscribe": "<https://lists.osuosl.org/mailman/options/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@osuosl.org?subject=unsubscribe>", "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>", "List-Post": "<mailto:intel-wired-lan@osuosl.org>", "List-Help": "<mailto:intel-wired-lan-request@osuosl.org?subject=help>", "List-Subscribe": "<https://lists.osuosl.org/mailman/listinfo/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@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@osuosl.org", "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@osuosl.org>" }, "content": "This patch adds a define and WOL support for an i225 parts.\n\nSigned-off-by: Sasha Neftin <sasha.neftin@intel.com>\n---\n drivers/net/ethernet/intel/igc/igc.h | 1 +\n drivers/net/ethernet/intel/igc/igc_defines.h | 3 ++\n drivers/net/ethernet/intel/igc/igc_ethtool.c | 61 ++++++++++++++++++++++++++++\n drivers/net/ethernet/intel/igc/igc_main.c | 10 +++++\n 4 files changed, 75 insertions(+)", "diff": "diff --git a/drivers/net/ethernet/intel/igc/igc.h b/drivers/net/ethernet/intel/igc/igc.h\nindex 34300f551d84..7202c3761068 100644\n--- a/drivers/net/ethernet/intel/igc/igc.h\n+++ b/drivers/net/ethernet/intel/igc/igc.h\n@@ -61,6 +61,7 @@ extern char igc_driver_version[];\n #define IGC_FLAG_QUEUE_PAIRS\t\tBIT(3)\n #define IGC_FLAG_DMAC\t\t\tBIT(4)\n #define IGC_FLAG_PTP\t\t\tBIT(8)\n+#define IGC_FLAG_WOL_SUPPORTED\t\tBIT(8)\n #define IGC_FLAG_NEED_LINK_UPDATE\tBIT(9)\n #define IGC_FLAG_MEDIA_RESET\t\tBIT(10)\n #define IGC_FLAG_MAS_ENABLE\t\tBIT(12)\ndiff --git a/drivers/net/ethernet/intel/igc/igc_defines.h b/drivers/net/ethernet/intel/igc/igc_defines.h\nindex d400786fc413..6468253ec4f5 100644\n--- a/drivers/net/ethernet/intel/igc/igc_defines.h\n+++ b/drivers/net/ethernet/intel/igc/igc_defines.h\n@@ -16,7 +16,10 @@\n \n /* Wake Up Filter Control */\n #define IGC_WUFC_LNKC\t0x00000001 /* Link Status Change Wakeup Enable */\n+#define IGC_WUFC_MAG\t0x00000002 /* Magic Packet Wakeup Enable */\n+#define IGC_WUFC_EX\t0x00000004 /* Directed Exact Wakeup Enable */\n #define IGC_WUFC_MC\t0x00000008 /* Directed Multicast Wakeup Enable */\n+#define IGC_WUFC_BC\t0x00000010 /* Broadcast Wakeup Enable */\n \n #define IGC_CTRL_ADVD3WUC\t0x00100000 /* D3 WUC */\n \ndiff --git a/drivers/net/ethernet/intel/igc/igc_ethtool.c b/drivers/net/ethernet/intel/igc/igc_ethtool.c\nindex ee07011e13e9..69f50b8e2af3 100644\n--- a/drivers/net/ethernet/intel/igc/igc_ethtool.c\n+++ b/drivers/net/ethernet/intel/igc/igc_ethtool.c\n@@ -308,6 +308,65 @@ static void igc_get_regs(struct net_device *netdev,\n \t\tregs_buff[168 + i] = rd32(IGC_TXDCTL(i));\n }\n \n+static void igc_get_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)\n+{\n+\tstruct igc_adapter *adapter = netdev_priv(netdev);\n+\n+\twol->wolopts = 0;\n+\n+\tif (!(adapter->flags & IGC_FLAG_WOL_SUPPORTED))\n+\t\treturn;\n+\n+\twol->supported = WAKE_UCAST | WAKE_MCAST |\n+\t\t\t WAKE_BCAST | WAKE_MAGIC |\n+\t\t\t WAKE_PHY;\n+\n+\t/* apply any specific unsupported masks here */\n+\tswitch (adapter->hw.device_id) {\n+\tdefault:\n+\t\tbreak;\n+\t}\n+\n+\tif (adapter->wol & IGC_WUFC_EX)\n+\t\twol->wolopts |= WAKE_UCAST;\n+\tif (adapter->wol & IGC_WUFC_MC)\n+\t\twol->wolopts |= WAKE_MCAST;\n+\tif (adapter->wol & IGC_WUFC_BC)\n+\t\twol->wolopts |= WAKE_BCAST;\n+\tif (adapter->wol & IGC_WUFC_MAG)\n+\t\twol->wolopts |= WAKE_MAGIC;\n+\tif (adapter->wol & IGC_WUFC_LNKC)\n+\t\twol->wolopts |= WAKE_PHY;\n+}\n+\n+static int igc_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)\n+{\n+\tstruct igc_adapter *adapter = netdev_priv(netdev);\n+\n+\tif (wol->wolopts & (WAKE_ARP | WAKE_MAGICSECURE | WAKE_FILTER))\n+\t\treturn -EOPNOTSUPP;\n+\n+\tif (!(adapter->flags & IGC_FLAG_WOL_SUPPORTED))\n+\t\treturn wol->wolopts ? -EOPNOTSUPP : 0;\n+\n+\t/* these settings will always override what we currently have */\n+\tadapter->wol = 0;\n+\n+\tif (wol->wolopts & WAKE_UCAST)\n+\t\tadapter->wol |= IGC_WUFC_EX;\n+\tif (wol->wolopts & WAKE_MCAST)\n+\t\tadapter->wol |= IGC_WUFC_MC;\n+\tif (wol->wolopts & WAKE_BCAST)\n+\t\tadapter->wol |= IGC_WUFC_BC;\n+\tif (wol->wolopts & WAKE_MAGIC)\n+\t\tadapter->wol |= IGC_WUFC_MAG;\n+\tif (wol->wolopts & WAKE_PHY)\n+\t\tadapter->wol |= IGC_WUFC_LNKC;\n+\tdevice_set_wakeup_enable(&adapter->pdev->dev, adapter->wol);\n+\n+\treturn 0;\n+}\n+\n static u32 igc_get_msglevel(struct net_device *netdev)\n {\n \tstruct igc_adapter *adapter = netdev_priv(netdev);\n@@ -1859,6 +1918,8 @@ static const struct ethtool_ops igc_ethtool_ops = {\n \t.get_drvinfo\t\t= igc_get_drvinfo,\n \t.get_regs_len\t\t= igc_get_regs_len,\n \t.get_regs\t\t= igc_get_regs,\n+\t.get_wol\t\t= igc_get_wol,\n+\t.set_wol\t\t= igc_set_wol,\n \t.get_msglevel\t\t= igc_get_msglevel,\n \t.set_msglevel\t\t= igc_set_msglevel,\n \t.nway_reset\t\t= igc_nway_reset,\ndiff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c\nindex af5dd43a4c6c..dec6f5a4f03f 100644\n--- a/drivers/net/ethernet/intel/igc/igc_main.c\n+++ b/drivers/net/ethernet/intel/igc/igc_main.c\n@@ -4966,6 +4966,16 @@ static int igc_probe(struct pci_dev *pdev,\n \thw->fc.requested_mode = igc_fc_default;\n \thw->fc.current_mode = igc_fc_default;\n \n+\t/* By default, support wake on port A */\n+\tadapter->flags |= IGC_FLAG_WOL_SUPPORTED;\n+\n+\t/* initialize the wol settings based on the eeprom settings */\n+\tif (adapter->flags & IGC_FLAG_WOL_SUPPORTED)\n+\t\tadapter->wol |= IGC_WUFC_MAG;\n+\n+\tdevice_set_wakeup_enable(&adapter->pdev->dev,\n+\t\t\t\t adapter->flags & IGC_FLAG_WOL_SUPPORTED);\n+\n \t/* reset the hardware with the new settings */\n \tigc_reset(adapter);\n \n", "prefixes": [ "v1", "1/1" ] }