get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 1016222,
    "url": "http://patchwork.ozlabs.org/api/patches/1016222/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20181219180334.1104-5-anirudh.venkataramanan@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": "<20181219180334.1104-5-anirudh.venkataramanan@intel.com>",
    "list_archive_url": null,
    "date": "2018-12-19T18:03:23",
    "name": "[S10,04/15] ice: Add ethtool set_phys_id handler",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "a0cb06929457cf959a99b76a409a946898003fbf",
    "submitter": {
        "id": 73601,
        "url": "http://patchwork.ozlabs.org/api/people/73601/?format=api",
        "name": "Anirudh Venkataramanan",
        "email": "anirudh.venkataramanan@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/20181219180334.1104-5-anirudh.venkataramanan@intel.com/mbox/",
    "series": [
        {
            "id": 82906,
            "url": "http://patchwork.ozlabs.org/api/series/82906/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=82906",
            "date": "2018-12-19T18:03:28",
            "name": "Feature updates for ice",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/82906/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/1016222/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/1016222/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;\n\tspf=pass (mailfrom) smtp.mailfrom=osuosl.org\n\t(client-ip=140.211.166.133; helo=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 43KjSN1Y8lz9s3Z\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 20 Dec 2018 05:03:48 +1100 (AEDT)",
            "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id B8154878C4;\n\tWed, 19 Dec 2018 18:03:46 +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 sVVoblXPx+Or; Wed, 19 Dec 2018 18:03:45 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 2475B8798D;\n\tWed, 19 Dec 2018 18:03:45 +0000 (UTC)",
            "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\tby ash.osuosl.org (Postfix) with ESMTP id E05901C2A9B\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 19 Dec 2018 18:03:37 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id DDC6222FB9\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 19 Dec 2018 18:03:37 +0000 (UTC)",
            "from silver.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id 4nx8AgNOv1yg for <intel-wired-lan@lists.osuosl.org>;\n\tWed, 19 Dec 2018 18:03:36 +0000 (UTC)",
            "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n\tby silver.osuosl.org (Postfix) with ESMTPS id 96B8922049\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 19 Dec 2018 18:03:36 +0000 (UTC)",
            "from fmsmga002.fm.intel.com ([10.253.24.26])\n\tby orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t19 Dec 2018 10:03:35 -0800",
            "from shasta.jf.intel.com ([10.166.241.11])\n\tby fmsmga002.fm.intel.com with ESMTP; 19 Dec 2018 10:03:34 -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.56,373,1539673200\"; d=\"scan'208\";a=\"127400074\"",
        "From": "Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>",
        "To": "intel-wired-lan@lists.osuosl.org",
        "Date": "Wed, 19 Dec 2018 10:03:23 -0800",
        "Message-Id": "<20181219180334.1104-5-anirudh.venkataramanan@intel.com>",
        "X-Mailer": "git-send-email 2.14.5",
        "In-Reply-To": "<20181219180334.1104-1-anirudh.venkataramanan@intel.com>",
        "References": "<20181219180334.1104-1-anirudh.venkataramanan@intel.com>",
        "Subject": "[Intel-wired-lan] [PATCH S10 04/15] ice: Add ethtool set_phys_id\n\thandler",
        "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": "Add led blinking handler to ethtool. Since led blinking is\ncontrolled by FW/HW only ETHTOOL_ID_ACTIVE and ETHTOOL_ID_INACTIVE\nare really needed.\n\nSigned-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>\n---\n drivers/net/ethernet/intel/ice/ice_adminq_cmd.h | 12 +++++++++++\n drivers/net/ethernet/intel/ice/ice_common.c     | 28 +++++++++++++++++++++++++\n drivers/net/ethernet/intel/ice/ice_common.h     |  4 ++++\n drivers/net/ethernet/intel/ice/ice_ethtool.c    | 24 +++++++++++++++++++++\n 4 files changed, 68 insertions(+)",
    "diff": "diff --git a/drivers/net/ethernet/intel/ice/ice_adminq_cmd.h b/drivers/net/ethernet/intel/ice/ice_adminq_cmd.h\nindex 4c7e3af07254..245068b21982 100644\n--- a/drivers/net/ethernet/intel/ice/ice_adminq_cmd.h\n+++ b/drivers/net/ethernet/intel/ice/ice_adminq_cmd.h\n@@ -1048,6 +1048,16 @@ struct ice_aqc_set_event_mask {\n \tu8\treserved1[6];\n };\n \n+/* Set Port Identification LED (direct, 0x06E9) */\n+struct ice_aqc_set_port_id_led {\n+\tu8 lport_num;\n+\tu8 lport_num_valid;\n+\tu8 ident_mode;\n+#define ICE_AQC_PORT_IDENT_LED_BLINK\tBIT(0)\n+#define ICE_AQC_PORT_IDENT_LED_ORIG\t0\n+\tu8 rsvd[13];\n+};\n+\n /* NVM Read command (indirect 0x0701)\n  * NVM Erase commands (direct 0x0702)\n  * NVM Update commands (indirect 0x0703)\n@@ -1334,6 +1344,7 @@ struct ice_aq_desc {\n \t\tstruct ice_aqc_get_phy_caps get_phy;\n \t\tstruct ice_aqc_set_phy_cfg set_phy;\n \t\tstruct ice_aqc_restart_an restart_an;\n+\t\tstruct ice_aqc_set_port_id_led set_port_id_led;\n \t\tstruct ice_aqc_get_sw_cfg get_sw_conf;\n \t\tstruct ice_aqc_sw_rules sw_rules;\n \t\tstruct ice_aqc_get_topo get_topo;\n@@ -1434,6 +1445,7 @@ enum ice_adminq_opc {\n \tice_aqc_opc_restart_an\t\t\t\t= 0x0605,\n \tice_aqc_opc_get_link_status\t\t\t= 0x0607,\n \tice_aqc_opc_set_event_mask\t\t\t= 0x0613,\n+\tice_aqc_opc_set_port_id_led\t\t\t= 0x06E9,\n \n \t/* NVM commands */\n \tice_aqc_opc_nvm_read\t\t\t\t= 0x0701,\ndiff --git a/drivers/net/ethernet/intel/ice/ice_common.c b/drivers/net/ethernet/intel/ice/ice_common.c\nindex 4c1d35da940d..2bcd8230d35e 100644\n--- a/drivers/net/ethernet/intel/ice/ice_common.c\n+++ b/drivers/net/ethernet/intel/ice/ice_common.c\n@@ -2031,6 +2031,34 @@ ice_aq_set_link_restart_an(struct ice_port_info *pi, bool ena_link,\n \treturn ice_aq_send_cmd(pi->hw, &desc, NULL, 0, cd);\n }\n \n+/**\n+ * ice_aq_set_port_id_led\n+ * @pi: pointer to the port information\n+ * @is_orig_mode: is this LED set to original mode (by the net-list)\n+ * @cd: pointer to command details structure or NULL\n+ *\n+ * Set LED value for the given port (0x06e9)\n+ */\n+enum ice_status\n+ice_aq_set_port_id_led(struct ice_port_info *pi, bool is_orig_mode,\n+\t\t       struct ice_sq_cd *cd)\n+{\n+\tstruct ice_aqc_set_port_id_led *cmd;\n+\tstruct ice_hw *hw = pi->hw;\n+\tstruct ice_aq_desc desc;\n+\n+\tcmd = &desc.params.set_port_id_led;\n+\n+\tice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_set_port_id_led);\n+\n+\tif (is_orig_mode)\n+\t\tcmd->ident_mode = ICE_AQC_PORT_IDENT_LED_ORIG;\n+\telse\n+\t\tcmd->ident_mode = ICE_AQC_PORT_IDENT_LED_BLINK;\n+\n+\treturn ice_aq_send_cmd(hw, &desc, NULL, 0, cd);\n+}\n+\n /**\n  * __ice_aq_get_set_rss_lut\n  * @hw: pointer to the hardware structure\ndiff --git a/drivers/net/ethernet/intel/ice/ice_common.h b/drivers/net/ethernet/intel/ice/ice_common.h\nindex cf760c24a6aa..b86cfe540045 100644\n--- a/drivers/net/ethernet/intel/ice/ice_common.h\n+++ b/drivers/net/ethernet/intel/ice/ice_common.h\n@@ -86,6 +86,10 @@ enum ice_status\n ice_aq_set_link_restart_an(struct ice_port_info *pi, bool ena_link,\n \t\t\t   struct ice_sq_cd *cd);\n enum ice_status\n+ice_aq_set_port_id_led(struct ice_port_info *pi, bool is_orig_mode,\n+\t\t       struct ice_sq_cd *cd);\n+\n+enum ice_status\n ice_dis_vsi_txq(struct ice_port_info *pi, u8 num_queues, u16 *q_ids,\n \t\tu32 *q_teids, enum ice_disq_rst_src rst_src, u16 vmvf_num,\n \t\tstruct ice_sq_cd *cmd_details);\ndiff --git a/drivers/net/ethernet/intel/ice/ice_ethtool.c b/drivers/net/ethernet/intel/ice/ice_ethtool.c\nindex 3b6e387f5440..6facb0a7eed4 100644\n--- a/drivers/net/ethernet/intel/ice/ice_ethtool.c\n+++ b/drivers/net/ethernet/intel/ice/ice_ethtool.c\n@@ -249,6 +249,29 @@ static void ice_get_strings(struct net_device *netdev, u32 stringset, u8 *data)\n \t}\n }\n \n+static int\n+ice_set_phys_id(struct net_device *netdev, enum ethtool_phys_id_state state)\n+{\n+\tstruct ice_netdev_priv *np = netdev_priv(netdev);\n+\tbool led_active;\n+\n+\tswitch (state) {\n+\tcase ETHTOOL_ID_ACTIVE:\n+\t\tled_active = true;\n+\t\tbreak;\n+\tcase ETHTOOL_ID_INACTIVE:\n+\t\tled_active = false;\n+\t\tbreak;\n+\tdefault:\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tif (ice_aq_set_port_id_led(np->vsi->port_info, !led_active, NULL))\n+\t\treturn -EIO;\n+\n+\treturn 0;\n+}\n+\n static int ice_get_sset_count(struct net_device *netdev, int sset)\n {\n \tswitch (sset) {\n@@ -1677,6 +1700,7 @@ static const struct ethtool_ops ice_ethtool_ops = {\n \t.set_msglevel           = ice_set_msglevel,\n \t.get_link\t\t= ethtool_op_get_link,\n \t.get_strings\t\t= ice_get_strings,\n+\t.set_phys_id\t\t= ice_set_phys_id,\n \t.get_ethtool_stats      = ice_get_ethtool_stats,\n \t.get_sset_count\t\t= ice_get_sset_count,\n \t.get_rxnfc\t\t= ice_get_rxnfc,\n",
    "prefixes": [
        "S10",
        "04/15"
    ]
}