summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorHeinrich Schuchardt <xypron.glpk@gmx.de>2017-10-05 16:36:02 +0200
committerAlexander Graf <agraf@suse.de>2017-10-09 07:00:34 +0200
commit891b3d9051690d0ba39da4eda1d15773ebfee2b6 (patch)
treec985e4277d6e5be0303e97a90af61f59cd741454 /lib
parente5c21603fce2e6143f7312211eaed47c16510ea3 (diff)
downloadu-boot-891b3d9051690d0ba39da4eda1d15773ebfee2b6.tar.gz
efi_loader: fix efi_net_get_status
The returned interrupt status was wrong. As out transmit buffer is empty we need to always set EFI_SIMPLE_NETWORK_TRANSMIT_INTERRUPT. When we have received a packet we need to set EFI_SIMPLE_NETWORK_RECEIVE_INTERRUPT. Furthermore we should call efi_timer_check() to handle events. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'lib')
-rw-r--r--lib/efi_loader/efi_net.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/efi_loader/efi_net.c b/lib/efi_loader/efi_net.c
index cd46d2db53..b16463ba1a 100644
--- a/lib/efi_loader/efi_net.c
+++ b/lib/efi_loader/efi_net.c
@@ -133,9 +133,14 @@ static efi_status_t EFIAPI efi_net_get_status(struct efi_simple_network *this,
{
EFI_ENTRY("%p, %p, %p", this, int_status, txbuf);
- /* We send packets synchronously, so nothing is outstanding */
- if (int_status)
- *int_status = 0;
+ efi_timer_check();
+
+ if (int_status) {
+ /* We send packets synchronously, so nothing is outstanding */
+ *int_status = EFI_SIMPLE_NETWORK_TRANSMIT_INTERRUPT;
+ if (new_rx_packet)
+ *int_status |= EFI_SIMPLE_NETWORK_RECEIVE_INTERRUPT;
+ }
if (txbuf)
*txbuf = new_tx_packet;