get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 817658,
    "url": "http://patchwork.ozlabs.org/api/patches/817658/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20170922171323.10348-8-f4bug@amsat.org/",
    "project": {
        "id": 14,
        "url": "http://patchwork.ozlabs.org/api/projects/14/?format=api",
        "name": "QEMU Development",
        "link_name": "qemu-devel",
        "list_id": "qemu-devel.nongnu.org",
        "list_email": "qemu-devel@nongnu.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": "",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20170922171323.10348-8-f4bug@amsat.org>",
    "list_archive_url": null,
    "date": "2017-09-22T17:13:23",
    "name": "[v5,7/7] hw/mdio: Use bitbang core for smc91c111 network device",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "daaa2d34557546142a09668a8630fde1abaebb3c",
    "submitter": {
        "id": 70924,
        "url": "http://patchwork.ozlabs.org/api/people/70924/?format=api",
        "name": "Philippe Mathieu-Daudé",
        "email": "f4bug@amsat.org"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20170922171323.10348-8-f4bug@amsat.org/mbox/",
    "series": [
        {
            "id": 4680,
            "url": "http://patchwork.ozlabs.org/api/series/4680/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=4680",
            "date": "2017-09-22T17:13:16",
            "name": "Generalize MDIO framework",
            "version": 5,
            "mbox": "http://patchwork.ozlabs.org/series/4680/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/817658/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/817658/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>",
        "X-Original-To": "incoming@patchwork.ozlabs.org",
        "Delivered-To": "patchwork-incoming@bilbo.ozlabs.org",
        "Authentication-Results": [
            "ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)",
            "ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"k1CpRbaU\"; dkim-atps=neutral"
        ],
        "Received": [
            "from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xzKwP4vTdz9t3Z\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat, 23 Sep 2017 03:19:33 +1000 (AEST)",
            "from localhost ([::1]:60305 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dvRbv-0008JK-GV\n\tfor incoming@patchwork.ozlabs.org; Fri, 22 Sep 2017 13:19:31 -0400",
            "from eggs.gnu.org ([2001:4830:134:3::10]:59475)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <philippe.mathieu.daude@gmail.com>)\n\tid 1dvRWf-0003jB-Tm\n\tfor qemu-devel@nongnu.org; Fri, 22 Sep 2017 13:14:07 -0400",
            "from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <philippe.mathieu.daude@gmail.com>)\n\tid 1dvRWc-0003cI-Ix\n\tfor qemu-devel@nongnu.org; Fri, 22 Sep 2017 13:14:05 -0400",
            "from mail-qk0-x243.google.com ([2607:f8b0:400d:c09::243]:34739)\n\tby eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)\n\t(Exim 4.71) (envelope-from <philippe.mathieu.daude@gmail.com>)\n\tid 1dvRWc-0003c4-Dp\n\tfor qemu-devel@nongnu.org; Fri, 22 Sep 2017 13:14:02 -0400",
            "by mail-qk0-x243.google.com with SMTP id d70so1028312qkc.1\n\tfor <qemu-devel@nongnu.org>; Fri, 22 Sep 2017 10:14:02 -0700 (PDT)",
            "from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id\n\tf69sm238468qke.27.2017.09.22.10.13.56\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tFri, 22 Sep 2017 10:13:58 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=sender:from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=8WUBkW9wpJPB/VCLjIGjQWKuBifSyiF53SoglAoDu9w=;\n\tb=k1CpRbaU5zC39rgVotHezDiC01wrIWlc9sboIyUtVRd8hi1Wg7cdaeJwqnNDo4vN4V\n\tSOkGNZHgwHEzdUDqz96wmA6vQb8vJucZV7Tfrjd3sfM82XPKhViNFTXsSXmF50fYJxY5\n\tBNYwc0xHRJTPlK27Ymvlq8oJCIym5ykRwonsIHs6Fr1br1rNP+6oxv9t/APUOnOi5wLP\n\trBw+ESFb0YYVFcWRdmVFqxzGGCHZScDOjqYP9VEt3odZubV5KuhJCJWaTCYDQLT06Su+\n\txCDF2k8mYx16SRfDy4nqzxA8illy/yj4oWxgbFbNNQnvbX0yVmqi0g3/uI2k2H+Qmecd\n\tfolA==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:sender:from:to:cc:subject:date:message-id\n\t:in-reply-to:references:mime-version:content-transfer-encoding;\n\tbh=8WUBkW9wpJPB/VCLjIGjQWKuBifSyiF53SoglAoDu9w=;\n\tb=k+pULdPzfUsVy9w/P1ECuaql5gQAKgD5pb9Dztqn3tVeqJhgdQY6HSf/vXyWVmrZ+j\n\t72igm+DZaE6wNoNAGHwa63KtJWRvDG7KBhLdCUC/ClD8ntJbXYlzXyGIjTOKCHrT7YWI\n\tp8pqFChAOCXiP4X22NCOMXC3xtCt/Xtn5ctkwtZA4aFZhpVyWj251ViWb5ThmAw9oK7W\n\tkcxF0nPiCU8PDCjp7KT26qHMULb2g3g13KmTUxSmRhP4+WZe/g5VyCbOtXnqFH1zq7UE\n\tNgailtfK1lsXr8v23K1lQ3yCNZN+HTX07y8VwN6tfMK9ZqNMs1TlBFDUn/1kFBAw6MFT\n\toIYw==",
        "X-Gm-Message-State": "AHPjjUhGf5uVQxE1t+rs29JkM/eDtMnkNL/PAzQy7Eaij6mcfEz6I/Z4\n\tFSiazcUZxks+MbUmahm3yRc=",
        "X-Google-Smtp-Source": "AOwi7QABBPM04NKbGcUavZLFRmQtDREhlQtkwG92AAetSNIVKiV7cix+Ofm989NPSYOG799ARsRxhQ==",
        "X-Received": "by 10.55.33.87 with SMTP id h84mr8422313qkh.138.1506100438901;\n\tFri, 22 Sep 2017 10:13:58 -0700 (PDT)",
        "From": "=?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= <f4bug@amsat.org>",
        "To": "Peter Maydell <peter.maydell@linaro.org>,\n\tGrant Likely <grant.likely@arm.com>, Jason Wang <jasowang@redhat.com>,\n\tPeter Crosthwaite <crosthwaitepeter@gmail.com>",
        "Date": "Fri, 22 Sep 2017 14:13:23 -0300",
        "Message-Id": "<20170922171323.10348-8-f4bug@amsat.org>",
        "X-Mailer": "git-send-email 2.14.1",
        "In-Reply-To": "<20170922171323.10348-1-f4bug@amsat.org>",
        "References": "<20170922171323.10348-1-f4bug@amsat.org>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=UTF-8",
        "Content-Transfer-Encoding": "8bit",
        "X-detected-operating-system": "by eggs.gnu.org: Genre and OS details not\n\trecognized.",
        "X-Received-From": "2607:f8b0:400d:c09::243",
        "Subject": "[Qemu-devel] [PATCH v5 7/7] hw/mdio: Use bitbang core for smc91c111\n\tnetwork device",
        "X-BeenThere": "qemu-devel@nongnu.org",
        "X-Mailman-Version": "2.1.21",
        "Precedence": "list",
        "List-Id": "<qemu-devel.nongnu.org>",
        "List-Unsubscribe": "<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.nongnu.org/archive/html/qemu-devel/>",
        "List-Post": "<mailto:qemu-devel@nongnu.org>",
        "List-Help": "<mailto:qemu-devel-request@nongnu.org?subject=help>",
        "List-Subscribe": "<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>",
        "Cc": "qemu-devel@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?=\n\t<f4bug@amsat.org>",
        "Errors-To": "qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org",
        "Sender": "\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"
    },
    "content": "From: Grant Likely <grant.likely@arm.com>\n\nThe smc91c111 device has bitbanged MDIO access, but the model doesn't\nyet implement it. This patch uses the generalized bitbang MDIO support\npulled out of etraxfs Ethernet driver.\n\nThe MDIO state machine is driven by changes in state to the clock\ncontrol bit in the management register. The PHY model emulated is\ncurrently trivial (being whatever was done for the etraxfs driver), but\nit is enough to get an OS to recognize a PHY as being present.\n\nTested with the versatilepb model with U-Boot and the Linux Kernel as\nclient software.\n\nUpdated .version_id and .minimum_version_id fields because this patch\nadd fields to the state structure.\n\nSigned-off-by: Grant Likely <grant.likely@arm.com>\nSigned-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>\n[PMD: just rebased]\n---\n hw/net/smc91c111.c | 27 ++++++++++++++++++++++-----\n 1 file changed, 22 insertions(+), 5 deletions(-)",
    "diff": "diff --git a/hw/net/smc91c111.c b/hw/net/smc91c111.c\nindex 3b16dcf5a1..b5cc493f9f 100644\n--- a/hw/net/smc91c111.c\n+++ b/hw/net/smc91c111.c\n@@ -11,6 +11,7 @@\n #include \"hw/sysbus.h\"\n #include \"net/net.h\"\n #include \"hw/devices.h\"\n+#include \"hw/net/mdio.h\"\n /* For crc32 */\n #include <zlib.h>\n \n@@ -49,12 +50,16 @@ typedef struct {\n     uint8_t int_level;\n     uint8_t int_mask;\n     MemoryRegion mmio;\n+\n+    /* MDIO bus and the attached phy */\n+    struct qemu_mdio mdio_bus;\n+    struct qemu_phy phy;\n } smc91c111_state;\n \n static const VMStateDescription vmstate_smc91c111 = {\n     .name = \"smc91c111\",\n-    .version_id = 1,\n-    .minimum_version_id = 1,\n+    .version_id = 2,\n+    .minimum_version_id = 2,\n     .fields = (VMStateField[]) {\n         VMSTATE_UINT16(tcr, smc91c111_state),\n         VMSTATE_UINT16(rcr, smc91c111_state),\n@@ -76,6 +81,8 @@ static const VMStateDescription vmstate_smc91c111 = {\n         VMSTATE_BUFFER_UNSAFE(data, smc91c111_state, 0, NUM_PACKETS * 2048),\n         VMSTATE_UINT8(int_level, smc91c111_state),\n         VMSTATE_UINT8(int_mask, smc91c111_state),\n+        VMSTATE_MDIO(mdio_bus, smc91c111_state),\n+        VMSTATE_MDIO_PHY(phy, smc91c111_state),\n         VMSTATE_END_OF_LIST()\n     }\n };\n@@ -466,7 +473,15 @@ static void smc91c111_writeb(void *opaque, hwaddr offset,\n             /* Multicast table.  */\n             /* Not implemented.  */\n             return;\n-        case 8: case 9: /* Management Interface.  */\n+        case 8: /* Management Interface.  */\n+            /* Update MDIO data line status; but only if output is enabled */\n+            if (value & 8) {\n+                mdio_bitbang_set_data(&s->mdio_bus, !!(value & 1));\n+            }\n+            /* Process the clock */\n+            mdio_bitbang_set_clk(&s->mdio_bus, value & 4);\n+            return;\n+        case 9: /* Management Interface.  */\n             /* Not implemented.  */\n             return;\n         case 12: /* Early receive.  */\n@@ -606,8 +621,7 @@ static uint32_t smc91c111_readb(void *opaque, hwaddr offset)\n             /* Not implemented.  */\n             return 0;\n         case 8: /* Management Interface.  */\n-            /* Not implemented.  */\n-            return 0x30;\n+            return 0x30 | (mdio_bitbang_get_data(&s->mdio_bus) ? 2 : 0);\n         case 9:\n             return 0x33;\n         case 10: /* Revision.  */\n@@ -774,6 +788,9 @@ static int smc91c111_init1(SysBusDevice *sbd)\n     s->nic = qemu_new_nic(&net_smc91c111_info, &s->conf,\n                           object_get_typename(OBJECT(dev)), dev->id, s);\n     qemu_format_nic_info_str(qemu_get_queue(s->nic), s->conf.macaddr.a);\n+\n+    mdio_phy_init(&s->phy, 0x0016, 0xf84);\n+    mdio_attach(&s->mdio_bus, &s->phy, 0);\n     /* ??? Save/restore.  */\n     return 0;\n }\n",
    "prefixes": [
        "v5",
        "7/7"
    ]
}