get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 772622,
    "url": "http://patchwork.ozlabs.org/api/patches/772622/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20170607094313.32060-9-alice.michael@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": "<20170607094313.32060-9-alice.michael@intel.com>",
    "list_archive_url": null,
    "date": "2017-06-07T09:43:09",
    "name": "[next,S72-V3,09/13] i40e: Add support for OEM firmware version",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "6735fd5972021bbd204bee752f64c15aab6b92bb",
    "submitter": {
        "id": 71123,
        "url": "http://patchwork.ozlabs.org/api/people/71123/?format=api",
        "name": "Michael, Alice",
        "email": "alice.michael@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/20170607094313.32060-9-alice.michael@intel.com/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/772622/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/772622/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"
        ],
        "Received": [
            "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\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 3wjbbS1MD6z9sDG\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu,  8 Jun 2017 03:47:00 +1000 (AEST)",
            "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id ABD58879F1;\n\tWed,  7 Jun 2017 17:46:58 +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 vNqmQvB48CEh; Wed,  7 Jun 2017 17:46:55 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id D72F387A28;\n\tWed,  7 Jun 2017 17:46:54 +0000 (UTC)",
            "from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n\tby ash.osuosl.org (Postfix) with ESMTP id E36B21C3EB9\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed,  7 Jun 2017 17:46:45 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id DE90F89379\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed,  7 Jun 2017 17:46:45 +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 sZYNKzOhJG3t for <intel-wired-lan@lists.osuosl.org>;\n\tWed,  7 Jun 2017 17:46:44 +0000 (UTC)",
            "from mga03.intel.com (mga03.intel.com [134.134.136.65])\n\tby hemlock.osuosl.org (Postfix) with ESMTPS id 0A3AD89469\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed,  7 Jun 2017 17:46:44 +0000 (UTC)",
            "from orsmga004.jf.intel.com ([10.7.209.38])\n\tby orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t07 Jun 2017 10:46:41 -0700",
            "from unknown (HELO localhost.jf.intel.com) ([10.166.16.121])\n\tby orsmga004.jf.intel.com with ESMTP; 07 Jun 2017 10:46:41 -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.39,311,1493708400\"; d=\"scan'208\";a=\"95650692\"",
        "From": "Alice Michael <alice.michael@intel.com>",
        "To": "alice.michael@intel.com,\n\tintel-wired-lan@lists.osuosl.org",
        "Date": "Wed,  7 Jun 2017 05:43:09 -0400",
        "Message-Id": "<20170607094313.32060-9-alice.michael@intel.com>",
        "X-Mailer": "git-send-email 2.9.3",
        "In-Reply-To": "<20170607094313.32060-1-alice.michael@intel.com>",
        "References": "<20170607094313.32060-1-alice.michael@intel.com>",
        "Cc": "Filip Sadowski <filip.sadowski@intel.com>",
        "Subject": "[Intel-wired-lan] [next PATCH S72-V3 09/13] i40e: Add support for\n\tOEM firmware version",
        "X-BeenThere": "intel-wired-lan@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.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": "From: Filip Sadowski <filip.sadowski@intel.com>\n\nThis patch adds support for OEM firmware version. If OEM specific\nadapter is detected ethtool reports OEM product version in firmware\nversion string instead of etrack id.\n\nSigned-off-by: Filip Sadowski <filip.sadowski@intel.com>\n---\n drivers/net/ethernet/intel/i40e/i40e.h      | 48 ++++++++++++++++++++---------\n drivers/net/ethernet/intel/i40e/i40e_main.c | 47 ++++++++++++++++++++++++++++\n 2 files changed, 81 insertions(+), 14 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h\nindex 962ef98..cb102cd 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e.h\n+++ b/drivers/net/ethernet/intel/i40e/i40e.h\n@@ -103,6 +103,12 @@\n \t(I40E_AQ_PHY_DEBUG_DISABLE_LINK_FW | \\\n \tI40E_AQ_PHY_DEBUG_DISABLE_ALL_LINK_FW)\n \n+#define I40E_OEM_EETRACK_ID\t\t0xffffffff\n+#define I40E_OEM_GEN_SHIFT\t\t24\n+#define I40E_OEM_SNAP_MASK\t\t0x00ff0000\n+#define I40E_OEM_SNAP_SHIFT\t\t16\n+#define I40E_OEM_RELEASE_MASK\t\t0x0000ffff\n+\n /* The values in here are decimal coded as hex as is the case in the NVM map*/\n #define I40E_CURRENT_NVM_VERSION_HI\t0x2\n #define I40E_CURRENT_NVM_VERSION_LO\t0x40\n@@ -733,22 +739,36 @@ static inline char *i40e_nvm_version_str(struct i40e_hw *hw)\n {\n \tstatic char buf[32];\n \tu32 full_ver;\n-\tu8 ver, patch;\n-\tu16 build;\n \n \tfull_ver = hw->nvm.oem_ver;\n-\tver = (u8)(full_ver >> I40E_OEM_VER_SHIFT);\n-\tbuild = (u16)((full_ver >> I40E_OEM_VER_BUILD_SHIFT) &\n-\t\t I40E_OEM_VER_BUILD_MASK);\n-\tpatch = (u8)(full_ver & I40E_OEM_VER_PATCH_MASK);\n-\n-\tsnprintf(buf, sizeof(buf),\n-\t\t \"%x.%02x 0x%x %d.%d.%d\",\n-\t\t (hw->nvm.version & I40E_NVM_VERSION_HI_MASK) >>\n-\t\t\tI40E_NVM_VERSION_HI_SHIFT,\n-\t\t (hw->nvm.version & I40E_NVM_VERSION_LO_MASK) >>\n-\t\t\tI40E_NVM_VERSION_LO_SHIFT,\n-\t\t hw->nvm.eetrack, ver, build, patch);\n+\n+\tif (hw->nvm.eetrack == I40E_OEM_EETRACK_ID) {\n+\t\tu8 gen, snap;\n+\t\tu16 release;\n+\n+\t\tgen = (u8)(full_ver >> I40E_OEM_GEN_SHIFT);\n+\t\tsnap = (u8)((full_ver & I40E_OEM_SNAP_MASK) >>\n+\t\t\tI40E_OEM_SNAP_SHIFT);\n+\t\trelease = (u16)(full_ver & I40E_OEM_RELEASE_MASK);\n+\n+\t\tsnprintf(buf, sizeof(buf), \"%x.%x.%x\", gen, snap, release);\n+\t} else {\n+\t\tu8 ver, patch;\n+\t\tu16 build;\n+\n+\t\tver = (u8)(full_ver >> I40E_OEM_VER_SHIFT);\n+\t\tbuild = (u16)((full_ver >> I40E_OEM_VER_BUILD_SHIFT) &\n+\t\t\t I40E_OEM_VER_BUILD_MASK);\n+\t\tpatch = (u8)(full_ver & I40E_OEM_VER_PATCH_MASK);\n+\n+\t\tsnprintf(buf, sizeof(buf),\n+\t\t\t \"%x.%02x 0x%x %d.%d.%d\",\n+\t\t\t (hw->nvm.version & I40E_NVM_VERSION_HI_MASK) >>\n+\t\t\t\tI40E_NVM_VERSION_HI_SHIFT,\n+\t\t\t (hw->nvm.version & I40E_NVM_VERSION_LO_MASK) >>\n+\t\t\t\tI40E_NVM_VERSION_LO_SHIFT,\n+\t\t\t hw->nvm.eetrack, ver, build, patch);\n+\t}\n \n \treturn buf;\n }\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c\nindex e4ae673..5fd4d2f 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_main.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c\n@@ -7107,6 +7107,51 @@ static void i40e_send_version(struct i40e_pf *pf)\n }\n \n /**\n+ * i40e_get_oem_version - get OEM specific version information\n+ * @hw: pointer to the hardware structure\n+ **/\n+static void i40e_get_oem_version(struct i40e_hw *hw)\n+{\n+\tu16 block_offset = 0xffff;\n+\tu16 block_length = 0;\n+\tu16 capabilities = 0;\n+\tu16 gen_snap = 0;\n+\tu16 release = 0;\n+\n+#define I40E_SR_NVM_OEM_VERSION_PTR\t\t0x1B\n+#define I40E_NVM_OEM_LENGTH_OFFSET\t\t0x00\n+#define I40E_NVM_OEM_CAPABILITIES_OFFSET\t0x01\n+#define I40E_NVM_OEM_GEN_OFFSET\t\t\t0x02\n+#define I40E_NVM_OEM_RELEASE_OFFSET\t\t0x03\n+#define I40E_NVM_OEM_CAPABILITIES_MASK\t\t0x000F\n+#define I40E_NVM_OEM_LENGTH\t\t\t3\n+\n+\t/* Check if pointer to OEM version block is valid. */\n+\ti40e_read_nvm_word(hw, I40E_SR_NVM_OEM_VERSION_PTR, &block_offset);\n+\tif (block_offset == 0xffff)\n+\t\treturn;\n+\n+\t/* Check if OEM version block has correct length. */\n+\ti40e_read_nvm_word(hw, block_offset + I40E_NVM_OEM_LENGTH_OFFSET,\n+\t\t\t   &block_length);\n+\tif (block_length < I40E_NVM_OEM_LENGTH)\n+\t\treturn;\n+\n+\t/* Check if OEM version format is as expected. */\n+\ti40e_read_nvm_word(hw, block_offset + I40E_NVM_OEM_CAPABILITIES_OFFSET,\n+\t\t\t   &capabilities);\n+\tif ((capabilities & I40E_NVM_OEM_CAPABILITIES_MASK) != 0)\n+\t\treturn;\n+\n+\ti40e_read_nvm_word(hw, block_offset + I40E_NVM_OEM_GEN_OFFSET,\n+\t\t\t   &gen_snap);\n+\ti40e_read_nvm_word(hw, block_offset + I40E_NVM_OEM_RELEASE_OFFSET,\n+\t\t\t   &release);\n+\thw->nvm.oem_ver = (gen_snap << I40E_OEM_SNAP_SHIFT) | release;\n+\thw->nvm.eetrack = I40E_OEM_EETRACK_ID;\n+}\n+\n+/**\n  * i40e_reset - wait for core reset to finish reset, reset pf if corer not seen\n  * @pf: board private structure\n  **/\n@@ -7153,6 +7198,7 @@ static void i40e_rebuild(struct i40e_pf *pf, bool reinit, bool lock_acquired)\n \t\t\t i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status));\n \t\tgoto clear_recovery;\n \t}\n+\ti40e_get_oem_version(&pf->hw);\n \n \t/* re-verify the eeprom if we just had an EMP reset */\n \tif (test_and_clear_bit(__I40E_EMP_RESET_INTR_RECEIVED, pf->state))\n@@ -11337,6 +11383,7 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)\n \n \t\tgoto err_pf_reset;\n \t}\n+\ti40e_get_oem_version(hw);\n \n \t/* provide nvm, fw, api versions */\n \tdev_info(&pdev->dev, \"fw %d.%d.%05d api %d.%d nvm %s\\n\",\n",
    "prefixes": [
        "next",
        "S72-V3",
        "09/13"
    ]
}