get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 806181,
    "url": "http://patchwork.ozlabs.org/api/patches/806181/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/20170826225328.7550-6-xypron.glpk@gmx.de/",
    "project": {
        "id": 18,
        "url": "http://patchwork.ozlabs.org/api/projects/18/?format=api",
        "name": "U-Boot",
        "link_name": "uboot",
        "list_id": "u-boot.lists.denx.de",
        "list_email": "u-boot@lists.denx.de",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20170826225328.7550-6-xypron.glpk@gmx.de>",
    "list_archive_url": null,
    "date": "2017-08-26T22:53:24",
    "name": "[U-Boot,15/23] efi_loader: implement ConnectController",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "51c54fe51489ceb59e3a34fa4815aff9eceaa921",
    "submitter": {
        "id": 61270,
        "url": "http://patchwork.ozlabs.org/api/people/61270/?format=api",
        "name": "Heinrich Schuchardt",
        "email": "xypron.glpk@gmx.de"
    },
    "delegate": {
        "id": 3400,
        "url": "http://patchwork.ozlabs.org/api/users/3400/?format=api",
        "username": "agraf",
        "first_name": "Alexander",
        "last_name": "Graf",
        "email": "agraf@suse.de"
    },
    "mbox": "http://patchwork.ozlabs.org/project/uboot/patch/20170826225328.7550-6-xypron.glpk@gmx.de/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/806181/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/806181/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<u-boot-bounces@lists.denx.de>",
        "X-Original-To": "incoming@patchwork.ozlabs.org",
        "Delivered-To": "patchwork-incoming@bilbo.ozlabs.org",
        "Authentication-Results": "ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)",
        "Received": [
            "from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xfttH1Xthz9sN5\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSun, 27 Aug 2017 09:05:43 +1000 (AEST)",
            "by lists.denx.de (Postfix, from userid 105)\n\tid DA73AC22214; Sat, 26 Aug 2017 23:00:24 +0000 (UTC)",
            "from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id BEE03C22201;\n\tSat, 26 Aug 2017 23:00:07 +0000 (UTC)",
            "by lists.denx.de (Postfix, from userid 105)\n\tid CBFDAC221BF; Sat, 26 Aug 2017 22:54:24 +0000 (UTC)",
            "from mout.gmx.net (mout.gmx.net [212.227.17.22])\n\tby lists.denx.de (Postfix) with ESMTPS id 50B90C221D2\n\tfor <u-boot@lists.denx.de>; Sat, 26 Aug 2017 22:54:20 +0000 (UTC)",
            "from localhost.localdomain ([84.118.154.110]) by mail.gmx.com\n\t(mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id\n\t0MU0U9-1du9zM2jiL-00Qgu3; Sun, 27 Aug 2017 00:53:37 +0200"
        ],
        "X-Spam-Checker-Version": "SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de",
        "X-Spam-Level": "",
        "X-Spam-Status": "No, score=-0.7 required=5.0 tests=FREEMAIL_FROM,\n\tRCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,\n\tRCVD_IN_MSPIKE_WL autolearn=unavailable\n\tautolearn_force=no version=3.4.0",
        "From": "Heinrich Schuchardt <xypron.glpk@gmx.de>",
        "To": "Alexander Graf <agraf@suse.de>",
        "Date": "Sun, 27 Aug 2017 00:53:24 +0200",
        "Message-Id": "<20170826225328.7550-6-xypron.glpk@gmx.de>",
        "X-Mailer": "git-send-email 2.14.1",
        "In-Reply-To": "<20170826225328.7550-1-xypron.glpk@gmx.de>",
        "References": "<20170826225110.7381-1-xypron.glpk@gmx.de>\n\t<20170826225328.7550-1-xypron.glpk@gmx.de>",
        "X-Provags-ID": "V03:K0:vMWT+hIqaDoxj04zbqmfZOJLKKEiq4mXgL58A8weHHbXtiS9SEJ\n\tPdLONGIiDcuR+64kzzZi1B2P1zMrDio5k9606ffQkGetWrFK+M3pENhDHO2p4i1dEH/3aZS\n\t2Z4j6zYFFt+BMuEBlF4Ea6WUUoJNVl/ihHn3ROQQK2BCmB2OsiS9Qj3PWWCEGnbkNsu5kEJ\n\tCxf88IHa5ZJFYpygDAMXQ==",
        "X-UI-Out-Filterresults": "notjunk:1; V01:K0:4nqYNawGjds=:rR4z2ST8UVaa7e0B49D+4R\n\ttxluA/+xqE3VC0zsL6qllBW8sum71wVIsfVdRPT0ck0oeI5U0308jAPGNdVloGqS3VTMnvWEX\n\tSisrmKw5ORQ1ZpcWxFCVeZUQUG4u4uQgQ5nie5D6nJIDCx8IJKhKqkRVxs84SgMLW0HfP5VmT\n\treo4L9yWkQ+qjQBrBPa4tV0K6mQD6K14+Z5+bbVZA4wZ05kLuVkda0o5cMn+3Fu899uUrAmVI\n\tTFku5R81D1c9uKh3eFIXj6lemBQ2G/eQq8XVCKW2Ix6SCN0KbX7V4luFNAKILC1ySZ6uFWWns\n\tO2NKIAlO84An0vOV6hsbKsSvLHl40GTxGLYH21Z4dawmHZuw2AI4wZqyfHkPLgzup1vGcmZS0\n\tPnBs1zR6xzSOqSs6ofwyG2Cqg1CYrPrWckMovZUIkUIIrCb70wif/VE8LHzWKqhBsHwCbIR7A\n\tOkX5W2JIXQJglQY7nALu+TqBOKuPU0uNDzwjV6PkpLZSOQEjtCdCrnifFxEWvxCeZBHXl4Isk\n\teQ2zzQR1hUH0Q21QTQZz7qMNzq527Su9eu1ATYQvRw8Fb4/CKuAeb535f/hSsRk+VSts53cV8\n\tCoWOkr7mW+fmJAuhMKrebJvRrM1Xzh7IbKmXGy1+Pm8c6CjHiwqWrkg417avL5LDTYE2qL61d\n\tQSSII20pjohQmTycDMtx8xuErVNA9Kg3llfaaylg2ZTliQ1p3n1xhKAlIr6X8pEoxJ/jvRGY/\n\t4SHYEAe6sjrK085z48vwR5fD/RZ42HnJMyDaHIjqX0GJvTgQvWxiulUzWc+cQiFZw1dxeF33K\n\tbjsa4E2FsEnxqfvWEQveKJ1zbn0iA==",
        "Cc": "Heinrich Schuchardt <xypron.glpk@gmx.de>, u-boot@lists.denx.de",
        "Subject": "[U-Boot] [PATCH 15/23] efi_loader: implement ConnectController",
        "X-BeenThere": "u-boot@lists.denx.de",
        "X-Mailman-Version": "2.1.18",
        "Precedence": "list",
        "List-Id": "U-Boot discussion <u-boot.lists.denx.de>",
        "List-Unsubscribe": "<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>",
        "List-Archive": "<http://lists.denx.de/pipermail/u-boot/>",
        "List-Post": "<mailto:u-boot@lists.denx.de>",
        "List-Help": "<mailto:u-boot-request@lists.denx.de?subject=help>",
        "List-Subscribe": "<https://lists.denx.de/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=\"utf-8\"",
        "Content-Transfer-Encoding": "base64",
        "Errors-To": "u-boot-bounces@lists.denx.de",
        "Sender": "\"U-Boot\" <u-boot-bounces@lists.denx.de>"
    },
    "content": "Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>\n---\n include/efi_api.h             |  22 ++++++++\n include/efi_loader.h          |   1 +\n lib/efi_loader/efi_boottime.c | 119 +++++++++++++++++++++++++++++++++++++++++-\n 3 files changed, 141 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/include/efi_api.h b/include/efi_api.h\nindex 8efc8dfab8..b2838125d7 100644\n--- a/include/efi_api.h\n+++ b/include/efi_api.h\n@@ -609,4 +609,26 @@ struct efi_pxe {\n \tstruct efi_pxe_mode *mode;\n };\n \n+#define EFI_DRIVER_BINDING_PROTOCOL_GUID \\\n+\tEFI_GUID(0x18a031ab, 0xb443, 0x4d1a,\\\n+\t\t 0xa5, 0xc0, 0x0c, 0x09, 0x26, 0x1e, 0x9f, 0x71)\n+struct efi_driver_binding_protocol {\n+\tefi_status_t (EFIAPI * supported)(\n+\t\t\tstruct efi_driver_binding_protocol *this,\n+\t\t\tefi_handle_t controller_handle,\n+\t\t\tstruct efi_device_path *remaining_device_path);\n+\tefi_status_t (EFIAPI * start)(\n+\t\t\tstruct efi_driver_binding_protocol *this,\n+\t\t\tefi_handle_t controller_handle,\n+\t\t\tstruct efi_device_path *remaining_device_path);\n+\tefi_status_t (EFIAPI * stop)(\n+\t\t\tstruct efi_driver_binding_protocol *this,\n+\t\t\tefi_handle_t controller_handle,\n+\t\t\tUINTN number_of_children,\n+\t\t\tefi_handle_t child_handle_buffer);\n+\tu32 version;\n+\tefi_handle_t image_handle;\n+\tefi_handle_t driver_binding_handle;\n+};\n+\n #endif\ndiff --git a/include/efi_loader.h b/include/efi_loader.h\nindex 9c68246c7c..f9f33e1d01 100644\n--- a/include/efi_loader.h\n+++ b/include/efi_loader.h\n@@ -74,6 +74,7 @@ extern const struct efi_device_path_to_text_protocol efi_device_path_to_text;\n \n extern const efi_guid_t efi_guid_console_control;\n extern const efi_guid_t efi_guid_device_path;\n+extern const efi_guid_t efi_guid_driver_binding_protocol;\n extern const efi_guid_t efi_guid_loaded_image;\n extern const efi_guid_t efi_guid_device_path_to_text_protocol;\n \ndiff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c\nindex 5a73ea5cd0..1069da7d79 100644\n--- a/lib/efi_loader/efi_boottime.c\n+++ b/lib/efi_loader/efi_boottime.c\n@@ -18,6 +18,14 @@\n \n DECLARE_GLOBAL_DATA_PTR;\n \n+static efi_status_t EFIAPI efi_locate_protocol(const efi_guid_t *protocol,\n+\t\t\t\t\t       void *registration,\n+\t\t\t\t\t       void **protocol_interface);\n+static efi_status_t EFIAPI efi_locate_handle_buffer(\n+\t\t\tenum efi_locate_search_type search_type,\n+\t\t\tconst efi_guid_t *protocol, void *search_key,\n+\t\t\tunsigned long *no_handles, efi_handle_t **buffer);\n+\n /* This list contains all the EFI objects our payload has access to */\n LIST_HEAD(efi_obj_list);\n \n@@ -49,6 +57,9 @@ static struct efi_configuration_table __efi_runtime_data efi_conf_table[2];\n static volatile void *efi_gd, *app_gd;\n #endif\n \n+const efi_guid_t efi_guid_driver_binding_protocol =\n+\t\t\tEFI_DRIVER_BINDING_PROTOCOL_GUID;\n+\n static int entry_count;\n static int nesting_level;\n \n@@ -920,15 +931,121 @@ static efi_status_t EFIAPI efi_set_watchdog_timer(unsigned long timeout,\n \treturn efi_unsupported(__func__);\n }\n \n+static efi_status_t efi_bind_controller(\n+\t\t\tefi_handle_t controller_handle,\n+\t\t\tefi_handle_t driver_image_handle,\n+\t\t\tstruct efi_device_path *remain_device_path)\n+{\n+\tstruct efi_driver_binding_protocol *binding_protocol;\n+\tefi_status_t r;\n+\n+\tr = EFI_CALL(efi_open_protocol(driver_image_handle,\n+\t\t\t\t       &efi_guid_driver_binding_protocol,\n+\t\t\t\t       (void **)&binding_protocol,\n+\t\t\t\t       driver_image_handle, NULL,\n+\t\t\t\t       EFI_OPEN_PROTOCOL_GET_PROTOCOL));\n+\tif (r != EFI_SUCCESS)\n+\t\treturn r;\n+\tr = EFI_CALL(binding_protocol->supported(binding_protocol,\n+\t\t\t\t\t\t controller_handle,\n+\t\t\t\t\t\t remain_device_path));\n+\tif (r == EFI_SUCCESS)\n+\t\tr = EFI_CALL(binding_protocol->start(binding_protocol,\n+\t\t\t\t\t\t     controller_handle,\n+\t\t\t\t\t\t     remain_device_path));\n+\tEFI_CALL(efi_close_protocol(driver_image_handle,\n+\t\t\t\t    &efi_guid_driver_binding_protocol,\n+\t\t\t\t    driver_image_handle, NULL));\n+\treturn r;\n+}\n+\n+static efi_status_t efi_connect_single_controller(\n+\t\t\tefi_handle_t controller_handle,\n+\t\t\tefi_handle_t *driver_image_handle,\n+\t\t\tstruct efi_device_path *remain_device_path)\n+{\n+\tefi_handle_t *buffer;\n+\tunsigned long count;\n+\tsize_t i;\n+\tefi_status_t r;\n+\tsize_t connected = 0;\n+\n+\t/* Get buffer with all handles with driver binding protocol */\n+\tr = EFI_CALL(efi_locate_handle_buffer(by_protocol,\n+\t\t\t\t\t      &efi_guid_driver_binding_protocol,\n+\t\t\t\t\t      NULL, &count, &buffer));\n+\tif (r != EFI_SUCCESS)\n+\t\treturn r;\n+\n+\t/*  Context Override */\n+\tif (driver_image_handle) {\n+\t\tfor (; *driver_image_handle; ++driver_image_handle) {\n+\t\t\tfor (i = 0; i < count; ++i) {\n+\t\t\t\tif (buffer[i] == *driver_image_handle) {\n+\t\t\t\t\tbuffer[i] = NULL;\n+\t\t\t\t\tr = efi_bind_controller(\n+\t\t\t\t\t\t\tcontroller_handle,\n+\t\t\t\t\t\t\t*driver_image_handle,\n+\t\t\t\t\t\t\tremain_device_path);\n+\t\t\t\t\tif (r == EFI_SUCCESS)\n+\t\t\t\t\t\t++connected;\n+\t\t\t\t}\n+\t\t\t}\n+\t\t}\n+\t}\n+\n+\t/*\n+\t * Some overrides are not yet implemented:\n+\t * Platform Driver Override\n+\t * Driver Family Override Search\n+\t * Driver Family Override Search\n+\t * Bus Specific Driver Override\n+\t */\n+\n+\t/* Driver Binding Search */\n+\tfor (i = 0; i < count; ++i) {\n+\t\tif (buffer[i]) {\n+\t\t\tr = efi_bind_controller(controller_handle,\n+\t\t\t\t\t\tbuffer[i],\n+\t\t\t\t\t\tremain_device_path);\n+\t\t\tif (r == EFI_SUCCESS)\n+\t\t\t\t++connected;\n+\t\t}\n+\t}\n+\n+\tefi_free_pool(buffer);\n+\tif (!connected)\n+\t\treturn EFI_NOT_FOUND;\n+\treturn EFI_SUCCESS;\n+}\n+\n static efi_status_t EFIAPI efi_connect_controller(\n \t\t\tefi_handle_t controller_handle,\n \t\t\tefi_handle_t *driver_image_handle,\n \t\t\tstruct efi_device_path *remain_device_path,\n \t\t\tbool recursive)\n {\n+\tefi_status_t r;\n+\n \tEFI_ENTRY(\"%p, %p, %p, %d\", controller_handle, driver_image_handle,\n \t\t  remain_device_path, recursive);\n-\treturn EFI_EXIT(EFI_NOT_FOUND);\n+\n+\tif (!controller_handle) {\n+\t\tr = EFI_INVALID_PARAMETER;\n+\t\tgoto out;\n+\t}\n+\n+\tif (recursive) {\n+\t\tr = EFI_UNSUPPORTED;\n+\t\tgoto out;\n+\t}\n+\n+\tr = efi_connect_single_controller(controller_handle,\n+\t\t\t\t\t  driver_image_handle,\n+\t\t\t\t\t  remain_device_path);\n+\n+out:\n+\treturn EFI_EXIT(r);\n }\n \n static efi_status_t EFIAPI efi_disconnect_controller(void *controller_handle,\n",
    "prefixes": [
        "U-Boot",
        "15/23"
    ]
}