get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 684812,
    "url": "http://patchwork.ozlabs.org/api/patches/684812/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/1477014120-23682-1-git-send-email-donald.c.skidmore@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": "<1477014120-23682-1-git-send-email-donald.c.skidmore@intel.com>",
    "list_archive_url": null,
    "date": "2016-10-21T01:42:00",
    "name": "ixgbe: Add support to retrieve and store LED link active",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "19ab522ac4f5c027c530957d498a41abd239244d",
    "submitter": {
        "id": 4487,
        "url": "http://patchwork.ozlabs.org/api/people/4487/?format=api",
        "name": "Skidmore, Donald C",
        "email": "donald.c.skidmore@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/1477014120-23682-1-git-send-email-donald.c.skidmore@intel.com/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/684812/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/684812/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 silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\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 3t0Rls43Xsz9srZ\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 21 Oct 2016 11:44:57 +1100 (AEDT)",
            "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id BFF9833856;\n\tFri, 21 Oct 2016 00:44:55 +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 o7Bztn-t9Lnj; Fri, 21 Oct 2016 00:44:53 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby silver.osuosl.org (Postfix) with ESMTP id DEAF333895;\n\tFri, 21 Oct 2016 00:44:52 +0000 (UTC)",
            "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\tby ash.osuosl.org (Postfix) with ESMTP id C6DC61CF851\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 21 Oct 2016 00:44:51 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id C1E5691EF0\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 21 Oct 2016 00:44:51 +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 X0VRHH2wzn0M for <intel-wired-lan@lists.osuosl.org>;\n\tFri, 21 Oct 2016 00:44:50 +0000 (UTC)",
            "from mga01.intel.com (mga01.intel.com [192.55.52.88])\n\tby whitealder.osuosl.org (Postfix) with ESMTPS id CF13391FC4\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 21 Oct 2016 00:44:50 +0000 (UTC)",
            "from fmsmga001.fm.intel.com ([10.253.24.23])\n\tby fmsmga101.fm.intel.com with ESMTP; 20 Oct 2016 17:44:50 -0700",
            "from dcskidmo-m40.jf.intel.com ([134.134.3.124])\n\tby fmsmga001.fm.intel.com with ESMTP; 20 Oct 2016 17:44:50 -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.31,521,1473145200\"; d=\"scan'208\";\n\ta=\"1056899517\"",
        "From": "Donald C Skidmore <donald.c.skidmore@intel.com>",
        "To": "intel-wired-lan@lists.osuosl.org",
        "Date": "Thu, 20 Oct 2016 21:42:00 -0400",
        "Message-Id": "<1477014120-23682-1-git-send-email-donald.c.skidmore@intel.com>",
        "X-Mailer": "git-send-email 2.4.3",
        "Subject": "[Intel-wired-lan] [PATCH] ixgbe: Add support to retrieve and store\n\tLED link active",
        "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": "This patch adds support to get the LED link active via the LEDCTL\nregister.  If the LEDCTL register does not have LED link active\n(LED mode field = 0x0100) set then default LED link active returned.\n\nSigned-off-by: Don Skidmore <donald.c.skidmore@intel.com>\n---\n drivers/net/ethernet/intel/ixgbe/ixgbe_82598.c   |  1 +\n drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c   |  1 +\n drivers/net/ethernet/intel/ixgbe/ixgbe_common.c  | 46 ++++++++++++++++++++++++\n drivers/net/ethernet/intel/ixgbe/ixgbe_common.h  |  1 +\n drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c |  4 +--\n drivers/net/ethernet/intel/ixgbe/ixgbe_type.h    |  2 ++\n drivers/net/ethernet/intel/ixgbe/ixgbe_x540.c    |  1 +\n drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c    |  3 ++\n 8 files changed, 57 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_82598.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_82598.c\nindex 1b7009b..805ab31 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_82598.c\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_82598.c\n@@ -1179,6 +1179,7 @@ static const struct ixgbe_mac_operations mac_ops_82598 = {\n \t.get_link_capabilities\t= &ixgbe_get_link_capabilities_82598,\n \t.led_on\t\t\t= &ixgbe_led_on_generic,\n \t.led_off\t\t= &ixgbe_led_off_generic,\n+\t.init_led_link_act\t= ixgbe_init_led_link_act_generic,\n \t.blink_led_start\t= &ixgbe_blink_led_start_generic,\n \t.blink_led_stop\t\t= &ixgbe_blink_led_stop_generic,\n \t.set_rar\t\t= &ixgbe_set_rar_generic,\ndiff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c\nindex 709af71..e00aaeb 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c\n@@ -2204,6 +2204,7 @@ static const struct ixgbe_mac_operations mac_ops_82599 = {\n \t.get_link_capabilities  = &ixgbe_get_link_capabilities_82599,\n \t.led_on                 = &ixgbe_led_on_generic,\n \t.led_off                = &ixgbe_led_off_generic,\n+\t.init_led_link_act\t= ixgbe_init_led_link_act_generic,\n \t.blink_led_start        = &ixgbe_blink_led_start_generic,\n \t.blink_led_stop         = &ixgbe_blink_led_stop_generic,\n \t.set_rar                = &ixgbe_set_rar_generic,\ndiff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c\nindex deac764..8832df3 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c\n@@ -392,6 +392,9 @@ s32 ixgbe_init_hw_generic(struct ixgbe_hw *hw)\n \t\tstatus = hw->mac.ops.start_hw(hw);\n \t}\n \n+\t/* Initialize the LED link active for LED blink support */\n+\thw->mac.ops.init_led_link_act(hw);\n+\n \treturn status;\n }\n \n@@ -775,6 +778,49 @@ s32 ixgbe_stop_adapter_generic(struct ixgbe_hw *hw)\n }\n \n /**\n+ *  ixgbe_init_led_link_act_generic - Store the LED index link/activity.\n+ *  @hw: pointer to hardware structure\n+ *\n+ *  Store the index for the link active LED. This will be used to support\n+ *  blinking the LED.\n+ **/\n+s32 ixgbe_init_led_link_act_generic(struct ixgbe_hw *hw)\n+{\n+\tstruct ixgbe_mac_info *mac = &hw->mac;\n+\tu32 led_reg, led_mode;\n+\tu16 i;\n+\n+\tled_reg = IXGBE_READ_REG(hw, IXGBE_LEDCTL);\n+\n+\t/* Get LED link active from the LEDCTL register */\n+\tfor (i = 0; i < 4; i++) {\n+\t\tled_mode = led_reg >> IXGBE_LED_MODE_SHIFT(i);\n+\n+\t\tif ((led_mode & IXGBE_LED_MODE_MASK_BASE) ==\n+\t\t    IXGBE_LED_LINK_ACTIVE) {\n+\t\t\tmac->led_link_act = i;\n+\t\t\treturn 0;\n+\t\t}\n+\t}\n+\n+\t/* If LEDCTL register does not have the LED link active set, then use\n+\t * known MAC defaults.\n+\t */\n+\tswitch (hw->mac.type) {\n+\tcase ixgbe_mac_x550em_a:\n+\t\tmac->led_link_act = 0;\n+\t\tbreak;\n+\tcase ixgbe_mac_X550EM_x:\n+\t\tmac->led_link_act = 1;\n+\t\tbreak;\n+\tdefault:\n+\t\tmac->led_link_act = 2;\n+\t}\n+\n+\treturn 0;\n+}\n+\n+/**\n  *  ixgbe_led_on_generic - Turns on the software controllable LEDs.\n  *  @hw: pointer to hardware structure\n  *  @index: led number to turn on\ndiff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_common.h b/drivers/net/ethernet/intel/ixgbe/ixgbe_common.h\nindex 6d4c260..5b3e3c6 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_common.h\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_common.h\n@@ -49,6 +49,7 @@ s32 ixgbe_stop_adapter_generic(struct ixgbe_hw *hw);\n \n s32 ixgbe_led_on_generic(struct ixgbe_hw *hw, u32 index);\n s32 ixgbe_led_off_generic(struct ixgbe_hw *hw, u32 index);\n+s32 ixgbe_init_led_link_act_generic(struct ixgbe_hw *hw);\n \n s32 ixgbe_init_eeprom_params_generic(struct ixgbe_hw *hw);\n s32 ixgbe_write_eeprom_generic(struct ixgbe_hw *hw, u16 offset, u16 data);\ndiff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c\nindex f49f803..fd192bf 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c\n@@ -2225,11 +2225,11 @@ static int ixgbe_set_phys_id(struct net_device *netdev,\n \t\treturn 2;\n \n \tcase ETHTOOL_ID_ON:\n-\t\thw->mac.ops.led_on(hw, hw->bus.func);\n+\t\thw->mac.ops.led_on(hw, hw->mac.led_link_act);\n \t\tbreak;\n \n \tcase ETHTOOL_ID_OFF:\n-\t\thw->mac.ops.led_off(hw, hw->bus.func);\n+\t\thw->mac.ops.led_off(hw, hw->mac.led_link_act);\n \t\tbreak;\n \n \tcase ETHTOOL_ID_INACTIVE:\ndiff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h b/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h\nindex dfd6143..856152f 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h\n@@ -3337,6 +3337,7 @@ struct ixgbe_mac_operations {\n \ts32 (*led_off)(struct ixgbe_hw *, u32);\n \ts32 (*blink_led_start)(struct ixgbe_hw *, u32);\n \ts32 (*blink_led_stop)(struct ixgbe_hw *, u32);\n+\ts32 (*init_led_link_act)(struct ixgbe_hw *);\n \n \t/* RAR, Multicast, VLAN */\n \ts32 (*set_rar)(struct ixgbe_hw *, u32, u8 *, u32, u32);\n@@ -3460,6 +3461,7 @@ struct ixgbe_mac_info {\n \tu8\t\t\t\tsan_mac_rar_index;\n \tstruct ixgbe_thermal_sensor_data  thermal_sensor_data;\n \tbool\t\t\t\tset_lben;\n+\tu8\t\t\t\tled_link_act;\n };\n \n struct ixgbe_phy_info {\ndiff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_x540.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_x540.c\nindex 22425c2..e2ff823 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_x540.c\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_x540.c\n@@ -851,6 +851,7 @@ static const struct ixgbe_mac_operations mac_ops_X540 = {\n \t.get_link_capabilities  = &ixgbe_get_copper_link_capabilities_generic,\n \t.led_on                 = &ixgbe_led_on_generic,\n \t.led_off                = &ixgbe_led_off_generic,\n+\t.init_led_link_act\t= ixgbe_init_led_link_act_generic,\n \t.blink_led_start        = &ixgbe_blink_led_start_X540,\n \t.blink_led_stop         = &ixgbe_blink_led_stop_X540,\n \t.set_rar                = &ixgbe_set_rar_generic,\ndiff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c\nindex b6b35e4..f06b0e1 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c\n@@ -3292,6 +3292,7 @@ static const struct ixgbe_mac_operations mac_ops_X550 = {\n \tX550_COMMON_MAC\n \t.led_on\t\t\t= ixgbe_led_on_generic,\n \t.led_off\t\t= ixgbe_led_off_generic,\n+\t.init_led_link_act\t= ixgbe_init_led_link_act_generic,\n \t.reset_hw\t\t= &ixgbe_reset_hw_X540,\n \t.get_media_type\t\t= &ixgbe_get_media_type_X540,\n \t.get_san_mac_addr\t= &ixgbe_get_san_mac_addr_generic,\n@@ -3313,6 +3314,7 @@ static const struct ixgbe_mac_operations mac_ops_X550EM_x = {\n \tX550_COMMON_MAC\n \t.led_on\t\t\t= ixgbe_led_on_t_x550em,\n \t.led_off\t\t= ixgbe_led_off_t_x550em,\n+\t.init_led_link_act\t= ixgbe_init_led_link_act_generic,\n \t.reset_hw\t\t= &ixgbe_reset_hw_X550em,\n \t.get_media_type\t\t= &ixgbe_get_media_type_X550em,\n \t.get_san_mac_addr\t= NULL,\n@@ -3334,6 +3336,7 @@ static struct ixgbe_mac_operations mac_ops_x550em_a = {\n \tX550_COMMON_MAC\n \t.led_on\t\t\t= ixgbe_led_on_t_x550em,\n \t.led_off\t\t= ixgbe_led_off_t_x550em,\n+\t.init_led_link_act\t= ixgbe_init_led_link_act_generic,\n \t.reset_hw\t\t= ixgbe_reset_hw_X550em,\n \t.get_media_type\t\t= ixgbe_get_media_type_X550em,\n \t.get_san_mac_addr\t= NULL,\n",
    "prefixes": []
}