get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 687399,
    "url": "http://patchwork.ozlabs.org/api/patches/687399/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/1477524318-17574-1-git-send-email-anthony.l.nguyen@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": "<1477524318-17574-1-git-send-email-anthony.l.nguyen@intel.com>",
    "list_archive_url": null,
    "date": "2016-10-26T23:25:18",
    "name": "[v2] ixgbe: Report driver version to firmware for x550 devices",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "63b0c04cd087389615614cba150907aea2ddd75c",
    "submitter": {
        "id": 68875,
        "url": "http://patchwork.ozlabs.org/api/people/68875/?format=api",
        "name": "Tony Nguyen",
        "email": "anthony.l.nguyen@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/1477524318-17574-1-git-send-email-anthony.l.nguyen@intel.com/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/687399/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/687399/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\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 3t47MF5bz2z9t2b\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 27 Oct 2016 11:39:53 +1100 (AEDT)",
            "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 2C598958C0;\n\tThu, 27 Oct 2016 00:39:52 +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 eeqRjPyZLEJZ; Thu, 27 Oct 2016 00:39:51 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 88FDE958BB;\n\tThu, 27 Oct 2016 00:39:51 +0000 (UTC)",
            "from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n\tby ash.osuosl.org (Postfix) with ESMTP id E43691C288A\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 27 Oct 2016 00:39:49 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id D6093958BB\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 27 Oct 2016 00:39:49 +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 M3gao8EUQ5Mp for <intel-wired-lan@lists.osuosl.org>;\n\tThu, 27 Oct 2016 00:39:48 +0000 (UTC)",
            "from mga09.intel.com (mga09.intel.com [134.134.136.24])\n\tby hemlock.osuosl.org (Postfix) with ESMTPS id 82FA8956BA\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 27 Oct 2016 00:39:48 +0000 (UTC)",
            "from fmsmga003.fm.intel.com ([10.253.24.29])\n\tby orsmga102.jf.intel.com with ESMTP; 26 Oct 2016 17:39:48 -0700",
            "from unknown (HELO anguy11-desk2.localdomain.com) ([10.166.12.155])\n\tby FMSMGA003.fm.intel.com with ESMTP; 26 Oct 2016 17:39:48 -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,551,1473145200\"; d=\"scan'208\";a=\"778261245\"",
        "From": "Tony Nguyen <anthony.l.nguyen@intel.com>",
        "To": "intel-wired-lan@lists.osuosl.org",
        "Date": "Wed, 26 Oct 2016 16:25:18 -0700",
        "Message-Id": "<1477524318-17574-1-git-send-email-anthony.l.nguyen@intel.com>",
        "X-Mailer": "git-send-email 2.4.0",
        "Subject": "[Intel-wired-lan] [PATCH v2] ixgbe: Report driver version to\n\tfirmware for x550 devices",
        "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": "Some x550 devices require the driver version reported to its firmware; this\npatch sends the driver version string to the firmware through the host\ninterface command for x550 devices.\n\nv2:\n  Set ixgbe_set_fw_drv_ver_x550() to static\n\nSigned-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>\n---\n drivers/net/ethernet/intel/ixgbe/ixgbe_common.c |  7 ++-\n drivers/net/ethernet/intel/ixgbe/ixgbe_common.h |  3 +-\n drivers/net/ethernet/intel/ixgbe/ixgbe_main.c   |  5 ++-\n drivers/net/ethernet/intel/ixgbe/ixgbe_type.h   | 14 +++++-\n drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c   | 58 ++++++++++++++++++++++++-\n 5 files changed, 80 insertions(+), 7 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c\nindex deac764..eb112f0 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c\n@@ -3532,7 +3532,7 @@ void ixgbe_set_rxpba_generic(struct ixgbe_hw *hw,\n  *  Calculates the checksum for some buffer on a specified length.  The\n  *  checksum calculated is returned.\n  **/\n-static u8 ixgbe_calculate_checksum(u8 *buffer, u32 length)\n+u8 ixgbe_calculate_checksum(u8 *buffer, u32 length)\n {\n \tu32 i;\n \tu8 sum = 0;\n@@ -3676,6 +3676,8 @@ s32 ixgbe_host_interface_command(struct ixgbe_hw *hw, void *buffer,\n  *  @min: driver version minor number\n  *  @build: driver version build number\n  *  @sub: driver version sub build number\n+ *  @len: length of driver_ver string\n+ *  @driver_ver: driver string\n  *\n  *  Sends driver version number to firmware through the manageability\n  *  block.  On success return 0\n@@ -3683,7 +3685,8 @@ s32 ixgbe_host_interface_command(struct ixgbe_hw *hw, void *buffer,\n  *  semaphore or IXGBE_ERR_HOST_INTERFACE_COMMAND when command fails.\n  **/\n s32 ixgbe_set_fw_drv_ver_generic(struct ixgbe_hw *hw, u8 maj, u8 min,\n-\t\t\t\t u8 build, u8 sub)\n+\t\t\t\t u8 build, u8 sub, __always_unused u16 len,\n+\t\t\t\t __always_unused const char *driver_ver)\n {\n \tstruct ixgbe_hic_drv_info fw_cmd;\n \tint i;\ndiff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_common.h b/drivers/net/ethernet/intel/ixgbe/ixgbe_common.h\nindex 6d4c260..a0a04ff 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_common.h\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_common.h\n@@ -110,7 +110,8 @@ void ixgbe_set_mac_anti_spoofing(struct ixgbe_hw *hw, bool enable, int vf);\n void ixgbe_set_vlan_anti_spoofing(struct ixgbe_hw *hw, bool enable, int vf);\n s32 ixgbe_get_device_caps_generic(struct ixgbe_hw *hw, u16 *device_caps);\n s32 ixgbe_set_fw_drv_ver_generic(struct ixgbe_hw *hw, u8 maj, u8 min,\n-\t\t\t\t u8 build, u8 ver);\n+\t\t\t\t u8 build, u8 ver, u16 len, const char *str);\n+u8 ixgbe_calculate_checksum(u8 *buffer, u32 length);\n s32 ixgbe_host_interface_command(struct ixgbe_hw *hw, void *, u32 length,\n \t\t\t\t u32 timeout, bool return_data);\n void ixgbe_clear_tx_pending(struct ixgbe_hw *hw);\ndiff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\nindex a582bea..e36a27b 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\n@@ -9812,8 +9812,9 @@ static int ixgbe_probe(struct pci_dev *pdev, const struct pci_device_id *ent)\n \t * since os does not support feature\n \t */\n \tif (hw->mac.ops.set_fw_drv_ver)\n-\t\thw->mac.ops.set_fw_drv_ver(hw, 0xFF, 0xFF, 0xFF,\n-\t\t\t\t\t   0xFF);\n+\t\thw->mac.ops.set_fw_drv_ver(hw, 0xFF, 0xFF, 0xFF, 0xFF,\n+\t\t\t\t\t   sizeof(ixgbe_driver_version) - 1,\n+\t\t\t\t\t   ixgbe_driver_version);\n \n \t/* add san mac addr to netdev */\n \tixgbe_add_sanmac_netdev(netdev);\ndiff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h b/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h\nindex dfd6143..af7d9a7 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h\n@@ -2618,6 +2618,7 @@ enum ixgbe_fdir_pballoc_type {\n #define FW_CEM_UNUSED_VER\t\t0x0\n #define FW_CEM_MAX_RETRIES\t\t3\n #define FW_CEM_RESP_STATUS_SUCCESS\t0x1\n+#define FW_CEM_DRIVER_VERSION_SIZE\t39 /* +9 would send 48 bytes to fw */\n #define FW_READ_SHADOW_RAM_CMD\t\t0x31\n #define FW_READ_SHADOW_RAM_LEN\t\t0x6\n #define FW_WRITE_SHADOW_RAM_CMD\t\t0x33\n@@ -2685,6 +2686,16 @@ struct ixgbe_hic_drv_info {\n \tu16 pad2; /* end spacing to ensure length is mult. of dword2 */\n };\n \n+struct ixgbe_hic_drv_info2 {\n+\tstruct ixgbe_hic_hdr hdr;\n+\tu8 port_num;\n+\tu8 ver_sub;\n+\tu8 ver_build;\n+\tu8 ver_min;\n+\tu8 ver_maj;\n+\tchar driver_string[FW_CEM_DRIVER_VERSION_SIZE];\n+};\n+\n /* These need to be dword aligned */\n struct ixgbe_hic_read_shadow_ram {\n \tunion ixgbe_hic_hdr2 hdr;\n@@ -3360,7 +3371,8 @@ struct ixgbe_mac_operations {\n \tvoid (*fc_autoneg)(struct ixgbe_hw *);\n \n \t/* Manageability interface */\n-\ts32 (*set_fw_drv_ver)(struct ixgbe_hw *, u8, u8, u8, u8);\n+\ts32 (*set_fw_drv_ver)(struct ixgbe_hw *, u8, u8, u8, u8, u16,\n+\t\t\t      const char *);\n \ts32 (*get_thermal_sensor_data)(struct ixgbe_hw *);\n \ts32 (*init_thermal_sensor_thresh)(struct ixgbe_hw *hw);\n \tvoid (*disable_rx)(struct ixgbe_hw *hw);\ndiff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c\nindex b6b35e4..4e825c8 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c\n@@ -2354,6 +2354,62 @@ static s32 ixgbe_led_off_t_x550em(struct ixgbe_hw *hw, u32 led_idx)\n \treturn 0;\n }\n \n+/**\n+ *  ixgbe_set_fw_drv_ver_x550 - Sends driver version to firmware\n+ *  @hw: pointer to the HW structure\n+ *  @maj: driver version major number\n+ *  @min: driver version minor number\n+ *  @build: driver version build number\n+ *  @sub: driver version sub build number\n+ *  @len: length of driver_ver string\n+ *  @driver_ver: driver string\n+ *\n+ *  Sends driver version number to firmware through the manageability\n+ *  block.  On success return 0\n+ *  else returns IXGBE_ERR_SWFW_SYNC when encountering an error acquiring\n+ *  semaphore or IXGBE_ERR_HOST_INTERFACE_COMMAND when command fails.\n+ **/\n+static s32 ixgbe_set_fw_drv_ver_x550(struct ixgbe_hw *hw, u8 maj, u8 min,\n+\t\t\t\t     u8 build, u8 sub, u16 len,\n+\t\t\t\t     const char *driver_ver)\n+{\n+\tstruct ixgbe_hic_drv_info2 fw_cmd;\n+\ts32 ret_val;\n+\tint i;\n+\n+\tif (!len || !driver_ver || (len > sizeof(fw_cmd.driver_string)))\n+\t\treturn IXGBE_ERR_INVALID_ARGUMENT;\n+\n+\tfw_cmd.hdr.cmd = FW_CEM_CMD_DRIVER_INFO;\n+\tfw_cmd.hdr.buf_len = FW_CEM_CMD_DRIVER_INFO_LEN + len;\n+\tfw_cmd.hdr.cmd_or_resp.cmd_resv = FW_CEM_CMD_RESERVED;\n+\tfw_cmd.port_num = (u8)hw->bus.func;\n+\tfw_cmd.ver_maj = maj;\n+\tfw_cmd.ver_min = min;\n+\tfw_cmd.ver_build = build;\n+\tfw_cmd.ver_sub = sub;\n+\tfw_cmd.hdr.checksum = 0;\n+\tmemcpy(fw_cmd.driver_string, driver_ver, len);\n+\tfw_cmd.hdr.checksum = ixgbe_calculate_checksum((u8 *)&fw_cmd,\n+\t\t\t      (FW_CEM_HDR_LEN + fw_cmd.hdr.buf_len));\n+\n+\tfor (i = 0; i <= FW_CEM_MAX_RETRIES; i++) {\n+\t\tret_val = ixgbe_host_interface_command(hw, (u32 *)&fw_cmd,\n+\t\t\t\t\t\t       sizeof(fw_cmd),\n+\t\t\t\t\t\t       IXGBE_HI_COMMAND_TIMEOUT,\n+\t\t\t\t\t\t       true);\n+\t\tif (ret_val)\n+\t\t\tcontinue;\n+\n+\t\tif (fw_cmd.hdr.cmd_or_resp.ret_status !=\n+\t\t    FW_CEM_RESP_STATUS_SUCCESS)\n+\t\t\treturn IXGBE_ERR_HOST_INTERFACE_COMMAND;\n+\t\treturn 0;\n+\t}\n+\n+\treturn ret_val;\n+}\n+\n /** ixgbe_get_lcd_x550em - Determine lowest common denominator\n  *  @hw: pointer to hardware structure\n  *  @lcd_speed: pointer to lowest common link speed\n@@ -3273,7 +3329,7 @@ static s32 ixgbe_write_phy_reg_x550a(struct ixgbe_hw *hw, u32 reg_addr,\n \t.clear_vfta\t\t\t= &ixgbe_clear_vfta_generic, \\\n \t.set_vfta\t\t\t= &ixgbe_set_vfta_generic, \\\n \t.fc_enable\t\t\t= &ixgbe_fc_enable_generic, \\\n-\t.set_fw_drv_ver\t\t\t= &ixgbe_set_fw_drv_ver_generic, \\\n+\t.set_fw_drv_ver\t\t\t= &ixgbe_set_fw_drv_ver_x550, \\\n \t.init_uta_tables\t\t= &ixgbe_init_uta_tables_generic, \\\n \t.set_mac_anti_spoofing\t\t= &ixgbe_set_mac_anti_spoofing, \\\n \t.set_vlan_anti_spoofing\t\t= &ixgbe_set_vlan_anti_spoofing, \\\n",
    "prefixes": [
        "v2"
    ]
}