{"id":806184,"url":"http://patchwork.ozlabs.org/api/patches/806184/?format=json","web_url":"http://patchwork.ozlabs.org/project/uboot/patch/20170826225444.7608-2-xypron.glpk@gmx.de/","project":{"id":18,"url":"http://patchwork.ozlabs.org/api/projects/18/?format=json","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":"<20170826225444.7608-2-xypron.glpk@gmx.de>","list_archive_url":null,"date":"2017-08-26T22:54:42","name":"[U-Boot,21/23] efi_loader: fix efi_net_get_status","commit_ref":null,"pull_url":null,"state":"superseded","archived":true,"hash":"b1bf27b12dfba819462f8e9d516007fde649dc6f","submitter":{"id":61270,"url":"http://patchwork.ozlabs.org/api/people/61270/?format=json","name":"Heinrich Schuchardt","email":"xypron.glpk@gmx.de"},"delegate":{"id":3400,"url":"http://patchwork.ozlabs.org/api/users/3400/?format=json","username":"agraf","first_name":"Alexander","last_name":"Graf","email":"agraf@suse.de"},"mbox":"http://patchwork.ozlabs.org/project/uboot/patch/20170826225444.7608-2-xypron.glpk@gmx.de/mbox/","series":[],"comments":"http://patchwork.ozlabs.org/api/patches/806184/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/806184/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 3xftvx2jd4z9s7g\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSun, 27 Aug 2017 09:07:09 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid 21056C2224C; Sat, 26 Aug 2017 23:03:47 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id C06F8C2221A;\n\tSat, 26 Aug 2017 23:03:44 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid B271CC221FC; Sat, 26 Aug 2017 22:55:37 +0000 (UTC)","from mout.gmx.net (mout.gmx.net [212.227.17.21])\n\tby lists.denx.de (Postfix) with ESMTPS id ED147C221E1\n\tfor <u-boot@lists.denx.de>; Sat, 26 Aug 2017 22:55:36 +0000 (UTC)","from localhost.localdomain ([84.118.154.110]) by mail.gmx.com\n\t(mrgmx101 [212.227.17.168]) with ESMTPSA (Nemesis) id\n\t0MdnN3-1eAfML2A5F-00PbHC; Sun, 27 Aug 2017 00:54:56 +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:54:42 +0200","Message-Id":"<20170826225444.7608-2-xypron.glpk@gmx.de>","X-Mailer":"git-send-email 2.14.1","In-Reply-To":"<20170826225444.7608-1-xypron.glpk@gmx.de>","References":"<20170826225110.7381-1-xypron.glpk@gmx.de>\n\t<20170826225444.7608-1-xypron.glpk@gmx.de>","X-Provags-ID":"V03:K0:ws9VZseEs4tJTgRkTO72an24rDw6oLWDI8zHcBrHXShWgGcssKq\n\tlgjNP4py1FnSNvhi84pGe9M/316/bD09tUCA/bA9Lz/NKDfQxJk0qxI0JqqsCAvQVOTC96L\n\tLuZ5COgqrVShys7RmuftqFkaZ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de","Subject":"[U-Boot] [PATCH 21/23] efi_loader: fix efi_net_get_status","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":"The returned interrupt status was wrong.\n\nAs out transmit buffer is empty we need to always set\nEFI_SIMPLE_NETWORK_TRANSMIT_INTERRUPT.\n\nWhen we have received a packet we need to set\nEFI_SIMPLE_NETWORK_RECEIVE_INTERRUPT.\n\nFurthermore we should call efi_timer_check() to handle events.\n\nSigned-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>\n---\n include/efi_api.h        |  6 ++++++\n lib/efi_loader/efi_net.c | 11 ++++++++---\n 2 files changed, 14 insertions(+), 3 deletions(-)","diff":"diff --git a/include/efi_api.h b/include/efi_api.h\nindex 029b57ca5e..7d2355c033 100644\n--- a/include/efi_api.h\n+++ b/include/efi_api.h\n@@ -537,6 +537,12 @@ struct efi_simple_network_mode {\n #define EFI_SIMPLE_NETWORK_RECEIVE_PROMISCUOUS           0x08\n #define EFI_SIMPLE_NETWORK_RECEIVE_PROMISCUOUS_MULTICAST 0x10\n \n+/* interrupt status bit mask */\n+#define EFI_SIMPLE_NETWORK_RECEIVE_INTERRUPT\t0x01\n+#define EFI_SIMPLE_NETWORK_TRANSMIT_INTERRUPT\t0x02\n+#define EFI_SIMPLE_NETWORK_COMMAND_INTERRUPT\t0x04\n+#define EFI_SIMPLE_NETWORK_SOFTWARE_INTERRUPT\t0x08\n+\n struct efi_simple_network\n {\n \tu64 revision;\ndiff --git a/lib/efi_loader/efi_net.c b/lib/efi_loader/efi_net.c\nindex 7659109386..e15f403c20 100644\n--- a/lib/efi_loader/efi_net.c\n+++ b/lib/efi_loader/efi_net.c\n@@ -127,9 +127,14 @@ static efi_status_t EFIAPI efi_net_get_status(struct efi_simple_network *this,\n {\n \tEFI_ENTRY(\"%p, %p, %p\", this, int_status, txbuf);\n \n-\t/* We send packets synchronously, so nothing is outstanding */\n-\tif (int_status)\n-\t\t*int_status = 0;\n+\tefi_timer_check();\n+\n+\tif (int_status) {\n+\t\t/* We send packets synchronously, so nothing is outstanding */\n+\t\t*int_status = EFI_SIMPLE_NETWORK_TRANSMIT_INTERRUPT;\n+\t\tif (new_rx_packet)\n+\t\t\t*int_status |= EFI_SIMPLE_NETWORK_RECEIVE_INTERRUPT;\n+\t}\n \tif (txbuf)\n \t\t*txbuf = new_tx_packet;\n \n","prefixes":["U-Boot","21/23"]}