get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 556240,
    "url": "http://patchwork.ozlabs.org/api/patches/556240/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linux-mtd/patch/566DF50A.3090902@simon.arlott.org.uk/",
    "project": {
        "id": 3,
        "url": "http://patchwork.ozlabs.org/api/projects/3/?format=api",
        "name": "Linux MTD development",
        "link_name": "linux-mtd",
        "list_id": "linux-mtd.lists.infradead.org",
        "list_email": "linux-mtd@lists.infradead.org",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<566DF50A.3090902@simon.arlott.org.uk>",
    "list_archive_url": null,
    "date": "2015-12-13T22:45:30",
    "name": "[linux-next,v4,01/11] MIPS: bcm963xx: Add Broadcom BCM963xx board nvram data structure",
    "commit_ref": null,
    "pull_url": null,
    "state": "not-applicable",
    "archived": false,
    "hash": "ac1ea5581eb42bdf30760d89465aec7a8e907d21",
    "submitter": {
        "id": 1123,
        "url": "http://patchwork.ozlabs.org/api/people/1123/?format=api",
        "name": "Simon Arlott",
        "email": "simon@fire.lp0.eu"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/linux-mtd/patch/566DF50A.3090902@simon.arlott.org.uk/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/556240/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/556240/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org>",
        "X-Original-To": "incoming@patchwork.ozlabs.org",
        "Delivered-To": "patchwork-incoming@bilbo.ozlabs.org",
        "Received": [
            "from bombadil.infradead.org (bombadil.infradead.org\n\t[IPv6:2001:1868:205::9])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id E1460140311\n\tfor <incoming@patchwork.ozlabs.org>;\n\tMon, 14 Dec 2015 09:47:15 +1100 (AEDT)",
            "from localhost ([127.0.0.1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux))\n\tid 1a8FOv-0005Xc-DD; Sun, 13 Dec 2015 22:45:57 +0000",
            "from proxima.lp0.eu ([2001:8b0:ffea:0:205:b4ff:fe12:530])\n\tby bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux))\n\tid 1a8FOs-0005TS-62\n\tfor linux-mtd@lists.infradead.org; Sun, 13 Dec 2015 22:45:55 +0000",
            "from redrum.lp0.eu ([2001:8b0:ffea:0:2e0:81ff:fe4d:2bec]:44491\n\tident=simon)\n\tby proxima.lp0.eu ([2001:8b0:ffea:0:205:b4ff:fe12:530]:465)\n\twith esmtpsav (UNKNOWN:DHE-RSA-AES256-SHA:256/CN=Simon Arlott)\n\tid 1a8FOV-0003oE-3v (Exim); Sun, 13 Dec 2015 22:45:32 +0000"
        ],
        "Authentication-Results": "ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tsecure) header.d=fire.lp0.eu header.i=@fire.lp0.eu header.b=As5lmvFj;\n\tdkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=fire.lp0.eu; s=exim; \n\th=Content-Transfer-Encoding:Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:Cc:References:To:Subject;\n\tbh=U85uV8QUTc1pUbtEjpmNBOopR/4lKSOFXyi6sAUpOjI=; \n\tb=As5lmvFjFgYoBiN92VSo6qVHwt3CTUpRypzMq4uzoyr4Xq/pABHrdsbZoP4AM+AItvpuvrwwcGW01GTjd3wvPM1xctvcDC9wgIgi+nfy/cS/+IfMQUbEySn4pa3YgU9X161U9Gw1ZywNk/mmKY8uwIOSu3JG1axZWqL3WLykdYOA9qa72tvtAn0nyvS/KL2hMgYo7X0HXBFYY8CAmwRAZ3uWJluGNuFFbFalHIjXRLS7uIuvdz4RgZyFx6nKoxSXN68J7aM+/dcFSLk0Yq9E/GmR7mB29/Tg3oc2mF9bLW3BzkIlcq30Vvs55vUzr99yKZuEwrKPFEXlyar9QNbINQ==;",
        "Subject": "[PATCH linux-next v4 01/11] MIPS: bcm963xx: Add Broadcom BCM963xx\n\tboard nvram data structure",
        "To": "Ralf Baechle <ralf@linux-mips.org>, David Woodhouse\n\t<dwmw2@infradead.org>, Brian Norris <computersforpeace@gmail.com>,\n\tKevin Cernekee <cernekee@gmail.com>, Florian Fainelli\n\t<f.fainelli@gmail.com>, Jonas Gorski <jogo@openwrt.org>",
        "References": "<566DF43B.5010400@simon.arlott.org.uk>",
        "From": "Simon Arlott <simon@fire.lp0.eu>",
        "Message-ID": "<566DF50A.3090902@simon.arlott.org.uk>",
        "Date": "Sun, 13 Dec 2015 22:45:30 +0000",
        "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101\n\tThunderbird/38.4.0",
        "MIME-Version": "1.0",
        "In-Reply-To": "<566DF43B.5010400@simon.arlott.org.uk>",
        "X-CRM114-Version": "20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ",
        "X-CRM114-CacheID": "sfid-20151213_144554_568133_DB9C472A ",
        "X-CRM114-Status": "GOOD (  16.76  )",
        "X-Spam-Score": "-4.3 (----)",
        "X-Spam-Report": "SpamAssassin version 3.4.0 on bombadil.infradead.org summary:\n\tContent analysis details:   (-4.3 points)\n\tpts rule name              description\n\t---- ----------------------\n\t--------------------------------------------------\n\t-2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/,\n\tmedium trust [2001:8b0:ffea:0:205:b4ff:fe12:530 listed in]\n\t[list.dnswl.org]\n\t-0.0 SPF_HELO_PASS          SPF: HELO matches SPF record\n\t-0.0 SPF_PASS               SPF: sender matches SPF record\n\t-0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay\n\tdomain\n\t-1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%\n\t[score: 0.0000]\n\t0.1 DKIM_SIGNED            Message has a DKIM or DK signature,\n\tnot necessarily valid\n\t-0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from\n\tauthor's domain\n\t-0.1 DKIM_VALID Message has at least one valid DKIM or DK signature",
        "X-BeenThere": "linux-mtd@lists.infradead.org",
        "X-Mailman-Version": "2.1.20",
        "Precedence": "list",
        "List-Id": "Linux MTD discussion mailing list <linux-mtd.lists.infradead.org>",
        "List-Unsubscribe": "<http://lists.infradead.org/mailman/options/linux-mtd>,\n\t<mailto:linux-mtd-request@lists.infradead.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.infradead.org/pipermail/linux-mtd/>",
        "List-Post": "<mailto:linux-mtd@lists.infradead.org>",
        "List-Help": "<mailto:linux-mtd-request@lists.infradead.org?subject=help>",
        "List-Subscribe": "<http://lists.infradead.org/mailman/listinfo/linux-mtd>,\n\t<mailto:linux-mtd-request@lists.infradead.org?subject=subscribe>",
        "Cc": "MIPS Mailing List <linux-mips@linux-mips.org>,\n\tMTD Maling List <linux-mtd@lists.infradead.org>,\n\tLinux Kernel Mailing List <linux-kernel@vger.kernel.org>",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Sender": "\"linux-mtd\" <linux-mtd-bounces@lists.infradead.org>",
        "Errors-To": "linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org"
    },
    "content": "Broadcom BCM963xx boards have multiple nvram variants across different\nSoCs with additional checksum fields added whenever the size of the\nnvram was extended.\n\nAdd this structure as a header file so that multiple drivers can use it.\n\nSigned-off-by: Simon Arlott <simon@fire.lp0.eu>\n---\nv4: Move out of uapi.\n\n    Add nand offset/size functions/macros.\n\n    Add checksum calculation function.\n\nv3: Fix includes/type names, add comments explaining the nvram struct.\n\nv2: Use external struct bcm963xx_nvram definition for bcm963268part.\n\n MAINTAINERS                    |   1 +\n include/linux/bcm963xx_nvram.h | 112 +++++++++++++++++++++++++++++++++++++++++\n 2 files changed, 113 insertions(+)\n create mode 100644 include/linux/bcm963xx_nvram.h",
    "diff": "diff --git a/MAINTAINERS b/MAINTAINERS\nindex 31fc0bf..ac7de1a 100644\n--- a/MAINTAINERS\n+++ b/MAINTAINERS\n@@ -2391,6 +2391,7 @@ F:\tarch/mips/kernel/*bmips*\n F:\tarch/mips/boot/dts/brcm/bcm*.dts*\n F:\tdrivers/irqchip/irq-bcm7*\n F:\tdrivers/irqchip/irq-brcmstb*\n+F:\tinclude/linux/bcm963xx_nvram.h\n \n BROADCOM TG3 GIGABIT ETHERNET DRIVER\n M:\tPrashant Sreedharan <prashant@broadcom.com>\ndiff --git a/include/linux/bcm963xx_nvram.h b/include/linux/bcm963xx_nvram.h\nnew file mode 100644\nindex 0000000..290c231\n--- /dev/null\n+++ b/include/linux/bcm963xx_nvram.h\n@@ -0,0 +1,112 @@\n+#ifndef __LINUX_BCM963XX_NVRAM_H__\n+#define __LINUX_BCM963XX_NVRAM_H__\n+\n+#include <linux/crc32.h>\n+#include <linux/if_ether.h>\n+#include <linux/sizes.h>\n+#include <linux/types.h>\n+\n+/*\n+ * Broadcom BCM963xx SoC board nvram data structure.\n+ *\n+ * The nvram structure varies in size depending on the SoC board version. Use\n+ * the appropriate minimum BCM963XX_NVRAM_*_SIZE define for the information\n+ * you need instead of sizeof(struct bcm963xx_nvram) as this may change.\n+ */\n+\n+#define BCM963XX_NVRAM_V4_SIZE\t\t300\n+#define BCM963XX_NVRAM_V5_SIZE\t\t(1 * SZ_1K)\n+\n+#define BCM963XX_DEFAULT_PSI_SIZE\t64\n+\n+enum bcm963xx_nvram_nand_part {\n+\tBCM963XX_NVRAM_NAND_PART_BOOT = 0,\n+\tBCM963XX_NVRAM_NAND_PART_ROOTFS_1,\n+\tBCM963XX_NVRAM_NAND_PART_ROOTFS_2,\n+\tBCM963XX_NVRAM_NAND_PART_DATA,\n+\tBCM963XX_NVRAM_NAND_PART_BBT,\n+\n+\t__BCM963XX_NVRAM_NAND_NR_PARTS\n+};\n+\n+struct bcm963xx_nvram {\n+\tu32\tversion;\n+\tchar\tbootline[256];\n+\tchar\tname[16];\n+\tu32\tmain_tp_number;\n+\tu32\tpsi_size;\n+\tu32\tmac_addr_count;\n+\tu8\tmac_addr_base[ETH_ALEN];\n+\tu8\t__reserved1[2];\n+\tu32\tchecksum_v4;\n+\n+\tu8\t__reserved2[292];\n+\tu32\tnand_part_offset[__BCM963XX_NVRAM_NAND_NR_PARTS];\n+\tu32\tnand_part_size[__BCM963XX_NVRAM_NAND_NR_PARTS];\n+\tu8\t__reserved3[388];\n+\tu32\tchecksum_v5;\n+};\n+\n+#define BCM963XX_NVRAM_NAND_PART_OFFSET(nvram, part) \\\n+\tbcm963xx_nvram_nand_part_offset(nvram, BCM963XX_NVRAM_NAND_PART_ ##part)\n+\n+static inline u64 __pure bcm963xx_nvram_nand_part_offset(\n+\tconst struct bcm963xx_nvram *nvram,\n+\tenum bcm963xx_nvram_nand_part part)\n+{\n+\treturn nvram->nand_part_offset[part] * SZ_1K;\n+}\n+\n+#define BCM963XX_NVRAM_NAND_PART_SIZE(nvram, part) \\\n+\tbcm963xx_nvram_nand_part_size(nvram, BCM963XX_NVRAM_NAND_PART_ ##part)\n+\n+static inline u64 __pure bcm963xx_nvram_nand_part_size(\n+\tconst struct bcm963xx_nvram *nvram,\n+\tenum bcm963xx_nvram_nand_part part)\n+{\n+\treturn nvram->nand_part_size[part] * SZ_1K;\n+}\n+\n+/*\n+ * bcm963xx_nvram_checksum - Verify nvram checksum\n+ *\n+ * @nvram: pointer to full size nvram data structure\n+ * @expected_out: optional pointer to store expected checksum value\n+ * @actual_out: optional pointer to store actual checksum value\n+ *\n+ * Return: 0 if the checksum is valid, otherwise -EINVAL\n+ */\n+static int __maybe_unused bcm963xx_nvram_checksum(\n+\tconst struct bcm963xx_nvram *nvram,\n+\tu32 *expected_out, u32 *actual_out)\n+{\n+\tu32 expected, actual;\n+\tsize_t len;\n+\n+\tif (nvram->version <= 4) {\n+\t\texpected = nvram->checksum_v4;\n+\t\tlen = BCM963XX_NVRAM_V4_SIZE - sizeof(u32);\n+\t} else {\n+\t\texpected = nvram->checksum_v5;\n+\t\tlen = BCM963XX_NVRAM_V5_SIZE - sizeof(u32);\n+\t}\n+\n+\t/*\n+\t * Calculate the CRC32 value for the nvram with a checksum value\n+\t * of 0 without modifying or copying the nvram by combining:\n+\t * - The CRC32 of the nvram without the checksum value\n+\t * - The CRC32 of a zero checksum value (which is also 0)\n+\t */\n+\tactual = crc32_le_combine(\n+\t\tcrc32_le(~0, (u8 *)nvram, len), 0, sizeof(u32));\n+\n+\tif (expected_out)\n+\t\t*expected_out = expected;\n+\n+\tif (actual_out)\n+\t\t*actual_out = actual;\n+\n+\treturn expected == actual ? 0 : -EINVAL;\n+};\n+\n+#endif /* __LINUX_BCM963XX_NVRAM_H__ */\n",
    "prefixes": [
        "linux-next",
        "v4",
        "01/11"
    ]
}